@@ -4,7 +4,7 @@
|
||||
<div class="box">
|
||||
<el-scrollbar>
|
||||
<basic-container>
|
||||
<avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" />
|
||||
<avue-tree ref="deptTree" :option="treeOption" :data="treeData" @node-click="nodeClick" />
|
||||
</basic-container>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
@@ -647,7 +647,17 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
nodeClick(data) {
|
||||
this.treeDeptId = data.id;
|
||||
const deptId = data?.id;
|
||||
if (deptId != null && String(this.treeDeptId) === String(deptId)) {
|
||||
this.treeDeptId = '';
|
||||
this.page.currentPage = 1;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.deptTree?.setCurrentKey?.(null);
|
||||
});
|
||||
this.onLoad(this.page);
|
||||
return;
|
||||
}
|
||||
this.treeDeptId = deptId;
|
||||
this.page.currentPage = 1;
|
||||
this.onLoad(this.page);
|
||||
},
|
||||
@@ -1075,6 +1085,9 @@ export default {
|
||||
searchReset() {
|
||||
this.query = {};
|
||||
this.treeDeptId = '';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.deptTree?.setCurrentKey?.(null);
|
||||
});
|
||||
this.onLoad(this.page);
|
||||
},
|
||||
searchChange(params, done) {
|
||||
|
||||
Reference in New Issue
Block a user