修改编目BUG

This commit is contained in:
a0049873 2022-06-20 17:42:01 +08:00
parent 2b5676d31c
commit 9c10dce23c
1 changed files with 13 additions and 12 deletions

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua * @Author: hisense.liangjunhua
* @Date: 2022-05-06 11:17:55 * @Date: 2022-05-06 11:17:55
* @LastEditors: hisense.liangjunhua * @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-06-08 17:19:11 * @LastEditTime: 2022-06-20 17:40:52
* @Description: 编目弹窗 * @Description: 编目弹窗
--> -->
<template> <template>
@ -441,17 +441,7 @@ export default {
const newData = [...this.data] const newData = [...this.data]
this.editData = {} this.editData = {}
newData.forEach(val => { newData.forEach(val => {
if (val.key === key) { this.handleChangeFor(val, key)
this.editData = val
} else {
if (val.children) {
val.children.forEach(item => {
if (item.key === key) {
this.editData = item
}
})
}
}
}) })
if (this.editData) { if (this.editData) {
this.editData[column] = value this.editData[column] = value
@ -459,6 +449,17 @@ export default {
} }
console.log(this.data) console.log(this.data)
}, },
handleChangeFor (val, key) {
if (val.key === key) {
this.editData = val
} else {
if (val.children) {
val.children.forEach(item => {
this.handleChangeFor(item, key)
})
}
}
},
edit (key) { edit (key) {
if (this.flag) { if (this.flag) {
const newData = [...this.data] const newData = [...this.data]