This commit is contained in:
zyy 2020-12-09 17:08:52 +08:00
commit 1bd1af2df3
14 changed files with 581 additions and 935 deletions

View File

@ -152,6 +152,23 @@ export function deleteRoutingData(routingId) {
});
}
/** 保存用户配置 (新版)*/
export function addRunplanConfig(mapId, data) {
return request({
url: `/api/runPlan/userData/${mapId}/config`,
method: 'post',
data: data
});
}
/** 获取用户配置(新版)*/
export function getRunplanConfig(mapId) {
return request({
url: `/api/runPlan/userData/${mapId}/config`,
method: 'get'
});
}
/** 获取交路详情(新版)*/
export function getRoutingData(routingId) {
return request({

View File

@ -147,10 +147,19 @@ export function checkServiceNumberExist({ planId, serviceNumber }) {
});
}
/** 查询交路列表*/
export function getRoutingList(planId) {
// /** 查询交路列表*/
// export function getRoutingList(planId) {
// return request({
// url: `/api/runPlan/draft/${planId}/routingList`,
// method: 'get'
// });
// }
/** 查询用户交路数据 (新版)*/
export function listUserRoutingData(mapId) {
return request({
url: `/api/runPlan/draft/${planId}/routingList`,
// url: `/api/mapBuild/${mapId}/routingData`,
url: `/api/runPlan/userData/${mapId}/routing`,
method: 'get'
});
}
@ -233,10 +242,19 @@ export function updatePlanTrip(data) {
});
}
/** 根据车次号查询交路*/
/** 根据车次号查询交路 */
export function getRoutingBySDTNumber(params) {
// 旧版
// return request({
// url: `/api/runPlan/draft/${params.planId}/routing`,
// method: 'get',
// params: {
// SDTNumber: params.SDTNumber
// }
// });
// 新版
return request({
url: `/api/runPlan/draft/${params.planId}/routing`,
url: `/api/runPlan/draft/${params.planId}/userRouting`,
method: 'get',
params: {
SDTNumber: params.SDTNumber
@ -252,6 +270,15 @@ export function updateServiceNumber(planId, serviceNumber, newServiceNumber) {
});
}
/** 生成计划(新版)*/
export function generatePlanTrain(planId, data) {
return request({
url: `/api/runPlan/draft/${planId}/service/generate`,
method: 'post',
data
});
}
/** 修改任务车次号*/
export function updateTripNumber(planId, SDTNumber, tripNumber) {
return request({

View File

@ -1,5 +1,5 @@
<template>
<el-form ref="form" :rules="rules" :model="formModel" :inline="inline" :label-width="form.labelWidth" @submit.native.prevent>
<el-form ref="form" :rules="rules" :model="formModel" :inline="inline" :label-width="form.labelWidth" :size="form.size?form.size:'medium'" @submit.native.prevent>
<template v-for="item in form.items">
<template v-if="checkFieldType(item, 'text')">
<el-form-item :key="item.prop" :prop="item.prop" :label="item.label" :required="item.required">

View File

@ -81,6 +81,7 @@ export default {
modifySuccess: 'Modify Success',
modifyFailed: 'Modify Failed',
modifyRunLevel: 'Modify run level',
modifyStopTime:'Modify stop time',
startStationTips: 'Start station departure time unchanged',
endStationTips: 'End station departure time unchanged',
@ -142,7 +143,7 @@ export default {
afterTheTrainHasBackInterval: 'After the train has a back interval',
secondsCanBeRunnedByTrain: 'seconds can be runned by train',
defaultStopTime: 'Default stop time:',
defaultRunLevel: 'Default run level:',
defaultRunLevel: 'Run level:',
stopTime: 'Stop time',
runLevel: 'Run level',
platform: 'Platform',
@ -236,5 +237,6 @@ export default {
modifyName: 'Modify name',
applyRelease:'Apply for release',
preview:'Preview',
revoke:'Revoke'
revoke:'Revoke',
gerneratePlan:'Gernerate plan'
};

View File

@ -39,7 +39,7 @@ export default {
continuationPlan: '延续计划',
firstTrain: '首班车',
serialNumber: '序列号:',
defaultRunLevel: '缺省运行等级:',
defaultRunLevel: '运行等级:',
startTime: '开始时间',
selectTime: '选择时间',
inStock: '入库',
@ -81,6 +81,7 @@ export default {
modifySuccess: '修改成功!',
modifyFailed: '修改失败',
modifyRunLevel: '修改运行等级',
modifyStopTime:'修改停站时间',
startStationTips: '起始站发车时间不变',
endStationTips: '终到站到达时间不变',
@ -239,5 +240,6 @@ export default {
modifyName: '修改名称',
applyRelease:'申请发布',
preview:'预览',
revoke:'撤回'
revoke:'撤回',
gerneratePlan:'生成计划'
};

View File

@ -45,6 +45,7 @@
<populating-generic-data ref="populatingGenericData" :load-run-plan-id="loadRunPlanId" />
<create-empty-plan ref="createEmptyPlan" @refresh="refreshRunPlanList" />
<edit-plan-name ref="editPlan" @renewal="refreshRunPlanName" />
<gernarate-plan ref="gernaratePlanTrain" />
</div>
</template>
@ -65,6 +66,7 @@ import ModifyingTask from './menus/modifyingTask';
import ModifyingRouting from './menus/modifyingRouting';
import ModifyingBeginTime from './menus/modifyingBeginTime';
import EditStationBetweenTime from './menus/editStationBetweenTime';
import GernaratePlan from './menus/gernaratePlanTrain';
// import AddSmoothRunTime from './menus/addSmoothRunTime';
// import EditSmoothRunTime from './menus/editSmoothRunTime';
import ModifyingStationIntervalTime from './menus/modifyingStationIntervalTime';
@ -100,7 +102,8 @@ export default {
ModifyingStationIntervalTime,
ModifyingStationStopTime,
CreateEmptyPlan,
EditPlanName
EditPlanName,
GernaratePlan
},
data() {
return {

View File

@ -116,6 +116,7 @@
<script>
import { mapGetters } from 'vuex';
import routeMap from './routingoperate/routeMap';
// import RunplanParams from './config/index';
import { planEffectiveCheck, runPlanNotify } from '@/api/runplan';
import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/scripts/ConstDic';
@ -177,18 +178,14 @@ export default {
{
title: this.$t('planMonitor.tool'),
children: [
{
title: this.$t('planMonitor.validityCheck'),
click: this.handlePlanEffectiveCheck
},
{
title: this.$t('planMonitor.testRunningDiagram'),
click: this.handleTestRunPlan
},
{
title: '交路设置',
click: this.handleRoutingSettings
},
{
title: '参数配置',
click: this.handleRunplanParams
},
{
title: '停站时间',
click: this.handleDwellTime
@ -196,6 +193,14 @@ export default {
{
title: '运行等级',
click: this.handleRoutingLevel
},
{
title: this.$t('planMonitor.validityCheck'),
click: this.handlePlanEffectiveCheck
},
{
title: this.$t('planMonitor.testRunningDiagram'),
click: this.handleTestRunPlan
}
]
},
@ -213,6 +218,10 @@ export default {
// {
// type: 'separator'
// },
{
title: '生成计划',
click: this.handleGernaratePlanningTrain
},
{
title: this.$t('planMonitor.addPlan'),
click: this.handleAddPlanningTrain
@ -436,7 +445,11 @@ export default {
},
//
handleRoutingSettings() {
this.$refs.routeMap.doShow();
this.$refs.routeMap.doShow('routeMap');
},
//
handleRunplanParams() {
this.$refs.routeMap.doShow('runplanParams');
},
//
handleDwellTime() {
@ -446,6 +459,10 @@ export default {
handleRoutingLevel() {
this.$emit('dispatchDialog', { name: 'modifyingStationIntervalTime', params: {} });
},
//
handleGernaratePlanningTrain() {
this.$emit('dispatchDialog', { name: 'gernaratePlanTrain', params: {} });
},
//
handlePlanEffectiveCheck() {
const planId = this.$route.query.planId;

View File

@ -12,14 +12,14 @@
:close-on-click-modal="false"
>
<el-row>
<el-col :span="3" style="height: 28px;line-height: 28px;">
<!-- <el-col :span="3" style="height: 28px;line-height: 28px;">
<el-radio v-model="addModel.forward" :label="true">{{ $t('planMonitor.addToTheFront') }}</el-radio>
</el-col>
</el-col> -->
<el-col :span="3" style="margin-left: 10px;height: 28px;line-height: 28px;">
<span>{{ $t('planMonitor.tripNumber')+$t('global.colon') }}</span>
</el-col>
<el-col :span="5">
<el-select v-model="addModel.tripNumber" size="mini" :placeholder="this.$t('global.choose')">
<el-select v-model="addModel.tripNumber" size="mini" :placeholder="this.$t('global.choose')" disabled>
<el-option
v-for="item in tripNumberList"
:key="item.value"
@ -36,15 +36,15 @@
</el-col>
</el-row>
<el-row style="margin-top: 5px;height: 28px;line-height: 28px;">
<el-col :span="3">
<!-- <el-col :span="3">
<el-radio v-model="addModel.forward" :label="false">{{ $t('planMonitor.addToTheEnd') }}</el-radio>
</el-col>
<el-col :span="3" style="margin-left: 10px;height: 28px;line-height: 28px;">
</el-col> -->
<!-- <el-col :span="3" style="margin-left: 10px;height: 28px;line-height: 28px;">
<span>{{ $t('planMonitor.defaultStopTime') }}</span>
</el-col>
<el-col :span="5">
<el-input-number v-model="defaultStopTime" placeholder="请输入时间" size="mini" :controls="false" :min="0" />
<!-- <el-select v-model="defaultStopTime" size="mini" :placeholder="this.$t('global.choose')">
<el-input-number v-model="defaultStopTime" placeholder="请输入时间" size="mini" :controls="false" :min="0" /> -->
<!-- <el-select v-model="defaultStopTime" size="mini" :placeholder="this.$t('global.choose')">
<el-option
v-for="item in defaultStopTimeList"
:key="item.value"
@ -52,8 +52,8 @@
:value="item.value"
/>
</el-select> -->
</el-col>
<el-col :span="3" style="margin-left: 20px;height: 28px;line-height: 28px;">
<!-- </el-col> -->
<el-col :span="3" style="margin-left:10px;height: 28px;line-height: 28px;">
<span>{{ $t('planMonitor.defaultRunLevel') }}</span>
</el-col>
<el-col :span="5">
@ -129,27 +129,38 @@
{{ formatName(scope.row.sectionCode) }}
</template>
</el-table-column>
<el-table-column prop="arriveTime" :label="this.$t('planMonitor.arriveTime')" width="100px" />
<!-- prop="stopTime" -->
<el-table-column :label="this.$t('planMonitor.stopTime')" width="100px">
<template slot-scope="scope">
<el-input v-model="scope.row.stopTime" placeholder="请输入时间" size="mini" @input="changeStopTime(scope.$index, scope.row.stopTime)" />
<!-- prop="arriveTime" -->
<el-table-column :label="this.$t('planMonitor.arriveTime')" width="100px">
<template v-if="scope.$index!=0" slot-scope="scope">
{{ scope.row.arriveTime }}
</template>
</el-table-column>
<!-- prop="stopTime" -->
<el-table-column :label="this.$t('planMonitor.stopTime')" width="100px">
<template v-if="scope.$index!=0&&scope.$index!=addModel.arriveConfigList.length-1" slot-scope="scope">
{{ scope.row.stopTime+'s' }}
<!-- <el-input v-model="scope.row.stopTime" placeholder="请输入时间" size="mini" @input="changeStopTime(scope.$index, scope.row.stopTime)" /> -->
</template>
</el-table-column>
<el-table-column :label="this.$t('planMonitor.departureTime')" width="100px">
<template v-if="scope.$index!=addModel.arriveConfigList.length-1" slot-scope="scope">
{{ scope.row.departureTime }}
</template>
</el-table-column>
<el-table-column prop="departureTime" :label="this.$t('planMonitor.departureTime')" width="100px" />
<el-table-column :label="this.$t('planMonitor.runLevel')">
<template slot-scope="scope">
<span style="font-size:13px;">{{ scope.row.speedLevel }}</span>
<el-input v-model="scope.row.speedLevelTime" style="width:70px" placeholder="请输入运行等级" size="mini" @input="changeSpeedLevelTime(scope.$index, scope.row.speedLevelTime)" />
<span>{{ '('+scope.row.speedLevelTime+'s)' }}</span>
<!-- <el-input v-model="scope.row.speedLevelTime" style="width:70px" placeholder="请输入运行等级" size="mini" @input="changeSpeedLevelTime(scope.$index, scope.row.speedLevelTime)" /> -->
</template>
</el-table-column>
</el-table>
</el-row>
<el-row>
<!-- <el-row>
<el-col :offset="16">
<el-checkbox v-model="showDefault">{{ $t('planMonitor.showDefaultStopTimeAndRunLevel') }}</el-checkbox>
</el-col>
</el-row>
</el-row> -->
<span slot="footer" class="dialog-footer">
<el-button size="medium" @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
@ -158,7 +169,7 @@
</template>
<script>
import { getRoutingList, addPlanTrip, getMapStationRun } from '@/api/runplan';
import { listUserRoutingData, addPlanTrip, getMapStationRunUser, getStationStopTime } from '@/api/runplan';
import { formatTime, formatName } from '@/utils/runPlan';
export default {
@ -170,16 +181,17 @@ export default {
dialogShow: false,
loading: false,
isPlan: false,
showDefault: true,
// showDefault: true,
stopStationMap: {},
stopTimeMap:{},
params: {},
routingList: [],
startStationFilters:[],
endStationFilters:[],
defaultStopTime: '30',
defaultSpeedLevel: 'l3',
// defaultStopTime: '30',
defaultSpeedLevel: 'l1',
addModel: {
forward: false,
// forward: false,
routingCode: '',
endStationCode: '',
startStationCode: '',
@ -215,9 +227,9 @@ export default {
'addModel.startTime': function () {
this.computedDetailList();
},
'defaultStopTime': function () {
this.computedDetailList('defaultStopTime');
},
// 'defaultStopTime': function () {
// this.computedDetailList('defaultStopTime');
// },
'defaultSpeedLevel': function () {
this.computedDetailList('defaultSpeedLevel');
}
@ -225,15 +237,14 @@ export default {
methods: {
loadInitData(params) {
this.isPlan = params.isPlan;
// this.addModel.taskIndex = getUID('task_');
this.addModel.serviceNumber = params.serviceNumber;
this.addModel.planId = this.$route.query.planId;
this.addModel.arriveConfigList = [];
const planId = this.$route.query.planId;
if (planId) {
getRoutingList(planId).then(resp => {
const mapId = this.$route.query.mapId;
listUserRoutingData(mapId).then(resp => {
this.routingList = resp.data;
// debugger;
const startStationFilterMap = {};
const endStationFilterMap = {};
this.routingList.forEach(routing=>{
@ -263,11 +274,17 @@ export default {
const mapId = this.$route.query.mapId;
if (mapId) {
getMapStationRun(mapId).then(resp =>{
const list = resp.data;
getMapStationRunUser(mapId).then(resp =>{
const list = resp.data.list;
list.forEach(elem => {
this.stopStationMap[[elem.startSectionCode, elem.endSectionCode].toString()] = elem;
});
getStationStopTime(mapId).then(response=>{
const stopTimeList = response.data.list;
stopTimeList.forEach(element=>{
this.stopTimeMap[element.stationCode] = {parkingTime:element.parkingTime};
});
});
// if (list && list.length) {
// list.forEach(elem => {
// if (!elem.runPlanLevelVO) {
@ -321,73 +338,92 @@ export default {
}
return runTime;
},
changeSpeedLevelTime(indexs, speedLevelTime) {
const arriveConfigList = Object.assign([], this.addModel.arriveConfigList);
let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000;
arriveConfigList.forEach((elem, index) => {
elem.arriveTime = index ? formatTime(tempTime) : '';
if (index == indexs) { elem.speedLevelTime = speedLevelTime ? Number(speedLevelTime) : 0; }
elem.arriveTime = index ? formatTime(tempTime) : '';
if (index > 0) {
elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
} else {
elem.departureTime = formatTime(tempTime);
}
const realRunlevel = elem.speedLevelTime;
if (index > 0) {
tempTime = tempTime + elem.stopTime + realRunlevel;
} else {
tempTime = tempTime + realRunlevel;
}
});
this.addModel.arriveConfigList = arriveConfigList;
this.addModel.endTime = formatTime(tempTime - this.addModel.arriveConfigList[this.addModel.arriveConfigList.length - 1].stopTime);
},
changeStopTime(indexs, time) {
let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000;
// const runLevel = this.defaultSpeedLevel || 'l3'; //
const arriveConfigList = Object.assign([], this.addModel.arriveConfigList);
arriveConfigList.forEach((elem, index) => {
if (index == indexs) { elem.stopTime = time ? Number(time) : 0; }
elem.arriveTime = index ? formatTime(tempTime) : '';
// const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
// elem.speedLevel = this.defaultSpeedLevel == 'l3' ? `${this.$t('planMonitor.default')}(${runLevelObj.label})` : runLevelObj.label;
if (index > 0) {
elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
} else {
elem.departureTime = formatTime(tempTime);
}
const realRunlevel = elem.speedLevelTime;
if (index > 0) {
tempTime = tempTime + elem.stopTime + realRunlevel;
} else {
tempTime = tempTime + realRunlevel;
}
});
this.addModel.arriveConfigList = arriveConfigList;
this.addModel.endTime = formatTime(tempTime - this.addModel.arriveConfigList[this.addModel.arriveConfigList.length - 1].stopTime);
},
// changeSpeedLevelTime(indexs, speedLevelTime) {
// const arriveConfigList = Object.assign([], this.addModel.arriveConfigList);
// let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000;
// arriveConfigList.forEach((elem, index) => {
// elem.arriveTime = index ? formatTime(tempTime) : '';
// if (index == indexs) { elem.speedLevelTime = speedLevelTime ? Number(speedLevelTime) : 0; }
// elem.arriveTime = index ? formatTime(tempTime) : '';
// if (index > 0) {
// elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
// } else {
// elem.departureTime = formatTime(tempTime);
// }
// const realRunlevel = elem.speedLevelTime;
// if (index > 0) {
// tempTime = tempTime + elem.stopTime + realRunlevel;
// } else {
// tempTime = tempTime + realRunlevel;
// }
// });
// this.addModel.arriveConfigList = arriveConfigList;
// this.addModel.endTime = formatTime(tempTime - this.addModel.arriveConfigList[this.addModel.arriveConfigList.length - 1].stopTime);
// },
// changeStopTime(indexs, time) {
// let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000;
// // const runLevel = this.defaultSpeedLevel || 'l3'; //
// const arriveConfigList = Object.assign([], this.addModel.arriveConfigList);
// arriveConfigList.forEach((elem, index) => {
// if (index == indexs) { elem.stopTime = time ? Number(time) : 0; }
// elem.arriveTime = index ? formatTime(tempTime) : '';
// // const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
// // elem.speedLevel = this.defaultSpeedLevel == 'l3' ? `${this.$t('planMonitor.default')}(${runLevelObj.label})` : runLevelObj.label;
// if (index > 0) {
// elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
// } else {
// elem.departureTime = formatTime(tempTime);
// }
// const realRunlevel = elem.speedLevelTime;
// if (index > 0) {
// tempTime = tempTime + elem.stopTime + realRunlevel;
// } else {
// tempTime = tempTime + realRunlevel;
// }
// });
// this.addModel.arriveConfigList = arriveConfigList;
// this.addModel.endTime = formatTime(tempTime - this.addModel.arriveConfigList[this.addModel.arriveConfigList.length - 1].stopTime);
// },
computedDetailList(type = null) {
if (this.addModel.routingCode) {
const list = Object.assign([], this.addModel.arriveConfigList);
let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000;
const runLevel = this.defaultSpeedLevel || 'l3'; //
const runLevel = this.defaultSpeedLevel || 'l1'; //
list.forEach((elem, index) => {
if (type == 'defaultStopTime' || type == 'routingCode') {
elem.stopTime = parseInt(this.defaultStopTime);
// type == 'defaultStopTime' ||
if (type == 'routingCode') {
// elem.stopTime = parseInt(this.defaultStopTime);
if (this.stopTimeMap[elem.stationCode]) {
// if (index == 0 || index == list.length - 1) {
// elem.stopTime = 0;
// } else {
elem.stopTime = this.stopTimeMap[elem.stationCode].parkingTime;
// }
} else {
elem.stopTime = 0;
}
}
// elem.arriveTime = index ? formatTime(tempTime) : '';
if (index) {
elem.arriveTime = formatTime(tempTime);
} else {
const time = tempTime || this.computedTimeByString('23:59:59') / 1000 + 1;
elem.arriveTime = formatTime(time - elem.stopTime);
}
elem.arriveTime = index ? formatTime(tempTime) : '';
if (index > 0) {
elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
elem.departureTime = formatTime(tempTime + elem.stopTime);
// elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
} else {
elem.departureTime = formatTime(tempTime);
}
const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
if (!elem.speedLevelTime || type == 'defaultSpeedLevel') {
const realRunlevel = this.compuntedRunTime(list, index, runLevel);
elem.speedLevelTime = realRunlevel;
}
elem.speedLevel = this.defaultSpeedLevel == 'l3' ? `${this.$t('planMonitor.default')}(${runLevelObj.label})` : runLevelObj.label;
// if (!elem.speedLevelTime || type == 'defaultSpeedLevel') {
const realRunlevel = this.compuntedRunTime(list, index, runLevel);
elem.speedLevelTime = realRunlevel;
// }
// this.defaultSpeedLevel == 'l1' ? `(${runLevelObj.label})` : runLevelObj.label
elem.speedLevel = runLevelObj.label;
// elem.speedLevelTime = realRunlevel;
if (index > 0) {
tempTime = tempTime + elem.stopTime + elem.speedLevelTime;
} else {
@ -406,8 +442,8 @@ export default {
this.$set(this.addModel, 'arriveConfigList', arriveConfigList);
this.addModel.startStationCode = row.startStationCode;
this.addModel.endStationCode = row.endStationCode;
// this.addModel.endSectionCode = row.endSectionCode;
// this.addModel.startSectionCode = row.startSectionCode;
this.addModel.endSectionCode = row.endSectionCode;
this.addModel.startSectionCode = row.startSectionCode;
this.addModel.routingCode = row.code;
this.computedDetailList('routingCode');
},

View File

@ -15,9 +15,9 @@
<el-col :span="4">
<el-input v-model="model.serviceNumber" disabled size="mini" />
</el-col>
<el-col :span="4" :offset="1">
<!-- <el-col :span="4" :offset="1">
<el-checkbox v-model="model.debugTrain">{{ $t('planMonitor.commissioningTrain') }}</el-checkbox>
</el-col>
</el-col> -->
</el-row>
<el-row style="margin-top: 5px">
{{ $t('planMonitor.task') }}
@ -74,7 +74,7 @@ export default {
isNew:true,
model: {
serviceNumber: '',
debugTrain: false,
// debugTrain: false,
tripConfigList: []
}
};
@ -107,9 +107,9 @@ export default {
id:index + 1,
tripNumber: tripNumber,
startStationCode: resp.data.startStationCode,
startTime: formatTime(trainInfo.stationTimeList[0].secondTime + 7200),
startTime: formatTime(trainInfo.stationTimeList[1].secondTime + 7200),
endStationCode: resp.data.endStationCode,
endTime: formatTime(trainInfo.stationTimeList[lastIndex].secondTime + 7200),
endTime: formatTime(trainInfo.stationTimeList[lastIndex - 1].secondTime + 7200),
routingCode : resp.data.code,
endSectionCode:resp.data.endSectionCode,
startSectionCode:resp.data.startSectionCode,
@ -142,13 +142,14 @@ export default {
const newModel = {
sectionCode:resp.data.parkSectionCodeList[index].sectionCode,
stationCode:newstationTime.stationCode,
speedLevel:'默认',
// speedLevel:'',
arriveTime: formatTime(newstationTime.arriveTime + 7200),
departureTime: formatTime(newstationTime.departureTime + 7200),
stopTime:newstationTime.departureTime - newstationTime.arriveTime
};
if (index < newstationTimeList.length - 1) {
newModel.speedLevelTime = newstationTimeList[index + 1].arriveTime - newstationTime.departureTime;
// newModel.speedLevel=
}
taskObj.arriveConfigList.push(newModel);
});
@ -279,14 +280,18 @@ export default {
if (this.isNew) {
if (this.model.tripConfigList.length > 0) {
this.doClose();
this.model.tripConfigList.map(each=>{
each.startTime = each.arriveConfigList[0].arriveTime;
each.endTime = each.arriveConfigList[each.arriveConfigList.length - 1].departureTime;
});
addPlanService(this.model).then(() => {
this.$emit('refresh');
// this.$emit('dispatchOperate', {
// dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
// });
this.$message.success(this.$t('tip.planCreationSuccessful'));
}).catch(() => {
this.$messageBox(this.$t('tip.createPlanFailed'));
}).catch((error) => {
this.$messageBox(this.$t('tip.createPlanFailed') + error.message);
});
} else {
this.$messageBox('请增加任务');
@ -294,6 +299,10 @@ export default {
} else {
if (this.model.tripConfigList.length > 0) {
this.doClose();
this.model.tripConfigList.map(each=>{
each.startTime = each.arriveConfigList[0].arriveTime;
each.endTime = each.arriveConfigList[each.arriveConfigList.length - 1].departureTime;
});
updatePlanService(this.$route.query.planId, this.model.serviceNumber, this.model).then(() => {
this.$emit('refresh');
// this.$emit('dispatchOperate', {

View File

@ -24,7 +24,8 @@
</el-table-column>
<el-table-column prop="right" label="所属站台">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ formatSelect(scope.row.sectionCode) ?'上行站台':'下行站台' }}</span>
<!-- ?'上行站台':'下行站台' -->
<span style="margin-left: 10px">{{ formatSelect(scope.row.sectionCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="parkingTime" label="停站时间" width="90">
@ -59,7 +60,7 @@ export default {
},
computed: {
title() {
return this.$t('planMonitor.modifying.modifyRunLevel');
return this.$t('planMonitor.modifying.modifyStopTime');
}
},
mounted() {
@ -71,6 +72,7 @@ export default {
},
formatSelect(code) {
const device = this.$store.state.map.map && this.$store.state.map.map.stationStandList.find(ele => ele.standTrackCode == code);
console.log(device.right);
if (device) {
return device.right ? '上行站台' : '下行站台';
}

View File

@ -12,7 +12,88 @@
:close-on-click-modal="false"
>
<el-row>
<el-col :span="4">
<!-- <el-col :span="2">
<el-row>
<el-col :offset="8" class="lineHeight">
<el-checkbox v-model="editModel.trainManual">{{ $t('planMonitor.modifying.manual') }}</el-checkbox>
</el-col>
</el-row>
</el-col> -->
<!-- <el-col :span="6">
<el-row>
<el-col :span="11" :offset="1" class="lineHeight">
<span>{{ $t('planMonitor.modifying.defaultStopTime') }}</span>
</el-col>
<el-col :span="12">
<el-input-number v-model="defaultStopTime" placeholder="请输入时间" size="mini" :controls="false" :min="0" /> -->
<!-- <el-select
v-model="editModel.defaultStopTime"
style="display: inline-black"
size="mini"
:placeholder="$t('planMonitor.modifying.pleaseSelect')"
>
<el-option
v-for="item in defaultStopTimeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> -->
<!-- </el-col>
</el-row>
</el-col> -->
<el-col :span="6">
<el-row>
<el-col :span="9" class="lineHeight">
<span>{{ $t('planMonitor.modifying.serviceNumber') }}</span>
</el-col>
<el-col :span="15">
<el-input v-model="serviceNumber" size="mini" disabled />
</el-col>
</el-row>
</el-col>
<!-- <el-col :span="7" class="lineHeight">
<el-row>
<el-col :span="22" :offset="2">
<el-row>
<el-col :span="6">
<el-checkbox v-model="editModel.clearGuest">{{ $t('planMonitor.modifying.clearGuest') }}</el-checkbox>
</el-col>
<el-col :span="8">
<el-checkbox v-model="editModel.continuationPlan">{{ $t('planMonitor.modifying.continuationPlan') }}</el-checkbox>
</el-col>
<el-col :span="6">
<el-checkbox v-model="editModel.firstTrain">{{ $t('planMonitor.modifying.firstTrain') }}</el-checkbox>
</el-col>
</el-row>
</el-col>
</el-row>
</el-col> -->
<el-col :span="6" class="lineHeight">
<el-row>
<el-col :span="10" :offset="1">
<span>{{ $t('planMonitor.modifying.defaultRunLevel') }}</span>
</el-col>
<el-col :span="12">
<el-select
v-model="defaultSpeedLevel"
style="display: inline-black"
size="mini"
:placeholder="$t('planMonitor.modifying.pleaseSelect')"
>
<el-option
v-for="item in defaultSpeedLevelList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-row>
<el-col :span="9" class="lineHeight">
<span>{{ $t('planMonitor.modifying.tripNumber') }}</span>
@ -29,72 +110,13 @@
</el-col>
</el-row>
</el-col>
<el-col :span="2">
<el-row>
<el-col :offset="8" class="lineHeight">
<el-checkbox v-model="editModel.trainManual">{{ $t('planMonitor.modifying.manual') }}</el-checkbox>
</el-col>
</el-row>
</el-col>
<el-col :span="6">
<el-row>
<el-col :span="11" :offset="1" class="lineHeight">
<span>{{ $t('planMonitor.modifying.defaultStopTime') }}</span>
</el-col>
<el-col :span="12">
<el-input-number v-model="defaultStopTime" placeholder="请输入时间" size="mini" :controls="false" :min="0" />
<!-- <el-select
v-model="editModel.defaultStopTime"
style="display: inline-black"
size="mini"
:placeholder="$t('planMonitor.modifying.pleaseSelect')"
>
<el-option
v-for="item in defaultStopTimeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> -->
</el-col>
</el-row>
</el-col>
<el-col :span="5">
<el-row>
<el-col :span="9" :offset="2" class="lineHeight">
<span>{{ $t('planMonitor.modifying.serviceNumber') }}</span>
</el-col>
<el-col :span="13">
<el-input v-model="serviceNumber" size="mini" disabled />
</el-col>
</el-row>
</el-col>
<el-col :span="7" class="lineHeight">
<el-row>
<el-col :span="22" :offset="2">
<el-row>
<el-col :span="6">
<el-checkbox v-model="editModel.clearGuest">{{ $t('planMonitor.modifying.clearGuest') }}</el-checkbox>
</el-col>
<el-col :span="8">
<el-checkbox v-model="editModel.continuationPlan">{{ $t('planMonitor.modifying.continuationPlan') }}</el-checkbox>
</el-col>
<el-col :span="6">
<el-checkbox v-model="editModel.firstTrain">{{ $t('planMonitor.modifying.firstTrain') }}</el-checkbox>
</el-col>
</el-row>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row>
<el-col :span="4">
<!-- <el-col :span="6">
<el-row>
<el-col :span="9" class="lineHeight">
<span>{{ $t('planMonitor.modifying.serialNumber') }}</span>
</el-col>
<el-col :span="15">
<el-select v-model="editModel.serialNumber" size="mini" style="display: inline-black" :placeholder="$t('planMonitor.modifying.pleaseSelect')">
<el-select v-model="editModel.serialNumber" size="mini" style="display: inline-black" disabled :placeholder="$t('planMonitor.modifying.pleaseSelect')">
<el-option
v-for="item in serialNumberList"
:key="item.value"
@ -104,42 +126,20 @@
</el-select>
</el-col>
</el-row>
</el-col>
<el-col :span="2">
</el-col> -->
<!-- <el-col :span="2">
<el-row>
<el-col :offset="8" class="lineHeight">
<el-checkbox v-model="editModel.serialManual" size="mini">{{ $t('planMonitor.modifying.manual') }}</el-checkbox>
</el-col>
</el-row>
</el-col>
</el-col> -->
<el-col :span="6" class="lineHeight">
<el-row>
<el-col :span="11" :offset="1">
<span>{{ $t('planMonitor.modifying.defaultRunLevel') }}</span>
</el-col>
<el-col :span="12">
<el-select
v-model="editModel.defaultSpeedLevel"
style="display: inline-black"
size="mini"
:placeholder="$t('planMonitor.modifying.pleaseSelect')"
>
<el-option
v-for="item in defaultSpeedLevelList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-col>
</el-row>
</el-col>
<el-col :span="5" class="lineHeight">
<el-row>
<el-col :span="9" :offset="2">
<el-col :span="10" :offset="1">
<span>{{ $t('planMonitor.modifying.startTime') }}</span>
</el-col>
<el-col :span="13">
<el-col :span="12">
<el-time-picker
v-model="editModel.startTime"
:placeholder="$t('planMonitor.modifying.selectTime')"
@ -150,7 +150,7 @@
</el-col>
</el-row>
</el-col>
<el-col :span="7" class="lineHeight">
<!-- <el-col :span="7" class="lineHeight">
<el-row>
<el-col :span="22" :offset="2">
<el-row>
@ -166,7 +166,7 @@
</el-row>
</el-col>
</el-row>
</el-col>
</el-col> -->
</el-row>
<el-row style="margin-bottom: 5px;">
{{ $t('planMonitor.modifying.route') }}
@ -212,27 +212,37 @@
{{ formatName(scope.row.sectionCode) }}
</template>
</el-table-column>
<el-table-column prop="arriveTime" :label="this.$t('planMonitor.arriveTime')" />
<!-- prop="stopTime" -->
<el-table-column :label="this.$t('planMonitor.stopTime')">
<template slot-scope="scope">
<el-input v-model="scope.row.stopTime" placeholder="请输入时间" size="mini" @input="changeStopTime(scope.$index, scope.row.stopTime)" />
<el-table-column :label="this.$t('planMonitor.arriveTime')">
<template v-if="scope.$index!=0" slot-scope="scope">
{{ scope.row.arriveTime }}
</template>
</el-table-column>
<!-- prop="stopTime" -->
<el-table-column :label="this.$t('planMonitor.stopTime')">
<template v-if="scope.$index!=0&&scope.$index!=editModel.arriveConfigList.length-1" slot-scope="scope">
{{ scope.row.stopTime+'s' }}
<!-- <el-input v-model="scope.row.stopTime" placeholder="请输入时间" size="mini" @input="changeStopTime(scope.$index, scope.row.stopTime)" /> -->
</template>
</el-table-column>
<el-table-column :label="this.$t('planMonitor.departureTime')">
<template v-if="scope.$index!=editModel.arriveConfigList.length-1" slot-scope="scope">
{{ scope.row.departureTime }}
</template>
</el-table-column>
<el-table-column prop="departureTime" :label="this.$t('planMonitor.departureTime')" />
<el-table-column :label="this.$t('planMonitor.runLevel')">
<template slot-scope="scope">
{{ scope.row.speedLevel }}
<el-input v-model="scope.row.speedLevelTime" placeholder="请输入运行等级" size="mini" @input="changeSpeedLevelTime(scope.$index, scope.row.speedLevelTime)" />
<span style="font-size:13px;"> {{ scope.row.speedLevel }}</span>
<span>{{ '('+scope.row.speedLevelTime+'s)' }}</span>
<!-- <el-input v-model="scope.row.speedLevelTime" placeholder="请输入运行等级" size="mini" @input="changeSpeedLevelTime(scope.$index, scope.row.speedLevelTime)" /> -->
</template>
</el-table-column>
</el-table>
</el-row>
<el-row>
<!-- <el-row>
<el-col :offset="16">
<el-checkbox v-model="editModel.default">{{ $t('planMonitor.modifying.showDefaultTime') }}</el-checkbox>
</el-col>
</el-row>
</el-row> -->
<span slot="footer" class="dialog-footer">
<el-button size="medium" @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
@ -240,7 +250,7 @@
</el-dialog>
</template>
<script>
import { getRoutingBySDTNumber, updatePlanTrip, getMapStationRun } from '@/api/runplan';
import { getRoutingBySDTNumber, updatePlanTrip, getMapStationRunUser, getStationStopTime } from '@/api/runplan';
import { formatTime, formatName } from '@/utils/runPlan';
export default {
@ -263,8 +273,9 @@ export default {
PlanConvert: {},
parkSectionCodeList:[],
stopStationMap: {},
defaultStopTime: 0,
defaultSpeedLevel: 'l3',
stopTimeMap:{},
// defaultStopTime: 0,
defaultSpeedLevel: 'l1',
routingList: [],
tripNumber: '',
serviceNumber: '',
@ -289,7 +300,7 @@ export default {
tripNumberList: [{ value: '', label: this.$t('planMonitor.modifying.automatic') }],
// defaultStopTimeList: [{ value: '', label: this.$t('planMonitor.modifying.default') }],
// defaultSpeedLevelList: [{ value: '', label: this.$t('planMonitor.modifying.default') }],
serialNumberList: [],
// serialNumberList: [],
defaultSpeedLevelList: [
{ value: 'l1', label: '等级一' },
{ value: 'l2', label: '等级二' },
@ -308,9 +319,9 @@ export default {
'editModel.startTime': function () {
this.computedDetailList();
},
'defaultStopTime': function () {
this.computedDetailList('defaultStopTime');
},
// 'defaultStopTime': function () {
// this.computedDetailList('defaultStopTime');
// },
'defaultSpeedLevel': function () {
this.computedDetailList('defaultSpeedLevel');
}
@ -334,35 +345,50 @@ export default {
if (stopStationObj) {
if (stopStationObj.runPlanLevelVO) {
runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]);
} else if (stopStationObj['l3']) {
runTime = parseInt(stopStationObj['l3']);
} else if (stopStationObj[runLevel]) {
runTime = parseInt(stopStationObj[runLevel]);
}
}
}
return runTime;
},
computedDetailList(type = null) {
if (this.editModel.routingCode) {
const list = Object.assign([], this.editModel.arriveConfigList);
let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000;
const runLevel = this.defaultSpeedLevel || 'l3'; //
const runLevel = this.defaultSpeedLevel || 'l1'; //
list.forEach((elem, index) => {
if (type == 'defaultStopTime' || type == 'routingCode') {
elem.stopTime = parseInt(this.defaultStopTime);
// type == 'defaultStopTime' ||
if (type == 'routingCode') {
// elem.stopTime = parseInt(this.defaultStopTime);
if (this.stopTimeMap[elem.stationCode]) {
elem.stopTime = this.stopTimeMap[elem.stationCode].parkingTime;
} else {
elem.stopTime = 0;
}
}
// elem.arriveTime = index ? formatTime(tempTime) : '';
if (index) {
elem.arriveTime = formatTime(tempTime);
} else {
const time = tempTime || this.computedTimeByString('23:59:59') / 1000 + 1;
elem.arriveTime = formatTime(time - elem.stopTime);
}
elem.arriveTime = index ? formatTime(tempTime) : '';
if (index > 0) {
elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
// elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
elem.departureTime = formatTime(tempTime + elem.stopTime);
} else {
elem.departureTime = formatTime(tempTime);
}
const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
if (!elem.speedLevelTime || type == 'defaultSpeedLevel') {
const realRunlevel = this.compuntedRunTime(list, index, runLevel);
elem.speedLevelTime = realRunlevel;
}
elem.speedLevel = this.defaultSpeedLevel == 'l3' ? `${this.$t('planMonitor.default')}(${runLevelObj.label})` : runLevelObj.label;
// if (!elem.speedLevelTime || type == 'defaultSpeedLevel') {
const realRunlevel = this.compuntedRunTime(list, index, runLevel);
elem.speedLevelTime = realRunlevel;
// }
// this.defaultSpeedLevel == 'l1' ? `(${runLevelObj.label})` : runLevelObj.label
elem.speedLevel = runLevelObj.label;
// elem.speedLevelTime = realRunlevel;
if (index > 0) {
tempTime = tempTime + elem.stopTime + elem.speedLevelTime;
} else {
@ -382,34 +408,46 @@ export default {
this.planId = this.$route.query.planId;
this.PlanConvert = this.$theme.loadPlanConvert(lineCode);
if (mapId) {
getMapStationRun(mapId).then(resp => {
const list = resp.data;
getMapStationRunUser(mapId).then(resp => {
const list = resp.data.list;
list.forEach(elem => {
this.stopStationMap[[elem.startSectionCode, elem.endSectionCode].toString()] = elem;
});
getStationStopTime(mapId).then(response=>{
const stopTimeList = response.data.list;
stopTimeList.forEach(element=>{
this.stopTimeMap[element.stationCode] = {parkingTime:element.parkingTime};
});
this.initTaskData(params);
this.dialogShow = true;
});
});
}
// this.routingList
},
initTaskData(params) {
if (params.rowData && params.rowData.arriveConfigList.length > 0) {
this.editModel.arriveConfigList = params.rowData.arriveConfigList;
this.editModel.routingCode = params.rowData.routingCode;
this.editModel.startStationCode = params.rowData.startStationCode;
this.editModel.endStationCode = params.rowData.endStationCode;
this.editModel.startTime = params.rowData.startTime;
this.editModel.endTime = params.rowData.endTime;
this.editModel.endSectionCode = params.rowData.endSectionCode;
this.editModel.startSectionCode = params.rowData.startSectionCode;
this.editModel.id = params.rowData.id;
const paramData = params.rowData;
this.initRunlevel(paramData);
// const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.label == ; });
this.editModel.arriveConfigList = paramData.arriveConfigList;
this.editModel.routingCode = paramData.routingCode;
this.editModel.startStationCode = paramData.startStationCode;
this.editModel.endStationCode = paramData.endStationCode;
this.editModel.startTime = paramData.startTime;
this.editModel.endTime = paramData.endTime;
this.editModel.endSectionCode = paramData.endSectionCode;
this.editModel.startSectionCode = paramData.startSectionCode;
this.editModel.id = paramData.id;
this.routingList = [];
this.routingList.push({
code:params.rowData.routingCode,
startStationCode:params.rowData.startStationCode,
endStationCode:params.rowData.endStationCode,
endSectionCode:params.rowData.endSectionCode,
startSectionCode:params.rowData.startSectionCode
code:paramData.routingCode,
startStationCode:paramData.startStationCode,
endStationCode:paramData.endStationCode,
endSectionCode:paramData.endSectionCode,
startSectionCode:paramData.startSectionCode
});
this.computedDetailList();
this.dialogShow = true;
} else {
const model = {
planId: this.$route.query.planId || this.loadRunPlanId,
@ -467,7 +505,7 @@ export default {
const newModel = {
sectionCode:resp.data.parkSectionCodeList[index].sectionCode,
stationCode:newstationTime.stationCode,
speedLevel:'默认',
// speedLevel:'',
arriveTime: formatTime(newstationTime.arriveTime + 7200),
departureTime: formatTime(newstationTime.departureTime + 7200),
stopTime:newstationTime.departureTime - newstationTime.arriveTime
@ -477,58 +515,88 @@ export default {
}
this.editModel.arriveConfigList.push(newModel);
});
this.initRunlevel(this.editModel);
this.dialogShow = true;
this.computedDetailList();
}
});
}
},
changeStopTime(indexs, time) {
let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000;
// const runLevel = this.defaultSpeedLevel || 'l3'; //
const arriveConfigList = Object.assign([], this.editModel.arriveConfigList);
arriveConfigList.forEach((elem, index) => {
if (index == indexs) { elem.stopTime = time ? Number(time) : 0; }
elem.arriveTime = index ? formatTime(tempTime) : '';
// const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
// elem.speedLevel = this.defaultSpeedLevel == 'l3' ? `${this.$t('planMonitor.default')}(${runLevelObj.label})` : runLevelObj.label;
if (index > 0) {
elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
} else {
elem.departureTime = formatTime(tempTime);
}
const realRunlevel = elem.speedLevelTime;
if (index > 0) {
tempTime = tempTime + elem.stopTime + realRunlevel;
} else {
tempTime = tempTime + realRunlevel;
}
});
this.editModel.arriveConfigList = arriveConfigList;
this.editModel.endTime = formatTime(tempTime - this.editModel.arriveConfigList[this.editModel.arriveConfigList.length - 1].stopTime);
},
changeSpeedLevelTime(indexs, speedLevelTime) {
const arriveConfigList = Object.assign([], this.editModel.arriveConfigList);
let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000;
arriveConfigList.forEach((elem, index) => {
elem.arriveTime = index ? formatTime(tempTime) : '';
if (index == indexs) { elem.speedLevelTime = speedLevelTime ? Number(speedLevelTime) : 0; }
elem.arriveTime = index ? formatTime(tempTime) : '';
if (index > 0) {
elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
} else {
elem.departureTime = formatTime(tempTime);
}
const realRunlevel = elem.speedLevelTime;
if (index > 0) {
tempTime = tempTime + elem.stopTime + realRunlevel;
} else {
tempTime = tempTime + realRunlevel;
}
});
this.editModel.arriveConfigList = arriveConfigList;
this.editModel.endTime = formatTime(tempTime - this.editModel.arriveConfigList[this.editModel.arriveConfigList.length - 1].stopTime);
initRunlevel(paramData) {
const speedLevelData = this.stopStationMap[[paramData.arriveConfigList[0].sectionCode, paramData.arriveConfigList[1].sectionCode].toString()];
switch (paramData.arriveConfigList[0].speedLevelTime) {
case speedLevelData.l1: {
this.defaultSpeedLevel = 'l1';
break;
}
case speedLevelData.l2: {
this.defaultSpeedLevel = 'l2';
break;
}
case speedLevelData.l3: {
this.defaultSpeedLevel = 'l3';
break;
}
case speedLevelData.l4: {
this.defaultSpeedLevel = 'l4';
break;
}
case speedLevelData.l5: {
this.defaultSpeedLevel = 'l5';
break;
}
default: {
this.defaultSpeedLevel = 'l1';
break;
}
}
},
// changeStopTime(indexs, time) {
// let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000;
// // const runLevel = this.defaultSpeedLevel || 'l3'; //
// const arriveConfigList = Object.assign([], this.editModel.arriveConfigList);
// arriveConfigList.forEach((elem, index) => {
// if (index == indexs) { elem.stopTime = time ? Number(time) : 0; }
// elem.arriveTime = index ? formatTime(tempTime) : '';
// // const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
// // elem.speedLevel = this.defaultSpeedLevel == 'l3' ? `${this.$t('planMonitor.default')}(${runLevelObj.label})` : runLevelObj.label;
// if (index > 0) {
// elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
// } else {
// elem.departureTime = formatTime(tempTime);
// }
// const realRunlevel = elem.speedLevelTime;
// if (index > 0) {
// tempTime = tempTime + elem.stopTime + realRunlevel;
// } else {
// tempTime = tempTime + realRunlevel;
// }
// });
// this.editModel.arriveConfigList = arriveConfigList;
// this.editModel.endTime = formatTime(tempTime - this.editModel.arriveConfigList[this.editModel.arriveConfigList.length - 1].stopTime);
// },
// changeSpeedLevelTime(indexs, speedLevelTime) {
// const arriveConfigList = Object.assign([], this.editModel.arriveConfigList);
// let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000;
// arriveConfigList.forEach((elem, index) => {
// elem.arriveTime = index ? formatTime(tempTime) : '';
// if (index == indexs) { elem.speedLevelTime = speedLevelTime ? Number(speedLevelTime) : 0; }
// elem.arriveTime = index ? formatTime(tempTime) : '';
// if (index > 0) {
// elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
// } else {
// elem.departureTime = formatTime(tempTime);
// }
// const realRunlevel = elem.speedLevelTime;
// if (index > 0) {
// tempTime = tempTime + elem.stopTime + realRunlevel;
// } else {
// tempTime = tempTime + realRunlevel;
// }
// });
// this.editModel.arriveConfigList = arriveConfigList;
// this.editModel.endTime = formatTime(tempTime - this.editModel.arriveConfigList[this.editModel.arriveConfigList.length - 1].stopTime);
// },
doShow(params) {
this.loadInitData(params);
},
@ -541,8 +609,10 @@ export default {
planId: this.$route.query.planId || this.loadRunPlanId,
routingCode: this.editModel.routingCode,
tripNumber: this.tripNumber,
startTime: this.editModel.startTime,
endTime: this.editModel.endTime,
// startTime: this.editModel.startTime,
startTime:this.editModel.arriveConfigList[0].arriveTime,
// endTime: this.editModel.endTime,
endTime: this.editModel.arriveConfigList[this.editModel.arriveConfigList.length - 1].departureTime,
arriveConfigList: this.editModel.arriveConfigList,
SDTNumber: `${this.serviceNumber}${this.tripNumber}`
};

View File

@ -1,180 +1,13 @@
<template>
<el-dialog title="交路配置" :visible.sync="dialogShow" custom-class="content-route" width="100%" :fullscreen="true" top="0px" :before-close="close" :z-index="2000" :append-to-body="true">
<el-dialog :title="title" :visible.sync="dialogShow" custom-class="content-route" width="100%" :fullscreen="true" top="0px" :before-close="close" :z-index="2000" :append-to-body="true">
<div class="content-box">
<jlmap-visual ref="jlmapVisual" @onMenu="onContextmenu" @onSelect="clickEvent" />
<div style="width: 29%;float: right;" :style="{height: $store.state.app.height-54+'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper">
<div class="clearfix" style="padding-right: 20px;">
<el-button type="text" class="mapEdit_box" @click="previewRouteEvent">{{ $t('map.preview') }}</el-button>
<el-button type="text" class="mapEdit_box" @click="createRouteEvent">{{ $t('map.newConstruction') }}</el-button>
</div>
<el-form ref="form" :model="addModel" :rules="rules" label-width="120px" size="mini">
<div class="definition">
<el-form-item :label="$t('map.routingName')" prop="name">
<el-input v-model="addModel.name" />
</el-form-item>
<el-form-item :label="$t('map.startStationCodeColon')" prop="startStationCode">
<el-select v-model="addModel.startStationCode" clearable :filterable="true" @change="changeStartStation">
<el-option
v-for="item in filterStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'startStationCode' ? 'danger' : 'primary'"
@click="hover('startStationCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.startSectionColon')" prop="startSectionCode">
<el-select v-model="addModel.startSectionCode" clearable :filterable="true" :disabled="editShow" @change="changeStartSection">
<el-option
v-for="item in filterSectionList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:disabled="editShow"
:type=" field === 'startSectionCode' ? 'danger' : 'primary'"
@click="hover('startSectionCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.endStationColon')" prop="endStationCode">
<el-select v-model="addModel.endStationCode" clearable :filterable="true" :disabled="!isStartSelected" @change="changeEndStation">
<el-option
v-for="item in filterStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:disabled="!isStartSelected"
:type=" field === 'endStationCode' ? 'danger' : 'primary'"
@click="hover('endStationCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.endSectionColon')" prop="endSectionCode">
<el-select v-model="addModel.endSectionCode" clearable :filterable="true" :disabled="editShow || !isStartSelected" @change="changeEndSection">
<el-option
v-for="item in filterSectionList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:disabled="editShow || !isStartSelected"
:type=" field === 'endSectionCode' ? 'danger' : 'primary'"
@click="hover('endSectionCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.destinationCode')" prop="destinationCode" :disabled="editShow">
<el-input v-model="addModel.destinationCode" />
</el-form-item>
<el-form-item :label="$t('map.routingDirection')" prop="directionCode">
<el-select v-model="addModel.right" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in DirectionCodeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item v-if="!editShow" label="是否生成回路" prop="withLoop">
<el-checkbox v-model="addModel.withLoop" />
</el-form-item> -->
<el-form-item :label="$t('map.remarksColon')" prop="remarks">
<el-input v-model="addModel.remarks" type="textarea" :rows="4" :placeholder="$t('map.pleaseSelect')" />
</el-form-item>
<el-form-item :label="$t('map.trafficSegmentData')" prop="parkSectionCodeList">
<el-table
:data="addModel.parkSectionCodeList"
border
style="width: 97%"
class="el-parkSectionCode-table"
>
<el-table-column prop="sectionCode" :label="$t('map.stationName')">
<template slot-scope="scope">
<span>{{ formatName(scope.row.stationCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="sectionCode" :label="$t('map.sectionName')">
<template slot-scope="scope">
<span>{{ formatName(scope.row.sectionCode) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('map.operation')" width="50">
<template slot-scope="scope">
<el-button
v-show="scope.$index!=0&&scope.$index!=addModel.parkSectionCodeList.length-1"
type="text"
size="small"
@click.native.prevent="deleteSection(addModel.parkSectionCodeList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
<div style="margin-top:10px;">
<span>车站:</span>
<el-select v-model="stationCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in filterStationList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:disabled="!allowSelect"
:type="field === 'routingStation' ? 'danger' : 'primary'"
@click="hover('routingStation')"
>{{ $t('map.activate') }}</el-button>
</div>
<div style="margin-top:10px;">
<span>区段:</span>
<el-select v-model="sectionCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'routingSection' ? 'danger' : 'primary'"
:disabled="!allowSelect"
@click="hover('routingSection')"
>{{ $t('map.activate') }}</el-button>
<el-button
type="primary"
:disabled="!allowSelect"
@click="pushSection({stationCode: stationCode, sectionCode: sectionCode},'center')"
>
{{ $t('map.add') }}
</el-button>
</div>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
</el-button>
<el-button v-else type="warning" size="small" :loading="loading" @click="update">{{ $t('map.updata') }}
</el-button>
</el-button-group>
</el-form-item>
</div>
</el-form>
</el-scrollbar>
<!-- :style="{height: $store.state.app.height-54+'px' }" -->
<div class="routeMap">
<route-config v-if="type=='routeMap'" ref="routeConfig" />
<runplan-config v-if="type=='runplanParams'" ref="runPlanConfig" />
</div>
</div>
<route-operate ref="routeOperate" @routingSelected="routingSelected" />
</el-dialog>
</template>
@ -182,150 +15,54 @@
import JlmapVisual from '@/views/newMap/jlmapNew/index';
import { loadMapDataById } from '@/utils/loaddata';
import { EventBus } from '@/scripts/event-bus';
import RouteOperate from './routeOperate';
import { mapGetters } from 'vuex';
import { setUID } from '@/jmapNew/utils/Uid';
import { addRoutingData, updateRoutingData } from '@/api/jmap/mapdraft';
import { formatName } from '@/utils/runPlan';
import Sortable from 'sortablejs';
import RouteConfig from './routeConfig';
import RunplanConfig from './runplanConfig';
export default {
name: 'RouteMap',
components: {
JlmapVisual,
RouteOperate
RouteConfig,
RunplanConfig
},
props:{
},
data() {
return {
type:'',
title:'',
dialogShow: false,
oldDevice: null,
field: '',
allowSelect:false,
isStartSelected:false,
stationCode: '',
sectionCode: '',
isSave: true,
loading: false,
oldsection:[],
DirectionCodeList: [{label: '右行', value: true}, {label: '左行', value: false}],
addModel: {
name: '',
mapId: '',
code: '',
// withLoop:false,
right: true,
destinationCode: '',
startStationCode: '',
startSectionCode: '',
endStationCode: '',
endSectionCode: '',
remarks: '',
userId: '',
parkSectionCodeList: []
},
editShow: false,
rules: {
name: [
{ required: true, message: '请输入交路名称', trigger: 'change' }
],
startStationCode: [
{ required: true, message: '请选择起始站', trigger: 'change' }
],
startSectionCode: [
{ required: true, message: '请选择起始区段', trigger: 'change' }
],
endStationCode: [
{ required: true, message: '请选择终到站', trigger: 'change' }
],
endSectionCode: [
{ required: true, message: '请选择终到区段', trigger: 'change' }
]
}
isFirst:true
};
},
computed: {
...mapGetters('map', [
'sectionList',
'stationList'
]),
filterSectionList() {
if (this.sectionList) {
return this.sectionList.filter(elem => { return elem.standTrack || elem.reentryTrack || elem.transferTrack; });
} else {
return [];
}
},
filterStationList() {
if (this.stationList) {
return this.stationList.filter(elem => { return true; });
} else {
return [];
}
},
routeName: {
get() {
var name = '';
if (this.isSave) {
let begStation = ''; let endStation = '';
let begSection = ''; let endSection = '';
if (this.stationList) {
this.stationList.forEach(elem => {
if (elem.code === this.addModel.startStationCode) begStation = elem.name;
if (elem.code === this.addModel.endStationCode) endStation = elem.name;
});
}
if (this.sectionList) {
this.sectionList.forEach(elem => {
if (elem.code === this.addModel.startSectionCode) begSection = '(' + elem.name + ')';
if (elem.code === this.addModel.endSectionCode) endSection = '(' + elem.name + ')';
});
}
name = begStation + begSection + '-' + endStation + endSection;
}
return name;
}
}
},
watch: {
mapInfo(val) {
if (val) {
this.addModel.mapId = val.id;
}
},
'addModel.parkSectionCodeList':function(val, old) {
this.changeSectionSelected(val, true);
},
'$store.state.app.width': function(val) {
this.setWindowSize();
},
routeName(val, old) {
if (val) {
this.addModel.name = val;
}
},
sectionCode(val) {
val && this.changeBelongSection(val);
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
}
},
mounted() {
this.rowDrop();
},
methods: {
async doShow() {
async doShow(type) {
this.type = type;
if (this.type == 'routeMap') {
this.title = '交路配置';
} else if (this.type == 'runplanParams') {
this.title = '参数配置';
}
this.dialogShow = true;
await this.setWindowSize();
await this.loadInitPage();
},
previewRouteEvent() {
this.$refs.routeOperate.doShow();
},
createRouteEvent() {
this.clear();
if (this.isFirst) {
await this.loadInitPage();
}
this.isFirst = false;
if (this.type == 'runplanParams') { this.$refs.runPlanConfig.doShow(); }
},
//
getDeviceByEm(em) {
@ -384,331 +121,22 @@ export default {
EventBus.$emit('viewLoading', false);
});
},
routingSelected(data) {
this.editData(data);
},
//
rowDrop() {
const that = this;
const tbody = document.querySelector('.el-parkSectionCode-table tbody', {filter:'.ignoreDrag'});
if (tbody) {
Sortable.create(tbody, {
onEnd({ newIndex, oldIndex }) {
const length = that.addModel.parkSectionCodeList.length - 1;
if (newIndex != 0 && oldIndex != 0 && newIndex != length && oldIndex != length) {
that.addModel.parkSectionCodeList.splice(newIndex, 0, that.addModel.parkSectionCodeList.splice(oldIndex, 1)[0]);
const newArray = that.addModel.parkSectionCodeList.slice(0);
that.addModel.parkSectionCodeList = [];
that.$nextTick(function () {
that.addModel.parkSectionCodeList = newArray;
});
} else {
const newArray = that.addModel.parkSectionCodeList.slice(0);
that.addModel.parkSectionCodeList = [];
that.$nextTick(function () {
that.addModel.parkSectionCodeList = newArray;
});
}
}
});
}
},
editData(data) {
this.isSave = false;
this.allowSelect = true;
this.isStartSelected = true;
this.editShow = true;
this.addModel = data;
},
changeStartStation() {
this.judgeAllowSelected();
this.addStartSectionData(true);
},
changeStartSection(data) {
const section = this.$store.getters['map/getDeviceByCode'](data);
if (section.belongStation) {
this.addModel.startStationCode = section.belongStation;
}
this.judgeAllowSelected();
this.addStartSectionData(false);
},
changeEndStation() {
this.judgeAllowSelected();
this.addEndSectionData(true);
},
changeEndSection(data) {
const section = this.$store.getters['map/getDeviceByCode'](data);
if (section.belongStation) {
this.addModel.endStationCode = section.belongStation;
}
this.judgeAllowSelected();
this.addEndSectionData(false);
},
changeBelongSection(code) {
const section = this.$store.getters['map/getDeviceByCode'](code);
if (section && section.belongStation) {
this.stationCode = section.belongStation;
}
},
judgeAllowSelected() {
if (this.addModel.startStationCode != '' && this.addModel.startSectionCode != '' && this.addModel.endStationCode != '' && this.addModel.endSectionCode != '') {
this.allowSelect = true;
} else {
this.allowSelect = false;
}
},
addStartSectionData(isStation) {
if (this.addModel.startStationCode != '' && this.addModel.startSectionCode != '') {
this.isStartSelected = true;
const result = this.pushSection({stationCode: this.addModel.startStationCode, sectionCode: this.addModel.startSectionCode}, 'top', isStation);
return result;
}
return false;
},
addEndSectionData(isStation) {
if (this.addModel.endStationCode != '' && this.addModel.endSectionCode != '') {
const result = this.pushSection({stationCode: this.addModel.endStationCode, sectionCode: this.addModel.endSectionCode}, 'bottom', isStation);
return result;
}
return false;
},
hover(field) {
this.field = field === this.field ? '' : field;
},
formatName(code) {
return formatName(code);
},
setSelected(selected) {
if (selected) {
if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'startStationCode'.toUpperCase()) {
this.addModel.startStationCode = selected.code;
this.judgeAllowSelected();
this.addStartSectionData(true);
} else if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'endStationCode'.toUpperCase()) {
this.addModel.endStationCode = selected.code;
this.judgeAllowSelected();
this.addEndSectionData(true);
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'startSectionCode'.toUpperCase()) {
if (selected.standTrack || selected.reentryTrack || selected.transferTrack) {
if (selected.belongStation) {
this.addModel.startStationCode = selected.belongStation;
}
this.addModel.startSectionCode = selected.code;
this.judgeAllowSelected();
this.addStartSectionData(false);
} else {
// (//)
this.$message.error('请选择正确的起始区段');
}
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'endSectionCode'.toUpperCase()) {
if (selected.standTrack || selected.reentryTrack || selected.transferTrack) {
if (selected.belongStation) {
this.addModel.endStationCode = selected.belongStation;
}
this.addModel.endSectionCode = selected.code;
this.judgeAllowSelected();
this.addEndSectionData(false);
this.addModel.destinationCode = selected.destinationCode || '';
} else {
this.$message.error('请选择正确的终到区段');
}
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() == 'routingSection'.toUpperCase()) {
if (selected.standTrack || selected.reentryTrack || selected.transferTrack) {
this.sectionCode = selected.code;
} else {
this.$message.error('请选择正确的区段');
}
} else if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() == 'routingStation'.toUpperCase()) {
this.stationCode = selected.code;
}
}
},
pushSection(data, type, isStation) {
const list = this.addModel.parkSectionCodeList;
if (data && data.stationCode && data.sectionCode) {
const index = list.findIndex(elem => { return elem.sectionCode == data.sectionCode; });
switch (type) {
case 'center': {
if (index < 0) {
list.splice(list.length - 1, 0, data);
} else {
this.$messageBox('该区段已经在交路区段中存在');
}
break;
}
case 'top': {
if (isStation) {
list.splice(0, 1, data);
} else {
if (index < 0) {
list.splice(0, 1, data);
} else {
if (index == list.length - 1 && list.length >= 2) {
this.addModel.startSectionCode = list[0].sectionCode;
this.addModel.startStationCode = list[0].stationCode;
this.$messageBox('起始区段和终到区段不能相同');
} else if (index != list.length - 1 && index != 0) {
this.$messageBox('该区段已经在交路区段中存在');
}
}
}
break;
}
case 'bottom': {
if (isStation) {
if (list.length >= 2) {
list.splice(list.length - 1, 1, data);
} else {
if (index < 0) {
list.push(data);
}
}
} else {
if (index < 0) {
if (list.length >= 2) {
list.splice(list.length - 1, 1, data);
} else {
list.push(data);
}
} else {
if (index == 0 && list.length >= 2) {
this.addModel.endSectionCode = list[list.length - 1].sectionCode;
this.addModel.endStationCode = list[list.length - 1].stationCode;
this.$messageBox('起始区段和终到区段不能相同');
} else if (index != list.length - 1 && index != 0) {
this.$messageBox('该区段已经在交路区段中存在');
}
}
}
break;
}
default: {
if (index < 0) {
list.splice(list.length - 1, 0, data);
} else {
this.$messageBox(this.$t('tip.routeSameID'));
}
break;
}
}
this.sectionCode = '';
this.stationCode = '';
}
},
deleteSection(list, index) {
const data = list.splice(index, 1);
if (data.length > 0) {
const section = this.$store.getters['map/getDeviceByCode'](data[0].sectionCode);
section.instance.drawBatchSelected(section, '');
}
},
buildModel(code) {
const model = Object.assign({}, this.addModel);
// if (model.withLoop) { model.withLoop = true; } else { model.withLoop = false; }
model['mapId'] = this.$route.query.mapId;
model['userId'] = this.$store.state.user.id;
if (code) { model['code'] = code; }
return model;
},
save() {
this.addModel;
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
addRoutingData(this.buildModel(setUID('Routing'))).then(resp => {
this.$message.success(this.$t('tip.pathCreationSuccessful'));
this.loading = false;
this.clear();
}).catch((error) => {
this.$messageBox(this.$t('tip.createRoutingFailed') + ':' + error.message);
this.loading = false;
});
}
});
},
update() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
const data = this.buildModel();
// delete data.withLoop;
updateRoutingData(data).then(resp => {
this.$message.success(this.$t('tip.pathUpdataSuccessful'));
this.loading = false;
this.clear();
}).catch((error) => {
this.$messageBox(this.$t('tip.pathUpdataFailed') + ':' + error.message);
this.loading = false;
});
}
});
},
batchSectionListFocus(flag) {
this.changeSectionSelected(this.addModel.parkSectionCodeList, flag);
},
changeSectionSelected(selectedList, flag) {
if (this.addModel.parkSectionCodeList && this.addModel.parkSectionCodeList.length > 0) {
if (flag) {
if (this.oldsection.length > 0) {
this.oldsection.forEach((section)=>{
section.instance.drawBatchSelected(section, '');
});
this.oldsection = [];
}
selectedList.forEach(each=>{
const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode);
const list = section.logicSectionCodeList;
if (list && list.length > 0) {
list.forEach(logicSectionCode=>{
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
this.oldsection.push(logicSection);
logicSection.instance.drawBatchSelected(section, 'routingSection');
});
} else {
this.oldsection.push(section);
section.instance.drawBatchSelected(section, 'routingSection');
}
});
} else {
selectedList.forEach(each=>{
const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode);
const list = section.logicSectionCodeList;
if (list && list.length > 0) {
list.forEach(logicSectionCode=>{
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
logicSection.instance.drawBatchSelected(section, '');
});
} else {
section.instance.drawBatchSelected(section, '');
}
});
}
}
},
clear() {
if (this.$refs && this.$refs.form) {
this.changeSectionSelected(this.addModel.parkSectionCodeList, false);
delete this.addModel.id;
this.$refs.form.resetFields();
this.addModel.mapId = this.$route.query.mapId;
this.addModel.parkSectionCodeList = [];
this.addModel.code = '';
this.stationCode = '';
this.sectionCode = '';
this.isSave = true;
this.allowSelect = false;
this.isStartSelected = false;
// this.addModel.withLoop = false;
this.editShow = false;
this.field = '';
if (this.type == 'routeMap') { this.$refs.routeConfig.setSelected(selected); }
if (this.type == 'runplanParams') { this.$refs.runPlanConfig.setSelected(selected); }
}
},
// batchSectionListFocus(flag) {
// this.changeSectionSelected(this.addModel.parkSectionCodeList, flag);
// },
onContextmenu() {
},
close() {
this.dialogShow = false;
if (this.type == 'routeMap') { this.$refs.routeConfig.createRouteEvent(); }
if (this.type == 'runplanParams') { this.$refs.runPlanConfig.clear(); }
}
}
};
@ -716,18 +144,41 @@ export default {
<style lang="scss" scope>
.content-route{
display: flex;
flex-direction: column;
/deep/ {
.el-dialog__body{
width: 100%;
height: calc(100% - 54px);
height:100%;
flex:1;
padding: 0;
overflow: hidden;
}
}
}
.mapEdit_box{
float: right;
padding: 3px 0;
margin-right: 5px;
.content-box{
display:flex;
height:100%;
}
.routeMap{
height:100%;
overflow:auto;
width: 29%;
flex:1;
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-thumb {
border-radius: 10px;
background: #c3c3c3;
}
&::-webkit-scrollbar-track {
border-radius: 0;
background: #f0f0f0;
}
}
</style>

View File

@ -361,8 +361,11 @@ export default {
.map(serviceNumber => { return { serviceNumber }; });
},
async analyticalTripNumber(data) {
// this.tripNumberConfig.data = Object.keys(data || {})
// .sort((a, b) => { return data[a].tripNumber - data[b].tripNumber; })
// .map(tripNumber => { return { tripNumber }; });
this.tripNumberConfig.data = Object.keys(data || {})
.sort((a, b) => { return data[a].tripNumber - data[b].tripNumber; })
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; })
.map(tripNumber => { return { tripNumber }; });
},
async setPosition() {
@ -569,7 +572,6 @@ export default {
this.option.title.text = this.mapName;
}
this.myChart = echarts.init(document.getElementById(this.runPlanId));
// debugger;
// this.option;
this.myChart.setOption(this.option);
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });

View File

@ -1,15 +1,15 @@
<template>
<div class="PlanStatusBar">
<ul class="ul-box">
<div v-if="isNotUser" class="li_plan" @click="showTrain">{{ $t('planMonitor.serviceAndTripNumber') }}</div>
</ul>
<ul class="ul-box">
<div v-if="isNotUser" class="li_plan" @click="handleAddPlanningTrain">{{ $t('planMonitor.addPlan') }}</div>
<div v-if="isNotUser" class="li_plan" @click="handleDeletePlanningTrain">{{ $t('planMonitor.deletePlan') }}</div>
<div v-if="isNotUser" class="li_plan" @click="handleDuplicateTrain">{{ $t('planMonitor.duplicatePlan') }}</div>
<div v-if="isNotUser" class="li_plan" @click="handleAddTask">{{ $t('planMonitor.addTask') }}</div>
<div v-if="isNotUser" class="li_plan" @click="handleDeleteTask">{{ $t('planMonitor.deleteTask') }}</div>
<div v-if="isNotUser" class="li_plan" @click="handleModifyingTask">{{ $t('planMonitor.modifyTask') }}</div>
<!-- v-if="isNotUser" -->
<div class="li_plan" @click="showTrain">{{ $t('planMonitor.serviceAndTripNumber') }}</div>
<div class="li_plan" @click="handleGernaratePlanningTrain">{{ $t('planMonitor.gerneratePlan') }}</div>
<div class="li_plan" @click="handleAddPlanningTrain">{{ $t('planMonitor.addPlan') }}</div>
<div class="li_plan" @click="handleDeletePlanningTrain">{{ $t('planMonitor.deletePlan') }}</div>
<div class="li_plan" @click="handleDuplicateTrain">{{ $t('planMonitor.duplicatePlan') }}</div>
<div class="li_plan" @click="handleAddTask">{{ $t('planMonitor.addTask') }}</div>
<div class="li_plan" @click="handleDeleteTask">{{ $t('planMonitor.deleteTask') }}</div>
<div class="li_plan" @click="handleModifyingTask">{{ $t('planMonitor.modifyTask') }}</div>
</ul>
<ul class="ul-box tool">
<div class="li_plan" @click="handlePlanEffectiveCheck">{{ $t('planMonitor.validityCheck') }}</div>
@ -35,18 +35,18 @@ export default {
},
data() {
return {
isNotUser: true
// isNotUser: true
};
},
watch: {
},
created() {
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
this.isNotUser = false;
} else {
this.isNotUser = true;
}
// if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
// this.isNotUser = false;
// } else {
// this.isNotUser = true;
// }
},
methods: {
showTrain() {
@ -61,6 +61,14 @@ export default {
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
}
},
handleGernaratePlanningTrain() {
const planId = this.$route.query.planId || this.loadRunPlanId;
if (planId) {
this.$emit('dispatchDialog', { name: 'gernaratePlanTrain', params: {} });
} else {
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
}
},
//
handleDeletePlanningTrain() {
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;