|
|
@@ -1,4 +1,4 @@
|
|
|
-import { last } from 'lodash';
|
|
|
+import { first, get, last } from 'lodash';
|
|
|
import { ref } from 'vue';
|
|
|
import { useRoute } from 'vue-router';
|
|
|
import { getGoafSelectOption } from '../monitor.api';
|
|
|
@@ -8,11 +8,14 @@ export function useInitForm() {
|
|
|
const mineStore = useMineDepartmentStore();
|
|
|
const route = useRoute();
|
|
|
const departId = last(route.fullPath.split('/'));
|
|
|
- const code = route.params.mineCode;
|
|
|
+ const dep = mineStore.findDepartById(departId, mineStore.departTree);
|
|
|
+ const code = route.params.mineCode as string;
|
|
|
+ // 给历史数据默认填充的矿码
|
|
|
+ const historyMineCode = !code ? first(get(dep, 'id', '').split(',')) : code;
|
|
|
|
|
|
- if (code) {
|
|
|
- mineStore.setDepartById(code as string);
|
|
|
- initGoafOptions(code);
|
|
|
+ if (historyMineCode) {
|
|
|
+ // mineStore.setDepartById(code as string);
|
|
|
+ initGoafOptions(historyMineCode);
|
|
|
}
|
|
|
|
|
|
// 采空区选择器
|
|
|
@@ -30,6 +33,7 @@ export function useInitForm() {
|
|
|
departId,
|
|
|
goafOptions,
|
|
|
goafId,
|
|
|
+ historyMineCode,
|
|
|
initGoafOptions,
|
|
|
};
|
|
|
}
|