From 56bbb9441cc8ba87af154cca449e318b63fa9aa6 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 27 May 2020 18:35:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BF=A1=E5=8F=B7=E6=9C=BAat?= =?UTF-8?q?s=E4=BA=BA=E5=B7=A5=E6=8E=A7=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/map.js | 24 ++++++++++++++++-------- src/store/modules/map.js | 13 +++++++++++++ src/utils/baseUrl.js | 4 ++-- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index df076df0e..db61befd0 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -378,7 +378,6 @@ class Jlmap { update(list) { this.setUpdateMapDevice(list || []); // 增加一个 前数据 处理 为了在区段中 获取全部的 道岔信息 const signalDeviceList = []; - const signalStatusList = []; (list || []).forEach(elem => { const code = elem.code; const type = elem._type; @@ -393,13 +392,9 @@ class Jlmap { } } const signalDevice = this.mapDevice[route.startSignalCode]; - const signalStatus = {atsControl: elem.atsControl, fleetMode: elem.fleetMode}; const index = signalDeviceList.indexOf(signalDevice); if (index === -1) { signalDeviceList.push(signalDevice); - signalStatusList.push(signalStatus); - } else { - signalStatusList[index] = {atsControl: signalStatusList[index].atsControl && elem.atsControl, fleetMode: signalStatusList[index].fleetMode || elem.fleetMode}; } } else if (elem.deviceType === 'CYCLE') { store.dispatch('map/updateAutoReentryState', elem); @@ -438,15 +433,28 @@ class Jlmap { } } }); - this.handleRouteSignalStatus(signalDeviceList, signalStatusList); + this.handleRouteSignalStatus(signalDeviceList); // 状态后处理 this.postHandle(list || []); if (this.methods.stateUpdate instanceof Function) { this.methods.stateUpdate(list); } } - handleRouteSignalStatus(signalDeviceList, signalStatusList) { + handleRouteSignalStatus(signalDeviceList) { + const routeStartSignalData = store.state.map.routeStartSignalData; signalDeviceList.forEach((item, index)=> { - if (item && this.hookHandle(item, signalStatusList[index])) { + const status = {}; + if (routeStartSignalData[item.code] && routeStartSignalData[item.code].length) { + routeStartSignalData[item.code].forEach((elem, index)=> { + if (index) { + status.atsControl = status.atsControl && elem.atsControl; + status.fleetMode = status.fleetMode || elem.fleetMode; + } else { + status.atsControl = elem.atsControl; + status.fleetMode = elem.fleetMode; + } + }); + } + if (item && this.hookHandle(item, status)) { this.$painter.update(item); } }); diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 8de77f1b7..3205a7be4 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -181,6 +181,7 @@ const map = { state: { routeData: {}, // 进路数据 routeList: [], // 进路list + routeStartSignalData: {}, // 进路始端信号机数据 autoReentryData: {}, // 自动折返数据 autoReentryList: [], // 自动折返list signalApproachSectionData: {}, // 信号机接近区段数据 @@ -232,6 +233,13 @@ const map = { routeData: (state) => { return state.routeData; }, + routeStartSignalData: (state) => { + if (state.map) { + return state.map.routeStartSignalData || {}; + } else { + return {}; + } + }, overlapData: (state) => { return state.overlapData; }, @@ -719,6 +727,11 @@ const map = { setRouteData: (state, routeDataList) => { routeDataList.forEach(data => { state.routeData[data.code] = data; + if (state.routeStartSignalData[data.startSignalCode] && state.routeStartSignalData[data.startSignalCode].length) { + state.routeStartSignalData[data.startSignalCode].push(data); + } else { + state.routeStartSignalData[data.startSignalCode] = [data]; + } }); state.map.automaticRouteButtonList && state.map.automaticRouteButtonList.forEach(item => { state.routeData[item.automaticRouteCode].automaticRouteCode = item.code; diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 836771751..778caeb7b 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,11 +2,11 @@ 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.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 - BASE_API = 'http://192.168.3.82:9000'; // 杜康 + // BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛