refactor: tryGetDeviceTypeVal
This commit is contained in:
@@ -3,7 +3,7 @@ import type { NdmDeviceAlarmLogResultVO } from '@/apis/models';
|
||||
import { ndmDeviceAlarmLogDefaultExportByTemplate, postNdmDeviceAlarmLogPage } from '@/apis/requests';
|
||||
import { FaultLevel } from '@/enums/fault-level';
|
||||
import { AlarmType } from '@/enums/alarm-type';
|
||||
import { DeviceType, DeviceTypeCode, DeviceTypeName, getDeviceTypeVal, type DeviceTypeVal } from '@/enums/device-type';
|
||||
import { DeviceType, DeviceTypeCode, DeviceTypeName, tryGetDeviceTypeVal, type DeviceTypeVal } from '@/enums/device-type';
|
||||
import { useCurrentAlarmsStore } from '@/stores/current-alarms';
|
||||
import { useStationStore } from '@/stores/station';
|
||||
import { downloadByData } from '@/utils/download';
|
||||
@@ -79,7 +79,9 @@ const tableColumns: DataTableColumns<NdmDeviceAlarmLogResultVO> = [
|
||||
title: '设备类型',
|
||||
key: 'deviceType',
|
||||
render: (rowData) => {
|
||||
return DeviceTypeName[getDeviceTypeVal(rowData.deviceType)];
|
||||
const deviceTypeVal = tryGetDeviceTypeVal(rowData.deviceType);
|
||||
if (!deviceTypeVal) return '-';
|
||||
return DeviceTypeName[deviceTypeVal];
|
||||
},
|
||||
},
|
||||
{ title: '设备名称', key: 'deviceName' },
|
||||
|
||||
Reference in New Issue
Block a user