南京二添加列车后按计划行车列车不消失问题修复

This commit is contained in:
fan 2021-10-14 13:35:43 +08:00
parent 2028a73d19
commit c319a73f0c
4 changed files with 30 additions and 10 deletions

View File

@ -622,7 +622,14 @@ class Jlmap {
}
});
}
initClearTrainData() {
this.$painter.clearLevel(deviceType.Train);
zrUtil.each(Object.values(this.mapDevice), device => {
if (device._type == deviceType.Train) {
delete this.mapDevice[device.code];
}
});
}
clearEvent() {
this.$zr.curEvent = null;
}

View File

@ -1231,7 +1231,17 @@ const map = {
parser.parserTrainData(state.mapDevice, state.map.trainList, state.map.skinVO.code, showConfig);
}
},
initClearTrainData: ({ commit, state}) => {
if (Vue.prototype.$jlmap) {
Vue.prototype.$jlmap.initClearTrainData();
let showConfig = {};
if (Vue.prototype.$jlmap && typeof Vue.prototype.$jlmap.getShowConfig === 'function') {
showConfig = Vue.prototype.$jlmap.getShowConfig();
}
const parser = parserFactory(ParserType.Graph.value);
parser.parserTrainData(state.mapDevice, state.map.trainList, state.map.skinVO.code, showConfig);
}
},
setTrainWindowShow: ({ commit, state }, show) => {
if (state.map) {
var deviceList = [];

View File

@ -86,7 +86,7 @@
<div>
<div style="margin-top: 20px;display: flex;justify-content: space-between;padding: 5px;align-items: center;">
<span>位置</span>
<el-select v-model="nowSectionCode" :disabled="true" size="mini" style="width: 150px">
<el-select v-model="nowSectionCode" :disabled="true" :popper-append-to-body="false" size="mini" style="width: 150px">
<el-option
v-for="item in sectionList"
:key="item.code"
@ -101,7 +101,7 @@
</div>
<div style="display: flex;justify-content: space-between;padding: 5px;margin-top: 5px;">
<span>方向</span>
<el-select v-model="direction" :disabled="true" size="mini" style="width: 80px" placeholder="请选择">
<el-select v-model="direction" :disabled="true" :popper-append-to-body="false" size="mini" style="width: 80px" placeholder="请选择">
<el-option
v-for="item in directionList"
:key="item.value"
@ -162,7 +162,7 @@
<div>
<div style="margin-top: 20px;display: flex;justify-content: space-between;padding: 5px;align-items: center;">
<span>位置</span>
<el-select v-model="nowSectionCode" size="mini" style="width: 150px">
<el-select v-model="nowSectionCode" :popper-append-to-body="false" size="mini" style="width: 150px">
<el-option
v-for="item in sectionList"
:key="item.code"
@ -177,7 +177,7 @@
</div>
<div style="display: flex;justify-content: space-between;padding: 5px;margin-top: 5px;">
<span>方向</span>
<el-select v-model="direction" size="mini" style="width: 80px">
<el-select v-model="direction" :popper-append-to-body="false" size="mini" style="width: 80px">
<el-option
v-for="item in directionList"
:key="item.value"
@ -239,7 +239,7 @@
</div>
<div style="display: flex;justify-content: space-between;padding: 5px;align-items: center;">
<span>当前位置</span>
<el-select v-model="nowSectionCode" size="mini" style="width: 150px">
<el-select v-model="nowSectionCode" size="mini" :popper-append-to-body="false" style="width: 150px">
<el-option
v-for="item in sectionList"
:key="item.code"
@ -250,7 +250,7 @@
</div>
<div style="display: flex;justify-content: space-between;padding: 5px;align-items: center;">
<span>新位置</span>
<el-select v-model="newSectionCode" size="mini" style="width: 150px">
<el-select v-model="newSectionCode" :popper-append-to-body="false" size="mini" style="width: 150px">
<el-option
v-for="item in sectionList"
:key="item.code"
@ -263,7 +263,7 @@
</div>
<div style="display: flex;justify-content: flex-end;margin-top: 10px;border-top: 1px solid #c0c0c0;padding-top: 10px;">
<el-button v-if="operationType === 'update'" size="mini" @click="trainCommit">修改</el-button>
<el-button v-if="operationType === 'create'" size="mini" @click="trainCommit">创建</el-button>
<el-button v-if="operationType === 'create'" size="mini" :disabled="createDisable" @click="trainCommit">创建</el-button>
<el-button v-if="operationType === 'delete'" size="mini" @click="trainCommit">删除</el-button>
<el-button v-if="operationType === 'move'" size="mini" @click="trainCommit">步进</el-button>
<el-button size="mini" @click="doClose">关闭</el-button>
@ -312,6 +312,9 @@ export default {
},
title() {
return '列监';
},
createDisable() {
return !(this.groupNumber1 && this.groupNumber1.length === 4 && this.newSectionCode && this.newTrainCode && this.newTrainCode.length === 8);
}
},
watch: {

View File

@ -358,7 +358,7 @@ export default {
},
async simulationReset() {
await this.$store.dispatch('socket/setSimulationStart');
await this.$store.dispatch('map/clearJlmapTrainView');
await this.$store.dispatch('map/initClearTrainData');
await this.$store.dispatch('map/setTrainWindowShow', false); //
await this.$store.dispatch('training/over');
await this.$store.dispatch('map/resetActiveTrainList');