From d83c7eff980a0c6d88276ced43df25e8145acb0d Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Thu, 17 Aug 2023 17:42:12 +0800 Subject: [PATCH] =?UTF-8?q?revert(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):?= =?UTF-8?q?=20=E5=9B=9E=E9=80=80=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1028035 --user=王旭 高级搜索所属模块取消某个模块会把父级模块一起取消 https://www.tapd.cn/55049933/s/1404684 --- .../search/MsTableSearchNodeTree.vue | 32 ++----------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/framework/sdk-parent/frontend/src/components/search/MsTableSearchNodeTree.vue b/framework/sdk-parent/frontend/src/components/search/MsTableSearchNodeTree.vue index 9cde94aaf6..0224f3364f 100644 --- a/framework/sdk-parent/frontend/src/components/search/MsTableSearchNodeTree.vue +++ b/framework/sdk-parent/frontend/src/components/search/MsTableSearchNodeTree.vue @@ -36,7 +36,6 @@ @check="handleCheckChange" default-expand-all show-checkbox - :check-strictly="true" node-key="id" class="search-tree" ref="tree"> @@ -155,34 +154,9 @@ export default { } } }, - handleCheckChange(data) { - const node = this.$refs.tree.getNode(data.id); - this.setNode(node); - }, - setNode(node) { - if (node.checked) { - //选中,递归设置所有父节点选中 - this.setParentNode(node); - } else { - //取消选中,所有子节点取消选中 - this.setChildenNode(node); - } - }, - setParentNode(node) { - if (node.parent) { - for (const key in node) { - if (key === "parent") { - node[key].checked = true; - this.setParentNode(node[key]); - } - } - } - }, - setChildenNode(node) { - for (let i = 0; i < node.childNodes.length; i++) { - node.childNodes[i].checked = false; - this.setChildenNode(node.childNodes[i]); - } + handleCheckChange(data, curData) { + const {checkedKeys} = curData; + this.component.value = checkedKeys; }, changeTreeTag() { if (this.component.value) {