✨ 再次点击组织取消人员筛选

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-21 11:53:55 +08:00
parent 4a0af452e8
commit c1863d0b6a
+15 -2
View File
@@ -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) {