feat: stationVerifyMode

This commit is contained in:
yangsy
2025-10-10 15:54:28 +08:00
parent ccdcbfd103
commit 3c69887308
3 changed files with 83 additions and 36 deletions

View File

@@ -2,34 +2,46 @@ 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 enablePolling = () => (pollingEnabled.value = true);
const disablePolling = () => (pollingEnabled.value = false);
export const useQueryControlStore = defineStore(
'ndm-query-control-store',
() => {
const pollingEnabled = ref(true);
const enablePolling = () => (pollingEnabled.value = true);
const disablePolling = () => (pollingEnabled.value = false);
const deviceQueryStamp = ref(0);
const alarmQueryStamp = ref(0);
const updateDeviceQueryStamp = () => (deviceQueryStamp.value = dayjs().valueOf());
const updateAlarmQueryStamp = () => (alarmQueryStamp.value = dayjs().valueOf());
const deviceQueryStamp = ref(0);
const alarmQueryStamp = ref(0);
const updateDeviceQueryStamp = () => (deviceQueryStamp.value = dayjs().valueOf());
const updateAlarmQueryStamp = () => (alarmQueryStamp.value = dayjs().valueOf());
const deviceQueryUpdatedAt = ref(0);
const alarmQueryUpdatedAt = ref(0);
const updateDeviceQueryUpdatedAt = () => (deviceQueryUpdatedAt.value = dayjs().valueOf());
const updateAlarmQueryUpdatedAt = () => (alarmQueryUpdatedAt.value = dayjs().valueOf());
const deviceQueryUpdatedAt = ref(0);
const alarmQueryUpdatedAt = ref(0);
const updateDeviceQueryUpdatedAt = () => (deviceQueryUpdatedAt.value = dayjs().valueOf());
const updateAlarmQueryUpdatedAt = () => (alarmQueryUpdatedAt.value = dayjs().valueOf());
return {
pollingEnabled,
enablePolling,
disablePolling,
const stationVerifyMode = ref<'concurrent' | 'batch'>('batch');
deviceQueryStamp,
alarmQueryStamp,
updateDeviceQueryStamp,
updateAlarmQueryStamp,
return {
pollingEnabled,
enablePolling,
disablePolling,
deviceQueryUpdatedAt,
alarmQueryUpdatedAt,
updateDeviceQueryUpdatedAt,
updateAlarmQueryUpdatedAt,
};
});
deviceQueryStamp,
alarmQueryStamp,
updateDeviceQueryStamp,
updateAlarmQueryStamp,
deviceQueryUpdatedAt,
alarmQueryUpdatedAt,
updateDeviceQueryUpdatedAt,
updateAlarmQueryUpdatedAt,
stationVerifyMode,
};
},
{
persist: {
pick: ['stationVerifyMode'],
},
},
);