2019-07-26 13:32:43 +08:00
|
|
|
<template>
|
2019-08-13 15:54:26 +08:00
|
|
|
<div class="plan-tool" style="width: 100%; height: 100%;">
|
2020-08-14 10:55:32 +08:00
|
|
|
<menu-bar
|
|
|
|
ref="menuBar"
|
|
|
|
:plan-convert="PlanConvert"
|
|
|
|
:run-plan-list="runPlanList"
|
2020-08-14 18:30:04 +08:00
|
|
|
:load-run-plan-id="loadRunPlanId"
|
2020-08-14 10:55:32 +08:00
|
|
|
@doClose="doClose"
|
2020-12-22 17:27:04 +08:00
|
|
|
@refresh="refresh"
|
2020-08-14 10:55:32 +08:00
|
|
|
@dispatchDialog="dispatchDialog"
|
|
|
|
@loadingRunPlan="loadingRunPlan"
|
|
|
|
@checkIsLoadRunPlan="checkIsLoadRunPlan"
|
|
|
|
@modifyRunPlanName="modifyRunPlanName"
|
|
|
|
/>
|
2019-08-08 13:36:53 +08:00
|
|
|
<schedule
|
|
|
|
ref="schedule"
|
|
|
|
:plan-convert="PlanConvert"
|
2020-08-14 10:55:32 +08:00
|
|
|
:load-run-plan-id="loadRunPlanId"
|
|
|
|
:load-run-plan-name="loadRunPlanName"
|
2019-08-08 13:36:53 +08:00
|
|
|
/>
|
2020-12-22 17:27:04 +08:00
|
|
|
<status-bar ref="statusBar" :load-run-plan-id="loadRunPlanId" @dispatchDialog="dispatchDialog" @showTrain="showTrain" @refresh="refresh" />
|
2019-08-08 13:36:53 +08:00
|
|
|
<parameter ref="parameter" />
|
|
|
|
<off-line ref="offLine" @handleConfirm="handleConfirm" @dispatchDialog="dispatchDialog" />
|
2020-08-14 18:30:04 +08:00
|
|
|
<add-planning-train ref="addPlanningTrain" :load-run-plan-id="loadRunPlanId" @dispatchDialog="dispatchDialog" />
|
2019-08-08 13:36:53 +08:00
|
|
|
<edit-planning-train
|
|
|
|
ref="editPlanningTrain"
|
|
|
|
@dispatchDialog="dispatchDialog"
|
|
|
|
@dispatchOperate="dispatchOperate"
|
2019-10-14 15:35:11 +08:00
|
|
|
@refresh="refresh"
|
2019-08-08 13:36:53 +08:00
|
|
|
/>
|
2020-11-18 13:22:53 +08:00
|
|
|
<!-- <edit-smooth-run-time ref="editSmoothRunTime" @dispatchDialog="dispatchDialog" /> -->
|
|
|
|
<!-- <add-smooth-run-time ref="addSmoothRunTime" @dispatchDialog="dispatchDialog" /> -->
|
2019-10-31 17:30:24 +08:00
|
|
|
<duplicate-train ref="duplicateTrain" @dispatchDialog="dispatchDialog" @dispatchOperate="dispatchOperate" @refresh="refresh" />
|
2020-12-22 17:27:04 +08:00
|
|
|
<move-planing-train ref="movePlaningTrain" :load-run-plan-id="loadRunPlanId" @dispatchDialog="dispatchDialog" @dispatchOperate="dispatchOperate" @refresh="refresh" />
|
2019-08-08 13:36:53 +08:00
|
|
|
<modifying-routing ref="modifyingRouting" @dispatchDialog="dispatchDialog" />
|
|
|
|
<modifying-begin-time ref="modifyingBeginTime" />
|
|
|
|
|
|
|
|
<systerm-out ref="systermOut" />
|
2019-10-31 17:30:24 +08:00
|
|
|
<add-task ref="addTask" @dispatchOperate="dispatchOperate" @refresh="refresh" />
|
|
|
|
<delete-task ref="deleteTask" @dispatchOperate="dispatchOperate" @refresh="refresh" />
|
2020-08-14 18:30:04 +08:00
|
|
|
<modifying-task ref="modifyingTask" :load-run-plan-id="loadRunPlanId" @dispatchOperate="dispatchOperate" @refresh="refresh" />
|
2019-08-08 13:36:53 +08:00
|
|
|
|
|
|
|
<edit-station-between-time ref="editStationBetweenTime" />
|
|
|
|
|
|
|
|
<modifying-station-interval-time ref="modifyingStationIntervalTime" />
|
2020-12-04 17:10:03 +08:00
|
|
|
<modifying-station-stop-time ref="modifyingStationStopTime" />
|
2020-08-14 10:55:32 +08:00
|
|
|
<populating-generic-data ref="populatingGenericData" :load-run-plan-id="loadRunPlanId" />
|
|
|
|
<create-empty-plan ref="createEmptyPlan" @refresh="refreshRunPlanList" />
|
|
|
|
<edit-plan-name ref="editPlan" @renewal="refreshRunPlanName" />
|
2020-12-09 17:03:22 +08:00
|
|
|
<gernarate-plan ref="gernaratePlanTrain" />
|
2019-08-08 13:36:53 +08:00
|
|
|
</div>
|
2019-07-26 13:32:43 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-08-08 13:36:53 +08:00
|
|
|
import MenuBar from './menuBar';
|
|
|
|
import StatusBar from './statusBar';
|
|
|
|
import Schedule from './schedule';
|
|
|
|
import Parameter from './menus/parameter/index';
|
|
|
|
import OffLine from './menus/offLine';
|
|
|
|
import AddPlanningTrain from './menus/addPlanningTrain';
|
|
|
|
import EditPlanningTrain from './menus/editPlanningTrain';
|
2020-08-14 10:55:32 +08:00
|
|
|
import EditPlanName from './menus/editPlanName';
|
2019-08-08 13:36:53 +08:00
|
|
|
import DuplicateTrain from './menus/duplicateTrain';
|
|
|
|
import SystermOut from './menus/systermOut';
|
|
|
|
import AddTask from './menus/addTask';
|
|
|
|
import DeleteTask from './menus/deleteTask';
|
|
|
|
import ModifyingTask from './menus/modifyingTask';
|
|
|
|
import ModifyingRouting from './menus/modifyingRouting';
|
|
|
|
import ModifyingBeginTime from './menus/modifyingBeginTime';
|
|
|
|
import EditStationBetweenTime from './menus/editStationBetweenTime';
|
2020-12-09 17:03:22 +08:00
|
|
|
import GernaratePlan from './menus/gernaratePlanTrain';
|
2020-12-22 17:27:04 +08:00
|
|
|
import MovePlaningTrain from './menus/movePlaningTrain';
|
2020-11-18 13:22:53 +08:00
|
|
|
// import AddSmoothRunTime from './menus/addSmoothRunTime';
|
|
|
|
// import EditSmoothRunTime from './menus/editSmoothRunTime';
|
2019-08-08 13:36:53 +08:00
|
|
|
import ModifyingStationIntervalTime from './menus/modifyingStationIntervalTime';
|
2020-12-04 17:10:03 +08:00
|
|
|
import ModifyingStationStopTime from './menus/modifyingStationStopTime';
|
2020-08-14 10:55:32 +08:00
|
|
|
import PopulatingGenericData from './menus/populatingGenericData';
|
|
|
|
import CreateEmptyPlan from './menus/createEmptyPlan';
|
2019-08-08 13:36:53 +08:00
|
|
|
import { deletePlanService } from '@/api/runplan';
|
2019-09-27 10:53:48 +08:00
|
|
|
import { checkLoginLine } from '@/api/login';
|
2020-08-14 10:55:32 +08:00
|
|
|
import { getRpListByMapId } from '@/api/runplan';
|
2020-12-04 17:10:03 +08:00
|
|
|
import { getPublishMapDetailById } from '@/api/jmap/map';
|
2019-08-08 13:36:53 +08:00
|
|
|
|
|
|
|
export default {
|
2019-10-31 17:30:24 +08:00
|
|
|
name: 'Menus',
|
|
|
|
components: {
|
|
|
|
MenuBar,
|
|
|
|
StatusBar,
|
|
|
|
Schedule,
|
2020-08-14 18:30:04 +08:00
|
|
|
PopulatingGenericData,
|
2019-10-31 17:30:24 +08:00
|
|
|
Parameter,
|
|
|
|
OffLine,
|
|
|
|
AddPlanningTrain,
|
|
|
|
EditPlanningTrain,
|
|
|
|
DuplicateTrain,
|
|
|
|
SystermOut,
|
|
|
|
AddTask,
|
|
|
|
DeleteTask,
|
|
|
|
ModifyingTask,
|
|
|
|
ModifyingRouting,
|
|
|
|
ModifyingBeginTime,
|
|
|
|
EditStationBetweenTime,
|
2020-11-18 13:22:53 +08:00
|
|
|
// AddSmoothRunTime,
|
|
|
|
// EditSmoothRunTime,
|
2020-08-14 10:55:32 +08:00
|
|
|
ModifyingStationIntervalTime,
|
2020-12-04 17:10:03 +08:00
|
|
|
ModifyingStationStopTime,
|
2020-08-14 10:55:32 +08:00
|
|
|
CreateEmptyPlan,
|
2020-12-09 17:03:22 +08:00
|
|
|
EditPlanName,
|
2020-12-22 17:27:04 +08:00
|
|
|
GernaratePlan,
|
|
|
|
MovePlaningTrain
|
2019-10-31 17:30:24 +08:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
PlanConvert: {},
|
2020-08-14 10:55:32 +08:00
|
|
|
timeDemon: null,
|
|
|
|
runPlanList: [],
|
|
|
|
loadRunPlanId: '',
|
|
|
|
loadRunPlanName: ''
|
2019-10-31 17:30:24 +08:00
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
2019-11-11 15:54:04 +08:00
|
|
|
lineCode() {
|
|
|
|
return this.$route.query.lineCode || '02';
|
2019-10-31 17:30:24 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
created() {
|
2019-11-11 15:54:04 +08:00
|
|
|
this.PlanConvert = this.$theme.loadPlanConvert(this.lineCode);
|
2019-10-31 17:30:24 +08:00
|
|
|
},
|
2020-12-04 17:10:03 +08:00
|
|
|
async mounted() {
|
2019-10-31 17:30:24 +08:00
|
|
|
this.timeDemon = setInterval(() => {
|
|
|
|
checkLoginLine();
|
2019-11-14 10:50:11 +08:00
|
|
|
}, 5000 * 60);
|
2020-08-14 10:55:32 +08:00
|
|
|
if (this.$route.query.mapId) {
|
|
|
|
this.refreshRunPlanList(true);
|
2020-12-04 17:10:03 +08:00
|
|
|
await this.loadMap();
|
2020-08-14 10:55:32 +08:00
|
|
|
}
|
2019-10-31 17:30:24 +08:00
|
|
|
},
|
|
|
|
beforeDestroy() {
|
|
|
|
if (this.timeDemon) {
|
|
|
|
clearTimeout(this.timeDemon);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
dispatchDialog(dialogObj) {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
if (this.$refs[dialogObj.name]) {
|
|
|
|
this.$refs[dialogObj.name].doShow(dialogObj.params);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
dispatchOperate(operateObj) {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
if (this.$refs[operateObj.dialogName]) {
|
|
|
|
this.$refs[operateObj.dialogName][operateObj.operate](operateObj.params);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
2020-12-04 17:10:03 +08:00
|
|
|
async loadMap() {
|
|
|
|
const res = await getPublishMapDetailById(this.$route.query.mapId);
|
|
|
|
if (res && res.code == 200) {
|
|
|
|
this.$store.dispatch('map/setMapData', res.data.graphDataNew);
|
|
|
|
}
|
|
|
|
},
|
2019-10-31 17:30:24 +08:00
|
|
|
handleConfirm(params) {
|
|
|
|
if (params.operate == 'AddPlanningTrain') {
|
|
|
|
// 添加计划
|
|
|
|
this.$refs.addPlanningTrain.handleConfirm();
|
|
|
|
} else if (params.operate == 'DeletePlanningTrain') {
|
|
|
|
// 删除计划
|
|
|
|
const model = {
|
|
|
|
planId: this.$route.query.planId,
|
|
|
|
serviceNumber: params.serviceNumber
|
2019-10-14 15:35:11 +08:00
|
|
|
};
|
2019-10-31 17:30:24 +08:00
|
|
|
deletePlanService(model).then(resp => {
|
|
|
|
this.$message.success(this.$t('tip.deletePlanSuccessfully'));
|
2019-10-14 15:35:11 +08:00
|
|
|
this.$store.dispatch('runPlan/setSelected', {});
|
|
|
|
this.$store.dispatch('runPlan/refresh');
|
2019-10-31 17:30:24 +08:00
|
|
|
// this.$refs.openRunPlan.loadRunPlanData(Object.assign({refresh: true}, this.$route.query));
|
|
|
|
}).catch(() => {
|
|
|
|
this.$messageBox(this.$t('tip.deletePlanFailed'));
|
|
|
|
});
|
|
|
|
}
|
2019-10-14 15:35:11 +08:00
|
|
|
},
|
2019-10-31 17:30:24 +08:00
|
|
|
showTrain() {
|
|
|
|
if (this.$refs.schedule) {
|
|
|
|
this.$refs.schedule.displayTrain();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
refresh() {
|
2019-10-14 15:35:11 +08:00
|
|
|
this.$store.dispatch('runPlan/refresh');
|
2020-08-14 10:55:32 +08:00
|
|
|
},
|
|
|
|
refreshRunPlanList(firstLoad) {
|
|
|
|
getRpListByMapId(this.$route.query.mapId).then(resp => {
|
|
|
|
this.runPlanList = resp.data || [];
|
|
|
|
if (firstLoad && this.runPlanList.length) {
|
|
|
|
this.loadRunPlanId = this.runPlanList[0].id;
|
|
|
|
this.loadRunPlanName = this.runPlanList[0].name;
|
|
|
|
}
|
|
|
|
}).catch(() => {
|
|
|
|
this.$message.error('获取草稿运行图列表失败');
|
|
|
|
});
|
|
|
|
},
|
|
|
|
doClose() {
|
|
|
|
this.$emit('doClose');
|
|
|
|
},
|
|
|
|
loadingRunPlan(param) {
|
|
|
|
this.loadRunPlanId = param.planId;
|
|
|
|
this.loadRunPlanName = param.planName;
|
|
|
|
},
|
|
|
|
checkIsLoadRunPlan(planId) {
|
|
|
|
this.refreshRunPlanList(planId === this.loadRunPlanId);
|
|
|
|
},
|
|
|
|
modifyRunPlanName() {
|
|
|
|
if (this.loadRunPlanId && this.loadRunPlanName) {
|
|
|
|
this.$refs.editPlan.doShow({id: this.loadRunPlanId, name: this.loadRunPlanName});
|
|
|
|
} else {
|
|
|
|
this.$message.info(this.$t('planMonitor.openRunPlan.pleaseSelectRunplan'));
|
|
|
|
}
|
|
|
|
},
|
|
|
|
refreshRunPlanName(name) {
|
2020-10-28 13:51:26 +08:00
|
|
|
this.$refs.schedule.refreshRunPlanName(name);
|
2019-10-14 15:35:11 +08:00
|
|
|
}
|
2019-10-31 17:30:24 +08:00
|
|
|
}
|
2019-08-08 13:36:53 +08:00
|
|
|
};
|
2019-07-26 13:32:43 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.plan-tool {
|
|
|
|
position: absolute;
|
|
|
|
}
|
|
|
|
|
|
|
|
.plan-tool .pop-menu {
|
|
|
|
background: #F0F0F0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.plan-tool .pop-menu span {
|
|
|
|
color: #000;
|
|
|
|
}
|
|
|
|
|
|
|
|
.plan-tool .system-close {
|
|
|
|
cursor: pointer;
|
|
|
|
height: 25px;
|
|
|
|
width: 25px;
|
|
|
|
background: -webkit-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
|
|
|
background: -o-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
|
|
|
background: -moz-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
|
|
|
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
|
|
|
border: 1px solid white;
|
|
|
|
border-radius: 4px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.plan-tool .system-close::before {
|
|
|
|
position: absolute;
|
|
|
|
top: 0px;
|
|
|
|
left: 0px;
|
|
|
|
font-size: x-large;
|
|
|
|
}
|
|
|
|
|
|
|
|
.planEdit__tool {
|
|
|
|
overflow: hidden !important;
|
|
|
|
}
|
2019-08-08 13:36:53 +08:00
|
|
|
</style>
|