From 1333a0ec6f80951a6710789fe207c384b203b55f Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Wed, 13 Nov 2024 09:33:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=97=A0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/dialog/FaultQueryDialog.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/dialog/FaultQueryDialog.vue b/src/components/dialog/FaultQueryDialog.vue index 97eafb1..9a89d04 100644 --- a/src/components/dialog/FaultQueryDialog.vue +++ b/src/components/dialog/FaultQueryDialog.vue @@ -198,7 +198,9 @@ const onRequest: QTable['onRequest'] = async (props) => { pagination.value.rowsNumber = resp.total; pagination.value.rowsPerPage = resp.size; rows.splice(0, rows.length, ...(resp.records as [])); - handleRowClick(rows[0]); + if (rows.length) { + handleRowClick(rows[0]); + } } catch (err) { $q.notify({ type: 'negative', From b26d213a0e201a587dc89a93254622c973ee34a4 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Wed, 13 Nov 2024 09:33:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=93=BE=E6=8E=A5=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/line-net-store.ts | 47 +++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/src/stores/line-net-store.ts b/src/stores/line-net-store.ts index 975caab..0b1d48b 100644 --- a/src/stores/line-net-store.ts +++ b/src/stores/line-net-store.ts @@ -7,7 +7,7 @@ import { cancelSubscribe, } from 'src/drawApp/lineNetApp'; import { markRaw } from 'vue'; -import { Notify, QTable } from 'quasar'; +import { Notify, QNotifyUpdateOptions, QTable } from 'quasar'; import { state } from 'src/protos/system_warn_message'; export interface AlarmInfo { id: string; @@ -22,6 +22,10 @@ export interface AlarmInfo { alert_location_id: number; alarmStatus?: number; } +let msgNotify: null | ((props?: QNotifyUpdateOptions | undefined) => void) = + null; +let tip = ''; + export const useLineNetStore = defineStore('lineNet', { state: () => ({ selectedGraphics: null as JlGraphic[] | null, @@ -91,27 +95,24 @@ export const useLineNetStore = defineStore('lineNet', { }); }, setConnectInfo(data: state.WarnLineMessage) { - let tip = ''; + let newTip = ''; data.msgs.forEach((item: state.WarnMessage) => { - if (this.connectInfo) { - this.connectInfo.msgs.forEach((elem) => { - if (elem.lineId === item.lineId) { - if (elem.occRealConned && !item.occRealConned) { - tip = - tip + - `
${elem.lineId}号线路与卡斯柯的实时连接已断开;
`; - } - if (elem.occUnrealConned && !item.occUnrealConned) { - tip = - tip + - `
${elem.lineId}号线路与卡斯柯的非实时连接已断开
`; - } - } - }); + if (!item.occRealConned) { + newTip = + newTip + `
${item.lineId}号线路与卡斯柯的实时连接已断开;
`; + } + if (!item.occUnrealConned) { + newTip = + newTip + + `
${item.lineId}号线路与卡斯柯的非实时连接已断开
`; } }); - if (tip) { - const msgNotify = Notify.create({ + if (newTip && (newTip !== tip || !msgNotify)) { + if (msgNotify) { + msgNotify(); + } + tip = newTip; + msgNotify = Notify.create({ type: 'negative', timeout: 0, position: 'top', @@ -122,11 +123,17 @@ export const useLineNetStore = defineStore('lineNet', { icon: 'close', color: 'white', handler: () => { - msgNotify(); + if (msgNotify) { + msgNotify(); + } }, }, ], }); + } else if (!newTip) { + if (msgNotify) { + msgNotify(); + } } this.connectInfo = data; const allConnectAmount = data.msgs.reduce((pre, cur) => { From de94896fd70dedcf4bf7a27ac929fbceb1922957 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Wed, 13 Nov 2024 10:05:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=87=E6=8D=A2=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=85=B3=E9=97=AD=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/dialog/FaultQueryDialog.vue | 13 +++++++++---- src/layouts/MainLayout.vue | 17 +++++++++++++++-- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/components/dialog/FaultQueryDialog.vue b/src/components/dialog/FaultQueryDialog.vue index 9a89d04..93d85ac 100644 --- a/src/components/dialog/FaultQueryDialog.vue +++ b/src/components/dialog/FaultQueryDialog.vue @@ -5,7 +5,7 @@ @show="onDialogShow" title="故障查询" :width="990" - :height="580" + :height="600" >