@@ -535,7 +535,6 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.resetNodeRows();
|
this.resetNodeRows();
|
||||||
this.loadProjectOptions('');
|
this.loadProjectOptions('');
|
||||||
this.applyDefaultDeptSearch();
|
|
||||||
this.initDeptOptions();
|
this.initDeptOptions();
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
flattenDept(tree, level = 0) {
|
||||||
return tree.flatMap(item => {
|
return tree.flatMap(item => {
|
||||||
const id =
|
const id =
|
||||||
@@ -1113,7 +1091,6 @@ export default {
|
|||||||
},
|
},
|
||||||
searchReset() {
|
searchReset() {
|
||||||
this.query = {};
|
this.query = {};
|
||||||
this.applyDefaultDeptSearch();
|
|
||||||
this.page.currentPage = 1;
|
this.page.currentPage = 1;
|
||||||
this.onLoad(this.page, this.query);
|
this.onLoad(this.page, this.query);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user