This commit is contained in:
itcast 2025-12-24 18:39:53 +08:00
parent 1cff4203b1
commit 5472b1417b
1 changed files with 18 additions and 0 deletions

View File

@ -371,6 +371,11 @@ export default {
components: {Treeselect}, components: {Treeselect},
data() { data() {
return { return {
// 1. ID
selectedDeptId: undefined,
// 2.
selectedDeptName: '',
// ...
// //
loading: true, loading: true,
// //
@ -556,6 +561,8 @@ export default {
// //
handleNodeClick(data) { handleNodeClick(data) {
this.queryParams.deptId = data.id this.queryParams.deptId = data.id
this.selectedDeptId = data.id; // ID
this.selectedDeptName = data.label; //
this.handleQuery() this.handleQuery()
}, },
// //
@ -614,6 +621,9 @@ export default {
this.dateRange = [] this.dateRange = []
this.resetForm('queryForm') this.resetForm('queryForm')
this.queryParams.deptId = undefined this.queryParams.deptId = undefined
this.selectedDeptId = undefined; // ID
this.selectedDeptName = ''; //
this.$refs.tree.setCurrentKey(null) this.$refs.tree.setCurrentKey(null)
this.handleQuery() this.handleQuery()
}, },
@ -654,6 +664,14 @@ export default {
this.open = true this.open = true
this.title = '添加用户' this.title = '添加用户'
this.form.password = this.initPassword this.form.password = this.initPassword
// form.deptIdIDtreeselect
if (this.selectedDeptId) {
this.form.deptId = this.selectedDeptId;
// treeselect
this.$nextTick(() => {
this.$forceUpdate();
});
}
}) })
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */