refactor: 抽离未读告警状态,不再持久化

This commit is contained in:
yangsy
2026-01-15 13:58:13 +08:00
parent de35075be8
commit b59b34e68b
9 changed files with 67 additions and 49 deletions

View File

@@ -3,7 +3,7 @@ import { exportDeviceAlarmLogApi, pageDeviceAlarmLogApi, type NdmDeviceAlarmLog,
import { useAlarmActionColumn, useCameraSnapColumn } from '@/composables';
import { ALARM_TYPES, DEVICE_TYPE_CODES, DEVICE_TYPE_LITERALS, DEVICE_TYPE_NAMES, FAULT_LEVELS, tryGetDeviceType, type DeviceType } from '@/enums';
import { renderAlarmDateCell, renderAlarmTypeCell, renderDeviceTypeCell, renderFaultLevelCell } from '@/helpers';
import { useAlarmStore, useDeviceStore, useStationStore } from '@/stores';
import { useDeviceStore, useStationStore, useUnreadStore } from '@/stores';
import { downloadByData, parseErrorFeedback } from '@/utils';
import { useMutation } from '@tanstack/vue-query';
import { watchDebounced } from '@vueuse/core';
@@ -44,10 +44,12 @@ const router = useRouter();
const stationStore = useStationStore();
const { stations } = storeToRefs(stationStore);
const deviceStore = useDeviceStore();
const { lineDevices } = storeToRefs(deviceStore);
const alarmStore = useAlarmStore();
const { unreadAlarmCount } = storeToRefs(alarmStore);
const unreadStore = useUnreadStore();
const { unreadAlarmCount } = storeToRefs(unreadStore);
const stationSelectOptions = computed<SelectOption[]>(() => {
return stations.value.map((station) => ({