From a4a1a6f50dfca3ef52604d0d03aee95cb9f1211d Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 25 Nov 2021 12:17:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E5=88=97=E8=A1=A8=E7=BB=84=E4=BB=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/DeWidget/DeSelectGrid.vue | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) 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() },