From eb76804fe4bf56e104561da8509b30b009225b6f Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Wed, 17 Apr 2024 10:28:14 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E9=80=89=E9=83=A8=E9=97=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=85=88=E9=80=89=E5=A4=8D=E9=80=89=E6=A1=86=E5=90=8E?= =?UTF-8?q?=E5=86=8D=E6=94=B9=E5=8F=98=E7=88=B6=E5=AD=90=E5=85=B3=E8=81=94?= =?UTF-8?q?=EF=BC=8C=E9=A1=B5=E9=9D=A2=E9=80=89=E4=B8=AD=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=92=8C=E5=AE=9E=E9=99=85=E9=80=89=E4=B8=AD=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8D=E7=AC=A6=E5=90=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jerobiz/modal/JSelectDepartModal.vue | 55 ++++++++++++++++--- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/src/components/jerobiz/modal/JSelectDepartModal.vue b/src/components/jerobiz/modal/JSelectDepartModal.vue index 3a02ac05..4a4bec0c 100644 --- a/src/components/jerobiz/modal/JSelectDepartModal.vue +++ b/src/components/jerobiz/modal/JSelectDepartModal.vue @@ -13,6 +13,7 @@ this.checkedKeys.includes(i.key))) { + // 子节点每一个都选中了 + nodeKeys.push(item.key) + } + nodeKeys.push(...this.getChildAllCheckNode(item.children)) + } + } + return nodeKeys + }, switchCheckStrictly (v) { if (v === 1) { this.checkStrictly = false + const allChildrenCheckKeys = this.getChildAllCheckNode(this.treeData) + const allChildrenKeys = this.getChildrenTreeData(this.checkedKeys, this.treeData) + this.checkedKeys = Array.from([...allChildrenCheckKeys, ...allChildrenKeys]) + this.checkedRows = this.getCheckedRows(this.checkedKeys) } else if (v === 2) { this.checkStrictly = true } - this.$nextTick(() => { - const dom = document.getElementsByClassName('ant-tree-checkbox') - console.log(dom) - dom[0].click() - setTimeout(() => { - dom[0].click() - }, 0) - }) }, isFullscreen (val) { this.fullscreen = val