Merge remote-tracking branch 'origin/develop' into local-test
All checks were successful
local-test分支构建发布到本地服务器 / Build-Publish (push) Successful in 7m49s

This commit is contained in:
joylink_fanyuhong 2024-06-25 10:02:50 +08:00
commit d2e6fe2d52
5 changed files with 573 additions and 554 deletions

View File

@ -1,456 +1,456 @@
<template>
<div>
<el-row>
<!-- <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 :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')" disabled>
<el-option
v-for="item in tripNumberList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-col>
<el-col :span="3" style="margin-left: 20px;height: 28px;line-height: 28px;">
<span>{{ $t('global.startTime')+$t('global.colon') }}</span>
</el-col>
<el-col :span="5">
<el-time-picker v-model="addModel.startTime" size="mini" value-format="HH:mm:ss" :clearable="false" :picker-options="{selectableRange:'02:00:00-23:59:59'}" />
</el-col>
</el-row>
<el-row style="margin-top: 5px;height: 28px;line-height: 28px;">
<!-- <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;">
<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-option
v-for="item in defaultStopTimeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> -->
<!-- </el-col> -->
<el-col :span="3" style="margin-left:10px;height: 28px;line-height: 28px;">
<!-- {{ $t('planMonitor.defaultRunLevel') }} -->
<span>运行等级</span>
</el-col>
<el-col :span="5">
<el-select v-model="defaultSpeedLevel" size="mini" :placeholder="this.$t('global.choose')">
<el-option
v-for="item in defaultSpeedLevelList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-col>
</el-row>
<el-row style="margin-bottom: 5px;">
{{ $t('planMonitor.crossRailway')+$t('global.colon') }}
</el-row>
<el-row>
<el-table
v-loading="tableLoading"
:data="routingList"
border
highlight-current-row
:height="230"
@row-click="handleClick"
>
<el-table-column
prop="startStationCode"
:label="this.$t('planMonitor.startingStation')"
:filters="startStationFilters"
:filter-method="filterStartStation"
column-key="startStationCode"
>
<template slot-scope="scope">
{{ formatName(scope.row.startStationCode) }}
</template>
</el-table-column>
<el-table-column prop="startSectionCode" :label="this.$t('planMonitor.startingSection')" width="95">
<template slot-scope="scope">
{{ formatName(scope.row.startSectionCode) }}
</template>
</el-table-column>
<el-table-column
prop="endStationCode"
:label="this.$t('planMonitor.terminal')"
:filters="endStationFilters"
:filter-method="filterEndStation"
column-key="endStationCode"
>
<template slot-scope="scope">
{{ formatName(scope.row.endStationCode) }}
</template>
</el-table-column>
<el-table-column prop="endSectionCode" :label="this.$t('planMonitor.endingSection')" width="95">
<template slot-scope="scope">
{{ formatName(scope.row.endSectionCode) }}
</template>
</el-table-column>
<el-table-column prop="routingType" label="交路类型">
<template slot-scope="scope">
{{ routingTypeMap[scope.row.routingType] }}
</template>
</el-table-column>
<el-table-column label="类别" width="240">
<template slot-scope="scope">
{{ `${frontMap[String(scope.row.startTbFront)]} - ${frontMap[String(scope.row.endTbFront)]}` }}
</template>
</el-table-column>
<el-table-column prop="remarks" width="auto" :label="this.$t('planMonitor.description')" />
</el-table>
</el-row>
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
{{ '经停转换轨 / 站台轨'+$t('global.colon') }}
</el-row>
<el-row>
<el-table v-loading="routeLoading" :data="addModel.arriveConfigList" border :height="230">
<el-table-column prop="stationCode" :label="this.$t('planMonitor.station')" width="160">
<template slot-scope="scope">
{{ formatName(scope.row.stationCode) }}
</template>
</el-table-column>
<el-table-column prop="sectionCode" :label="this.$t('planMonitor.section')" width="95">
<template slot-scope="scope">
{{ formatName(scope.row.sectionCode) }}
</template>
</el-table-column>
<!-- 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 :label="this.$t('planMonitor.runLevel')">
<template slot-scope="scope">
<span style="font-size:13px;">{{ scope.row.speedLevel }}</span>
<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-col :offset="16">
<el-checkbox v-model="showDefault">{{ $t('planMonitor.showDefaultStopTimeAndRunLevel') }}</el-checkbox>
</el-col>
</el-row> -->
<div style="text-align:center;margin-top:15px;">
<el-button size="medium" @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
</div>
</div>
</template>
<script>
import { listUserRoutingData, addPlanTrip, getMapStationRunUser, getStationStopTime, querySectionListByRouting } from '@/api/runplan';
import { getRunplanConfig } from '@/api/jmap/mapdraft';
import { formatTime, formatName } from '@/jmapNew/theme/parser/util';
export default {
name: 'AddTask',
components: {
},
data() {
return {
tableLoading:false,
routeLoading:false,
isPlan: false,
loadRunPlanId:'',
// showDefault: true,
stopStationMap: {},
stopTimeMap:{},
params: {},
routingList: [],
startStationFilters:[],
endStationFilters:[],
// defaultStopTime: '30',
defaultSpeedLevel: 'l3',
reentryData: {},
addModel: {
routingCode: '',
endStationCode: '',
startStationCode: '',
startTime: '02:00:00',
endTime: '',
arriveConfigList: [],
tripNumber: '',
planId: '',
serviceNumber: '',
startTbFront: false,
endTbFront: false
},
tripNumberList: [{ value: '', label: this.$t('planMonitor.automatic') }],
defaultSpeedLevelList: [
{ value: 'l1', label: '等级一' },
{ value: 'l2', label: '等级二' },
{ value: 'l3', label: '等级三'},
{ value: 'l4', label: '等级四' },
{ value: 'l5', label: '等级五' }
],
routingTypeMap: {
OUTBOUND: '出库',
INBOUND: '入库',
LOOP: '环路'
},
frontMap: {
'true': '折返轨(站前)',
'false': '折返轨(站后)',
'undefined': '转换轨',
'null': '转换轨'
}
};
},
watch: {
'addModel.routingCode': function (val) {
if (val) {
this.computedDetailList('routingCode');
}
},
'addModel.startTime': function () {
this.computedDetailList();
},
'defaultSpeedLevel': function () {
this.computedDetailList('defaultSpeedLevel');
}
},
methods: {
loadInitData(params) {
this.loadRunPlanId = params.loadRunPlanId;
this.isPlan = params.isPlan;
this.addModel.serviceNumber = params.serviceNumber;
this.addModel.planId = this.$route.query.planId || this.loadRunPlanId;
this.addModel.arriveConfigList = [];
const mapId = this.$route.query.mapId;
if (mapId) {
this.tableLoading = true;
getRunplanConfig(mapId).then(resp => {
const data = resp.data;
this.reentryData = data.config.reentryData;
});
listUserRoutingData(mapId).then(resp => {
this.routingList = resp.data;
const startStationFilterMap = {};
const endStationFilterMap = {};
this.routingList.forEach(routing=>{
if (!startStationFilterMap[routing.startStationCode]) {
startStationFilterMap[routing.startStationCode] = {text:formatName(routing.startStationCode), value:routing.startStationCode};
}
if (!endStationFilterMap[routing.endStationCode]) {
endStationFilterMap[routing.endStationCode] = {text:formatName(routing.endStationCode), value:routing.endStationCode};
}
});
this.startStationFilters = Object.values(startStationFilterMap).sort((a, b)=>{
const startStationA = this.$store.getters['map/getDeviceByCode'](a.value);
const startStationB = this.$store.getters['map/getDeviceByCode'](b.value);
return startStationA.kmRange - startStationB.kmRange;
});
this.endStationFilters = Object.values(endStationFilterMap).sort((a, b)=>{
const endStationA = this.$store.getters['map/getDeviceByCode'](a.value);
const endStationB = this.$store.getters['map/getDeviceByCode'](b.value);
return endStationA.kmRange - endStationB.kmRange;
});
this.tableLoading = false;
});
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};
});
});
});
}
},
filterStartStation(value, row) {
return row.startStationCode == value;
},
filterEndStation(value, row) {
return row.endStationCode == value;
},
doClose() {
this.$emit('doClose');
},
formatName(code) {
return formatName(code);
},
computedTimeByString(timeStr) {
const bTime = +new Date(`2019-01-01 00:00:00`);
const eTime = +new Date(`2019-01-01 ${timeStr}`);
return Number(eTime) - Number(bTime);
},
compuntedRunTime(list, index, runLevel) {
let runTime = 0;
if ((index == 0 && String(this.addModel.startTbFront) == false) ||
(index == list.length - 1 && String(this.addModel.endTbFront) == false)) {
return 0;
}
if (index < list.length - 1) {
const stopStationObj = this.stopStationMap[[list[index].sectionCode, list[index + 1].sectionCode].toString()];
if (stopStationObj) {
if (stopStationObj.runPlanLevelVO) {
runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]);
} else if (stopStationObj[runLevel]) {
runTime = parseInt(stopStationObj[runLevel]);
} else {
this.$messageBox(this.$t('planMonitor.addTaskHint1') + stopStationObj.startSectionCode + this.$t('planMonitor.addTaskHint2') + stopStationObj.endSectionCode + this.$t('planMonitor.addTaskHint3'));
}
}
}
return runTime;
},
computedDetailList(type = null) {
if (this.addModel.routingCode) {
let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000;
const list = Object.assign([], this.addModel.arriveConfigList);
const runLevel = this.defaultSpeedLevel || 'l1'; //
list.forEach((elem, index) => {
if (type == 'routingCode') {
if (index == 0 || index == list.length - 1) {
elem.stopTime = 0;
} else if (this.stopTimeMap[elem.stationCode]) {
elem.stopTime = this.stopTimeMap[elem.stationCode].parkingTime;
} else {
elem.stopTime = 0;
}
}
tempTime = tempTime || this.computedTimeByString('23:59:59') / 1000 + 1;
elem.arriveTime = formatTime(tempTime);
if (index == list.length - 1 && String(this.addModel.endTbFront) == 'true') {
const data = this.reentryData[list[index].stationCode] || {};
elem.departureTime = formatTime(tempTime + elem.stopTime + data.tbFront || 0);
} else {
elem.departureTime = formatTime(tempTime + elem.stopTime);
}
const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
const realRunlevel = this.compuntedRunTime(list, index, runLevel);
elem.speedLevelTime = realRunlevel;
elem.speedLevel = runLevelObj.label;
let fronTime = 0;
if (index == 0 && String(this.addModel.startTbFront) == 'false') {
const data = this.reentryData[elem.stationCode] || {};
fronTime = data.tbTo || 0;
} else if (index == list.length - 2 && String(this.addModel.endTbFront) == 'false') {
const data = this.reentryData[list[index + 1].stationCode] || {};
fronTime = data.tbTo || 0;
} else if (index == list.length - 1 && String(this.addModel.endTbFront) == 'true') {
const data = this.reentryData[list[index].stationCode] || {};
fronTime = data.tbFront || 0;
}
tempTime = tempTime + fronTime + elem.stopTime + elem.speedLevelTime;
});
this.addModel.endTime = formatTime(tempTime - list[list.length - 1].stopTime);
}
},
handleClick(row, column, event) {
this.routeLoading = true;
const arriveConfigList = [];
querySectionListByRouting(row.id).then(resp=>{
resp.data.forEach((parkSectionCode, index)=>{
arriveConfigList.push({arriveTime:'', departureTime:'', sectionCode:parkSectionCode.sectionCode, stationCode:parkSectionCode.stationCode});
});
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.routingCode = row.id;
this.addModel.startTbFront = row.startTbFront;
this.addModel.endTbFront = row.endTbFront;
this.computedDetailList('routingCode');
this.routeLoading = false;
});
},
handleCommit() {
if (this.addModel.arriveConfigList.length > 0) {
if (this.isPlan) {
//
this.$emit('dispatchOperate', { dialogName: 'editPlanningTrain', operate: 'handleConfirmAddTask', params: Object.assign({}, this.addModel) });
this.addModel.routingCode = '';
} else {
//
delete this.addModel.tripNumber;
addPlanTrip(this.addModel).then(resp => {
// this.$emit('dispatchOperate', {
// dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
// });
this.$emit('refresh');
this.$message.success(this.$t('tip.addTaskSuccessfully'));
}).catch((error) => {
this.$messageBox(this.$t('tip.addTaskFailed') + ': ' + error.message);
});
}
this.doClose();
} else {
this.$messageBox('请选择交路');
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
/deep/ {
.el-row {
margin-bottom: 5px !important;
}
}
.add-task{
/deep/ {
.el-dialog__body{
padding: 0 20px;
}
.dialog-footer{
display: flex;
justify-content: center;
}
}
}
</style>
<template>
<div>
<el-row>
<!-- <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 :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')" disabled>
<el-option
v-for="item in tripNumberList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-col>
<el-col :span="3" style="margin-left: 20px;height: 28px;line-height: 28px;">
<span>{{ $t('global.startTime')+$t('global.colon') }}</span>
</el-col>
<el-col :span="5">
<el-time-picker v-model="addModel.startTime" size="mini" value-format="HH:mm:ss" :clearable="false" :picker-options="{selectableRange:'02:00:00-23:59:59'}" />
</el-col>
</el-row>
<el-row style="margin-top: 5px;height: 28px;line-height: 28px;">
<!-- <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;">
<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-option
v-for="item in defaultStopTimeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> -->
<!-- </el-col> -->
<el-col :span="3" style="margin-left:10px;height: 28px;line-height: 28px;">
<!-- {{ $t('planMonitor.defaultRunLevel') }} -->
<span>运行等级</span>
</el-col>
<el-col :span="5">
<el-select v-model="defaultSpeedLevel" size="mini" :placeholder="this.$t('global.choose')">
<el-option
v-for="item in defaultSpeedLevelList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-col>
</el-row>
<el-row style="margin-bottom: 5px;">
{{ $t('planMonitor.crossRailway')+$t('global.colon') }}
</el-row>
<el-row>
<el-table
v-loading="tableLoading"
:data="routingList"
border
highlight-current-row
:height="230"
@row-click="handleClick"
>
<el-table-column
prop="startStationCode"
:label="this.$t('planMonitor.startingStation')"
:filters="startStationFilters"
:filter-method="filterStartStation"
column-key="startStationCode"
>
<template slot-scope="scope">
{{ formatName(scope.row.startStationCode) }}
</template>
</el-table-column>
<el-table-column prop="startSectionCode" :label="this.$t('planMonitor.startingSection')" width="95">
<template slot-scope="scope">
{{ formatName(scope.row.startSectionCode) }}
</template>
</el-table-column>
<el-table-column
prop="endStationCode"
:label="this.$t('planMonitor.terminal')"
:filters="endStationFilters"
:filter-method="filterEndStation"
column-key="endStationCode"
>
<template slot-scope="scope">
{{ formatName(scope.row.endStationCode) }}
</template>
</el-table-column>
<el-table-column prop="endSectionCode" :label="this.$t('planMonitor.endingSection')" width="95">
<template slot-scope="scope">
{{ formatName(scope.row.endSectionCode) }}
</template>
</el-table-column>
<el-table-column prop="routingType" label="交路类型">
<template slot-scope="scope">
{{ routingTypeMap[scope.row.routingType] }}
</template>
</el-table-column>
<el-table-column label="类别" width="240">
<template slot-scope="scope">
{{ `${frontMap[String(scope.row.startTbFront)]} - ${frontMap[String(scope.row.endTbFront)]}` }}
</template>
</el-table-column>
<el-table-column prop="remarks" width="auto" :label="this.$t('planMonitor.description')" />
</el-table>
</el-row>
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
{{ '经停转换轨 / 站台轨'+$t('global.colon') }}
</el-row>
<el-row>
<el-table v-loading="routeLoading" :data="addModel.arriveConfigList" border :height="230">
<el-table-column prop="stationCode" :label="this.$t('planMonitor.station')" width="160">
<template slot-scope="scope">
{{ formatName(scope.row.stationCode) }}
</template>
</el-table-column>
<el-table-column prop="sectionCode" :label="this.$t('planMonitor.section')" width="95">
<template slot-scope="scope">
{{ formatName(scope.row.sectionCode) }}
</template>
</el-table-column>
<!-- 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 :label="this.$t('planMonitor.runLevel')">
<template slot-scope="scope">
<span style="font-size:13px;">{{ scope.row.speedLevel }}</span>
<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-col :offset="16">
<el-checkbox v-model="showDefault">{{ $t('planMonitor.showDefaultStopTimeAndRunLevel') }}</el-checkbox>
</el-col>
</el-row> -->
<div style="text-align:center;margin-top:15px;">
<el-button size="medium" @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
</div>
</div>
</template>
<script>
import { listUserRoutingData, addPlanTrip, getMapStationRunUser, getStationStopTime, querySectionListByRouting } from '@/api/runplan';
import { getRunplanConfig } from '@/api/jmap/mapdraft';
import { formatTime, formatName } from '@/jmapNew/theme/parser/util';
export default {
name: 'AddTask',
components: {
},
data() {
return {
tableLoading:false,
routeLoading:false,
isPlan: false,
loadRunPlanId:'',
// showDefault: true,
stopStationMap: {},
stopTimeMap:{},
params: {},
routingList: [],
startStationFilters:[],
endStationFilters:[],
// defaultStopTime: '30',
defaultSpeedLevel: 'l3',
reentryData: {},
addModel: {
routingCode: '',
endStationCode: '',
startStationCode: '',
startTime: '02:00:00',
endTime: '',
arriveConfigList: [],
tripNumber: '',
planId: '',
serviceNumber: '',
startTbFront: false,
endTbFront: false
},
tripNumberList: [{ value: '', label: this.$t('planMonitor.automatic') }],
defaultSpeedLevelList: [
{ value: 'l1', label: '等级一' },
{ value: 'l2', label: '等级二' },
{ value: 'l3', label: '等级三'},
{ value: 'l4', label: '等级四' },
{ value: 'l5', label: '等级五' }
],
routingTypeMap: {
OUTBOUND: '出库',
INBOUND: '入库',
LOOP: '环路'
},
frontMap: {
'true': '折返轨(站前)',
'false': '折返轨(站后)',
'undefined': '转换轨',
'null': '转换轨'
}
};
},
watch: {
'addModel.routingCode': function (val) {
if (val) {
this.computedDetailList('routingCode');
}
},
'addModel.startTime': function () {
this.computedDetailList();
},
'defaultSpeedLevel': function () {
this.computedDetailList('defaultSpeedLevel');
}
},
methods: {
loadInitData(params) {
this.loadRunPlanId = params.loadRunPlanId;
this.isPlan = params.isPlan;
this.addModel.serviceNumber = params.serviceNumber;
this.addModel.planId = this.$route.query.planId || this.loadRunPlanId;
this.addModel.arriveConfigList = [];
const mapId = this.$route.query.mapId;
if (mapId) {
this.tableLoading = true;
getRunplanConfig(mapId).then(resp => {
const data = resp.data;
this.reentryData = data.config.reentryData;
});
listUserRoutingData(mapId).then(resp => {
this.routingList = resp.data;
const startStationFilterMap = {};
const endStationFilterMap = {};
this.routingList.forEach(routing=>{
if (!startStationFilterMap[routing.startStationCode]) {
startStationFilterMap[routing.startStationCode] = {text:formatName(routing.startStationCode), value:routing.startStationCode};
}
if (!endStationFilterMap[routing.endStationCode]) {
endStationFilterMap[routing.endStationCode] = {text:formatName(routing.endStationCode), value:routing.endStationCode};
}
});
this.startStationFilters = Object.values(startStationFilterMap).sort((a, b)=>{
const startStationA = this.$store.getters['map/getDeviceByCode'](a.value);
const startStationB = this.$store.getters['map/getDeviceByCode'](b.value);
return startStationA.kmRange - startStationB.kmRange;
});
this.endStationFilters = Object.values(endStationFilterMap).sort((a, b)=>{
const endStationA = this.$store.getters['map/getDeviceByCode'](a.value);
const endStationB = this.$store.getters['map/getDeviceByCode'](b.value);
return endStationA.kmRange - endStationB.kmRange;
});
this.tableLoading = false;
});
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};
});
});
});
}
},
filterStartStation(value, row) {
return row.startStationCode == value;
},
filterEndStation(value, row) {
return row.endStationCode == value;
},
doClose() {
this.$emit('doClose');
},
formatName(code) {
return formatName(code);
},
computedTimeByString(timeStr) {
const bTime = +new Date(`2019-01-01 00:00:00`);
const eTime = +new Date(`2019-01-01 ${timeStr}`);
return Number(eTime) - Number(bTime);
},
compuntedRunTime(list, index, runLevel) {
let runTime = 0;
if ((index == 0 && String(this.addModel.startTbFront) == false) ||
(index == list.length - 1 && String(this.addModel.endTbFront) == false)) {
return 0;
}
if (index < list.length - 1) {
const stopStationObj = this.stopStationMap[[list[index].sectionCode, list[index + 1].sectionCode].toString()];
if (stopStationObj) {
if (stopStationObj.runPlanLevelVO) {
runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]);
} else if (stopStationObj[runLevel]) {
runTime = parseInt(stopStationObj[runLevel]);
} else {
this.$messageBox(this.$t('planMonitor.addTaskHint1') + stopStationObj.startSectionCode + this.$t('planMonitor.addTaskHint2') + stopStationObj.endSectionCode + this.$t('planMonitor.addTaskHint3'));
}
}
}
return runTime;
},
computedDetailList(type = null) {
if (this.addModel.routingCode) {
let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000;
const list = Object.assign([], this.addModel.arriveConfigList);
const runLevel = this.defaultSpeedLevel || 'l1'; //
list.forEach((elem, index) => {
if (type == 'routingCode') {
if (index == 0 || index == list.length - 1) {
elem.stopTime = 0;
} else if (this.stopTimeMap[elem.stationCode]) {
elem.stopTime = this.stopTimeMap[elem.stationCode].parkingTime;
} else {
elem.stopTime = 0;
}
}
tempTime = tempTime || this.computedTimeByString('23:59:59') / 1000 + 1;
elem.arriveTime = formatTime(tempTime);
if (index == list.length - 1 && String(this.addModel.endTbFront) == 'true') {
const data = this.reentryData[list[index].stationCode] || {};
elem.departureTime = formatTime(tempTime + elem.stopTime + data.tbFront || 0);
} else {
elem.departureTime = formatTime(tempTime + elem.stopTime);
}
const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
const realRunlevel = this.compuntedRunTime(list, index, runLevel);
elem.speedLevelTime = realRunlevel;
elem.speedLevel = runLevelObj.label;
let fronTime = 0;
if (index == 0 && String(this.addModel.startTbFront) == 'false') {
const data = this.reentryData[elem.stationCode] || {};
fronTime = data.tbTo || 0;
} else if (index == list.length - 2 && String(this.addModel.endTbFront) == 'false') {
const data = this.reentryData[list[index + 1].stationCode] || {};
fronTime = data.tbTo || 0;
} else if (index == list.length - 1 && String(this.addModel.endTbFront) == 'true') {
const data = this.reentryData[list[index].stationCode] || {};
fronTime = data.tbFront || 0;
}
tempTime = tempTime + fronTime + elem.stopTime + elem.speedLevelTime;
});
this.addModel.endTime = formatTime(tempTime - list[list.length - 1].stopTime);
}
},
handleClick(row, column, event) {
this.routeLoading = true;
const arriveConfigList = [];
querySectionListByRouting(row.id).then(resp=>{
resp.data.forEach((parkSectionCode, index)=>{
arriveConfigList.push({arriveTime:'', departureTime:'', sectionCode:parkSectionCode.sectionCode, stationCode:parkSectionCode.stationCode});
});
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.routingCode = row.id;
this.addModel.startTbFront = row.startTbFront;
this.addModel.endTbFront = row.endTbFront;
this.computedDetailList('routingCode');
this.routeLoading = false;
});
},
handleCommit() {
if (this.addModel.arriveConfigList.length > 0) {
if (this.isPlan) {
//
this.$emit('dispatchOperate', { dialogName: 'editPlanningTrain', operate: 'handleConfirmAddTask', params: Object.assign({}, this.addModel) });
this.addModel.routingCode = '';
} else {
//
delete this.addModel.tripNumber;
addPlanTrip(this.addModel).then(resp => {
// this.$emit('dispatchOperate', {
// dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
// });
this.$store.dispatch('runPlan/refresh');
this.$message.success(this.$t('tip.addTaskSuccessfully'));
}).catch((error) => {
this.$messageBox(this.$t('tip.addTaskFailed') + ': ' + error.message);
});
}
this.doClose();
} else {
this.$messageBox('请选择交路');
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
/deep/ {
.el-row {
margin-bottom: 5px !important;
}
}
.add-task{
/deep/ {
.el-dialog__body{
padding: 0 20px;
}
.dialog-footer{
display: flex;
justify-content: center;
}
}
}
</style>

View File

@ -1,97 +1,97 @@
<template>
<div>
<el-row>
<el-radio v-model="model.deleteBefore" :label="true">{{ $t('planMonitor.deleteAllPreviousTasks') }}</el-radio>
</el-row>
<el-row>
<el-radio v-model="model.deleteBefore" :label="false">{{ $t('planMonitor.deleteAllSubsequentTasks') }}</el-radio>
</el-row>
<div style="text-align:center;margin-top:15px;">
<el-button size="medium" @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
</div>
</div>
</template>
<script>
import { deletePlanTrip } from '@/api/runplan';
export default {
name: 'DeleteTask',
components: {
},
data() {
return {
isPlan: false,
loadRunPlanId:'',
model: {
routingCode: '',
deleteBefore: false,
tripNumber: '',
serviceNumber: ''
}
};
},
mounted() {
},
methods: {
loadInitData(params) {
this.loadRunPlanId = params.loadRunPlanId;
this.isPlan = params.isPlan;
this.model.taskIndex = params.taskIndex;
this.model.tripNumber = params.tripNumber;
this.model.serviceNumber = params.serviceNumber;
this.model.routingCode = params.routingCode;
},
doClose() {
this.$emit('doClose');
},
handleCommit() {
if (this.isPlan) {
//
this.$emit('dispatchOperate', { dialogName: 'editPlanningTrain', operate: 'handleConfirmDeleteTask', params: this.model });
} else {
//
const model = {
planId: this.$route.query.planId || this.loadRunPlanId,
SDTNumber: `${this.model.serviceNumber}${this.model.tripNumber}`,
deleteBefore: this.model.deleteBefore
};
deletePlanTrip(model).then(resp => {
this.$store.dispatch('runPlan/setSelected', {});
this.$store.dispatch('runPlan/setDraftSelected', {});
this.$emit('refresh');
// this.$emit('dispatchOperate', {
// dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
// });
this.$message.success(this.$t('tip.deleteTaskSuccessfully'));
}).catch(() => {
this.$messageBox(this.$t('tip.deleteTaskFailed'));
});
}
this.doClose();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
/deep/ {
.el-row {
margin: 10px;
}
}
.delete-task{
/deep/ {
.el-dialog__body{
padding: 0 20px;
}
.dialog-footer{
display: flex;
justify-content: center;
}
}
}
</style>
<template>
<div>
<el-row>
<el-radio v-model="model.deleteBefore" :label="true">{{ $t('planMonitor.deleteAllPreviousTasks') }}</el-radio>
</el-row>
<el-row>
<el-radio v-model="model.deleteBefore" :label="false">{{ $t('planMonitor.deleteAllSubsequentTasks') }}</el-radio>
</el-row>
<div style="text-align:center;margin-top:15px;">
<el-button size="medium" @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
</div>
</div>
</template>
<script>
import { deletePlanTrip } from '@/api/runplan';
export default {
name: 'DeleteTask',
components: {
},
data() {
return {
isPlan: false,
loadRunPlanId:'',
model: {
routingCode: '',
deleteBefore: false,
tripNumber: '',
serviceNumber: ''
}
};
},
mounted() {
},
methods: {
loadInitData(params) {
this.loadRunPlanId = params.loadRunPlanId;
this.isPlan = params.isPlan;
this.model.taskIndex = params.taskIndex;
this.model.tripNumber = params.tripNumber;
this.model.serviceNumber = params.serviceNumber;
this.model.routingCode = params.routingCode;
},
doClose() {
this.$emit('doClose');
},
handleCommit() {
if (this.isPlan) {
//
this.$emit('dispatchOperate', { dialogName: 'editPlanningTrain', operate: 'handleConfirmDeleteTask', params: this.model });
} else {
//
const model = {
planId: this.$route.query.planId || this.loadRunPlanId,
SDTNumber: `${this.model.serviceNumber}${this.model.tripNumber}`,
deleteBefore: this.model.deleteBefore
};
deletePlanTrip(model).then(resp => {
this.$store.dispatch('runPlan/setSelected', {});
this.$store.dispatch('runPlan/setDraftSelected', {});
this.$store.dispatch('runPlan/refresh');
// this.$emit('dispatchOperate', {
// dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
// });
this.$message.success(this.$t('tip.deleteTaskSuccessfully'));
}).catch(() => {
this.$messageBox(this.$t('tip.deleteTaskFailed'));
});
}
this.doClose();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
/deep/ {
.el-row {
margin: 10px;
}
}
.delete-task{
/deep/ {
.el-dialog__body{
padding: 0 20px;
}
.dialog-footer{
display: flex;
justify-content: center;
}
}
}
</style>

View File

@ -714,6 +714,14 @@ export default {
confirmPublish() {
publishRunPlanAllUser(this.loadRunPlanId, this.publishName || this.loadRunPlanName).then(resp => {
this.$message.success(this.$t('tip.publishRunPlanSuccess'));
if (resp.data && resp.data.length > 0) {
let message = '';
resp.data.forEach(msg => message += (msg + ';'))
this.$confirm(message, this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
showCancelButton: false
})
}
this.publishVisible = false;
}).catch(() => {
this.$messageBox(this.$t('tip.publishRunPlanFail'));

View File

@ -205,7 +205,11 @@ export default {
//
const trainingDesign = this.$store.state.training.domConfig ? this.$store.state.training.domConfig.trainingDesign : false;
const terminal = this.findTerminalFromMap(trainingDesign ? 'driverAtsWork' : 'drivingPlan');
this.changePictureShow(terminal);
if (this.$route.query.type === 'TMS') {
this.changePictureShow(this.findTerminalFromMap('tms'));
} else {
this.changePictureShow(terminal);
}
} else if (this.roles === 'NCC_DISPATCHER') {
const terminal = this.findTerminalFromMap('nccWork');
this.changePictureShow(terminal);

View File

@ -717,6 +717,13 @@ export default {
confirmPublish() {
publishRunPlanAllUser(this.loadRunPlanId, this.publishName || this.loadRunPlanName).then(resp => {
this.$message.success(this.$t('tip.publishRunPlanSuccess'));
if (resp.data && resp.data.length > 0) {
let message = '';
resp.data.forEach(msg => message += (msg + ';'))
this.$confirm(message, this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm')
})
}
this.publishVisible = false;
}).catch(() => {
this.$messageBox(this.$t('tip.publishRunPlanFail'));