refactor&perf
- proxy config - query export - optimize station card request
This commit is contained in:
@@ -18,7 +18,7 @@ const { stationList } = storeToRefs(stationStore);
|
||||
const stationSelectOptions = computed(() => {
|
||||
return stationList.value.map<SelectOption>((station) => ({
|
||||
label: station.name,
|
||||
value: station.deviceIdPrefix,
|
||||
value: station.code,
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
@@ -3,50 +3,15 @@ import StationCard from '@/components/station-card.vue';
|
||||
import { NGrid, NGi } from 'naive-ui';
|
||||
import { useStationStore } from '@/stores/station';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { DeviceType } from '@/enums/device-type';
|
||||
import { useLineDevicesQuery } from '@/composables/query/use-line-devices-query';
|
||||
import { useLineAlarmsQuery } from '@/composables/query/use-line-alarms-query';
|
||||
|
||||
const stationStore = useStationStore();
|
||||
const { stationList } = storeToRefs(stationStore);
|
||||
|
||||
// 获取所有车站的设备数据
|
||||
const { data: lineDevices } = useLineDevicesQuery();
|
||||
// 获取所有车站的设备告警数据
|
||||
const { data: lineAlarms } = useLineAlarmsQuery();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NGrid :cols="8" :x-gap="6" :y-gap="6" style="padding: 8px">
|
||||
<NGi v-for="station in stationList" :key="station.name">
|
||||
<StationCard
|
||||
:station="station"
|
||||
:station-devices="
|
||||
lineDevices?.[station.code] ?? {
|
||||
[DeviceType.Camera]: [],
|
||||
[DeviceType.Decoder]: [],
|
||||
[DeviceType.Keyboard]: [],
|
||||
[DeviceType.MediaServer]: [],
|
||||
[DeviceType.Nvr]: [],
|
||||
[DeviceType.SecurityBox]: [],
|
||||
[DeviceType.Switch]: [],
|
||||
[DeviceType.VideoServer]: [],
|
||||
}
|
||||
"
|
||||
:station-alarms="
|
||||
lineAlarms?.[station.code] ?? {
|
||||
[DeviceType.Camera]: [],
|
||||
[DeviceType.Decoder]: [],
|
||||
[DeviceType.Keyboard]: [],
|
||||
[DeviceType.MediaServer]: [],
|
||||
[DeviceType.Nvr]: [],
|
||||
[DeviceType.SecurityBox]: [],
|
||||
[DeviceType.Switch]: [],
|
||||
[DeviceType.VideoServer]: [],
|
||||
unclassified: [],
|
||||
}
|
||||
"
|
||||
/>
|
||||
<StationCard :station="station" />
|
||||
</NGi>
|
||||
</NGrid>
|
||||
</template>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { Station } from '@/apis/domains';
|
||||
import type { NdmDeviceResultVO, NdmNvrResultVO } from '@/apis/models';
|
||||
import { useLineDevicesQuery } from '@/composables/query/use-line-devices-query';
|
||||
import { useLineDevicesQuery } from '@/composables/query';
|
||||
import { DeviceType, DeviceTypeName, type DeviceTypeCode, type DeviceTypeKey } from '@/enums/device-type';
|
||||
import { useStationStore } from '@/stores/station';
|
||||
import { ChevronBack } from '@vicons/ionicons5';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { NdmVimpLogResultVO } from '@/apis/models/device';
|
||||
import { ndmVimpLogDefaultExportByTemplate, postNdmVimpLogPage } from '@/apis/requests';
|
||||
import { useStationListQuery } from '@/composables/query/use-station-list-query';
|
||||
import { useStationListQuery } from '@/composables/query';
|
||||
import { JAVA_INTEGER_MAX_VALUE } from '@/constants';
|
||||
import { useStationStore } from '@/stores/station';
|
||||
import { downloadByData } from '@/utils/download';
|
||||
@@ -33,7 +33,7 @@ const { stationList } = storeToRefs(stationStore);
|
||||
const stationSelectOptions = computed(() => {
|
||||
return stationList.value.map<SelectOption>((station) => ({
|
||||
label: station.name,
|
||||
value: station.deviceIdPrefix,
|
||||
value: station.code,
|
||||
disabled: !station.online,
|
||||
}));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user