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