|
@@ -43,7 +43,8 @@ import { timesTampChange } from '@/utils/transform/date'
|
|
|
|
|
|
const emit = defineEmits(['update:modelValue'])
|
|
const emit = defineEmits(['update:modelValue'])
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
- modelValue: Array
|
|
|
|
|
|
+ modelValue: Array,
|
|
|
|
+ isEdit: Boolean
|
|
})
|
|
})
|
|
const list = ref([])
|
|
const list = ref([])
|
|
watch(() => props.modelValue, (newVal) => {
|
|
watch(() => props.modelValue, (newVal) => {
|
|
@@ -83,6 +84,7 @@ const handleDelete = async (index) => {
|
|
await message.delConfirm()
|
|
await message.delConfirm()
|
|
list.value.splice(index, 1)
|
|
list.value.splice(index, 1)
|
|
emit('update:modelValue', list.value.length ? list.value.map(e => e.name) : [])
|
|
emit('update:modelValue', list.value.length ? list.value.map(e => e.name) : [])
|
|
|
|
+ if (props.isEdit) emit('change', list.value.map(e => e.name), 'delete')
|
|
} catch {}
|
|
} catch {}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -94,5 +96,6 @@ const submitForm = async () => {
|
|
dialogVisible.value = false
|
|
dialogVisible.value = false
|
|
|
|
|
|
emit('update:modelValue', list.value.map(e => e.name))
|
|
emit('update:modelValue', list.value.map(e => e.name))
|
|
|
|
+ if (props.isEdit) emit('change', list.value.map(e => e.name), type.value)
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|