refactor&perf

- proxy config
- query export
- optimize station card request
This commit is contained in:
yangsy
2025-08-25 15:49:21 +08:00
parent dea621a7a2
commit d0658580a0
23 changed files with 263 additions and 109 deletions

View File

@@ -3,7 +3,7 @@
import type { Station } from '@/apis/domains';
import type { NdmDeviceAlarmLogResultVO } from '@/apis/models';
import { ndmDeviceAlarmLogDefaultExportByTemplate } from '@/apis/requests';
import type { StationAlarms } from '@/composables/query/use-line-alarms-query';
import type { StationAlarms } from '@/composables/query/alarm/use-line-alarms-query';
import { JAVA_INTEGER_MAX_VALUE } from '@/constants';
import { DeviceType, DeviceTypeName, type DeviceTypeCode } from '@/enums/device-type';
import { useQueryControlStore } from '@/stores/query-control';
@@ -15,7 +15,7 @@ import { computed, h, reactive, toRefs, watch } from 'vue';
interface Props {
station: Station;
stationAlarms: StationAlarms;
stationAlarms?: StationAlarms;
}
const props = defineProps<Props>();
@@ -35,7 +35,7 @@ watch(show, (newValue) => {
const alarmCount = computed(() => {
return Object.values(DeviceType).reduce((count, deviceType) => {
return count + stationAlarms.value[deviceType].length;
return count + (stationAlarms.value?.[deviceType].length ?? 0);
}, 0);
});
@@ -43,7 +43,7 @@ const classifiedCounts = computed(() => {
return Object.values(DeviceType).map<{ label: string; count: number }>((deviceType) => {
return {
label: DeviceTypeName[deviceType],
count: stationAlarms.value[deviceType].length,
count: stationAlarms.value?.[deviceType].length ?? 0,
};
});
});
@@ -132,7 +132,7 @@ const tablePagination = reactive<PaginationProps>({
},
});
const tableData = computed<DataTableRowData[]>(() => stationAlarms.value.unclassified);
const tableData = computed<DataTableRowData[]>(() => stationAlarms.value?.unclassified ?? []);
const { mutate: downloadTableData, isPending: isDownloading } = useMutation({
mutationFn: async () => {