This commit is contained in:
zyy 2020-05-27 19:02:47 +08:00
commit 2bd6986ce4
3 changed files with 31 additions and 10 deletions

View File

@ -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);
}
});

View File

@ -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;

View File

@ -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'; // 张赛