2019-07-26 13:32:43 +08:00
|
|
|
<template>
|
2019-08-13 15:54:26 +08:00
|
|
|
<div class="PlanStatusBar">
|
|
|
|
<ul class="ul-box">
|
2019-10-17 18:49:19 +08:00
|
|
|
<div class="li_plan" @click="showTrain" v-if="isNotUser">{{$t('planMonitor.serviceAndTripNumber')}}</div>
|
2019-08-13 15:54:26 +08:00
|
|
|
</ul>
|
|
|
|
<ul class="ul-box">
|
2019-10-17 18:49:19 +08:00
|
|
|
<div class="li_plan" @click="handleAddPlanningTrain" v-if="isNotUser">{{$t('planMonitor.addPlan')}}</div>
|
|
|
|
<div class="li_plan" @click="handleDeletePlanningTrain" v-if="isNotUser">{{$t('planMonitor.deletePlan')}}</div>
|
|
|
|
<div class="li_plan" @click="handleDuplicateTrain" v-if="isNotUser">{{$t('planMonitor.duplicatePlan')}}</div>
|
|
|
|
<div class="li_plan" @click="handleAddTask" v-if="isNotUser">{{$t('planMonitor.addTask')}}</div>
|
|
|
|
<div class="li_plan" @click="handleDeleteTask" v-if="isNotUser">{{$t('planMonitor.deleteTask')}}</div>
|
|
|
|
<div class="li_plan" @click="handleModifyingTask" v-if="isNotUser">{{$t('planMonitor.modifyTask')}}</div>
|
2019-08-13 15:54:26 +08:00
|
|
|
</ul>
|
|
|
|
<ul class="ul-box tool">
|
2019-10-17 18:49:19 +08:00
|
|
|
<div class="li_plan" @click="handlePlanEffectiveCheck" v-if="isNotUser">{{$t('planMonitor.validityCheck')}}</div>
|
|
|
|
<div class="li_plan" @click="handleTestRunPlan">{{$t('planMonitor.testRunning')}}</div>
|
2019-08-13 15:54:26 +08:00
|
|
|
</ul>
|
|
|
|
</div>
|
2019-07-26 13:32:43 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-08-13 15:54:26 +08:00
|
|
|
import { planEffectiveCheck, runPlanNotify } from '@/api/runplan';
|
|
|
|
import { launchFullscreen } from '@/utils/screen';
|
|
|
|
import { UrlConfig } from '@/router/index';
|
2019-07-26 13:32:43 +08:00
|
|
|
|
2019-08-09 16:57:07 +08:00
|
|
|
export default {
|
|
|
|
name: 'PlanStatusBar',
|
|
|
|
data() {
|
|
|
|
return {
|
2019-10-17 18:49:19 +08:00
|
|
|
isNotUser:true
|
2019-08-09 16:57:07 +08:00
|
|
|
};
|
|
|
|
},
|
|
|
|
watch: {
|
2019-08-13 15:54:26 +08:00
|
|
|
|
2019-08-09 16:57:07 +08:00
|
|
|
},
|
2019-10-17 18:49:19 +08:00
|
|
|
created(){
|
|
|
|
if(/^\/plan\/usertool/.test(this.$route.fullPath)){
|
|
|
|
this.isNotUser=false;
|
|
|
|
}else{
|
|
|
|
this.isNotUser=true;
|
|
|
|
}
|
|
|
|
},
|
2019-08-09 16:57:07 +08:00
|
|
|
methods: {
|
2019-08-13 15:54:26 +08:00
|
|
|
showTrain() {
|
|
|
|
this.$emit('showTrain');
|
|
|
|
},
|
|
|
|
// 添加计划
|
|
|
|
handleAddPlanningTrain() {
|
|
|
|
const planId = this.$route.query.planId;
|
|
|
|
if (planId) {
|
|
|
|
this.$emit('dispatchDialog', { name: 'addPlanningTrain', params: {} });
|
|
|
|
} else {
|
2019-10-17 18:49:19 +08:00
|
|
|
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
2019-08-13 15:54:26 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
// 删除计划
|
|
|
|
handleDeletePlanningTrain() {
|
|
|
|
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
|
|
|
if (serviceNumber) {
|
|
|
|
this.$emit('dispatchDialog', {
|
|
|
|
name: 'offLine', params: {
|
|
|
|
type: 'warning',
|
|
|
|
width: 260,
|
2019-10-17 18:49:19 +08:00
|
|
|
message: this.$t('tip.deleteTrainHint')+serviceNumber+'?',
|
2019-08-13 15:54:26 +08:00
|
|
|
operate: 'DeletePlanningTrain',
|
|
|
|
serviceNumber: serviceNumber,
|
|
|
|
refresh: true
|
|
|
|
}
|
|
|
|
});
|
|
|
|
} else {
|
2019-10-17 18:49:19 +08:00
|
|
|
this.$messageBox(this.$t('tip.selectAPlan'));
|
2019-08-13 15:54:26 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
// 复制计划
|
|
|
|
handleDuplicateTrain() {
|
|
|
|
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
|
|
|
if (serviceNumber) {
|
|
|
|
this.$emit('dispatchDialog', { name: 'duplicateTrain', params: { serviceNumber } });
|
|
|
|
} else {
|
2019-10-17 18:49:19 +08:00
|
|
|
this.$messageBox(this.$t('tip.selectAPlan'));
|
2019-08-13 15:54:26 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
// 添加任务
|
|
|
|
handleAddTask() {
|
|
|
|
const params = this.$store.state.runPlan.selected;
|
|
|
|
if (params.serviceNumber && params.tripNumber) {
|
|
|
|
this.$emit('dispatchDialog', { name: 'addTask', params });
|
|
|
|
} else {
|
2019-10-17 18:49:19 +08:00
|
|
|
this.$messageBox(this.$t('tip.selectATrain'));
|
2019-08-13 15:54:26 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
// 删除任务
|
|
|
|
handleDeleteTask() {
|
|
|
|
const params = this.$store.state.runPlan.selected;
|
|
|
|
if (params.serviceNumber && params.tripNumber) {
|
|
|
|
this.$emit('dispatchDialog', { name: 'deleteTask', params });
|
|
|
|
} else {
|
2019-10-17 18:49:19 +08:00
|
|
|
this.$messageBox(this.$t('tip.selectATrain'));
|
2019-08-13 15:54:26 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
// 修改任务
|
|
|
|
handleModifyingTask() {
|
|
|
|
const params = this.$store.state.runPlan.selected;
|
|
|
|
if (params.serviceNumber && params.tripNumber) {
|
|
|
|
this.$emit('dispatchDialog', { name: 'modifyingTask', params });
|
|
|
|
} else {
|
2019-10-17 18:49:19 +08:00
|
|
|
this.$messageBox(this.$t('tip.selectATrain'));
|
2019-08-13 15:54:26 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
// 校验运行图
|
|
|
|
handlePlanEffectiveCheck() {
|
|
|
|
const planId = this.$route.query.planId;
|
|
|
|
if (planId) {
|
|
|
|
planEffectiveCheck(planId).then(resp => {
|
|
|
|
this.$emit('dispatchDialog', {
|
|
|
|
name: 'systermOut',
|
|
|
|
params: {
|
|
|
|
width: 600,
|
|
|
|
contextList: resp.data
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}).catch(() => {
|
2019-10-17 18:49:19 +08:00
|
|
|
this.$messageBox(this.$t('tip.runGraphVerificationFailed'));
|
2019-08-13 15:54:26 +08:00
|
|
|
});
|
|
|
|
} else {
|
2019-10-17 18:49:19 +08:00
|
|
|
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
2019-08-13 15:54:26 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
// 测试运行图
|
|
|
|
async handleTestRunPlan() {
|
|
|
|
const data = { planId: this.$route.query.planId };
|
|
|
|
runPlanNotify(data).then(resp => {
|
|
|
|
const query = {
|
2019-08-14 16:37:17 +08:00
|
|
|
skinCode: this.$route.query.skinCode, prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId
|
2019-08-13 15:54:26 +08:00
|
|
|
};
|
|
|
|
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
|
|
|
|
launchFullscreen();
|
|
|
|
}).catch(error => {
|
2019-10-17 18:49:19 +08:00
|
|
|
this.$messageBox(this.$t('tip.createSimulationFaild')+this.$t('global.colon')+error.message);
|
2019-08-13 15:54:26 +08:00
|
|
|
});
|
2019-08-09 16:57:07 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2019-07-26 13:32:43 +08:00
|
|
|
</script>
|
|
|
|
|
2019-08-09 16:57:07 +08:00
|
|
|
<style scoped rel="stylesheet/scss" lang="scss">
|
2019-07-26 13:32:43 +08:00
|
|
|
@import "src/styles/mixin.scss";
|
|
|
|
|
2019-08-13 15:54:26 +08:00
|
|
|
.PlanStatusBar {
|
2019-07-26 13:32:43 +08:00
|
|
|
z-index: 5;
|
|
|
|
position: absolute;
|
2019-08-13 15:54:26 +08:00
|
|
|
width: 50px;
|
|
|
|
height: calc(100% - 45px);
|
|
|
|
top: 45px;
|
|
|
|
right: 0px;
|
|
|
|
background: #293c55;
|
|
|
|
padding-top: 10px;
|
|
|
|
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
2019-08-13 15:54:26 +08:00
|
|
|
.ul-box{
|
|
|
|
width: 100%;
|
|
|
|
padding: 0;
|
|
|
|
.li_plan{
|
|
|
|
width: 100%;
|
|
|
|
height: 50px;
|
|
|
|
font-size: 14px;
|
|
|
|
color: rgba(255, 255, 255, 0.45);
|
|
|
|
text-align: center;
|
|
|
|
padding: 5px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
margin-bottom: 4px;
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
&:hover{
|
|
|
|
background: #0e151f;
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.tool{
|
|
|
|
position: absolute;
|
|
|
|
bottom: 50px;
|
|
|
|
}
|
2019-08-09 16:57:07 +08:00
|
|
|
</style>
|