调整基础数据模块
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user