From 0063c53ec64aa28d348ffd27effb2e974c2c3e38 Mon Sep 17 00:00:00 2001 From: GGJ <357021191@qq.com> Date: Wed, 16 Apr 2025 09:43:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E8=A1=A8=E5=A4=B4?= =?UTF-8?q?=E4=B8=8B=E6=8B=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/table/header/index.vue | 2 + src/stores/monitoringPoint.ts | 9 +- src/utils/webSocketClient.ts | 2 +- .../userLedger/components/addForm.vue | 3 +- .../business/terminal/userLedger/index.vue | 2 +- .../monitoringPoint/online/index.vue | 12 +- .../online/shishishuju/index.vue | 7 + .../runManage/monitoringPoints/index.vue | 2 +- .../runManage/terminalLedger/index.vue | 187 +++++++++++------- 9 files changed, 146 insertions(+), 80 deletions(-) diff --git a/src/components/table/header/index.vue b/src/components/table/header/index.vue index fd8d6719..95aa58e4 100644 --- a/src/components/table/header/index.vue +++ b/src/components/table/header/index.vue @@ -131,7 +131,9 @@ onMounted(() => { } nextTick(() => { resizeObserver.observe(tableHeader.value) + setTimeout(() => { computedSearchRow() + },500) }) }) onUnmounted(() => { diff --git a/src/stores/monitoringPoint.ts b/src/stores/monitoringPoint.ts index 119f7a63..9aeca746 100644 --- a/src/stores/monitoringPoint.ts +++ b/src/stores/monitoringPoint.ts @@ -6,6 +6,7 @@ interface MonitoringPoint { pid: string lineIds: string[] showCheckBox: boolean + comFlag: number } export const useMonitoringPoint = defineStore( @@ -16,9 +17,13 @@ export const useMonitoringPoint = defineStore( lineName: '', pid: '', lineIds: [], - showCheckBox: false + showCheckBox: false, + comFlag: 0 }) - const setValue = (key: keyof Pick, val: any) => { + const setValue = ( + key: keyof Pick, + val: any + ) => { state[key] = val } const setShowCheckBox = (val: boolean) => { diff --git a/src/utils/webSocketClient.ts b/src/utils/webSocketClient.ts index 317ddc7f..4fbfec62 100644 --- a/src/utils/webSocketClient.ts +++ b/src/utils/webSocketClient.ts @@ -47,7 +47,7 @@ export default class SocketService { const response = await fetch('/') const mqttUrl = response.headers.get('X-Mqtt-Url') setTimeout(() => { - const url = (mqttUrl || 'ws://192.168.1.67:10407/api/pushMessage/') + id + const url = (mqttUrl || 'ws://192.168.1.31:10407/api/pushMessage/') + id this.ws = new WebSocket(url) this.ws.onopen = () => this.handleOpen() diff --git a/src/views/pqs/business/terminal/userLedger/components/addForm.vue b/src/views/pqs/business/terminal/userLedger/components/addForm.vue index f1540c6e..c471e5f2 100644 --- a/src/views/pqs/business/terminal/userLedger/components/addForm.vue +++ b/src/views/pqs/business/terminal/userLedger/components/addForm.vue @@ -130,7 +130,7 @@ - + - + + + - + @@ -70,10 +70,11 @@ import Xiebopingpu from './xiebopingpu/index.vue' import Gaojingshujutongji from './gaojingshujutongji/index.vue' import Yunxingzhuangtai from './yunxingzhuangtai/index.vue' import Shishishuju from './shishishuju/index.vue' +const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei' import router from '@/router' defineOptions({ - // name: 'harmonic-boot/monitor/online' + name: 'harmonic-boot/monitor/online' }) const monitoringPoint = useMonitoringPoint() @@ -94,6 +95,7 @@ const handleNodeClick = (data: any, node: any) => { monitoringPoint.setValue('lineId', data.id) monitoringPoint.setValue('pid', data.pids) monitoringPoint.setValue('lineName', data.alias) + monitoringPoint.setValue('comFlag', data.comFlag) } } const handleCheckChange = (data: any, node: any) => { diff --git a/src/views/pqs/harmonicMonitoring/monitoringPoint/online/shishishuju/index.vue b/src/views/pqs/harmonicMonitoring/monitoringPoint/online/shishishuju/index.vue index 17336382..646fb41b 100644 --- a/src/views/pqs/harmonicMonitoring/monitoringPoint/online/shishishuju/index.vue +++ b/src/views/pqs/harmonicMonitoring/monitoringPoint/online/shishishuju/index.vue @@ -345,6 +345,7 @@ import spectrum from './spectrum.vue' import trend from './trend.vue' import { getLineDetail } from '@/api/device-boot/communicate' import { mainHeight } from '@/utils/layout' +import { ElMessage } from 'element-plus' // import { getRealTimeTableList } from '@/api/cs-device-boot/EquipmentDelivery' const height = ref(mainHeight(580)) const monitoringPoint = useMonitoringPoint() @@ -755,6 +756,12 @@ const init = () => { console.error('WebSocket 客户端实例不存在') return } + if (monitoringPoint.state.comFlag == 0) { + return ElMessage({ + message: '所选监测点离线!', + type: 'warning' + }) + } let pids = monitoringPoint.state.pid.split(',') dataSocket.socketServe.connect(`${adminInfo.id},${monitoringPoint.state.lineId},${pids[pids.length - 2]}`) dataSocket.socketServe.registerCallBack('message', (res: any) => { diff --git a/src/views/pqs/harmonicMonitoring/runManage/monitoringPoints/index.vue b/src/views/pqs/harmonicMonitoring/runManage/monitoringPoints/index.vue index b37e5a6e..737ba6b8 100644 --- a/src/views/pqs/harmonicMonitoring/runManage/monitoringPoints/index.vue +++ b/src/views/pqs/harmonicMonitoring/runManage/monitoringPoints/index.vue @@ -121,7 +121,7 @@ const tableStore = new TableStore({ title: '通讯状态', render: 'tag', minWidth: 100, - effect: 'dark', + // effect: 'dark', custom: { '正常': 'success', '中断': 'danger', diff --git a/src/views/pqs/harmonicMonitoring/runManage/terminalLedger/index.vue b/src/views/pqs/harmonicMonitoring/runManage/terminalLedger/index.vue index a53f6f65..6f4366ad 100644 --- a/src/views/pqs/harmonicMonitoring/runManage/terminalLedger/index.vue +++ b/src/views/pqs/harmonicMonitoring/runManage/terminalLedger/index.vue @@ -1,6 +1,5 @@