Merge remote-tracking branch 'origin/develop'
All checks were successful
master分支构建发布到公网服务器 / Build-Publish (push) Successful in 7m48s

This commit is contained in:
joylink_fanyuhong 2024-08-16 09:59:38 +08:00
commit 478261512c
9 changed files with 590 additions and 560 deletions

View File

@ -122,7 +122,7 @@ class Handler {
const group = router.currentRoute.query.group; const group = router.currentRoute.query.group;
const stepInfo = store.state.trainingNew.stepInfo; const stepInfo = store.state.trainingNew.stepInfo;
endTrainingStep(group, stepInfo.id).then(resp => { endTrainingStep(group, stepInfo.id).then(resp => {
store.dispatch('trainingNew/clearOperateOrder'); // store.dispatch('trainingNew/clearOperateOrder');
}).catch(e => { }).catch(e => {
console.error('进入下一步失败!', e); console.error('进入下一步失败!', e);
}); });

View File

@ -83,6 +83,7 @@ const training = {
if (store.state.training.myMemberId == state.stepInfo.memberId) { if (store.state.training.myMemberId == state.stepInfo.memberId) {
state.stepRecord.push({ stepId: state.stepInfo.id, success: false, clientOperations: [] }); state.stepRecord.push({ stepId: state.stepInfo.id, success: false, clientOperations: [] });
} }
state.operateOrder = 0;
Handler.judgeIsTextSendOperation(); Handler.judgeIsTextSendOperation();
}, },
clearStepInfo: (state, stepInfo) => { clearStepInfo: (state, stepInfo) => {

View File

@ -35,7 +35,7 @@ export function getTopic(type, group, param) {
topic = `/queue/simulation/${group}/iscs/gate/${param.stationCode}`; topic = `/queue/simulation/${group}/iscs/gate/${param.stationCode}`;
break; break;
case 'TMS': case 'TMS':
topic = `/queue/simulation/${group}/train/001/tms`; topic = `/queue/simulation/${group}/train/${param.groupNumber}/tms`;
break; break;
case 'PIS_STAND': case 'PIS_STAND':
topic = `/queue/simulation/${group}/standPis/${param.standCode}`; topic = `/queue/simulation/${group}/standPis/${param.standCode}`;

View File

@ -8,7 +8,7 @@
<td>网压</td> <td>网压</td>
<td>网流</td> <td>网流</td>
<td>速度</td> <td>速度</td>
<td>牵引/制动级位</td> <td>牵引/制动级位111</td>
<td>里程标</td> <td>里程标</td>
<td>下一站</td> <td>下一站</td>
<td>目的站</td> <td>目的站</td>
@ -143,7 +143,7 @@
</div> </div>
</td></template </td></template
> >
<template v-else-if="k === '交流输出电压'"> <template v-else-if="k === '交流输出电压111'">
<td v-for="(item, j) in v" :key="j"> <td v-for="(item, j) in v" :key="j">
{{ item }} {{ item }}
</td></template </td></template
@ -230,6 +230,7 @@ export default {
data() { data() {
return { return {
localStatic: JL3D_LOCAL_STATIC, localStatic: JL3D_LOCAL_STATIC,
groupNumber: '001',
trainInfo: { trainInfo: {
voltage: 1600, voltage: 1600,
current: 317, current: 317,
@ -261,6 +262,14 @@ export default {
} }
}; };
}, },
watch: {
'$store.state.training.roleDeviceCode': function (val) {
if(val) {
this.unsubscribe();
this.subscribe();
}
}
},
mounted() { mounted() {
this.group = this.$route.query.group; this.group = this.$route.query.group;
this.subscribe(); this.subscribe();
@ -275,7 +284,8 @@ export default {
methods: { methods: {
subscribe() { subscribe() {
const header = { group: this.group || "", "X-Token": getToken() }; const header = { group: this.group || "", "X-Token": getToken() };
creatSubscribe(getTopic("TMS", this.group), header, msg => { this.groupNumber = this.$store.state.training.roleDeviceCode
creatSubscribe(getTopic("TMS", this.group, { groupNumber: this.groupNumber }), header, msg => {
let res = JSON.parse(msg.body); let res = JSON.parse(msg.body);
console.log(res); console.log(res);
console.log(res.parkingBreakPressure); console.log(res.parkingBreakPressure);
@ -315,7 +325,7 @@ export default {
}); });
}, },
unsubscribe() { unsubscribe() {
clearSubscribe(getTopic("TMS", this.group)); clearSubscribe(getTopic("TMS", this.group, { groupNumber: this.groupNumber }));
}, },
setTractionWave(flag) { setTractionWave(flag) {
if (timer) { if (timer) {

View File

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

View File

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

View File

@ -714,6 +714,14 @@ export default {
confirmPublish() { confirmPublish() {
publishRunPlanAllUser(this.loadRunPlanId, this.publishName || this.loadRunPlanName).then(resp => { publishRunPlanAllUser(this.loadRunPlanId, this.publishName || this.loadRunPlanName).then(resp => {
this.$message.success(this.$t('tip.publishRunPlanSuccess')); 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; this.publishVisible = false;
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('tip.publishRunPlanFail')); 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 trainingDesign = this.$store.state.training.domConfig ? this.$store.state.training.domConfig.trainingDesign : false;
const terminal = this.findTerminalFromMap(trainingDesign ? 'driverAtsWork' : 'drivingPlan'); 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') { } else if (this.roles === 'NCC_DISPATCHER') {
const terminal = this.findTerminalFromMap('nccWork'); const terminal = this.findTerminalFromMap('nccWork');
this.changePictureShow(terminal); this.changePictureShow(terminal);

View File

@ -717,6 +717,13 @@ export default {
confirmPublish() { confirmPublish() {
publishRunPlanAllUser(this.loadRunPlanId, this.publishName || this.loadRunPlanName).then(resp => { publishRunPlanAllUser(this.loadRunPlanId, this.publishName || this.loadRunPlanName).then(resp => {
this.$message.success(this.$t('tip.publishRunPlanSuccess')); 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; this.publishVisible = false;
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('tip.publishRunPlanFail')); this.$messageBox(this.$t('tip.publishRunPlanFail'));