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