|
|
@@ -84,6 +84,7 @@
|
|
|
import { DrillPlanListSearch, DrillPlanItem } from './types';
|
|
|
import { EMERGENCY_DRILL_STATUS_DICT } from './constants';
|
|
|
import { useEmergencyDrillHook } from './hook';
|
|
|
+ import { QueryPageRequest } from '@/types/basic-query';
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
@@ -96,14 +97,22 @@
|
|
|
// 搜索栏
|
|
|
const searchData = reactive<DrillPlanListSearch>({});
|
|
|
function handleSearch() {
|
|
|
- tableQuery.value.queryParam = searchData;
|
|
|
+ tableQuery.queryParam = {};
|
|
|
+ if (searchData.daterange) {
|
|
|
+ tableQuery.queryParam.dueCompleteTimeStart = searchData.daterange[0];
|
|
|
+ tableQuery.queryParam.dueCompleteTimeEnd = searchData.daterange[1];
|
|
|
+ }
|
|
|
+ if (searchData.drillScope) tableQuery.queryParam.drillScope = searchData.drillScope;
|
|
|
+ if (searchData.drillContent) tableQuery.queryParam.drillContent = searchData.drillContent;
|
|
|
+ if (searchData.responsibleDept) tableQuery.queryParam.responsibleDept = searchData.responsibleDept;
|
|
|
+ if (searchData.status) tableQuery.queryParam.status = searchData.status;
|
|
|
getTableData();
|
|
|
}
|
|
|
|
|
|
// 表格
|
|
|
const { tableConfig, pagination } = useTableConfig(DRILL_PLAN_LIST_TABLE_COLUMNS, TABLE_OPTIONS);
|
|
|
|
|
|
- const tableQuery = ref({
|
|
|
+ const tableQuery = reactive<QueryPageRequest<DrillPlanListSearch>>({
|
|
|
pageNumber: pagination.pageNumber,
|
|
|
pageSize: pagination.pageSize,
|
|
|
queryParam: {},
|
|
|
@@ -113,12 +122,12 @@
|
|
|
|
|
|
const handleSizeChange = (value: number) => {
|
|
|
pagination.pageSize = value;
|
|
|
- tableQuery.value.pageSize = value;
|
|
|
+ tableQuery.pageSize = value;
|
|
|
getTableData();
|
|
|
};
|
|
|
const handleCurrentChange = (value: number) => {
|
|
|
pagination.pageNumber = value;
|
|
|
- tableQuery.value.pageSize = value;
|
|
|
+ tableQuery.pageSize = value;
|
|
|
getTableData();
|
|
|
};
|
|
|
|
|
|
@@ -134,7 +143,7 @@
|
|
|
|
|
|
async function getTableData() {
|
|
|
tableConfig.loading = true;
|
|
|
- const res = await queryEnergencyDrillPlanList(tableQuery.value);
|
|
|
+ const res = await queryEnergencyDrillPlanList(tableQuery);
|
|
|
res.records.forEach((item) => {
|
|
|
item.responsibleDeptNameList = item.responsibleDeptNameList.replace(/^\[|\]$/g, '');
|
|
|
item.coordinateDeptNameList = item.coordinateDeptNameList?.replace(/^\[|\]$/g, '');
|