rt-sim-training-client/src/views/planMonitor/editTool/index.vue

241 lines
8.1 KiB
Vue
Raw Normal View History

2019-07-26 13:32:43 +08:00
<template>
<div class="plan-tool" style="width: 100%; height: 100%;">
<menu-bar
ref="menuBar"
@doClose="doClose"
2020-12-22 17:27:04 +08:00
@refresh="refresh"
@dispatchDialog="dispatchDialog"
@modifyRunPlanName="modifyRunPlanName"
/>
<!-- :load-run-plan-id="loadRunPlanId" -->
<!-- @loadingRunPlan="loadingRunPlan" -->
2021-04-14 17:48:28 +08:00
<!-- @checkIsLoadRunPlan="checkIsLoadRunPlan" -->
2021-04-14 15:17:34 +08:00
<div class="scheduleIn">
<schedule
ref="schedule"
v-loading="runplanLoading"
:plan-parser="PlanParser"
:load-run-plan-name="loadRunPlanName"
/>
<!-- :load-run-plan-id="loadRunPlanId" -->
<status-bar ref="statusBar" @dispatchDialog="dispatchDialog" @showTrain="showTrain" @refresh="refresh" />
<!-- :load-run-plan-id="loadRunPlanId" -->
2021-04-14 15:17:34 +08:00
</div>
2019-08-08 13:36:53 +08:00
<parameter ref="parameter" />
2021-04-14 15:30:52 +08:00
<!-- 删除计划 -->
2019-08-08 13:36:53 +08:00
<off-line ref="offLine" @handleConfirm="handleConfirm" @dispatchDialog="dispatchDialog" />
<add-planning-train ref="addPlanningTrain" @dispatchDialog="dispatchDialog" />
<!-- :load-run-plan-id="loadRunPlanId" -->
2019-08-08 13:36:53 +08:00
<edit-planning-train
ref="editPlanningTrain"
@dispatchDialog="dispatchDialog"
@dispatchOperate="dispatchOperate"
@refresh="refresh"
2019-08-08 13:36:53 +08:00
/>
2021-04-14 15:30:52 +08:00
<!-- 复制计划 -->
<duplicate-train ref="duplicateTrain" @dispatchDialog="dispatchDialog" @dispatchOperate="dispatchOperate" @refresh="refresh" />
2021-04-14 15:30:52 +08:00
<!-- 移动计划 -->
2020-12-22 17:27:04 +08:00
<move-planing-train ref="movePlaningTrain" :load-run-plan-id="loadRunPlanId" @dispatchDialog="dispatchDialog" @dispatchOperate="dispatchOperate" @refresh="refresh" />
2021-04-14 15:30:52 +08:00
<!-- 检查运行图-->
2019-08-08 13:36:53 +08:00
<systerm-out ref="systermOut" />
2021-12-09 17:56:54 +08:00
<!-- <add-task ref="addTask" @dispatchOperate="dispatchOperate" @refresh="refresh" /> -->
<!-- <delete-task ref="deleteTask" @dispatchOperate="dispatchOperate" @refresh="refresh" /> -->
<task-dialog ref="showDialog" @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
<modifying-station-interval-time ref="modifyingStationIntervalTime" />
2020-12-04 17:10:03 +08:00
<modifying-station-stop-time ref="modifyingStationStopTime" />
<edit-plan-name ref="editPlan" @renewal="refreshRunPlanName" />
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';
2021-04-14 16:43:09 +08:00
import Schedule from '../components/schedule';
2019-08-08 13:36:53 +08:00
import Parameter from './menus/parameter/index';
2021-03-09 15:41:05 +08:00
import OffLine from '../components/menus/offLine';
import AddPlanningTrain from '../components/menus/addPlanningTrain';
2021-03-09 17:11:58 +08:00
import EditPlanningTrain from '../components/menus/editPlanningTrain';
import EditPlanName from '../components/menus/editPlanName';
import DuplicateTrain from '../components/menus/duplicateTrain';
import SystermOut from '../components/menus/systermOut';
2021-12-09 17:56:54 +08:00
import TaskDialog from '../components/menus/taskDialog';
2021-03-09 17:11:58 +08:00
import ModifyingTask from '../components/menus/modifyingTask';
2021-03-09 15:57:59 +08:00
import MovePlaningTrain from '../components/menus/movePlaningTrain';
2021-03-09 14:45:50 +08:00
import ModifyingStationIntervalTime from '../components/menus/modifyingStationIntervalTime';
import ModifyingStationStopTime from '../components/menus/modifyingStationStopTime';
2019-08-08 13:36:53 +08:00
import { deletePlanService } from '@/api/runplan';
import { loadMapDataById } from '@/utils/loaddata';
2019-08-08 13:36:53 +08:00
export default {
name: 'Menus',
components: {
MenuBar,
StatusBar,
Schedule,
Parameter,
OffLine,
AddPlanningTrain,
EditPlanningTrain,
DuplicateTrain,
SystermOut,
2021-12-09 17:56:54 +08:00
TaskDialog,
ModifyingTask,
2020-11-18 13:22:53 +08:00
// AddSmoothRunTime,
// EditSmoothRunTime,
ModifyingStationIntervalTime,
2020-12-04 17:10:03 +08:00
ModifyingStationStopTime,
2020-12-09 17:03:22 +08:00
EditPlanName,
2020-12-22 17:27:04 +08:00
MovePlaningTrain
},
data() {
return {
2021-03-17 13:35:15 +08:00
PlanParser: {},
runPlanList: [],
loadRunPlanId: '',
loadRunPlanName: '',
runplanLoading:false
};
},
computed: {
2019-11-11 15:54:04 +08:00
lineCode() {
return this.$route.query.lineCode || '02';
}
},
watch: {
'$store.state.map.mapDataLoadedCount': function (val) {
this.loadRunPlanId = this.$route.query.planId;
this.runplanLoading = false;
}
},
created() {
2021-03-17 13:35:15 +08:00
this.PlanParser = this.$theme.loadPlanParser(this.lineCode);
},
2020-12-04 17:10:03 +08:00
async mounted() {
2020-12-23 09:40:57 +08:00
this.loadRunPlanName = this.$route.query.planName;
if (this.$route.query.mapId) {
2021-04-14 17:48:28 +08:00
// this.refreshRunPlanList(true);
2020-12-04 17:10:03 +08:00
await this.loadMap();
}
},
beforeDestroy() {
},
methods: {
dispatchDialog(dialogObj) {
this.$nextTick(() => {
2021-04-14 15:17:34 +08:00
if (dialogObj.name == 'generateRouting') {
this.$refs['menuBar'].handleGernarateRouting();
} else {
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() {
this.runplanLoading = true;
// 加载地图数据
loadMapDataById(this.$route.query.mapId, 'parse');
2020-12-04 17:10:03 +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
};
deletePlanService(model).then(resp => {
this.$message.success(this.$t('tip.deletePlanSuccessfully'));
this.$store.dispatch('runPlan/setSelected', {});
this.$store.dispatch('runPlan/refresh');
// this.$refs.openRunPlan.loadRunPlanData(Object.assign({refresh: true}, this.$route.query));
}).catch(() => {
this.$messageBox(this.$t('tip.deletePlanFailed'));
});
}
},
showTrain() {
if (this.$refs.schedule) {
this.$refs.schedule.displayTrain();
}
},
refresh() {
this.$store.dispatch('runPlan/refresh');
},
2021-04-14 17:48:28 +08:00
// refreshRunPlanList(firstLoad) {
2020-12-23 09:40:57 +08:00
2021-04-14 17:48:28 +08:00
// },
doClose() {
this.$emit('doClose');
},
// loadingRunPlan(param) {
// // this.loadRunPlanId = param.planId;
// this.loadRunPlanName = param.planName;
// },
checkIsLoadRunPlan(planId) {
2021-04-14 17:48:28 +08:00
// 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);
this.$router.replace({ path: this.$route.path, query: { ...this.$route.query, planName: name }});
}
}
2019-08-08 13:36:53 +08:00
};
2019-07-26 13:32:43 +08:00
</script>
<style lang="scss">
2019-07-26 13:32:43 +08:00
.plan-tool {
position: absolute;
2021-04-14 13:57:35 +08:00
overflow: hidden;
2021-12-09 17:56:54 +08:00
// &::before {
// content: '';
// position: absolute;
// width: 100%;
// height: 100%;
// left: 0;
// top: 0;
// background-image: url(https://www.cnblogs.com/skins/imetro/images/background.jpg);
// filter: blur(30px);
2021-12-09 17:56:54 +08:00
// }
2019-07-26 13:32:43 +08:00
}
2021-04-14 15:17:34 +08:00
.scheduleIn{
width:100%;
height: 100%;
padding-top: 45px;
}
2019-07-26 13:32:43 +08:00
.plan-tool .pop-menu {
background: #F0F0F0;
}
.plan-tool .pop-menu span {
color: #000;
}
.planEdit__tool {
overflow: hidden !important;
}
2019-08-08 13:36:53 +08:00
</style>