refactor: extend device-type.ts
This commit is contained in:
@@ -4,7 +4,7 @@ import type { NdmDeviceAlarmLogResultVO } from '@/apis/models';
|
||||
import { ndmDeviceAlarmLogDefaultExportByTemplate } from '@/apis/requests';
|
||||
import type { StationAlarms } from '@/composables/query';
|
||||
import { JAVA_INTEGER_MAX_VALUE } from '@/constants';
|
||||
import { DeviceType, DeviceTypeName, type DeviceTypeVal } from '@/enums/device-type';
|
||||
import { DeviceType, DeviceTypeName, getDeviceTypeVal } from '@/enums/device-type';
|
||||
import { useQueryControlStore } from '@/stores/query-control';
|
||||
import { downloadByData } from '@/utils/download';
|
||||
import { useMutation } from '@tanstack/vue-query';
|
||||
@@ -60,12 +60,12 @@ const tableColumns: DataTableColumns<NdmDeviceAlarmLogResultVO> = [
|
||||
title: '设备类型',
|
||||
key: 'deviceType',
|
||||
render: (rowData) => {
|
||||
return DeviceTypeName[(rowData.deviceType ?? DeviceType.Camera) as DeviceTypeVal];
|
||||
return DeviceTypeName[getDeviceTypeVal(rowData.deviceType)];
|
||||
},
|
||||
filterMultiple: true,
|
||||
filterOptions: Object.values(DeviceType).map((deviceType) => ({ label: DeviceTypeName[deviceType], value: deviceType })),
|
||||
filter: (filterOptionValue, row) => {
|
||||
return row.deviceType === filterOptionValue;
|
||||
return getDeviceTypeVal(row.deviceType) === filterOptionValue;
|
||||
},
|
||||
},
|
||||
{ title: '设备名称', key: 'deviceName' },
|
||||
|
||||
Reference in New Issue
Block a user