diff --git a/src/views/system/user.vue b/src/views/system/user.vue index 57782f0..266deea 100644 --- a/src/views/system/user.vue +++ b/src/views/system/user.vue @@ -4,7 +4,7 @@
- +
@@ -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) {