From a2ae99209f79e5d2884220a26e81ef621e329400 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Mon, 11 Nov 2024 17:48:52 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E8=AE=A2=E9=98=85=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/AlarmInfoList.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/pages/AlarmInfoList.vue b/src/pages/AlarmInfoList.vue index c6bf285..1b12774 100644 --- a/src/pages/AlarmInfoList.vue +++ b/src/pages/AlarmInfoList.vue @@ -395,7 +395,10 @@ onMounted(() => { tableRef.value.requestServerInteraction(); lineNetStore.alarmInfoListTable = tableRef.value; destinations.forEach((destination) => { - socket = webSocketConnect(destination, handler); + allSocketsAndDestinations.push({ + socket: webSocketConnect(destination, handler), + destination, + }); }); }); }); @@ -584,7 +587,10 @@ function openAlarmDialog(row: any) { }); } -let socket: StompMessagingClient | null = null; +let allSocketsAndDestinations: { + socket: StompMessagingClient; + destination: string; +}[] = []; let destinations: string[] = []; function handler(message: Uint8Array) { const storage = alert.NccAlertInfoMessage.deserialize(message); @@ -592,8 +598,8 @@ function handler(message: Uint8Array) { } onUnmounted(() => { - destinations.forEach((destination) => { - closeWebSocketConnect(socket, destination); + allSocketsAndDestinations.forEach((info) => { + closeWebSocketConnect(info.socket, info.destination); }); }); From 425d8e986b5e77c0ed206e3ba0973d8e1add74b3 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Mon, 11 Nov 2024 18:16:10 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=A4=84=E7=90=86=E8=AE=A2=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drawApp/lineApp.ts | 13 ++++++++++++- src/drawApp/lineNetApp.ts | 10 ++++++++-- src/pages/LineMonitorPage.vue | 8 ++++---- src/pages/MonitorPage.vue | 8 ++++---- src/stores/line-net-store.ts | 5 +++++ src/stores/line-store.ts | 11 ++++++++++- 6 files changed, 43 insertions(+), 12 deletions(-) diff --git a/src/drawApp/lineApp.ts b/src/drawApp/lineApp.ts index 308d714..003584f 100644 --- a/src/drawApp/lineApp.ts +++ b/src/drawApp/lineApp.ts @@ -95,7 +95,10 @@ export function destroyLineApp(): void { export function initLineApp(lineId: number): IGraphicApp { lineApp = lineAppMap.get(lineId) || null; - if (lineApp) return lineApp; + if (lineApp) { + handleSubscribe(lineApp); + return lineApp; + } lineApp = newGraphicApp({ interactiveGraphicTypeIncludes: [ Signal.Type, @@ -258,6 +261,14 @@ export async function loadLineDatas(): Promise { } } +export function cancelSubscribe(lineApp: IGraphicApp) { + const lineStore = useLineStore(); + const lineId = lineStore.lineId; + if (lineId) { + lineApp.unsubscribe(`/queue/line/${lineId}/device`); + lineApp.unsubscribe(`/queue/line/${lineId}/train`); + } +} function handleSubscribe(lineApp: IGraphicApp) { const lineStore = useLineStore(); const lineId = lineStore.lineId; diff --git a/src/drawApp/lineNetApp.ts b/src/drawApp/lineNetApp.ts index e1fe7de..b0387e0 100644 --- a/src/drawApp/lineNetApp.ts +++ b/src/drawApp/lineNetApp.ts @@ -52,7 +52,10 @@ export function destroyLineNetApp(): void { } export function initLineNetApp(): IGraphicApp { - if (lineNetApp) return lineNetApp; + if (lineNetApp) { + handleSubscribe(lineNetApp); + return lineNetApp; + } lineNetApp = newGraphicApp({ interactiveGraphicTypeIncludes: [ RunLine.Type, @@ -146,7 +149,10 @@ export async function loadLineNetDatas(): Promise { } } -function handleSubscribe(lineNetApp: IGraphicApp) { +export function cancelSubscribe(lineApp: IGraphicApp) { + lineApp.unsubscribe('/queue/lineNet'); +} +export function handleSubscribe(lineNetApp: IGraphicApp) { const lineNetStore = useLineNetStore(); lineNetApp.enableWsMassaging({ wsUrl: `${getWebsocketUrl()}`, diff --git a/src/pages/LineMonitorPage.vue b/src/pages/LineMonitorPage.vue index 3c2bf0e..117cc43 100644 --- a/src/pages/LineMonitorPage.vue +++ b/src/pages/LineMonitorPage.vue @@ -7,7 +7,7 @@ diff --git a/src/pages/MonitorPage.vue b/src/pages/MonitorPage.vue index 579d4ba..71af585 100644 --- a/src/pages/MonitorPage.vue +++ b/src/pages/MonitorPage.vue @@ -7,7 +7,7 @@ diff --git a/src/stores/line-net-store.ts b/src/stores/line-net-store.ts index 5987389..c805161 100644 --- a/src/stores/line-net-store.ts +++ b/src/stores/line-net-store.ts @@ -4,6 +4,7 @@ import { initLineNetApp, getLineNetApp, destroyLineNetApp, + cancelSubscribe, } from 'src/drawApp/lineNetApp'; import { markRaw } from 'vue'; import { QTable } from 'quasar'; @@ -72,6 +73,10 @@ export const useLineNetStore = defineStore('lineNet', { this.selectedGraphics = []; return app; }, + cancelSubscribe() { + const app = this.getLineNetApp(); + cancelSubscribe(app); + }, destroy() { this.selectedGraphics = null; destroyLineNetApp(); diff --git a/src/stores/line-store.ts b/src/stores/line-store.ts index d2f09b8..e757f2a 100644 --- a/src/stores/line-store.ts +++ b/src/stores/line-store.ts @@ -1,6 +1,11 @@ import { defineStore } from 'pinia'; import { IJlCanvas, JlGraphic, IGraphicApp } from 'jl-graphic'; -import { initLineApp, getLineApp, destroyLineApp } from 'src/drawApp/lineApp'; +import { + initLineApp, + getLineApp, + destroyLineApp, + cancelSubscribe, +} from 'src/drawApp/lineApp'; import { markRaw } from 'vue'; export const useLineStore = defineStore('line', { @@ -50,6 +55,10 @@ export const useLineStore = defineStore('line', { this.selectedGraphics = null; destroyLineApp(); }, + cancelSubscribe() { + const app = this.getLineApp(); + cancelSubscribe(app); + }, setLineId(id: number | null) { this.lineId = id; }, From cdcad825f7c0d26880080e0705f94722ddc02bd4 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Tue, 12 Nov 2024 09:13:54 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=8F=96=E6=B6=88=E8=AE=A2=E9=98=85?= =?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/drawApp/lineApp.ts | 4 ++++ src/drawApp/lineNetApp.ts | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/drawApp/lineApp.ts b/src/drawApp/lineApp.ts index 003584f..1073ca6 100644 --- a/src/drawApp/lineApp.ts +++ b/src/drawApp/lineApp.ts @@ -267,6 +267,10 @@ export function cancelSubscribe(lineApp: IGraphicApp) { if (lineId) { lineApp.unsubscribe(`/queue/line/${lineId}/device`); lineApp.unsubscribe(`/queue/line/${lineId}/train`); + const userStore = useUserStore(); + getMonitorPath(userStore.roles).destinations.forEach((destination) => { + lineApp.unsubscribe(destination); + }); } } function handleSubscribe(lineApp: IGraphicApp) { diff --git a/src/drawApp/lineNetApp.ts b/src/drawApp/lineNetApp.ts index b0387e0..e513184 100644 --- a/src/drawApp/lineNetApp.ts +++ b/src/drawApp/lineNetApp.ts @@ -149,8 +149,12 @@ export async function loadLineNetDatas(): Promise { } } -export function cancelSubscribe(lineApp: IGraphicApp) { - lineApp.unsubscribe('/queue/lineNet'); +export function cancelSubscribe(lineNetApp: IGraphicApp) { + lineNetApp.unsubscribe('/queue/lineNet'); + const userStore = useUserStore(); + getMonitorPath(userStore.roles).destinations.forEach((destination) => { + lineNetApp.unsubscribe(destination); + }); } export function handleSubscribe(lineNetApp: IGraphicApp) { const lineNetStore = useLineNetStore(); From 33292ca9b85e40868dc18ca44ade04e5c464f285 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Tue, 12 Nov 2024 09:17:32 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E8=AE=A2=E9=98=85=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drawApp/lineApp.ts | 7 ++++--- src/drawApp/lineNetApp.ts | 8 +++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/drawApp/lineApp.ts b/src/drawApp/lineApp.ts index 1073ca6..034a238 100644 --- a/src/drawApp/lineApp.ts +++ b/src/drawApp/lineApp.ts @@ -267,12 +267,12 @@ export function cancelSubscribe(lineApp: IGraphicApp) { if (lineId) { lineApp.unsubscribe(`/queue/line/${lineId}/device`); lineApp.unsubscribe(`/queue/line/${lineId}/train`); - const userStore = useUserStore(); - getMonitorPath(userStore.roles).destinations.forEach((destination) => { + monitorDestinations.forEach((destination) => { lineApp.unsubscribe(destination); }); } } +let monitorDestinations: string[] = []; function handleSubscribe(lineApp: IGraphicApp) { const lineStore = useLineStore(); const lineId = lineStore.lineId; @@ -327,7 +327,8 @@ function handleSubscribe(lineApp: IGraphicApp) { }); const lineNetStore = useLineNetStore(); const userStore = useUserStore(); - getMonitorPath(userStore.roles).destinations.forEach((destination) => { + monitorDestinations = getMonitorPath(userStore.roles).destinations; + monitorDestinations.forEach((destination) => { lineApp.subscribe({ destination, messageHandle: (message: Uint8Array) => { diff --git a/src/drawApp/lineNetApp.ts b/src/drawApp/lineNetApp.ts index e513184..ab23b88 100644 --- a/src/drawApp/lineNetApp.ts +++ b/src/drawApp/lineNetApp.ts @@ -151,11 +151,12 @@ export async function loadLineNetDatas(): Promise { export function cancelSubscribe(lineNetApp: IGraphicApp) { lineNetApp.unsubscribe('/queue/lineNet'); - const userStore = useUserStore(); - getMonitorPath(userStore.roles).destinations.forEach((destination) => { + monitorDestinations.forEach((destination) => { lineNetApp.unsubscribe(destination); }); } + +let monitorDestinations: string[] = []; export function handleSubscribe(lineNetApp: IGraphicApp) { const lineNetStore = useLineNetStore(); lineNetApp.enableWsMassaging({ @@ -175,7 +176,8 @@ export function handleSubscribe(lineNetApp: IGraphicApp) { }, }); const userStore = useUserStore(); - getMonitorPath(userStore.roles).destinations.forEach((destination) => { + monitorDestinations = getMonitorPath(userStore.roles).destinations; + monitorDestinations.forEach((destination) => { lineNetApp.subscribe({ destination, messageHandle: (message: Uint8Array) => { From cfcf0e06d13c2b782cbcb8e92b25703dd1a28120 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Tue, 12 Nov 2024 15:18:07 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drawApp/lineNetApp.ts | 2 +- src/stores/line-net-store.ts | 39 +++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/drawApp/lineNetApp.ts b/src/drawApp/lineNetApp.ts index ab23b88..42dd35c 100644 --- a/src/drawApp/lineNetApp.ts +++ b/src/drawApp/lineNetApp.ts @@ -157,7 +157,7 @@ export function cancelSubscribe(lineNetApp: IGraphicApp) { } let monitorDestinations: string[] = []; -export function handleSubscribe(lineNetApp: IGraphicApp) { +function handleSubscribe(lineNetApp: IGraphicApp) { const lineNetStore = useLineNetStore(); lineNetApp.enableWsMassaging({ wsUrl: `${getWebsocketUrl()}`, diff --git a/src/stores/line-net-store.ts b/src/stores/line-net-store.ts index c805161..975caab 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 { QTable } from 'quasar'; +import { Notify, QTable } from 'quasar'; import { state } from 'src/protos/system_warn_message'; export interface AlarmInfo { id: string; @@ -91,6 +91,43 @@ export const useLineNetStore = defineStore('lineNet', { }); }, setConnectInfo(data: state.WarnLineMessage) { + let tip = ''; + 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 (tip) { + const msgNotify = Notify.create({ + type: 'negative', + timeout: 0, + position: 'top', + html: true, + message: tip, + actions: [ + { + icon: 'close', + color: 'white', + handler: () => { + msgNotify(); + }, + }, + ], + }); + } this.connectInfo = data; const allConnectAmount = data.msgs.reduce((pre, cur) => { let addValue = 0; From 9ac2c2dc59922a573058d51ab3931759f1a6e53b Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Tue, 12 Nov 2024 16:44:22 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=95=85=E9=9A=9C=E6=9F=A5=E8=AF=A2?= =?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/components/dialog/FaultQueryDialog.vue | 213 ++++++++++++--------- src/layouts/MainLayout.vue | 16 +- 2 files changed, 122 insertions(+), 107 deletions(-) diff --git a/src/components/dialog/FaultQueryDialog.vue b/src/components/dialog/FaultQueryDialog.vue index c9f9267..8d28ecf 100644 --- a/src/components/dialog/FaultQueryDialog.vue +++ b/src/components/dialog/FaultQueryDialog.vue @@ -3,11 +3,11 @@ seamless ref="dialogRef" @show="onDialogShow" - :title="props.dialogTitle" + title="故障查询" :width="990" - :height="0" + :height="580" > - + + +
+
+ 故障类型 :{{ + clickRowInfo.faultType + }} +
+
+ 消息名称(故障现象):{{ + clickRowInfo.faultNameShower + }} +
+ +
司机处理结果(服务故障现象)
+ +
+
{{ clickRowInfo.faultDriverShower }}
+
+
+ +
司机关键点(退出服务地点)
+ +
+
{{ clickRowInfo.resultMsg }}
+
+
+
+
+ - diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 1315359..a5d5d0b 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -18,16 +18,9 @@ - { socket = webSocketConnect(destination, handler); }); -function openFaultQueryDialog(dialogTitle: string) { +function openFaultQueryDialog() { $q.dialog({ component: FaultQueryDialog, - componentProps: { - dialogTitle, - }, }); } From 52fbdba1af0b1cabffb4958a0fd265893558344d Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Tue, 12 Nov 2024 17:28:58 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E6=95=85=E9=9A=9C=E6=9F=A5=E8=AF=A2?= =?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/components/dialog/FaultQueryDialog.vue | 26 +++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/components/dialog/FaultQueryDialog.vue b/src/components/dialog/FaultQueryDialog.vue index 8d28ecf..97eafb1 100644 --- a/src/components/dialog/FaultQueryDialog.vue +++ b/src/components/dialog/FaultQueryDialog.vue @@ -53,19 +53,18 @@ }}
- 消息名称(故障现象):{{ - clickRowInfo.faultNameShower - }} + {{ showTitle.faultNameShower }}:{{ clickRowInfo.faultNameShower }}
-
司机处理结果(服务故障现象)
+
{{ showTitle.faultDriverShower }}
{{ clickRowInfo.faultDriverShower }}
-
司机关键点(退出服务地点)
+
{{ showTitle.resultMsg }}
{{ clickRowInfo.resultMsg }}
@@ -199,6 +198,7 @@ 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]); } catch (err) { $q.notify({ type: 'negative', @@ -216,7 +216,21 @@ const clickRowInfo = reactive({ faultDriverShower: '', resultMsg: '', }); +const showTitle = reactive({ + faultNameShower: '', + faultDriverShower: '', + resultMsg: '', +}); function handleRowClick(row: FaultQueryListItem) { + if (row.faultType.includes('FAULT_EMERGENCY_GUIDE')) { + showTitle.faultNameShower = '故障现象'; + showTitle.faultDriverShower = '司机处理结果'; + showTitle.resultMsg = '行调提醒司机关键点'; + } else { + showTitle.faultNameShower = '故障名称'; + showTitle.faultDriverShower = '故障现象'; + showTitle.resultMsg = '退出服务地点'; + } clickRowInfo.id = row?.id as number; clickRowInfo.faultType = getFaultTypeName(row) as string; clickRowInfo.faultNameShower = row.faultNameShower; @@ -281,7 +295,7 @@ const onDialogShow = () => {