diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index 69a00defb..fba104b8e 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -292,7 +292,13 @@ class Jlmap { }); if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); } - this.updateShowMode(list, this.showConfig.showMode); + + + const prdType2ShowMode = { + '01': '03', + '02': '02' + } + this.updateShowMode(list, prdType2ShowMode[this.showConfig.prdType]); this.updateShowStation(list, this.stationCode); } @@ -333,18 +339,6 @@ class Jlmap { this.hookHandle(oDevice, elem); }); } - // 模式选择 -> 更新 - updateShowMode(list = [], showMode = false) { - this.showConfig.showMode = showMode; - list.forEach(elem => { - const code = elem.code; - const type = elem._type; - const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig); - oDevice.showMode = showMode; - this.$painter.updateShowMode(oDevice); - }); - this.$painter.$transformHandle.revisibleAll(); - } getShowConfig() { return this.showConfig; } @@ -406,7 +400,19 @@ class Jlmap { }); } } - updatePrdType(list = [], val = '', showMode = false) { + // 模式选择 -> 更新 + updateShowMode(list = [], showMode = '03') { + this.showConfig.showMode = showMode; + list.forEach(elem => { + const code = elem.code; + const type = elem._type; + const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig); + oDevice.showMode = showMode; + this.$painter.updateShowMode(oDevice); + }); + this.$painter.$transformHandle.revisibleAll(); + } + updatePrdType(list = [], showMode = '03', val = '') { this.showConfig.prdType = val; this.showConfig.showMode = showMode; list.forEach(item => { diff --git a/src/jmapNew/shape/GuideLock/index.js b/src/jmapNew/shape/GuideLock/index.js index a6d62f638..2e70e01b7 100644 --- a/src/jmapNew/shape/GuideLock/index.js +++ b/src/jmapNew/shape/GuideLock/index.js @@ -140,6 +140,7 @@ export default class GuideLock extends Group { setShowMode() { const showMode = this.model.showMode; const showConditions = (this.style.GuideLock || {}).displayCondition; + if (!showConditions || showConditions === '01' || showMode === showConditions) { this.showMode(); } else { diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/mapVisual.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/mapVisual.vue index 749e1b406..d877af19b 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/mapVisual.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/mapVisual.vue @@ -196,7 +196,7 @@ export default { } else if (val === "02") { showMode = "02"; } - this.map.updatePrdType(list, val, showMode); + this.map.updatePrdType(list, showMode, val); }, setShowStation(stationCode, setCenter) { const nameList = Object.keys(this.$store.state.map.map); diff --git a/src/scripts/GlobalPlugin.js b/src/scripts/GlobalPlugin.js index af9b09c5d..9a4d626b0 100644 --- a/src/scripts/GlobalPlugin.js +++ b/src/scripts/GlobalPlugin.js @@ -137,3 +137,19 @@ Vue.prototype.$str2number = function(str) { Vue.prototype.$asc2chart = function(ascii) { return String.fromCharCode(ascii); }; + + +// 测试相关接口 +/** +* trace +* @param [int] [count=10] +*/ +Vue.prototype.$trace = function (count=10) { + var caller = arguments.callee.caller; + var i = 0; + while (caller && i < count) { + console.log(caller.toString()); + caller = caller.caller; + i++; + } +} diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 2c5109b7c..8be119ded 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -666,7 +666,7 @@ const map = { if (map && map.skinVO) { state.map = map; let showConfig = {}; - if (Vue.prototype.$jlmap && ( typeof (Vue.prototype.$jlmap.getShowConfig) === 'function')) { + if (Vue.prototype.$jlmap && (typeof (Vue.prototype.$jlmap.getShowConfig) === 'function')) { showConfig = Vue.prototype.$jlmap.getShowConfig(); } const foldLineMap = {}; diff --git a/src/store/modules/training.js b/src/store/modules/training.js index 978b6a401..50fc77a82 100644 --- a/src/store/modules/training.js +++ b/src/store/modules/training.js @@ -299,12 +299,6 @@ const training = { }, actions: { - /** - * 清除仿真所在组 - */ - clearSimulationGroup: ({ commit }, type) => { - commit('clearSimulationGroup', type); - }, /** * 设置socke已经连接 */ @@ -350,9 +344,6 @@ const training = { commit('resetScore'); commit('start'); }, - // setTrainingStart:({ commit }) ={ - // commit('setTrainingStart'); - // }, setTrainingStart: ({ commit }, flag) => { commit('setTrainingStart', flag); if (!flag) { diff --git a/src/views/newMap/displayNew/index.vue b/src/views/newMap/displayNew/index.vue index 6d50f15d3..23b0c2dc6 100644 --- a/src/views/newMap/displayNew/index.vue +++ b/src/views/newMap/displayNew/index.vue @@ -4,11 +4,11 @@ - - - - - + + + + + @@ -103,6 +103,9 @@ export default { this.back(); } }); + }, + '$store.state.training.prdType':function(val) { + if (val == '01') { this.switchModeInner('01'); } else { this.switchModeInner('02'); } }, '$store.state.config.menuBarLoadedCount': function (val) { // menuBar加载完成 this.setPosition(); @@ -218,6 +221,30 @@ export default { } this.dataError = resp.data.dataError; } + }, + switchModeInner(swch) { + let showMode = '03'; + if (swch == '01') { + showMode = '03'; + } else if (swch == '02') { + showMode = '02'; + } + const nameList = Object.keys(this.$store.state.map.map || {}); + let list = []; + nameList.forEach(item => { + if (item !== 'skinVO') { + const data = this.$store.state.map.map[item]; + if (data && data.constructor === Array) { + list = [...list, ...data]; + } + } + }); + if (swch == '01') { + this.$emit('switchStationMode', this.showStationContent); // 设置显示集中站元素 + } else { + this.$jlmap.updateShowStation(list, ''); // 显示全部元素 + } + this.$jlmap.updateShowMode(list, showMode); // 二次过滤 }, // 加载地图数据 loadMapData() { diff --git a/src/views/newMap/displayNew/menuSchema.vue b/src/views/newMap/displayNew/menuSchema.vue index fcdef6f46..a76a08a09 100644 --- a/src/views/newMap/displayNew/menuSchema.vue +++ b/src/views/newMap/displayNew/menuSchema.vue @@ -119,9 +119,6 @@ export default { 'showStation':function(val) { this.showStationContent = val; }, - '$store.state.training.prdType':function(val) { - if (val == '01') { this.switchModeInner('01'); } else { this.switchModeInner('02'); } - }, '$store.state.map.mapDataLoadedCount': function () { this.loadRunData(); }, @@ -186,30 +183,6 @@ export default { selectQuest(row, id, mapLocation, roleName) { this.$emit('selectQuest', {row, id, mapLocation, roleName}); }, - switchModeInner(swch) { - let showMode = '03'; - if (swch == '01') { - showMode = '03'; - } else if (swch == '02') { - showMode = '02'; - } - const nameList = Object.keys(this.$store.state.map.map || {}); - let list = []; - nameList.forEach(item => { - if (item !== 'skinVO') { - const data = this.$store.state.map.map[item]; - if (data && data.constructor === Array) { - list = [...list, ...data]; - } - } - }); - if (swch == '01') { - this.$emit('switchStationMode', this.showStationContent); // 设置显示集中站元素 - } else { - this.$jlmap.updateShowStation(list, ''); // 显示全部元素 - } - this.$jlmap.updateShowMode(list, showMode); // 二次过滤 - }, runPlanEditShow() { // this.$refs.runPlanEdit.doShow(); // const query = { lineCode: lineCode, mapId: this.$route.params.mapId, planId: planId, planName: planName }; diff --git a/src/views/newMap/jointTrainingNew/index.vue b/src/views/newMap/jointTrainingNew/index.vue index d3ccf6358..72a807216 100644 --- a/src/views/newMap/jointTrainingNew/index.vue +++ b/src/views/newMap/jointTrainingNew/index.vue @@ -540,12 +540,14 @@ export default { } } }); + if (val === '01') { showMode = '03'; } else if (val === '02') { showMode = '02'; } - this.$jlmap.updatePrdType(list, val, showMode); + + this.$jlmap.updatePrdType(list, showMode, val); }, setShowStation(stationCode) { const showStation = this.centralizedStationMap[stationCode];