refactor:

- extend NdmDeviceAlarmLogVO
- only query alarm counts
- separate request and store update in useQuery
- refactor station card and alarm modal, data fetching is now inside modal
- optimize device tree
- optimize query station list
- make export size follow page size
- fix query sequence and make them follow stations -> devices -> alarms
This commit is contained in:
yangsy
2025-09-02 14:21:13 +08:00
parent 54a150ec07
commit 7afb79f826
21 changed files with 475 additions and 439 deletions

View File

@@ -0,0 +1,11 @@
import type { LineAlarmCounts } from '@/composables/query';
import { defineStore } from 'pinia';
import { ref } from 'vue';
export const useLineAlarmCountsStore = defineStore('ndm-line-alarm-counts-store', () => {
const lineAlarmCounts = ref<LineAlarmCounts>({});
return {
lineAlarmCounts,
};
});

View File

@@ -1,25 +1,25 @@
import dayjs from 'dayjs';
import { defineStore } from 'pinia';
import { ref } from 'vue';
export const useQueryControlStore = defineStore('ndm-query-control-store', () => {
const pollingEnabled = ref(true);
const globalPollingEnabled = ref(true);
const enablePolling = () => (pollingEnabled.value = true);
const disablePolling = () => (pollingEnabled.value = false);
const enableGlobalPolling = () => (globalPollingEnabled.value = true);
const disableGlobalPolling = () => (globalPollingEnabled.value = false);
const deviceQueryStamp = ref(0);
const alarmQueryStamp = ref(0);
const updateDeviceQueryStamp = () => (deviceQueryStamp.value = dayjs().valueOf());
const updateAlarmQueryStamp = () => (alarmQueryStamp.value = dayjs().valueOf());
return {
pollingEnabled,
enablePolling,
disablePolling,
globalPollingEnabled,
enableGlobalPolling,
disableGlobalPolling,
deviceQueryStamp,
alarmQueryStamp,
updateDeviceQueryStamp,
updateAlarmQueryStamp,
};
});