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:
11
src/stores/line-alarm-counts.ts
Normal file
11
src/stores/line-alarm-counts.ts
Normal 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,
|
||||
};
|
||||
});
|
||||
@@ -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,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user