运行图绘制代码调整

This commit is contained in:
joylink_cuiweidong 2020-11-12 19:04:57 +08:00
parent db3660a0eb
commit e5e7111965
4 changed files with 113 additions and 3 deletions

View File

@ -9,6 +9,7 @@
<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" /> <menu-script v-if="isScript" ref="menuScript" :offset-bottom="offsetBottom" :offset="offset" :text-status-height="textStatusHeight" :data-error="dataError" />
<menu-dispather-contest v-if="isContest" ref="menuDispatherContest" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" /> <menu-dispather-contest v-if="isContest" ref="menuDispatherContest" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" />
<menu-runplan v-if="isPlan" ref="menuPlan" />
</template> </template>
<menu-train-list v-if="isDemon||isContest||isScript" @setCenter="setCenter" /> <menu-train-list v-if="isDemon||isContest||isScript" @setCenter="setCenter" />
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" /> <menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
@ -26,6 +27,7 @@ import MenuDemon from './menuDemon';
import MenuExam from './exam/index'; import MenuExam from './exam/index';
import MenuScript from './scriptDisplay/scriptRecord/index'; import MenuScript from './scriptDisplay/scriptRecord/index';
import MenuDispatherContest from './dispatherContest/index'; import MenuDispatherContest from './dispatherContest/index';
import MenuRunplan from './menuRunplan';
import MenuTrainList from '@/views/newMap/displayNew/menuTrainList'; import MenuTrainList from '@/views/newMap/displayNew/menuTrainList';
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime'; import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
@ -44,7 +46,8 @@ export default {
MenuSystemTime, MenuSystemTime,
MenuTrainList, MenuTrainList,
MenuDispatherContest, MenuDispatherContest,
MenuScript MenuScript,
MenuRunplan
}, },
data() { data() {
return { return {
@ -82,6 +85,9 @@ export default {
isScript() { isScript() {
return this.mode === 'script'; return this.mode === 'script';
}, },
isPlan() {
return this.mode === 'plan';
},
mapId() { mapId() {
return this.$route.query.mapId; return this.$route.query.mapId;
}, },

View File

@ -0,0 +1,102 @@
<template>
<div>
<div class="display-draft">
<el-button-group>
<el-button type="primary" size="small" @click="back">返回</el-button>
<el-button type="danger" size="small" @click="end">{{ $t('display.demon.initialize') }}</el-button>
<el-button type="success" :disabled="isDisable" size="small" @click="selectBeginTime">{{ $t('display.demon.drivingByPlan') }}</el-button>
</el-button-group>
</div>
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />
</div>
</template>
<script>
import SetTime from './demon/setTime';
import { Notification } from 'element-ui';
import { ranAsPlan, exitRunPlan } from '@/api/simulation';
export default {
name:'MenuPlan',
components: {
SetTime
},
data() {
return {
};
},
computed:{
group() {
return this.$route.query.group;
},
isDisable() {
return this.$store.state.training.started;
}
},
methods:{
back() {
this.$store.dispatch('map/setShowCentralizedStationCode', '');
history.go(-1);
Notification.closeAll();
},
selectBeginTime() {
this.$refs.setTime.doShow();
},
end() {
exitRunPlan(this.group).then(() => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('map/resetActiveTrainList', false);
this.$store.dispatch('map/clearJlmapTrainView');
this.$store.dispatch('map/setTrainWindowShow', false);
});
});
}).catch(() => {
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
},
start(model) { // 仿
const data = {
time: model.initTime
};
// if (this.$route.query.prdType === '04') {
// data.loadNumber = model.loadNum;
// }
ranAsPlan(data, this.group).then(res => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
}).catch(error => {
if (error.code == '5001') {
this.$messageBox(this.$t('error.mapDataError') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5002') {
this.$messageBox(this.$t('error.runningChartDataError') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5003') {
this.$messageBox(this.$t('error.runningChartIsNotLoaded') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5004') {
this.$messageBox(this.$t('error.runningDataError') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5000') {
this.$messageBox(this.$t('error.systemError') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '4000') {
this.$messageBox(this.$t('error.simulationDoesNotExist') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '4001') {
this.$messageBox(this.$t('error.simulationOperationIsNotDefined') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '4002') {
this.$messageBox(this.$t('error.simulationOperationProcessingMethodNotFound') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '4003') {
this.$messageBox(this.$t('error.simulationOperationFailed') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '4004') {
this.$messageBox(this.$t('error.operationConflict') + ',' + this.$t('error.startSimulationFailed'));
} else {
this.$messageBox('按计划行车异常,请退出重试!');
}
});
}
}
};
</script>
<style lang="scss" scoped>
.display-draft {
position: absolute;
float: right;
right: 15px;
bottom: 15px;
}
</style>

View File

@ -462,7 +462,8 @@ export default {
const query = { const query = {
prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId
}; };
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query }); // this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
this.$router.push({ path: `${UrlConfig.displayNew}/plan`, query: query });
launchFullscreen(); launchFullscreen();
}).catch(error => { }).catch(error => {
this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message); this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);

View File

@ -151,7 +151,8 @@ export default {
const query = { const query = {
prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId
}; };
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query }); // this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
this.$router.push({ path: `${UrlConfig.displayNew}/plan`, query: query });
launchFullscreen(); launchFullscreen();
} else { } else {
this.$messageBox(this.$t('error.checkTheValidityFirst')); this.$messageBox(this.$t('error.checkTheValidityFirst'));