fix: deviceType column display

This commit is contained in:
yangsy
2025-09-02 21:27:27 +08:00
parent 3359f311d0
commit 66b24af9ea

View File

@@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { NdmDeviceAlarmLogResultVO } from '@/apis/models'; import type { NdmDeviceAlarmLogResultVO } from '@/apis/models';
import { ndmDeviceAlarmLogDefaultExportByTemplate, postNdmDeviceAlarmLogPage } from '@/apis/requests'; import { ndmDeviceAlarmLogDefaultExportByTemplate, postNdmDeviceAlarmLogPage } from '@/apis/requests';
import { DeviceType, DeviceTypeCode, DeviceTypeName, type DeviceTypeVal } from '@/enums/device-type'; import { DeviceType, DeviceTypeCode, DeviceTypeName, getDeviceTypeVal, type DeviceTypeVal } from '@/enums/device-type';
import { useCurrentAlarmsStore } from '@/stores/current-alarms'; import { useCurrentAlarmsStore } from '@/stores/current-alarms';
import { useStationStore } from '@/stores/station'; import { useStationStore } from '@/stores/station';
import { downloadByData } from '@/utils/download'; import { downloadByData } from '@/utils/download';
@@ -73,14 +73,14 @@ const tableColumns: DataTableColumns<NdmDeviceAlarmLogResultVO> = [
title: '设备类型', title: '设备类型',
key: 'deviceType', key: 'deviceType',
render: (rowData) => { render: (rowData) => {
return DeviceTypeName[(rowData.deviceType ?? DeviceType.Camera) as DeviceTypeVal]; return DeviceTypeName[getDeviceTypeVal(rowData.deviceType)];
}, },
}, },
{ title: '设备名称', key: 'deviceName' }, { title: '设备名称', key: 'deviceName' },
{ title: '告警类型', key: 'alarmType', align: 'center' }, { title: '告警类型', key: 'alarmType', align: 'center' },
{ title: '故障级别', key: 'faultLevel', align: 'center' }, { title: '故障级别', key: 'faultLevel', align: 'center' },
{ title: '故障编码', key: 'faultCode', align: 'center' }, { title: '故障编码', key: 'faultCode', align: 'center' },
{ title: '故障位置', key: 'faultLocation' }, // { title: '故障位置', key: 'faultLocation' },
{ title: '故障描述', key: 'faultDescription' }, { title: '故障描述', key: 'faultDescription' },
{ title: '修复建议', key: 'alarmRepairSuggestion' }, { title: '修复建议', key: 'alarmRepairSuggestion' },
{ {