From caa124685700af590dfde65ce20ba193ad97551b Mon Sep 17 00:00:00 2001 From: yujh Date: Fri, 7 Mar 2025 21:47:22 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E8=A7=86=E5=9B=BE=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/page/Department.html | 65 ++++++++++++++----- 1 file changed, 48 insertions(+), 17 deletions(-) diff --git a/com.awspaas.user.apps.yili.integration/template/page/Department.html b/com.awspaas.user.apps.yili.integration/template/page/Department.html index 1873ca28..0e0e29d0 100644 --- a/com.awspaas.user.apps.yili.integration/template/page/Department.html +++ b/com.awspaas.user.apps.yili.integration/template/page/Department.html @@ -387,8 +387,12 @@ this.debounceTimer = setTimeout(() => { // 调用查询接口的方法 this.loading=true; - this.options = [] - this.leftTreedatabind() + this.options = []; + if(this.checkedInfo==true){ + this.leftTreedatabindNew();//隐藏架构的 + }else{ + this.leftTreedatabind();//不需要隐藏架构 + } }, 500); // 500 毫秒的延迟,可以根据实际需求调整 }, navtab(e){ @@ -477,14 +481,18 @@ _this.policyFileNum = count.policyFileNum _this.guideFileNum = count.guideFileNum _this.formFileNum = count.formFileNum + // 数据加载完成后,手动触发展开 + _this.$nextTick(() => { + this.isExpand = true; + _this.buildData(); + //_this.$refs.treeNode.filter(_this.filtertreeText); + }); }else{ _this.processFileNum = 0 _this.policyFileNum = 0 _this.guideFileNum = 0 _this.formFileNum = 0 } - //最后搜索一下 - //this.search(); }); }, @@ -519,6 +527,18 @@ res.data.fileMaps.forEach(element => { _this.defaultkey.push(element.ID) }); + if(newMaps!== undefined){ + let count = res.data.filesCount; + _this.processFileNum = count.processFileNum + _this.policyFileNum = count.policyFileNum + _this.guideFileNum = count.guideFileNum + _this.formFileNum = count.formFileNum + }else{ + _this.processFileNum = 0 + _this.policyFileNum = 0 + _this.guideFileNum = 0 + _this.formFileNum = 0 + } //最后搜索一下 //this.search(); } @@ -544,13 +564,17 @@ this.loading=true; this.filetype = this.selectvalue this.options = [] - this.leftTreedatabind() + if(this.checkedInfo==true){ + this.leftTreedatabindNew();//隐藏架构的 + }else{ + this.leftTreedatabind();//不需要隐藏架构 + } }, - filterNode(value, data) { + filtertreeNode(value, data) { if (!value) return true; return data.name.indexOf(value) !== -1; }, - filtertreeNode(value, data) { + filterNode(value, data) { if (!value) return true; return data.name.indexOf(value) !== -1; }, @@ -566,21 +590,28 @@ } }, resetData(){ + this.checked1 = false;//全选,取消勾选 + let currentFilterTreeText = this.filtertreeText; this.idjson=[]; this.idjson.push(this.departmentId); - this.treelist = this.$refs.tree.getCheckedKeys() var nodeObj =this.$refs.tree.getNode(this.departmentId); - var nodeArry = []; - nodeArry.push(nodeObj.data) - this.$refs.tree.setCheckedNodes(nodeArry); - this.treeListNodes = this.$refs.tree.getCheckedNodes(); - //this.selectdept = []; + if(nodeObj !== null){ + var nodeArry = []; + nodeArry.push(nodeObj.data) + this.$refs.tree.setCheckedNodes(nodeArry); + this.treeListNodes = this.$refs.tree.getCheckedNodes(); + } + this.treelist = this.$refs.tree.getCheckedKeys(); + this.selectdept = JSON.stringify(this.treelist) this.processFileNum = '';//流程数量 this.policyFileNum = '';//制度数量 - if(this.checkedInfo==true){ - this.leftTreedatabindNew();//隐藏架构的 - }else{ - this.leftTreedatabind();//不需要隐藏架构 + this.filtertreeText=''; + if(currentFilterTreeText===''){//如果为,则执行。因为不为空时,filtertreeText的变化就会查询了 + if(this.checkedInfo==true){ + this.leftTreedatabindNew();//隐藏架构的 + }else{ + this.leftTreedatabind();//不需要隐藏架构 + } } }, filterFileMaps(items) {