From 19297c2870b42967df2edca95febc57a9033e958 Mon Sep 17 00:00:00 2001 From: yangsy Date: Mon, 10 Nov 2025 20:35:55 +0800 Subject: [PATCH] refactor import --- src/components/helper/device-alarm.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/helper/device-alarm.ts b/src/components/helper/device-alarm.ts index bc5aabd..d41c36d 100644 --- a/src/components/helper/device-alarm.ts +++ b/src/components/helper/device-alarm.ts @@ -1,4 +1,4 @@ -import type { NdmDeviceAlarmLogVO, NdmDeviceResultVO, NdmNvrResultVO } from '@/apis/models'; +import type { NdmDeviceAlarmLogResultVO, NdmDeviceResultVO, NdmNvrResultVO } from '@/apis/models'; import { AlarmType } from '@/enums/alarm-type'; import { DeviceType, DeviceTypeName, tryGetDeviceTypeVal } from '@/enums/device-type'; import { FaultLevel } from '@/enums/fault-level'; @@ -6,17 +6,17 @@ import dayjs from 'dayjs'; import { NButton, NPopover, NScrollbar, NTag, type TagProps } from 'naive-ui'; import { h } from 'vue'; -export const renderAlarmDateCell = (rowData: Partial) => { +export const renderAlarmDateCell = (rowData: NdmDeviceAlarmLogResultVO) => { return dayjs(Number(rowData.alarmDate ?? 0)).format('YYYY-MM-DD HH:mm:ss'); }; -export const renderDeviceTypeCell = (rowData: Partial) => { +export const renderDeviceTypeCell = (rowData: NdmDeviceAlarmLogResultVO) => { const deviceTypeVal = tryGetDeviceTypeVal(rowData.deviceType); if (!deviceTypeVal) return '-'; return DeviceTypeName[deviceTypeVal]; }; -export const renderAlarmTypeCell = (rowData: Partial) => { +export const renderAlarmTypeCell = (rowData: NdmDeviceAlarmLogResultVO) => { const { alarmType } = rowData; if (!alarmType) { return ''; @@ -24,7 +24,7 @@ export const renderAlarmTypeCell = (rowData: Partial) => { return h(NTag, { type: 'default' }, { default: () => AlarmType[alarmType] }); }; -export const renderFaultLevelCell = (rowData: Partial) => { +export const renderFaultLevelCell = (rowData: NdmDeviceAlarmLogResultVO) => { const { faultLevel } = rowData; if (!faultLevel) { return ''; @@ -40,7 +40,7 @@ export const renderFaultLevelCell = (rowData: Partial) => { return h(NTag, { type }, { default: () => FaultLevel[faultLevel] }); }; -export const renderFaultDescriptionCell = (rowData: Partial, ndmDevice: NdmDeviceResultVO) => { +export const renderFaultDescriptionCell = (rowData: NdmDeviceAlarmLogResultVO, ndmDevice: NdmDeviceResultVO) => { const isNvrCluster = (ndmDevice: NdmDeviceResultVO) => { const deviceTypeVal = tryGetDeviceTypeVal(ndmDevice.deviceType); if (!deviceTypeVal) return false;