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