线路:成都3
问题:现地第一次加载,引导按钮没有显示的问题
This commit is contained in:
parent
981e8a83d5
commit
52b1a87e9c
@ -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 => {
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
@ -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 = {};
|
||||
|
@ -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) {
|
||||
|
@ -4,11 +4,11 @@
|
||||
<transition name="el-zoom-in-bottom">
|
||||
<map-system-draft ref="mapCanvas" @back="back" />
|
||||
</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-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-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-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-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-dispather-contest v-if="isContest" ref="menuDispatherContest" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" @start="start" @end="end"/>
|
||||
</template>
|
||||
<menu-train-list v-if="isDemon||isContest||isScript" />
|
||||
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
|
||||
@ -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() {
|
||||
|
@ -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 };
|
||||
|
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user