main
parent
c3cb7b6ca1
commit
0b09d5e17f
@ -0,0 +1,97 @@
|
|||||||
|
<script setup>
|
||||||
|
import RPC from '@/utils/rpc';
|
||||||
|
const props = defineProps({
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
row: [Object],
|
||||||
|
})
|
||||||
|
import { VueDraggable } from 'vue-draggable-plus'
|
||||||
|
const list = ref([
|
||||||
|
{
|
||||||
|
name: 'Joao',
|
||||||
|
id: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Jean',
|
||||||
|
id: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Johanna',
|
||||||
|
id: 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Juan',
|
||||||
|
id: 4
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
const emit = defineEmits(['closed', 'onSuccess'])
|
||||||
|
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
|
||||||
|
const isAdd = computed(() => props.type === 'add')
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
})
|
||||||
|
|
||||||
|
const formRef = ref(null)
|
||||||
|
const formField = ref({
|
||||||
|
color_component: []
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
const loading = ref(false)
|
||||||
|
|
||||||
|
function closed() {
|
||||||
|
emit('closed')
|
||||||
|
}
|
||||||
|
|
||||||
|
const submitForm = () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const detailData = ref([])
|
||||||
|
if (!isAdd.value) {
|
||||||
|
// formField.value = props.row
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const add = () => {
|
||||||
|
formField.value.color_component.push({ num: calcId(formField.value.color_component), color_paste_id: '', remark: '', ratio: 0.01 })
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleDelete = row => {
|
||||||
|
formField.value.color_component = formField.value.color_component.filter(item => item.num !== row.num)
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-dialog align-center :title="isAdd ? '新增' : '修改'" width="774px" v-model="dialogVisible" @closed="closed" :close-on-click-modal="false">
|
||||||
|
<el-form ref="formRef" label-position="right" label-suffix=":" :model="formField" :rules="formRules" v-loading="loading">
|
||||||
|
<VueDraggable ref="el" v-model="list">
|
||||||
|
<div v-for="item in list" :key="item.id">
|
||||||
|
{{ item.name }}
|
||||||
|
</div>
|
||||||
|
</VueDraggable>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button @click="closed">
|
||||||
|
取 消
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" :loading="loading" @click="submitForm">
|
||||||
|
确 定
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
Loading…
Reference in new issue