-
-
-
@@ -31,8 +28,6 @@
import MenuTrain from './menuTrain';
import MenuStation from './menuStation';
import MenuBar from './menuBar';
- // import MenuTool from './menuTool';
- // import StatusBar from './statusBar';
import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from './passiveDialog/control';
import PassiveTimeout from './passiveDialog/timeout';
@@ -41,8 +36,6 @@
name: 'Menus',
components: {
MenuBar,
- // MenuTool,
- // StatusBar,
MenuCancel,
MenuSignal,
MenuSwitch,
@@ -69,7 +62,7 @@
this.$route.params.mode !== 'plan'
},
isShowBar() {
- return this.$store.state.map.prdType != '';
+ return this.$store.state.training.prdType != '';
}
},
data() {
diff --git a/src/jmap/theme/fuzhou_01/menus/menuBar.vue b/src/jmap/theme/fuzhou_01/menus/menuBar.vue
index 35a1efe42..b7b0fe4b4 100644
--- a/src/jmap/theme/fuzhou_01/menus/menuBar.vue
+++ b/src/jmap/theme/fuzhou_01/menus/menuBar.vue
@@ -410,7 +410,7 @@
'$store.state.training.started': function (val) {
this.closeMenu(true);
},
- '$store.state.map.prdType': function () {
+ '$store.state.training.prdType': function () {
this.initMenu();
}
},
@@ -419,7 +419,7 @@
},
methods: {
initMenu(menu) {
- this.menu = menuBarConvert(this.menuNormal[SystemType[this.$store.state.map.prdType]], this.$store.state.training.operatemode);
+ this.menu = menuBarConvert(this.menuNormal[SystemType[this.$store.state.training.prdType]], this.$store.state.training.operatemode);
this.clickEvent();
this.closeMenu(true);
},
diff --git a/src/jmap/theme/fuzhou_01/menus/menuCancel.vue b/src/jmap/theme/fuzhou_01/menus/menuCancel.vue
index 9311a3d17..7d3672e3a 100644
--- a/src/jmap/theme/fuzhou_01/menus/menuCancel.vue
+++ b/src/jmap/theme/fuzhou_01/menus/menuCancel.vue
@@ -84,7 +84,7 @@
if (elem.visible) {
let next = elem;
while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
- next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
+ next = (this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode) || {}).model;
}
if (station.code == next.code) {
diff --git a/src/jmap/theme/fuzhou_01/menus/menuDialog/childDialog/twoConfirmation.vue b/src/jmap/theme/fuzhou_01/menus/menuDialog/childDialog/twoConfirmation.vue
index 6e5ac7042..4bfc09bb9 100644
--- a/src/jmap/theme/fuzhou_01/menus/menuDialog/childDialog/twoConfirmation.vue
+++ b/src/jmap/theme/fuzhou_01/menus/menuDialog/childDialog/twoConfirmation.vue
@@ -4,7 +4,7 @@
append-to-body v-dialogDrag>
- {{message}}
+ {{message}}
diff --git a/src/jmap/theme/fuzhou_01/menus/menuDialog/stationControlConvert.vue b/src/jmap/theme/fuzhou_01/menus/menuDialog/stationControlConvert.vue
index d593eed37..eabe71a4b 100644
--- a/src/jmap/theme/fuzhou_01/menus/menuDialog/stationControlConvert.vue
+++ b/src/jmap/theme/fuzhou_01/menus/menuDialog/stationControlConvert.vue
@@ -228,7 +228,7 @@
loadTableData() {
this.tableData = [];
this.stationControlList.forEach(control => {
- let station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
+ let station = (this.$store.getters['map/getDeviceByCode'](control.stationCode) || {}).model;
this.tableData.push({
code: control.code,
operate: station.name || '',
diff --git a/src/jmap/theme/fuzhou_01/menus/menuDialog/viewDevice.vue b/src/jmap/theme/fuzhou_01/menus/menuDialog/viewDevice.vue
index ac824ae6e..3f78d68cb 100644
--- a/src/jmap/theme/fuzhou_01/menus/menuDialog/viewDevice.vue
+++ b/src/jmap/theme/fuzhou_01/menus/menuDialog/viewDevice.vue
@@ -114,46 +114,46 @@
})
},
setDeviceDisplay() {
- let show = false;
- let deviceList = [];
+ // let show = false;
+ // let deviceList = [];
- //区段边界设置
- let sectionList = this.$store.getters['map/sectionList'];
- if (sectionList && sectionList.length > 0) {
- sectionList.forEach(elem => {
- //区段边界
- show = this.deviceLevels.indexOf(2) !== -1 ? true : false;
- elem.borderBorderShow = show;
- deviceList.push(elem);
- });
- }
+ // //区段边界设置
+ // let sectionList = this.$store.getters['map/sectionList'];
+ // if (sectionList && sectionList.length > 0) {
+ // sectionList.forEach(elem => {
+ // //区段边界
+ // show = this.deviceLevels.indexOf(2) !== -1 ? true : false;
+ // elem.borderBorderShow = show;
+ // deviceList.push(elem);
+ // });
+ // }
- //车次窗设置
- let trainWindowList = this.$store.getters['map/trainWindowList'];
- if (trainWindowList && trainWindowList.length > 0) {
- trainWindowList.forEach(elem => {
- //车次窗
- show = this.deviceLevels.indexOf(1) !== -1 ? true : false;
- elem.trainWindowShow = show;
- deviceList.push(elem);
- });
- }
+ // //车次窗设置
+ // let trainWindowList = this.$store.getters['map/trainWindowList'];
+ // if (trainWindowList && trainWindowList.length > 0) {
+ // trainWindowList.forEach(elem => {
+ // //车次窗
+ // show = this.deviceLevels.indexOf(1) !== -1 ? true : false;
+ // elem.trainWindowShow = show;
+ // deviceList.push(elem);
+ // });
+ // }
- //联锁自动进路表示灯和ATS自动触发表示灯设置
- let signalList = this.$store.getters['map/signalList'];
- if (signalList && signalList.length > 0) {
- signalList.forEach(elem => {
- //联锁自动进路表示灯
- show = this.deviceLevels.indexOf(3) !== -1 ? true : false;
- elem.linkageAutoRouteShow = show;
- //ATS自动触发表示灯
- show = this.deviceLevels.indexOf(4) !== -1 ? true : false;
- elem.atsAutoTriggerShow = show;
- deviceList.push(elem);
- })
- }
+ // //联锁自动进路表示灯和ATS自动触发表示灯设置
+ // let signalList = this.$store.getters['map/signalList'];
+ // if (signalList && signalList.length > 0) {
+ // signalList.forEach(elem => {
+ // //联锁自动进路表示灯
+ // show = this.deviceLevels.indexOf(3) !== -1 ? true : false;
+ // elem.linkageAutoRouteShow = show;
+ // //ATS自动触发表示灯
+ // show = this.deviceLevels.indexOf(4) !== -1 ? true : false;
+ // elem.atsAutoTriggerShow = show;
+ // deviceList.push(elem);
+ // })
+ // }
- this.$store.dispatch('map/updateMapView', deviceList);
+ // this.$store.dispatch('map/updateMapDevices', deviceList);
}
}
}
diff --git a/src/jmap/theme/fuzhou_01/menus/menuDialog/viewName.vue b/src/jmap/theme/fuzhou_01/menus/menuDialog/viewName.vue
index 2a6b8ed3e..5bb4f4555 100644
--- a/src/jmap/theme/fuzhou_01/menus/menuDialog/viewName.vue
+++ b/src/jmap/theme/fuzhou_01/menus/menuDialog/viewName.vue
@@ -147,117 +147,118 @@
})
},
setNameDisplay() {
- let show = false;
- let deviceList = [];
+ // let show = false;
+ // let deviceList = [];
- // 信号机
- show = this.nameLevels.indexOf(1) !== -1 ? true : false;
- let signalList = this.$store.getters['map/signalList'];
- if (signalList && signalList.length > 0) {
- signalList.forEach(elem => {
- elem.nameShow = show;
- deviceList.push(elem);
- })
- }
+ // // 信号机
+ // show = this.nameLevels.indexOf(1) !== -1 ? true : false;
+ // let signalList = this.$store.getters['map/signalList'];
+ // if (signalList && signalList.length > 0) {
+ // signalList.forEach(elem => {
+ // elem.nameShow = show;
+ // deviceList.push(elem);
+ // })
+ // }
- // 按钮名称
- show = this.nameLevels.indexOf(3) !== -1 ? true : false;
+ // // 按钮名称
+ // show = this.nameLevels.indexOf(3) !== -1 ? true : false;
- // 道岔
- let switchList = this.$store.getters['map/switchList'];
- if (switchList && switchList.length > 0) {
- switchList.forEach(elem => {
- // 道岔名称
- show = this.nameLevels.indexOf(7) !== -1 ? true : false;
- elem.nameShow = show;
- // 道岔轨名称
- show = this.nameLevels.indexOf(9) !== -1 ? true : false;
- elem.switchSectionNameShow = show;
- deviceList.push(elem);
- })
- }
+ // // 道岔
+ // let switchList = this.$store.getters['map/switchList'];
+ // if (switchList && switchList.length > 0) {
+ // switchList.forEach(elem => {
+ // // 道岔名称
+ // show = this.nameLevels.indexOf(7) !== -1 ? true : false;
+ // elem.nameShow = show;
+ // // 道岔轨名称
+ // show = this.nameLevels.indexOf(9) !== -1 ? true : false;
+ // elem.switchSectionNameShow = show;
+ // deviceList.push(elem);
+ // })
+ // }
- // 控制模式
- show = this.nameLevels.indexOf(8) !== -1 ? true : false;
- let control = this.$store.getters['map/stationControlList'];
- if (control && control.length > 0) {
- control.forEach(elem => {
- // 标识灯名称
- elem.indicatorShow = show;
- deviceList.push(elem);
- })
- }
+ // // 控制模式
+ // show = this.nameLevels.indexOf(8) !== -1 ? true : false;
+ // let control = this.$store.getters['map/stationControlList'];
+ // if (control && control.length > 0) {
+ // control.forEach(elem => {
+ // // 标识灯名称
+ // elem.indicatorShow = show;
+ // deviceList.push(elem);
+ // })
+ // }
- // 区段
- let sectionList = this.$store.getters['map/sectionList'];
- if (sectionList && sectionList.length > 0) {
- sectionList.forEach(elem => {
- if (elem.isSwitchSection && elem.parentCode) {
- // 道岔轨的区段名称默认不显示
- elem.nameShow = false;
- } else {
- if (elem.type === '01') {
- // 计轴区段名称
- show = this.nameLevels.indexOf(11) !== -1 ? true : false;
- elem.nameShow = show;
- } else if (elem.type === '02') {
- // 股道轨名称
- show = this.nameLevels.indexOf(5) !== -1 ? true : false;
- elem.nameShow = show;
- } else if (elem.type === '03') {
- // 道岔区段名称
- show = this.nameLevels.indexOf(9) !== -1 ? true : false;
- elem.nameShow = show;
- }
- }
+ // // 区段
+ // let sectionList = this.$store.getters['map/sectionList'];
+ // if (sectionList && sectionList.length > 0) {
+ // sectionList.forEach(elem => {
+ // if (elem.isSwitchSection && elem.parentCode) {
+ // // 道岔轨的区段名称默认不显示
+ // elem.nameShow = false;
+ // } else {
+ // if (elem.type === '01') {
+ // // 计轴区段名称
+ // show = this.nameLevels.indexOf(11) !== -1 ? true : false;
+ // elem.nameShow = show;
+ // } else if (elem.type === '02') {
+ // // 股道轨名称
+ // show = this.nameLevels.indexOf(5) !== -1 ? true : false;
+ // elem.nameShow = show;
+ // } else if (elem.type === '03') {
+ // // 道岔区段名称
+ // show = this.nameLevels.indexOf(9) !== -1 ? true : false;
+ // elem.nameShow = show;
+ // }
+ // }
- // 站台轨名称
- if (elem.isStandTrack) {
- show = this.nameLevels.indexOf(2) !== -1 ? true : false;
- elem.standTrackNameShow = show;
- }
+ // // 站台轨名称
+ // if (elem.isStandTrack) {
+ // show = this.nameLevels.indexOf(2) !== -1 ? true : false;
+ // elem.standTrackNameShow = show;
+ // }
- // 折返轨名称
- if (elem.isReentryTrack) {
- show = this.nameLevels.indexOf(4) !== -1 ? true : false;
- elem.reentryTrackNameShow = show;
- }
+ // // 折返轨名称
+ // if (elem.isReentryTrack) {
+ // show = this.nameLevels.indexOf(4) !== -1 ? true : false;
+ // elem.reentryTrackNameShow = show;
+ // }
- // 转换轨名称
- if (elem.isTransferTrack) {
- show = this.nameLevels.indexOf(6) !== -1 ? true : false;
- elem.transferTrackNameShow = show;
- }
+ // // 转换轨名称
+ // if (elem.isTransferTrack) {
+ // show = this.nameLevels.indexOf(6) !== -1 ? true : false;
+ // elem.transferTrackNameShow = show;
+ // }
- deviceList.push(elem);
- })
- }
+ // deviceList.push(elem);
+ // })
+ // }
- // 停车点
- show = this.nameLevels.indexOf(10) !== -1 ? true : false;
- let stopPointList = this.$store.getters['map/stopPointList'];
- if (stopPointList && stopPointList.length > 0) {
- stopPointList.forEach(elem => {
- // 目的地名称
- elem.destCodeShow = show;
- deviceList.push(elem);
- })
- }
+ // // 停车点
+ // show = this.nameLevels.indexOf(10) !== -1 ? true : false;
+ // let stopPointList = this.$store.getters['map/stopPointList'];
+ // if (stopPointList && stopPointList.length > 0) {
+ // stopPointList.forEach(elem => {
+ // // 目的地名称
+ // elem.destCodeShow = show;
+ // deviceList.push(elem);
+ // })
+ // }
- // 车站
- show = this.nameLevels.indexOf(12) !== -1 ? true : false;
- let stationList = this.$store.getters['map/stationList'];
- if (stationList && stationList.length > 0) {
- stationList.forEach(elem => {
- // 公里标
- elem.kmPostShow = show;
- deviceList.push(elem);
+ // // 车站
+ // show = this.nameLevels.indexOf(12) !== -1 ? true : false;
+ // let stationList = this.$store.getters['map/stationList'];
+ // if (stationList && stationList.length > 0) {
+ // stationList.forEach(elem => {
+ // // 公里标
+ // elem.kmPostShow = show;
+ // deviceList.push(elem);
- })
- }
+ // })
+ // }
- this.$store.dispatch('map/updateMapView', parseDevices);
+ // console.log(deviceList);
+ // this.$store.dispatch('map/updateMapDevices', deviceList);
}
}
}
diff --git a/src/jmap/theme/fuzhou_01/menus/menuDialog/viewTrainId.vue b/src/jmap/theme/fuzhou_01/menus/menuDialog/viewTrainId.vue
index 0e8041065..63abd89a2 100644
--- a/src/jmap/theme/fuzhou_01/menus/menuDialog/viewTrainId.vue
+++ b/src/jmap/theme/fuzhou_01/menus/menuDialog/viewTrainId.vue
@@ -155,17 +155,17 @@
})
},
setTrainDispaly() {
- let trainList = this.$store.getters['training/viewTrainList'];
- if (trainList && trainList.length > 0) {
- let planFormat = this.trainNameFormatBy(this.planMode);
- let nameFontSize = this.fontSize;
- trainList.forEach(elem => {
- elem.nameFormat = planFormat;
- elem.nameFontSize = nameFontSize;
- });
+ // let trainList = this.$store.getters['training/viewTrainList'];
+ // if (trainList && trainList.length > 0) {
+ // let planFormat = this.trainNameFormatBy(this.planMode);
+ // let nameFontSize = this.fontSize;
+ // trainList.forEach(elem => {
+ // elem.nameFormat = planFormat;
+ // elem.nameFontSize = nameFontSize;
+ // });
- this.$store.dispatch('map/updateMapView', trainList);
- }
+ // this.$store.dispatch('map/updateMapDevices', trainList);
+ // }
},
trainNameFormatBy(mode) {
switch (mode.toString()) {
diff --git a/src/jmap/theme/fuzhou_01/menus/menuTool.vue b/src/jmap/theme/fuzhou_01/menus/menuTool.vue
deleted file mode 100644
index dc32a9673..000000000
--- a/src/jmap/theme/fuzhou_01/menus/menuTool.vue
+++ /dev/null
@@ -1,205 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/jmap/theme/fuzhou_01/menus/passiveDialog/control.vue b/src/jmap/theme/fuzhou_01/menus/passiveDialog/control.vue
index 125f940bd..0a3ecc2d0 100644
--- a/src/jmap/theme/fuzhou_01/menus/passiveDialog/control.vue
+++ b/src/jmap/theme/fuzhou_01/menus/passiveDialog/control.vue
@@ -70,10 +70,10 @@
},
computed: {
targetStatus() {
- if (this.$store.state.map.prdType == '01') {
+ if (this.$store.state.training.prdType == '01') {
return '01';
}
- if (this.$store.state.map.prdType == '02') {
+ if (this.$store.state.training.prdType == '02') {
return '02'
}
},
@@ -244,7 +244,7 @@
operation: OperationEvent.StationControl.controlResponse.agree.operation,
code: this.selection[0].code,
val: this.commandId,
- prdType: this.$store.state.map.prdType
+ prdType: this.$store.state.training.prdType
}
this.clearTimer();
@@ -266,7 +266,7 @@
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
code: this.selection.length ? this.selection[0].code : '',
val: this.commandId,
- prdType: this.$store.state.map.prdType
+ prdType: this.$store.state.training.prdType
}
if (!operate.code) {
operate.code = this.tableData[0].code;
diff --git a/src/jmap/theme/fuzhou_01/menus/statusBar.vue b/src/jmap/theme/fuzhou_01/menus/statusBar.vue
deleted file mode 100644
index 0fad48767..000000000
--- a/src/jmap/theme/fuzhou_01/menus/statusBar.vue
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/jmap/theme/fuzhou_01/menus/utils/menuItemStatus.js b/src/jmap/theme/fuzhou_01/menus/utils/menuItemStatus.js
index 379748a83..a580c2b66 100644
--- a/src/jmap/theme/fuzhou_01/menus/utils/menuItemStatus.js
+++ b/src/jmap/theme/fuzhou_01/menus/utils/menuItemStatus.js
@@ -240,7 +240,7 @@ export const MenuDisabledStatus = {
// 设置扣车
setDetainTrain() {
const device = getCurrentStatusObject();
- if (store.state.map.prdType == '02') {
+ if (store.state.training.prdType == '02') {
if (device && device.holdStatus == deviceState.StationStand.holdStatus.Status03) {
return true;
}
@@ -253,7 +253,7 @@ export const MenuDisabledStatus = {
// 取消扣车
cancelDetainTrain() {
const device = getCurrentStatusObject();
- if (store.state.map.prdType == '02') {
+ if (store.state.training.prdType == '02') {
if (device && device.holdStatus == deviceState.StationStand.holdStatus.Status03) {
return true;
}
@@ -426,7 +426,7 @@ export const MenuDisabledStatus = {
};
export function checkOperationValidity() {
- if (store.state.map.prdType == '02') {
+ if (store.state.training.prdType == '02') {
return true;
}
}
@@ -502,18 +502,19 @@ export function menuFiltration(menuObj) {
var selected = store.getters['menuOperation/selected'];
var control;
var menu = [];
+
if (selected._type == 'StationStand') {
- control = store.getters['map/getStationControlByStationCode'](selected.deviceStationCode);
+ control = store.getters['map/getStationControlByStationCode'](selected.model.deviceStationCode);
} else if (selected._type == 'Station') {
- control = store.getters['map/getStationControlByStationCode'](selected.code);
+ control = store.getters['map/getStationControlByStationCode'](selected.model.code);
} else {
- control = store.getters['map/getStationControlByStationCode'](selected.stationCode);
+ control = store.getters['map/getStationControlByStationCode'](selected.model.stationCode);
}
+
if (control) {
- const controlStatus = (control || {}).state;
- if (store.state.map.prdType != '') {
- const type = SystemType[store.state.map.prdType];
- const status = StationControlType[controlStatus.status];
+ if (store.state.training.prdType != '') {
+ const type = SystemType[store.state.training.prdType];
+ const status = StationControlType[control.state.status];
menu = [...menuObj[type]];
if (menu.constructor === Array) {
menu.forEach(elem => {
@@ -533,6 +534,7 @@ export function menuFiltration(menuObj) {
}
}
}
+
return menu;
}
@@ -541,8 +543,8 @@ export function menuFiltration(menuObj) {
*/
export function trainMenuFiltration(menuObj) {
var menu = [];
- if (store.state.map.prdType != '') {
- const type = SystemType[store.state.map.prdType];
+ if (store.state.training.prdType != '') {
+ const type = SystemType[store.state.training.prdType];
menu = [...menuObj[type]];
if (menu.constructor === Array) {
menu.forEach(elem => {
diff --git a/src/jmap/theme/fuzhou_01/menusPlan/chooseTemplatePlan.vue b/src/jmap/theme/fuzhou_01/menusPlan/chooseTemplatePlan.vue
index ec8c3d3c7..6e763a82a 100644
--- a/src/jmap/theme/fuzhou_01/menusPlan/chooseTemplatePlan.vue
+++ b/src/jmap/theme/fuzhou_01/menusPlan/chooseTemplatePlan.vue
@@ -82,7 +82,7 @@
},
queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) {
- params['skinStyle'] = this.$store.state.map.map.skinStyle;
+ params['skinStyle'] = this.$store.getters['map/skinStyle'];
}
return runPlanTemplateList(params);
},
diff --git a/src/jmap/theme/fuzhou_01/menusPlan/createTodayPlan.vue b/src/jmap/theme/fuzhou_01/menusPlan/createTodayPlan.vue
index fa3d2b234..7e361a141 100644
--- a/src/jmap/theme/fuzhou_01/menusPlan/createTodayPlan.vue
+++ b/src/jmap/theme/fuzhou_01/menusPlan/createTodayPlan.vue
@@ -86,7 +86,7 @@
},
queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) {
- params['skinStyle'] = this.$store.state.map.map.skinStyle;
+ params['skinStyle'] = this.$store.getters['map/skinStyle'];
}
return runPlanTemplateList(params);
},
diff --git a/src/store/modules/map.js b/src/store/modules/map.js
index bd11105d3..0dee56a4a 100644
--- a/src/store/modules/map.js
+++ b/src/store/modules/map.js
@@ -7,7 +7,7 @@ import Vue from 'vue';
* @param {Object} device
* @param {Array} effectedDeviceList
*/
-function queryEffectedDevices(map, device, effectedDeviceList) {
+function queryEffectedModels(map, device, effectedDeviceList) {
if (device && map) {
effectedDeviceList.push(device);
switch (device._type) {
@@ -17,7 +17,7 @@ function queryEffectedDevices(map, device, effectedDeviceList) {
if (map.sectionList && map.sectionList.length) {
map.sectionList.forEach(elem => {
if (elem.linkCode === device.code) {
- queryEffectedDevices(map, elem, effectedDeviceList);
+ queryEffectedModels(map, elem, effectedDeviceList);
}
});
}
@@ -369,57 +369,52 @@ const map = {
// 查询区段关联的计数器
getCounterBySectionCode: (state) => (code, type) => {
- let obj = null;
- if (code && type && state.map &&
- state.map.sectionList && state.map.sectionList.length &&
- state.map.counterList && state.map.counterList.length) {
- state.map.sectionList.forEach(section => {
- if (section.code === code) {
- state.map.counterList.forEach(counter => {
- if (counter.stationCode === section.stationCode && type == counter.type) {
- obj = counter;
- return;
- }
- });
- return;
- }
- });
+ let device = null;
+ if (Vue.prototype.$jlmap) {
+ var section = Vue.prototype.$jlmap.mapDevice[code];
+ if (section) {
+ state.map.counterList.forEach(counter => {
+ if (counter.stationCode === section.model.stationCode && type == counter.type) {
+ device = Vue.prototype.$jlmap.mapDevice[counter.code];
+ return;
+ }
+ });
+ }
}
- return obj;
+
+ return device;
},
// 查询信号机关联的计数器
getCounterBySingalCode: (state) => (code, type) => {
- let obj = null;
- if (code && type && state.map &&
- state.map.signalList && state.map.signalList.length &&
- state.map.counterList && state.map.counterList.length) {
- state.map.signalList.forEach(signal => {
- if (signal.code === code) {
- state.map.counterList.forEach(counter => {
- if (counter.stationCode === signal.stationCode && type == counter.type) {
- obj = counter;
- return;
- }
- });
- return;
- }
- });
+ let device = null;
+ if (Vue.prototype.$jlmap) {
+ var signal = Vue.prototype.$jlmap.mapDevice[code];
+ if (signal) {
+ state.map.counterList.forEach(counter => {
+ if (counter.stationCode === signal.model.stationCode && type == counter.type) {
+ device = Vue.prototype.$jlmap.mapDevice[counter.code];
+ return;
+ }
+ });
+ }
}
- return obj;
+ return device;
},
// 查询所属车站关联的控制模式
getStationControlByStationCode: (state) => (code) => {
let device = null;
- if (code && state.map &&
+ if (Vue.prototype.$jlmap && code &&
+ state.map &&
state.map.stationControlList && state.map.stationControlList.length) {
state.map.stationControlList.forEach(elem => {
if (elem.stationCode == code) {
- device = elem;
+ device = Vue.prototype.$jlmap.mapDevice[elem.code];
}
});
}
+
return device;
}
},
@@ -431,9 +426,6 @@ const map = {
mapRender: (devices) => {
Vue.prototype.$jlmap && Vue.prototype.$jlmap.render(devices);
},
- mapUpdate: (devices) => {
- Vue.prototype.$jlmap && Vue.prototype.$jlmap.update(devices);
- },
setTrainDetails: (state, details) => {
state.trainDetails = details;
},
@@ -492,38 +484,34 @@ const map = {
}
},
- updateMapDevices: ({ commit }, devices) => {
+ updateMapDevices: ({ commit }, models) => {
return new Promise((resolve) => {
- if (!(devices instanceof Array)) {
- devices = [devices];
+ if (!(models instanceof Array)) {
+ models = [models];
}
- commit('mapRender', devices);
- resolve(devices);
+ commit('mapRender', models);
+ resolve(models);
});
},
- deleteMapDevices: ({ commit, state }, devices) => {
+ deleteMapDevices: ({ commit, state }, models) => {
return new Promise((resolve) => {
- if (!(devices instanceof Array)) {
- devices = [devices];
+ if (!(models instanceof Array)) {
+ models = [models];
}
// 查找向上关联需要一起删除的设备
- const effectedDeviceList = [];
- devices.forEach((device) => {
- queryEffectedDevices(state.map, device, effectedDeviceList);
+ const effectedModelList = [];
+ models.forEach((device) => {
+ queryEffectedModels(state.map, device, effectedModelList);
});
- commit('mapRender', effectedDeviceList);
- resolve(effectedDeviceList);
+ commit('mapRender', effectedModelList);
+ resolve(effectedModelList);
});
},
- updateMapView: ({ commit }, devices) => {
- commit('mapUpdate', devices);
- },
-
saveMapDeviceDefaultConvert({ state }) {
saveMapDeviceDefaultConvert(state);
},
diff --git a/src/views/jlmap/index.vue b/src/views/jlmap/index.vue
index 4f1c65985..ef1cbf993 100644
--- a/src/views/jlmap/index.vue
+++ b/src/views/jlmap/index.vue
@@ -209,7 +209,7 @@ export default {
this.dataZoom.offsetY = dataZoom.offsetY.toFixed(1) + '';
this.dataZoom.scaleRate = dataZoom.scaleRate + '';
- const skinStyle = this.$store.state.map.map.skinStyle;
+ const skinStyle = this.$store.getters['map/skinStyle'];
if (skinStyle) {
const param = {
scaleRate: this.dataZoom.scaleRate,
diff --git a/src/views/map/mapdraft/mapmanage/edit.vue b/src/views/map/mapdraft/mapmanage/edit.vue
index dcf564032..facdba2f5 100644
--- a/src/views/map/mapdraft/mapmanage/edit.vue
+++ b/src/views/map/mapdraft/mapmanage/edit.vue
@@ -139,8 +139,10 @@ export default {
Object.assign(this.editModel, this.map);
}
},
- '$store.state.map.map.skinStyle': function () {
- this.isUpdate = true;
+ '$store.state.map.mapDataLoadedCount': function () {
+ if (this.$jlmap.skinStyle) {
+ this.isUpdate = true;
+ }
}
},
mounted() {
diff --git a/src/views/mapsystem/common/index.vue b/src/views/mapsystem/common/index.vue
index 19638a4c6..ca0a97d61 100644
--- a/src/views/mapsystem/common/index.vue
+++ b/src/views/mapsystem/common/index.vue
@@ -14,6 +14,7 @@
import JlmapVisual from '@/views/jlmap/index';
import TrainingTips from '@/views/mapsystem/plugin/trainingtip';
import ThemeFactory from '@/jmap/theme/factory';
+import { debug } from 'util';
export default {
name: 'LessonCanvas',
@@ -46,9 +47,10 @@
}
},
watch: {
- '$store.state.map.map.skinStyle': function (code) {
- if (code) {
- this.menus = ThemeFactory.loadMenusComponent(code);
+ '$store.state.map.mapDataLoadedCount': function () {
+ const skinStyle = this.$jlmap.skinStyle;
+ if (skinStyle) {
+ this.menus = ThemeFactory.loadMenusComponent(skinStyle);
}
}
},
@@ -104,18 +106,19 @@
},
contextmenu(em) {
var menu = null;
- var device = { _type: em.deviceType, code: em.deviceCode };
+ var device = null;
this.point = { x: em.clientX, y: em.clientY };
+
if (em.subType === 'TrainWindow') {
- em = { _type: 'Train', _code: em.deviceCode }
+ em = { _type: deviceType.Trian, _code: em.deviceCode }
this.$store.dispatch('map/setTrainWindowShow', true);
} else if (em.deviceCode && !this.isScreen) {
device = this.getDeviceByEm(em);
}
if (device) {
- this.selected = device = this.getSelectedBySkinStyle(em);
+ this.selected = device = this.getSelectedBySkinStyle(device);
if (!this.buttonOperation) {
this.$store.dispatch('menuOperation/setSelected', device);
if (!this.checkShouldPop(device)) {