From 718cf9333ac1fd2f6fbde3a78698a84569d1122d Mon Sep 17 00:00:00 2001 From: sunFlower <787203167@qq.com> Date: Fri, 30 Sep 2022 22:15:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A6=85=E9=81=93=E5=B7=B2?= =?UTF-8?q?=E7=9F=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/PersonnelSelection/index.vue | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/jero-web/src/components/PersonnelSelection/index.vue b/jero-web/src/components/PersonnelSelection/index.vue index a3e26e2bc..bfd786a92 100644 --- a/jero-web/src/components/PersonnelSelection/index.vue +++ b/jero-web/src/components/PersonnelSelection/index.vue @@ -42,12 +42,15 @@ isLeaf: 'leaf' }" :defaultCheckedKeys="defaultCheckedKeys" + :defaultExpandAll="defaultExpandAll" :check-strictly="false" node-key="id" @check-change="handleCheckChange" :data.sync="gData"> - {{ data.title }} + + {{ data.title }} + @@ -89,7 +92,7 @@ return { loading: false, gData: [], - autoExpandParent: true, + autoExpandParent: false, checkboxList: [], expandedKeys: [], visible: false, @@ -103,7 +106,8 @@ defaultCheckedKeys: [], defaultCheckedKeysName: [], content: [], - dataList: [] + dataList: [], + defaultExpandAll: false } }, mounted() { @@ -169,6 +173,7 @@ } this.defaultCheckedKeys = this.userIds this.defaultCheckedKeys = [...this.defaultCheckedKeys] + this.defaultExpandAll = false this.treeVisible = true } else { this.queryDepartUserTreeList(1) @@ -307,7 +312,7 @@ }, onSearch(e) { this.loading = true - // this.treeVisible = false + this.treeVisible = false let p = new Promise((resolve, reject) => { resolve() }) @@ -319,6 +324,7 @@ JSON.parse(gData).forEach(res => { if (res.type == 'User') { if (res.name.includes(e)) { + res.color = true content.push(res) } } else if (res.type == 'Depart') { @@ -328,6 +334,7 @@ content.push(res) } }) + this.defaultExpandAll = true this.gData = this.toTree(content) } else { let content = JSON.parse(gData) @@ -339,11 +346,12 @@ }) } this.gData = this.toTree(content) + this.defaultExpandAll = false } } this.defaultCheckedKeys = this.userIds this.defaultCheckedKeys = [...this.defaultCheckedKeys] - // this.treeVisible = true + this.treeVisible = true this.loading = false }) // this.gData = [] @@ -444,6 +452,7 @@ // } // } } + this.defaultExpandAll = false this.treeVisible = true } else { this.gData = [] @@ -537,4 +546,8 @@ .treeWrap { height: calc(100vh - 240px); } + .active{ + color: #21c9cc; + display: inline-block; + } \ No newline at end of file