diff --git a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue index fd4899ab20..02a54d5250 100644 --- a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue +++ b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue @@ -18,7 +18,7 @@ {{ node.label }} {{ node.label }} - {{ node.label }} + {{ node.label }} @@ -100,7 +100,7 @@ export default { this.allNode.indeterminate = false this.allNode.checked = false } - this.setMutiBox() + // this.setMutiBox() } else { !sourceValid && (this.options.value = null) sourceValid && Array.isArray(sourceValue) && (this.options.value = sourceValue[0]) @@ -169,6 +169,14 @@ export default { if (index >= 0 && !data.checked) { values.splice(index, 1) } + const datas = JSON.parse(JSON.stringify(this.options.attrs.datas)) + this.options.attrs.datas = [] + datas.forEach(item => { + if (item.id === data.id) { + item.checked = data.checked + } + }) + this.options.attrs.datas = datas this.setAllNodeStatus() @@ -194,13 +202,15 @@ export default { allCheckChange(data) { data.indeterminate = false const values = [] - // this.options.value = [] - this.options.attrs.datas.forEach(item => { + this.options.value = [] + const datas = JSON.parse(JSON.stringify(this.options.attrs.datas)) + this.options.attrs.datas = [] + datas.forEach(item => { item.checked = data.checked // data.checked && this.options.value.push(item.id) data.checked && values.push(item.id) }) - + this.options.attrs.datas = datas this.options.value = values this.setCondition() },