From 98170379e435ccfc91ef0d3f1af328b66b6fd218 Mon Sep 17 00:00:00 2001 From: qinoy Date: Wed, 30 Aug 2023 10:42:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=B8=AD=E5=BF=83=20?= =?UTF-8?q?=E5=B0=8F=E7=BB=84=E6=9D=83=E9=99=90=20=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=20=E5=8B=BE=E9=80=89=E6=A1=86=E9=97=AA=E5=8A=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CooperationUpdate/component.vue | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/com.actionsoft.apps.coe.pal.cooperation/src/components/CooperationUpdate/component.vue b/com.actionsoft.apps.coe.pal.cooperation/src/components/CooperationUpdate/component.vue index f90ecb0..713619a 100644 --- a/com.actionsoft.apps.coe.pal.cooperation/src/components/CooperationUpdate/component.vue +++ b/com.actionsoft.apps.coe.pal.cooperation/src/components/CooperationUpdate/component.vue @@ -532,6 +532,25 @@ checkedNode(data, checked, subChecked) {// 节点选中事件 // 获取所有子节点 const that = this; + that.permInfo.loading = true; + if (data.leaf){ // 如果当前节点是叶子节点 不存在子节点 就没必要再请求 性能优化 + // 只对当前叶子节点处理 + let currVerId = data.versionId; + let checkedVerIds = that.permInfo.tree.value; + if (checked){ + if (checkedVerIds.indexOf(currVerId) == -1) { + checkedVerIds.push(currVerId); + } + }else { + if (checkedVerIds.indexOf(currVerId) !== -1){ + checkedVerIds = checkedVerIds.filter(id => id !== currVerId); + } + } + that.permInfo.tree.value = checkedVerIds; + that.$refs.repositoryTree.setCheckedKeys(checkedVerIds); + that.permInfo.loading = false; + return; + } const params = { url:'jd', data:{ @@ -563,8 +582,9 @@ } } that.permInfo.tree.value = tempArr; - that.$refs.repositoryTree.setCheckedKeys([]); + that.$refs.repositoryTree.setCheckedKeys(tempArr); } + that.permInfo.loading = false; }).catch(error=>{ console.log(error); })