diff --git a/src/apis/domains/station.ts b/src/apis/domains/station.ts index 08d21ed..4ab3427 100644 --- a/src/apis/domains/station.ts +++ b/src/apis/domains/station.ts @@ -1,6 +1,5 @@ export interface Station { code: string; name: string; - deviceIdPrefix: string; // 当查询设备告警记录时,需要通过deviceId的前4位来判断车站 online: boolean; } diff --git a/src/apis/requests/device/log/ndm-device-alarm-log.ts b/src/apis/requests/device/log/ndm-device-alarm-log.ts index 8702fe1..d2d12d3 100644 --- a/src/apis/requests/device/log/ndm-device-alarm-log.ts +++ b/src/apis/requests/device/log/ndm-device-alarm-log.ts @@ -31,7 +31,7 @@ export const ndmDeviceAlarmLogDefaultExportByTemplate = async (stationCode: stri } return data; } - const resp = await ndmClient.post(`${endpoint}`, pageQuery, { responseType: 'blob', retRaw: true }); + const resp = await ndmClient.post(`/${stationCode}${endpoint}`, pageQuery, { responseType: 'blob', retRaw: true }); const [err, data] = resp; if (err || !data) { throw err; diff --git a/src/components/device-alarm-detail-modal.vue b/src/components/device-alarm-detail-modal.vue index 46ce709..ac3e398 100644 --- a/src/components/device-alarm-detail-modal.vue +++ b/src/components/device-alarm-detail-modal.vue @@ -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(); @@ -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({ }, }); -const tableData = computed(() => stationAlarms.value.unclassified); +const tableData = computed(() => stationAlarms.value?.unclassified ?? []); const { mutate: downloadTableData, isPending: isDownloading } = useMutation({ mutationFn: async () => { diff --git a/src/components/offline-device-detail-modal.vue b/src/components/offline-device-detail-modal.vue index 4647ddd..62e9ede 100644 --- a/src/components/offline-device-detail-modal.vue +++ b/src/components/offline-device-detail-modal.vue @@ -1,7 +1,7 @@ diff --git a/src/pages/device-page.vue b/src/pages/device-page.vue index 1314eda..64d9b19 100644 --- a/src/pages/device-page.vue +++ b/src/pages/device-page.vue @@ -1,7 +1,7 @@