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) {
try { id = props.item.id
// 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
}
} }
else{ 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) { if (props.item.isAdd) {
onAddChildTemp(props.item.id) onAddChildTemp(props.item.id)
} }