edit 模板

This commit is contained in:
lyc 2024-12-13 10:58:01 +08:00
parent 83d885bcbe
commit a3079a87d0
1 changed files with 15 additions and 13 deletions

View File

@ -40,7 +40,7 @@ const props = defineProps({
type: Number,
default: 1
},
item: { //
item: { //
type: Object,
default: () => {
return { ex3: '' }
@ -73,23 +73,25 @@ const loading = ref(false)
const saveAdd = async () => {
loading.value = true
if (props.item.ex3 == '1') {
let id; // id id
if (props.item.isAdd) {
try {
// copy
const { msg } = await addKeyWords({ name: form.name, id: props.item.id })
emitter.emit('onGetMain')
ElMessage.success(msg)
mode.value = false
} finally {
loading.value = false
}
id = props.item.id
}
else{
onAddChildTemp(props.item.parentId)
// item item.parentId
id = props.item.parentId
}
try {
// copy
const { msg } = await addKeyWords({ name: form.name, id })
emitter.emit('onGetMain')
ElMessage.success(msg)
mode.value = false
} finally {
loading.value = false
}
} else {
} else {
if (props.item.isAdd) {
onAddChildTemp(props.item.id)
}