调整基础数据模块

This commit is contained in:
2026-08-07 13:36:51 +08:00
parent 04ab648f5b
commit 56729c8cc9
6 changed files with 194 additions and 50 deletions
+18 -1
View File
@@ -527,6 +527,7 @@ export default {
created() {
this.resetNodeRows();
this.loadProjectOptions('');
this.applyDefaultDeptSearch();
this.initDeptOptions();
},
methods: {
@@ -545,6 +546,21 @@ export default {
}
});
},
defaultDeptId() {
return (this.userInfo && (this.userInfo.deptId || this.userInfo.dept_id)) || '';
},
applyDefaultDeptSearch() {
const deptId = this.defaultDeptId();
const deptColumn = this.findColumn(this.option.column, 'searchDeptId');
if (!deptId || !deptColumn) return;
deptColumn.searchValue = deptId;
this.query = { ...this.query, deptId };
this.$nextTick(() => {
if (this.$refs.crud?.searchForm) {
this.$refs.crud.searchForm.searchDeptId = deptId;
}
});
},
flattenDept(tree, level = 0) {
return tree.flatMap(item => [
{
@@ -953,8 +969,9 @@ export default {
},
searchReset() {
this.query = {};
this.applyDefaultDeptSearch();
this.page.currentPage = 1;
this.onLoad(this.page);
this.onLoad(this.page, this.query);
},
searchChange(params, done) {
this.query = params;