线路:成都3

问题:现地第一次加载,引导按钮没有显示的问题
This commit is contained in:
lVAL 2021-02-25 11:18:59 +08:00
parent 981e8a83d5
commit 52b1a87e9c
9 changed files with 74 additions and 58 deletions

View File

@ -292,7 +292,13 @@ class Jlmap {
}); });
if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); } 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); this.updateShowStation(list, this.stationCode);
} }
@ -333,18 +339,6 @@ class Jlmap {
this.hookHandle(oDevice, elem); 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() { getShowConfig() {
return this.showConfig; 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.prdType = val;
this.showConfig.showMode = showMode; this.showConfig.showMode = showMode;
list.forEach(item => { list.forEach(item => {

View File

@ -140,6 +140,7 @@ export default class GuideLock extends Group {
setShowMode() { setShowMode() {
const showMode = this.model.showMode; const showMode = this.model.showMode;
const showConditions = (this.style.GuideLock || {}).displayCondition; const showConditions = (this.style.GuideLock || {}).displayCondition;
if (!showConditions || showConditions === '01' || showMode === showConditions) { if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.showMode(); this.showMode();
} else { } else {

View File

@ -196,7 +196,7 @@ export default {
} else if (val === "02") { } else if (val === "02") {
showMode = "02"; showMode = "02";
} }
this.map.updatePrdType(list, val, showMode); this.map.updatePrdType(list, showMode, val);
}, },
setShowStation(stationCode, setCenter) { setShowStation(stationCode, setCenter) {
const nameList = Object.keys(this.$store.state.map.map); const nameList = Object.keys(this.$store.state.map.map);

View File

@ -137,3 +137,19 @@ Vue.prototype.$str2number = function(str) {
Vue.prototype.$asc2chart = function(ascii) { Vue.prototype.$asc2chart = function(ascii) {
return String.fromCharCode(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++;
}
}

View File

@ -666,7 +666,7 @@ const map = {
if (map && map.skinVO) { if (map && map.skinVO) {
state.map = map; state.map = map;
let showConfig = {}; 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(); showConfig = Vue.prototype.$jlmap.getShowConfig();
} }
const foldLineMap = {}; const foldLineMap = {};

View File

@ -299,12 +299,6 @@ const training = {
}, },
actions: { actions: {
/**
* 清除仿真所在组
*/
clearSimulationGroup: ({ commit }, type) => {
commit('clearSimulationGroup', type);
},
/** /**
* 设置socke已经连接 * 设置socke已经连接
*/ */
@ -350,9 +344,6 @@ const training = {
commit('resetScore'); commit('resetScore');
commit('start'); commit('start');
}, },
// setTrainingStart:({ commit }) ={
// commit('setTrainingStart');
// },
setTrainingStart: ({ commit }, flag) => { setTrainingStart: ({ commit }, flag) => {
commit('setTrainingStart', flag); commit('setTrainingStart', flag);
if (!flag) { if (!flag) {

View File

@ -4,11 +4,11 @@
<transition name="el-zoom-in-bottom"> <transition name="el-zoom-in-bottom">
<map-system-draft ref="mapCanvas" @back="back" /> <map-system-draft ref="mapCanvas" @back="back" />
</transition> </transition>
<menu-demon v-if="isDemon" ref="menuDemon" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" @start="start" @end="end" /> <menu-demon v-if="isDemon" ref="menuDemon" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" @start="start" @end="end"/>
<menu-lesson v-if="isLesson" ref="lessonMenu" :offset="offset" :data-error="dataError" :offset-bottom="offsetBottom" :tip-bottom="tipBottom" /> <menu-lesson v-if="isLesson" ref="lessonMenu" :offset="offset" :data-error="dataError" :offset-bottom="offsetBottom" :tip-bottom="tipBottom"/>
<menu-exam v-if="isExam" ref="menuExam" :offset="offset" :data-error="dataError" :offset-bottom="offsetBottom" /> <menu-exam v-if="isExam" ref="menuExam" :offset="offset" :data-error="dataError" :offset-bottom="offsetBottom"/>
<menu-script v-if="isScript" ref="menuScript" :offset-bottom="offsetBottom" :offset="offset" :text-status-height="textStatusHeight" :data-error="dataError" @start="start" @end="end" /> <menu-script v-if="isScript" ref="menuScript" :offset-bottom="offsetBottom" :offset="offset" :text-status-height="textStatusHeight" :data-error="dataError" @start="start" @end="end"/>
<menu-dispather-contest v-if="isContest" ref="menuDispatherContest" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" @start="start" @end="end" /> <menu-dispather-contest v-if="isContest" ref="menuDispatherContest" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" @start="start" @end="end"/>
</template> </template>
<menu-train-list v-if="isDemon||isContest||isScript" /> <menu-train-list v-if="isDemon||isContest||isScript" />
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" /> <menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
@ -103,6 +103,9 @@ export default {
this.back(); 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 '$store.state.config.menuBarLoadedCount': function (val) { // menuBar
this.setPosition(); this.setPosition();
@ -218,6 +221,30 @@ export default {
} }
this.dataError = resp.data.dataError; 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() { loadMapData() {

View File

@ -119,9 +119,6 @@ export default {
'showStation':function(val) { 'showStation':function(val) {
this.showStationContent = 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 () { '$store.state.map.mapDataLoadedCount': function () {
this.loadRunData(); this.loadRunData();
}, },
@ -186,30 +183,6 @@ export default {
selectQuest(row, id, mapLocation, roleName) { selectQuest(row, id, mapLocation, roleName) {
this.$emit('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() { runPlanEditShow() {
// this.$refs.runPlanEdit.doShow(); // this.$refs.runPlanEdit.doShow();
// const query = { lineCode: lineCode, mapId: this.$route.params.mapId, planId: planId, planName: planName }; // const query = { lineCode: lineCode, mapId: this.$route.params.mapId, planId: planId, planName: planName };

View File

@ -540,12 +540,14 @@ export default {
} }
} }
}); });
if (val === '01') { if (val === '01') {
showMode = '03'; showMode = '03';
} else if (val === '02') { } else if (val === '02') {
showMode = '02'; showMode = '02';
} }
this.$jlmap.updatePrdType(list, val, showMode);
this.$jlmap.updatePrdType(list, showMode, val);
}, },
setShowStation(stationCode) { setShowStation(stationCode) {
const showStation = this.centralizedStationMap[stationCode]; const showStation = this.centralizedStationMap[stationCode];