feat: ui
This commit is contained in:
18
src/composables/query/use-line-alarms-query.ts
Normal file
18
src/composables/query/use-line-alarms-query.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { useStationStore } from '@/stores/station';
|
||||
import { useQuery } from '@tanstack/vue-query';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { computed } from 'vue';
|
||||
|
||||
export function useLineDevicesQuery() {
|
||||
const stationStore = useStationStore();
|
||||
const { updatedTime, stationList, onlineStationList } = storeToRefs(stationStore);
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['line-devices', updatedTime],
|
||||
enabled: computed(() => onlineStationList.value.length > 0),
|
||||
queryFn: async () => {
|
||||
if (!stationList?.value) {
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user