From 09781774c74e3f0de96c7f38914132427bb4cac5 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 26 Apr 2021 17:59:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E9=93=81=E7=BA=BF=E8=B7=AF=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/Switch/index.js | 25 ++++++++++-------- .../components/menus/dialog/setFaultNew.vue | 5 ++++ .../theme/datie_01/menus/menuTrain.vue | 1 - src/store/modules/socket.js | 6 +++++ src/utils/baseUrl.js | 4 +-- src/utils/parseStatus.js | 4 +++ src/utils/stomp.js | 2 ++ src/views/newMap/displayCity/index.vue | 2 +- .../newMap/displayCity/menuSystemTime.vue | 26 +++++++++---------- src/views/newMap/mapsystemNew/index.vue | 2 ++ 10 files changed, 49 insertions(+), 28 deletions(-) diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index e1370ce0a..fdec3adfb 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -230,16 +230,16 @@ export default class Switch extends Group { offsetX = directx * this.style.Switch.rectLock.offset.x; offsetY = directy * this.style.Switch.rectLock.offset.y; } - let x = this.model.intersection.x - this.style.Switch.rectLock.rectWidth / 2 + offsetX; - let y = this.model.intersection.y - this.style.Switch.rectLock.rectWidth / 2 + offsetY; - if (this.style.Switch.rectLock.followName) { - const directx = this.triangle.drictx; - const rect = this.name.getBoundingRect(); - const wLen = this.style.Switch.rectLock.rectWidth - (directx > 0? rect.width: rect.width/2); - const hLen = this.style.Switch.rectLock.rectWidth - rect.height - x = rect.x - wLen/2; - y = rect.y - hLen/2 - } + let x = this.model.intersection.x - this.style.Switch.rectLock.rectWidth / 2 + offsetX; + let y = this.model.intersection.y - this.style.Switch.rectLock.rectWidth / 2 + offsetY; + if (this.style.Switch.rectLock.followName) { + const directx = this.triangle.drictx; + const rect = this.name.getBoundingRect(); + const wLen = this.style.Switch.rectLock.rectWidth - (directx > 0 ? rect.width : rect.width / 2); + const hLen = this.style.Switch.rectLock.rectWidth - rect.height; + x = rect.x - wLen / 2; + y = rect.y - hLen / 2; + } this.lockRect = new ELockRect({ // 单锁矩形框 zlevel: this.zlevel, @@ -326,7 +326,7 @@ export default class Switch extends Group { /** 恢复状态*/ recover() { this.lockRect && this.lockRect.hide(); // 矩形包围框 - this.lockCircle && this.lockCircle.hide(); // 圆形包围框 + this.lockCircle && this.lockCircle.hide(); // 圆形包围框 this.lockArc && this.lockArc.hide(); // 圆形单锁框 this.name.getNameText().stopAnimation(false); this.shapeModelC.hide(); // 形状 C @@ -703,6 +703,9 @@ export default class Switch extends Group { this.setInversionAction(model); /** 反位*/ } else { this.setLossAction(model.fault); // 失去 + if (model.switchSplit) { + this.setForkAction(); + } } model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示 diff --git a/src/jmapNew/theme/components/menus/dialog/setFaultNew.vue b/src/jmapNew/theme/components/menus/dialog/setFaultNew.vue index 463179908..76d640da2 100644 --- a/src/jmapNew/theme/components/menus/dialog/setFaultNew.vue +++ b/src/jmapNew/theme/components/menus/dialog/setFaultNew.vue @@ -197,6 +197,11 @@ export default { {label: '挤岔', value: 'SQUEEZE'}, {label: '计轴故障', value: 'AXLE_FAULT'} ]; + } else if (selected._type === 'Section') { + this.faultList = [ + {label: '计轴故障', value: 'AXLE_FAULT'}, + {label: '通信车占用', value: 'CBTC_OCCUPIED_FAULT'} + ]; } else { this.faultList = deviceFaultType[selected._type]; } diff --git a/src/jmapNew/theme/datie_01/menus/menuTrain.vue b/src/jmapNew/theme/datie_01/menus/menuTrain.vue index 77c332b17..93f0f859a 100644 --- a/src/jmapNew/theme/datie_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/datie_01/menus/menuTrain.vue @@ -184,7 +184,6 @@ export default { }, doShow(point) { this.initMenu(); - if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { this.$refs.popMenu.resetShowPosition(point); } diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index af4d0dbed..d96328d95 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -384,6 +384,9 @@ const socket = { }, clearSimulationRoleList: (state)=>{ state.simulationRoleList = []; + }, + setSimulationTimeSync: (state, time) => { + state.simulationTimeSync = time; } }, @@ -460,6 +463,9 @@ const socket = { }, clearSimulationRoleList:({ commit }) => { commit('clearSimulationRoleList'); + }, + setSimulationTimeSync:({ commit }, time) => { + commit('setSimulationTimeSync', time); } } }; diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 11702c286..aa7bf7e1b 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,9 +2,9 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - BASE_API = 'https://test.joylink.club/jlcloud'; + // BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.8.107:9000'; // 袁琪 - // BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线 + BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线 // BASE_API = 'http://192.168.8.114:9000'; // 旭强 无线 // BASE_API = 'http://192.168.3.120:9000'; // 张赛 // BASE_API = 'http://192.168.8.140:9000'; // 杜康 diff --git a/src/utils/parseStatus.js b/src/utils/parseStatus.js index 49bace98b..6d0f8c39b 100644 --- a/src/utils/parseStatus.js +++ b/src/utils/parseStatus.js @@ -9,18 +9,22 @@ export default function parseStatus(deviceStatus) { case 0: elem.normalPosition = 0; elem.reversePosition = 0; + elem.switchSplit = 0; break; case 1: elem.normalPosition = 1; elem.reversePosition = 0; + elem.switchSplit = 0; break; case 2: elem.normalPosition = 0; elem.reversePosition = 1; + elem.switchSplit = 0; break; case 4: elem.normalPosition = 0; elem.reversePosition = 0; + elem.switchSplit = 1; break; } elem.blockade = msg[2]; diff --git a/src/utils/stomp.js b/src/utils/stomp.js index def90da2a..9e1e475c9 100644 --- a/src/utils/stomp.js +++ b/src/utils/stomp.js @@ -26,6 +26,8 @@ function callback(Response) { if (Response.headers.destination.includes('ats')) { const data = {res:JSON.parse(Response.body), type:'ats' }; store.dispatch('socket/handleSock', data); + } else if (Response.headers.destination.includes('sysTime')) { + store.dispatch('socket/setSimulationTimeSync', Number.parseInt(Response.body)); } else { const data = JSON.parse(Response.body); store.dispatch('socket/setStomp', data); diff --git a/src/views/newMap/displayCity/index.vue b/src/views/newMap/displayCity/index.vue index ed7a3c199..0aa699c92 100644 --- a/src/views/newMap/displayCity/index.vue +++ b/src/views/newMap/displayCity/index.vue @@ -188,7 +188,7 @@ export default { if (!resp.data.dataError) { this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); // 是否暂停判断 this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`)); - this.$store.dispatch('training/countTime'); + // this.$store.dispatch('training/countTime'); this.$store.dispatch('runPlan/setRunPlanInfo', resp.data.runPlan); this.planRunning = resp.data.planRunning; if (resp.data.planRunning) { diff --git a/src/views/newMap/displayCity/menuSystemTime.vue b/src/views/newMap/displayCity/menuSystemTime.vue index 06d4b7486..c237cc3d2 100644 --- a/src/views/newMap/displayCity/menuSystemTime.vue +++ b/src/views/newMap/displayCity/menuSystemTime.vue @@ -1,18 +1,18 @@