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); })