From 674ffc598fc4c071c34b4c646e2aefd0ef81f08c Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Fri, 3 Nov 2023 16:57:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A8=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/AlarmInfoList.vue | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/pages/AlarmInfoList.vue b/src/pages/AlarmInfoList.vue index dc43920..1b5deaf 100644 --- a/src/pages/AlarmInfoList.vue +++ b/src/pages/AlarmInfoList.vue @@ -230,6 +230,8 @@ import { useLineNetStore } from 'src/stores/line-net-store'; import { StompMessagingClient } from 'src/jl-graphic/message/WsMsgBroker'; import alarmStatistics from 'src/components/alarm/alarmStatistics.vue'; import { errorNotify } from 'src/utils/CommonNotify'; +import { pageQuery } from 'src/api/LineInfoApi'; +import { ApiError } from 'src/boot/axios'; const $q = useQuasar(); const lineNetStore = useLineNetStore(); @@ -323,7 +325,7 @@ async function onRequest(props: any) { size: rowsPerPage, lineId: filter.value.lineId, }; - if (filter.value.alertType) { + if (filter.value.alertType !== '全部') { Object.assign(params, { alertType: (saveAlertTypeData as never)[filter.value.alertType], }); @@ -356,6 +358,7 @@ async function onRequest(props: any) { } onMounted(() => { + queryLineInfo(); setTimeout(() => { tableRef.value.requestServerInteraction(); lineNetStore.alarmInfoListTable = tableRef.value; @@ -404,13 +407,34 @@ function batchHandle() { } const filter = ref({ - alertType: '', + alertType: '全部', lineId: 3, beginDateTime: '', endDateTime: '', alertStatus: 999, }); + +const optionsLineId: { name: string; lineId: number }[] = []; +async function queryLineInfo() { + try { + let response = await pageQuery({ + current: 1, + size: 50, + }); + response.records.forEach((info) => { + optionsLineId.push({ name: info.name, lineId: info.lineId }); + }); + } catch (err) { + const error = err as ApiError; + $q.notify({ + type: 'negative', + message: error.title, + }); + } +} + const optionsAlertType = [ + '全部', '蓝显', '全线蓝显', '列车延误2分钟',