From b2e4b290dce7192bdb14f7d842d1c366a3c912d8 Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Tue, 16 Apr 2024 15:19:20 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E6=8E=88=E6=9D=83=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E5=85=88=E5=8B=BE=E9=80=89=E5=A4=8D=E9=80=89=E6=A1=86=E5=86=8D?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E6=A0=91=E6=93=8D=E4=BD=9C=EF=BC=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=AD=90=E8=8A=82=E7=82=B9=E9=80=89=E4=B8=AD=E5=AE=9E?= =?UTF-8?q?=E9=99=85=E6=B2=A1=E9=80=89=E4=B8=AD=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 | 38 ++++--------------- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/src/components/jerobiz/modal/JSelectDepartModal.vue b/src/components/jerobiz/modal/JSelectDepartModal.vue index 4583d0fc..a3f0711c 100644 --- a/src/components/jerobiz/modal/JSelectDepartModal.vue +++ b/src/components/jerobiz/modal/JSelectDepartModal.vue @@ -304,42 +304,20 @@ export default { } return rows }, - // 获取currKeys及其子节点 - getChildrenTreeData (currKeys, treeData) { - const childrenKeys = [] - for (let i = 0; i < treeData.length; i++) { - if (currKeys.includes(treeData[i].key)) { - childrenKeys.push(treeData[i].key) - if (treeData[i].children) { - const childrenKeysArr = this.getChildrenKeys(treeData[i].children) - childrenKeys.push(...childrenKeysArr) - } - } - if (treeData[i].children) { - childrenKeys.push(...this.getChildrenTreeData(currKeys, treeData[i].children)) - } - } - return childrenKeys - }, - // 把传入的树结构key值全部存成一个数组 - getChildrenKeys (treeData) { - const arr = [] - for (const item of treeData) { - arr.push(item.key) - if (item.children) { - arr.push(...this.getChildrenKeys(item.children)) - } - } - return arr - }, switchCheckStrictly (v) { if (v === 1) { this.checkStrictly = false - this.checkedKeys = this.getChildrenTreeData(this.checkedKeys, this.treeData) - 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