feat: add personnel type and time range search to inspection report

This commit is contained in:
2026-03-20 16:33:57 +08:00
parent 2eb27abfc3
commit 895e7f7bc3

View File

@@ -16,6 +16,30 @@
<el-form-item label="巡检人" prop="inspectorId">
<el-input v-model="queryParams.inspectorId" placeholder="输入巡检人姓名"></el-input>
</el-form-item>
<el-form-item label="人员类型" prop="inspectionPointType">
<el-select
v-model="queryParams.inspectionPointType"
placeholder="请选择人员类型"
clearable
>
<el-option
v-for="dict in inspection_point_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="巡检时间" style="width: 308px">
<el-date-picker
v-model="dateRange"
value-format="YYYY-MM-DD"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
@@ -77,6 +101,7 @@ import { ref, reactive, toRefs, getCurrentInstance } from "vue";
const showSearch = ref(true);
const { proxy } = getCurrentInstance();
const { inspection_point_type } = proxy.useDict("inspection_point_type");
// 三套柱状数据:总计 / 本月 / 本日(巡检点统计)
const histogramTotalData = ref({ xAxis: [], seriesData: [] });
@@ -93,26 +118,24 @@ const totalUser = ref(0);
const monthPoint = ref(0);
const monthUser = ref(0);
// const daterangeOccurTime = ref([]);
const dateRange = ref([]);
const data = reactive({
queryParams: {
startTime: null,
endTime: null,
inspectionPoint: '',
inspectorId: ''
inspectorId: '',
inspectionPointType: null
}
});
const { queryParams } = toRefs(data);
function getList() {
queryParams.value = {
inspectionPoint: data.queryParams.inspectionPoint,
inspectorId: data.queryParams.inspectorId
};
const params = proxy.addDateRange(queryParams.value, dateRange.value);
// 巡检点统计(三合一:总/月/日)
pointStats3(queryParams.value).then(res => {
pointStats3(params).then((res) => {
const d = res.data || {};
const total = d.total || { xAxis: [], seriesData: [] };
const month = d.month || { xAxis: [], seriesData: [] };
@@ -125,7 +148,7 @@ function getList() {
});
// 巡检人统计(三合一:总/月/日)
inspectorStats3(queryParams.value).then(res=>{
inspectorStats3(params).then((res) => {
const d = res.data || {};
inspectorTotalData.value = (d.total || []).map(i=>({ name:i.name, value:i.value }));
inspectorMonthData.value = (d.month || []).map(i=>({ name:i.name, value:i.value }));
@@ -143,6 +166,7 @@ function handleQuery() {
}
function resetQuery() {
dateRange.value = [];
proxy.resetForm("queryRef");
handleQuery();
}