diff --git a/src/api/home/alarm/report.ts b/src/api/home/alarm/report.ts new file mode 100644 index 0000000..285ba35 --- /dev/null +++ b/src/api/home/alarm/report.ts @@ -0,0 +1,12 @@ +/** + * 报表生成接口 + */ +import request from '@/api/index' + +export function getReportList(data: any) { + return request({ + url: '/statics/alarmRecords/report', + method: 'post', + data, + }) +} diff --git a/src/api/home/alarm/report.ts b/src/api/home/alarm/report.ts new file mode 100644 index 0000000..285ba35 --- /dev/null +++ b/src/api/home/alarm/report.ts @@ -0,0 +1,12 @@ +/** + * 报表生成接口 + */ +import request from '@/api/index' + +export function getReportList(data: any) { + return request({ + url: '/statics/alarmRecords/report', + method: 'post', + data, + }) +} diff --git a/src/views/home/alarm/report/components/detail.vue b/src/views/home/alarm/report/components/detail.vue index 7d892bb..180a9e9 100644 --- a/src/views/home/alarm/report/components/detail.vue +++ b/src/views/home/alarm/report/components/detail.vue @@ -12,86 +12,52 @@ { text: '日期', value: 'date', - width: 120 + width: 130, }, { text: '工况类报警', - value: 'workingCondition', - width: 110, + value: 'alarmSum', + width: 130, }, { text: '非工况类报警', - value: 'noWorkingCondition', - width: 110, + value: 'noAlarmSum', + width: 150, }, { text: '设备故障报警', - value: 'deviceFault', - width: 110, + value: 'faultSum', + width: 150, }, { text: '未确认', - value: 'unconfirmed', - width: 110, + value: 'noConfirmAlarmSum', + width: 130, }, { text: '总计(工况类报警+非工况类报警)', - value: 'count', + value: 'alarmCount', }, { text: '设备总数', - value: 'deviceAll', - width: 110, + value: 'deviceSum', + width: 130, }, ]) - const tableHeight = ref(undefined) +const tableHeight = ref(undefined) const loading = ref(false) const initDialog = (row: any) => { title.value = row.deptName dialogFormVisible.value = true - + // console.log(row, '123') // 获取接口 loading.value = true setTimeout(() => { - tableData.value = [ - { - date: '2025-03-06', - workingCondition: '2', - noWorkingCondition: '2', - deviceFault: '2', - unconfirmed: '2', - deviceAll: '2', - count: '5' - }, - { - date: '2025-03-06', - workingCondition: '2', - noWorkingCondition: '2', - deviceFault: '2', - unconfirmed: '2', - deviceAll: '2', - count: '5' - }, - { - date: '2025-03-06', - workingCondition: '2', - noWorkingCondition: '2', - deviceFault: '2', - unconfirmed: '2', - deviceAll: '2', - count: '5' - }, - { - date: '2025-03-06', - workingCondition: '2', - noWorkingCondition: '2', - deviceFault: '2', - unconfirmed: '2', - deviceAll: '2', - count: '5' - }, - ] + tableData.value = row.day.map((item: any) => ({ + ...item, + alarmCount: Number(item.alarmSum) + Number(item.noAlarmSum), + })) if (tableData.value.length > 7) { tableHeight.value = 300 } @@ -99,7 +65,7 @@ tableHeight.value = undefined } loading.value = false - }, 2000); + }, 1000) } defineExpose({ @@ -112,12 +78,14 @@