diff --git a/apps/l2/src/views/l2/track/rect.vue b/apps/l2/src/views/l2/track/rect.vue index 70cb845..6c030e2 100644 --- a/apps/l2/src/views/l2/track/rect.vue +++ b/apps/l2/src/views/l2/track/rect.vue @@ -8,16 +8,10 @@
入口段
-
+
{{ device.positionNameCn }}
{{ device.positionNameEn }}
@@ -37,16 +31,10 @@
熔炉段
-
+
{{ device.positionNameCn }}
{{ device.positionNameEn }}
@@ -66,16 +54,10 @@
涂层段
-
+
{{ device.positionNameCn }}
{{ device.positionNameEn }}
@@ -95,16 +77,10 @@
出口段
-
+
{{ device.positionNameCn }}
{{ device.positionNameEn }}
@@ -121,7 +97,7 @@
- +
@@ -169,14 +145,38 @@
操作
- 钢卷上线 - 手动卸卷 - 整卷回退 - 半卷回退 - 卸卷并封闭 + 钢卷上线 + 手动卸卷 + 整卷回退 + 半卷回退 + 卸卷并封闭
+ +
+ + + + + + + + + + + + + + + 确认调整 +
+
@@ -319,40 +319,40 @@ export default { }, // 入口段设备列表 entryDevicesList() { - return this.matMapList.filter(device => + return this.matMapList.filter(device => ['POR1', 'POR2', 'WELDER', 'ENL1', 'ENL2', 'CLEAN'].includes(device.positionNameEn) ) }, // 熔炉段设备列表 furnaceDevicesList() { - return this.matMapList.filter(device => + return this.matMapList.filter(device => ['FUR1', 'FUR2', 'FUR3', 'FUR4'].includes(device.positionNameEn) ) }, // 涂层段设备列表 coatDevicesList() { - return this.matMapList.filter(device => + return this.matMapList.filter(device => ['TM', 'TL', 'COAT'].includes(device.positionNameEn) ) }, // 出口段设备列表 exitDevicesList() { - return this.matMapList.filter(device => + return this.matMapList.filter(device => ['CXL1', 'CXL2', 'TR', 'WEIT'].includes(device.positionNameEn) ) }, // 根据选中设备获取详细数据 currentDeviceData() { if (!this.selectedCard) return [] - + const deviceId = this.selectedCard.positionNameEn const data = [] - + // 开卷机数据 if ((deviceId === 'POR1' || deviceId === 'POR2') && this.realtimeData.entry) { const entry = this.realtimeData.entry const reelNumber = entry.payOffReelNumber - + if ((deviceId === 'POR1' && reelNumber === 1) || (deviceId === 'POR2' && reelNumber === 2)) { data.push( { label: '入口钢卷ID', value: entry.entryCoilId || '--', unit: '' }, @@ -376,7 +376,7 @@ export default { else if ((deviceId === 'ENL1' || deviceId === 'ENL2') && this.realtimeData.entry) { const entry = this.realtimeData.entry const reelNumber = entry.payOffReelNumber - + if ((deviceId === 'ENL1' && reelNumber === 1) || (deviceId === 'ENL2' && reelNumber === 2)) { data.push( { label: '入口活套位置', value: this.formatValue(entry.celLength), unit: 'm' }, @@ -481,7 +481,7 @@ export default { else if (['CXL1', 'CXL2'].includes(deviceId) && this.realtimeData.exit && this.realtimeData.entry) { const exit = this.realtimeData.exit const reelNumber = this.realtimeData.entry.payOffReelNumber - + // CXL1对应开卷机1,CXL2对应开卷机2 if ((deviceId === 'CXL1' && reelNumber === 1) || (deviceId === 'CXL2' && reelNumber === 2)) { data.push( @@ -512,7 +512,7 @@ export default { { label: '出口段速度', value: this.formatValue(exit.speedExitSection), unit: 'm/min' } ) } - + return data } }, @@ -549,7 +549,7 @@ export default { // 判断设备是否有实时数据 hasRealtimeData(deviceId) { if (!this.realtimeData) return false - + // 入口段设备 if (['POR1', 'POR2', 'WELDER', 'ENL1', 'ENL2', 'CLEAN'].includes(deviceId) && this.realtimeData.entry) { if (deviceId === 'POR1' && this.realtimeData.entry.payOffReelNumber === 1) return true @@ -570,14 +570,14 @@ export default { if (deviceId === 'CXL1' && reelNumber === 1) return true if (deviceId === 'CXL2' && reelNumber === 2) return true } - + return false }, // 获取设备钢卷号 getDeviceCoilId(deviceId) { const deviceInfo = this.getDeviceInfo(deviceId) - + // 开卷机特殊处理 if (deviceId === 'POR1' || deviceId === 'POR2') { if (this.realtimeData.entry) { @@ -588,18 +588,18 @@ export default { return '空闲' } } - + return deviceInfo?.matId || '空闲' }, // 获取设备卡片上显示的迷你实时数据 getMiniRealtimeData(deviceId) { const data = [] - + if ((deviceId === 'POR1' || deviceId === 'POR2') && this.realtimeData.entry) { const entry = this.realtimeData.entry const reelNumber = entry.payOffReelNumber - + if ((deviceId === 'POR1' && reelNumber === 1) || (deviceId === 'POR2' && reelNumber === 2)) { data.push( { label: '速度', value: this.formatValue(entry.stripSpeed) + ' m/min' }, @@ -613,7 +613,7 @@ export default { } else if ((deviceId === 'ENL1' || deviceId === 'ENL2') && this.realtimeData.entry) { const entry = this.realtimeData.entry const reelNumber = entry.payOffReelNumber - + if ((deviceId === 'ENL1' && reelNumber === 1) || (deviceId === 'ENL2' && reelNumber === 2)) { data.push( { label: '位置', value: this.formatValue(entry.celLength) + ' m' }, @@ -658,7 +658,7 @@ export default { ) } else if (['CXL1', 'CXL2'].includes(deviceId) && this.realtimeData.exit && this.realtimeData.entry) { const reelNumber = this.realtimeData.entry.payOffReelNumber - + // CXL1对应开卷机1,CXL2对应开卷机2 if ((deviceId === 'CXL1' && reelNumber === 1) || (deviceId === 'CXL2' && reelNumber === 2)) { data.push( @@ -676,7 +676,7 @@ export default { { label: '长度', value: this.formatValue(this.realtimeData.exit.coilLength) + ' m' } ) } - + return data }, @@ -734,17 +734,17 @@ export default { // WebSocket连接 connectWebSocket() { if (this.socket) return - + const url = 'ws://140.143.206.120:18081/websocket?type=track_measure' - + try { this.socket = new WebSocket(url) - + this.socket.onopen = () => { console.log('WebSocket已连接') this.isConnected = true } - + this.socket.onmessage = (event) => { try { const data = JSON.parse(event.data) @@ -754,12 +754,12 @@ export default { console.error('数据解析错误:', error) } } - + this.socket.onerror = (error) => { console.error('WebSocket错误:', error) this.isConnected = false } - + this.socket.onclose = () => { console.log('WebSocket已关闭') this.isConnected = false @@ -786,7 +786,7 @@ export default { if (data.appMeasureExitMessage) { this.$set(this.realtimeData, 'exit', data.appMeasureExitMessage) } - + // 强制更新视图 this.$forceUpdate() }, @@ -819,7 +819,6 @@ export default { }).then(() => { adjustPosition(params).then(() => { this.$message.success('调整成功') - this.exitAdjustMode() this.fetchData() }).catch(err => { console.error('调整失败:', err) @@ -872,7 +871,7 @@ export default { this.fetchData() this.connectWebSocket() }, - + beforeDestroy() { this.disconnectWebSocket() } @@ -880,11 +879,6 @@ export default {