@@ -535,7 +535,6 @@ export default {
|
||||
created() {
|
||||
this.resetNodeRows();
|
||||
this.loadProjectOptions('');
|
||||
this.applyDefaultDeptSearch();
|
||||
this.initDeptOptions();
|
||||
},
|
||||
methods: {
|
||||
@@ -566,27 +565,6 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
defaultDeptId() {
|
||||
const raw = (this.userInfo && (this.userInfo.deptId || this.userInfo.dept_id)) || '';
|
||||
return (
|
||||
String(raw)
|
||||
.split(',')
|
||||
.map(item => item.trim())
|
||||
.filter(Boolean)[0] || ''
|
||||
);
|
||||
},
|
||||
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 => {
|
||||
const id =
|
||||
@@ -1113,7 +1091,6 @@ export default {
|
||||
},
|
||||
searchReset() {
|
||||
this.query = {};
|
||||
this.applyDefaultDeptSearch();
|
||||
this.page.currentPage = 1;
|
||||
this.onLoad(this.page, this.query);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user