宁波三列车操作调整

This commit is contained in:
fan 2021-04-07 17:14:54 +08:00
parent 2d5b863231
commit f5e00dd717
11 changed files with 465 additions and 231 deletions

View File

@ -233,12 +233,12 @@ export default {
children: [ children: [
{ {
title: '站台', title: '站台',
operate:'', operate: OperationEvent.Signal.arrangementRoute.toStand,
click: this.handleArrangeRoute click: this.handleArrangeRoute
}, },
{ {
title: '信号机', title: '信号机',
operate:'', operate: OperationEvent.Signal.arrangementRoute.toSignal,
click: this.handleArrangeRoute click: this.handleArrangeRoute
} }
] ]
@ -249,12 +249,12 @@ export default {
children: [ children: [
{ {
title: '运行线', title: '运行线',
operate:'', operate: OperationEvent.Train.destinationTrainId.menu,
click: this.handleTrainDistributionRunLine click: this.handleTrainDistributionRunLine
}, },
{ {
title: '班次', title: '班次',
operate:'', operate: OperationEvent.Train.trainDistribute.menu,
click: this.handleTrainDistributionClass click: this.handleTrainDistributionClass
}, },
{ {
@ -270,7 +270,7 @@ export default {
children: [ children: [
{ {
title: '发车', title: '发车',
operate:'', operate: OperationEvent.Train.setTrainDeparture.menu,
click: this.setTrainDepart click: this.setTrainDepart
}, },
{ {
@ -1013,12 +1013,12 @@ export default {
children: [ children: [
{ {
title: '站台', title: '站台',
operate:'', operate: OperationEvent.Signal.arrangementRoute.toStand,
click: this.handleArrangeRoute click: this.handleArrangeRoute
}, },
{ {
title: '信号机', title: '信号机',
operate:'', operate: OperationEvent.Signal.arrangementRoute.toSignal,
click: this.handleArrangeRoute click: this.handleArrangeRoute
} }
] ]
@ -1029,12 +1029,12 @@ export default {
children: [ children: [
{ {
title: '运行线', title: '运行线',
operate:'', operate: OperationEvent.Train.destinationTrainId.menu,
click: this.handleTrainDistributionRunLine click: this.handleTrainDistributionRunLine
}, },
{ {
title: '班次', title: '班次',
operate:'', operate: OperationEvent.Train.trainDistribute.menu,
click: this.handleTrainDistributionClass click: this.handleTrainDistributionClass
}, },
{ {
@ -1050,7 +1050,7 @@ export default {
children: [ children: [
{ {
title: '发车', title: '发车',
operate:'', operate:OperationEvent.Train.setTrainDeparture.menu,
click: this.setTrainDepart click: this.setTrainDepart
}, },
{ {
@ -1905,7 +1905,7 @@ export default {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.arrangeRoute.doShow(); this.$refs.arrangeRoute.doShow(operate);
} }
}); });
}, },
@ -1929,7 +1929,7 @@ export default {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainDistribution.doShow(operate, 'second'); this.$refs.trainDistribution.doShow(operate, 'third');
} }
}); });
}, },
@ -1941,7 +1941,7 @@ export default {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainDistribution.doShow(operate, 'third'); this.$refs.trainDistribution.doShow(operate, 'second');
} }
}); });
}, },

View File

@ -2,13 +2,17 @@
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="1000px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false"> <el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="1000px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
<el-table :data="tableData" height="397px" style="margin-top: 57px" highlight-current-row @current-change="handleTrainChange"> <el-table ref="trainTable" :data="tableData" height="397px" style="margin-top: 57px" highlight-current-row @current-change="handleTrainChange">
<el-table-column label="列车"> <el-table-column label="列车">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row }}</span> <span>{{ scope.row }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="groupNumber" label="班次" /> <el-table-column prop="groupNumber" label="班次">
<template slot-scope="scope">
<span>{{ getServiceNum(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column label="运行线"> <el-table-column label="运行线">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ getTrainDestinationCode(scope.row) }}</span> <span>{{ getTrainDestinationCode(scope.row) }}</span>
@ -32,7 +36,7 @@
</div> </div>
</el-col> </el-col>
<el-col :span="12" :offset="1"> <el-col :span="12" :offset="1">
<el-table :data="tempData" height="340px" highlight-current-row @current-change="handlePathChange"> <el-table ref="pathTable" :data="tempData" height="340px" highlight-current-row @current-change="handlePathChange">
<el-table-column prop="groupNumber" label="路径" /> <el-table-column prop="groupNumber" label="路径" />
<el-table-column prop="groupNumber" label="运行方向"> <el-table-column prop="groupNumber" label="运行方向">
<template slot-scope="scope"> <template slot-scope="scope">
@ -47,7 +51,7 @@
<el-tab-pane label="信号机" name="second"> <el-tab-pane label="信号机" name="second">
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-table :data="signalList" height="380px" highlight-current-row @current-change="handleSignalChange"> <el-table ref="signalTable" :data="signalList" height="380px" highlight-current-row @current-change="handleSignalChange">
<el-table-column prop="name" label="信号机" /> <el-table-column prop="name" label="信号机" />
<el-table-column prop="show" label="显示" /> <el-table-column prop="show" label="显示" />
</el-table> </el-table>
@ -70,7 +74,7 @@
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="4" :offset="1"> <el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定(O)</el-button> <el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="commitDisabled" @click="commit">确定(O)</el-button>
</el-col> </el-col>
<el-col :span="4" :offset="2"> <el-col :span="4" :offset="2">
<el-button>应用(A)</el-button> <el-button>应用(A)</el-button>
@ -138,6 +142,9 @@ export default {
}, },
title() { title() {
return '列车排进路'; return '列车排进路';
},
commitDisabled() {
return !(this.routeCodeList && this.routeCodeList.length);
} }
}, },
watch: { watch: {
@ -158,8 +165,17 @@ export default {
this.selectTrainCode = ''; this.selectTrainCode = '';
this.selectStandCode = ''; this.selectStandCode = '';
this.selectSignalCode = ''; this.selectSignalCode = '';
this.tempData = [];
this.tableData = this.$store.state.map.activeTrainList; this.tableData = this.$store.state.map.activeTrainList;
if (operate.operation === OperationEvent.Signal.arrangementRoute.toStand) {
this.activeName = 'first';
} else if (operate.operation === OperationEvent.Signal.arrangementRoute.toSignal) {
this.activeName = 'second';
}
this.$nextTick(function () { this.$nextTick(function () {
this.$refs.trainTable && this.$refs.trainTable.setCurrentRow();
this.$refs.pathTable && this.$refs.pathTable.setCurrentRow();
this.$refs.signalTable && this.$refs.signalTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
@ -169,6 +185,10 @@ export default {
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
getServiceNum(code) {
const train = this.$store.getters['map/getDeviceByCode'](code);
return (train || {}).serviceNumber;
},
getTrainDestinationCode(trainCode) { getTrainDestinationCode(trainCode) {
const train = this.$store.getters['map/getDeviceByCode'](trainCode); const train = this.$store.getters['map/getDeviceByCode'](trainCode);
return train.destinationCode; return train.destinationCode;
@ -233,7 +253,7 @@ export default {
over: true, over: true,
operation: OperationEvent.Train.trainSetRoute.confirm.operation, operation: OperationEvent.Train.trainSetRoute.confirm.operation,
cmdType: CMD.Train.CMD_TRAIN_SET_ROUTE, cmdType: CMD.Train.CMD_TRAIN_SET_ROUTE,
param: { routes: this.routeCodeList } param: { routeCodes: this.routeCodeList, groupNumber: this.selectTrainCode }
}; };
this.$store.dispatch('training/nextNew', operate).then(({valid}) => { this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) { if (valid) {

View File

@ -1,17 +1,29 @@
<template> <template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false"> <el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row> <el-row>
<el-table :data="trainList" height="300px"> <el-table ref="trainTable" :data="tableData" height="300px" highlight-current-row @current-change="handleCurrentChange">
<el-table-column prop="code" label="列车" /> <el-table-column prop="code" label="列车">
<el-table-column prop="interval" label="班次" /> <template slot-scope="scope">
<span>{{ scope.row }}</span>
</template>
</el-table-column>
<el-table-column prop="interval" label="班次">
<template slot-scope="scope">
<span>{{ getServiceNum(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column v-if="isDepart" prop="interval" label="模式" /> <el-table-column v-if="isDepart" prop="interval" label="模式" />
<el-table-column v-if="isDepart" prop="interval" label="状态" /> <el-table-column v-if="isDepart" prop="interval" label="状态" />
<el-table-column v-if="isDepart||isBreakAway" prop="interval" label="运行线" /> <el-table-column v-if="isDepart||isBreakAway" prop="interval" label="运行线">
<template slot-scope="scope">
<span>{{ getTrainDestinationCode(scope.row) }}</span>
</template>
</el-table-column>
</el-table> </el-table>
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="4" :offset="1"> <el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定(O)</el-button> <el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selectTrainCode" @click="commit">确定(O)</el-button>
</el-col> </el-col>
<el-col :span="4" :offset="2"> <el-col :span="4" :offset="2">
<el-button>应用(A)</el-button> <el-button>应用(A)</el-button>
@ -30,7 +42,7 @@
<script> <script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
export default { export default {
@ -46,13 +58,12 @@ export default {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
activeName: 'first', activeName: 'first',
operate: {} operate: {},
tableData: [],
selectTrainCode: ''
}; };
}, },
computed: { computed: {
...mapGetters('map', [
'trainList'
]),
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
@ -101,7 +112,10 @@ export default {
this.operate = operate; this.operate = operate;
// //
this.dialogShow = true; this.dialogShow = true;
this.selectTrainCode = '';
this.tableData = this.$store.state.map.activeTrainList;
this.$nextTick(function () { this.$nextTick(function () {
this.$refs.trainTable && this.$refs.trainTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
@ -110,10 +124,35 @@ export default {
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
getServiceNum(code) {
const train = this.$store.getters['map/getDeviceByCode'](code);
return (train || {}).serviceNumber;
},
getTrainDestinationCode(trainCode) {
const train = this.$store.getters['map/getDeviceByCode'](trainCode);
return train.destinationCode;
},
commit() { commit() {
const operate = {
over: true,
operation: OperationEvent.Train.trainSetRoute.confirm.operation,
cmdType: CMD.Train.CMD_TRAIN_DEPARTURE,
param: { groupNumber: this.selectTrainCode }
};
this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) {
this.doClose();
}
}).catch(error => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
}, },
handleClick() { handleClick() {
},
handleCurrentChange(val) {
this.selectTrainCode = val;
}, },
cancel() { cancel() {
const operate = { const operate = {

View File

@ -2,8 +2,8 @@
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="1000px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false"> <el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="1000px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
<el-table :id="domIdChoose" ref="trainTable" :data="tableData" height="397px" style="margin-top: 57px" :highlight-current-row="true" @current-change="handleChangeTrain"> <el-table :id="domIdChoose" ref="trainTable" :cell-style="getCellStyle" :data="tableData" height="397px" style="margin-top: 57px" :highlight-current-row="true" @current-change="handleChangeTrain">
<el-table-column prop="trainName" label="列车" /> <el-table-column prop="code" label="列车" />
<!-- <el-table-column prop="groupNumber" label="班次" /> --> <!-- <el-table-column prop="groupNumber" label="班次" /> -->
<el-table-column prop="runPathName" label="运行线" /> <el-table-column prop="runPathName" label="运行线" />
<!-- <el-table-column prop="length" label="长度" /> <!-- <el-table-column prop="length" label="长度" />
@ -35,7 +35,7 @@
</el-row> </el-row>
<el-row style="margin-top: 20px;"> <el-row style="margin-top: 20px;">
<el-col :span="12" style="padding-right: 10px;"> <el-col :span="12" style="padding-right: 10px;">
<el-table height="160px"> <el-table ref="pathTable" height="160px">
<el-table-column prop="path" label="路径" /> <el-table-column prop="path" label="路径" />
<el-table-column prop="direction" label="运行方向" /> <el-table-column prop="direction" label="运行方向" />
</el-table> </el-table>
@ -46,10 +46,14 @@
</el-row> </el-row>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="班次" name="third"> <el-tab-pane label="班次" name="third">
<el-table :data="trainList" height="382px"> <el-table ref="serviceTable" :data="serviceNumberDataList" height="382px" highlight-current-row @current-change="handleServiceChange">
<el-table-column prop="class" label="班次" /> <el-table-column prop="serviceNumber" label="班次" />
<el-table-column prop="length" label="长度" /> <el-table-column prop="length" label="长度" />
<el-table-column prop="code" label="列车" /> <el-table-column prop="code" label="列车">
<template slot-scope="scope">
<span>{{ getTrainName(scope.row) }}</span>
</template>
</el-table-column>
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -98,7 +102,10 @@ export default {
selectStandCode: '', selectStandCode: '',
showPath: false, showPath: false,
selectedTrain:'', selectedTrain:'',
selectedRunPath:'' selectedRunPath:'',
selectedService: '',
serviceNumberDataList: [],
operate: ''
}; };
}, },
computed: { computed: {
@ -109,9 +116,6 @@ export default {
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
// selected() {
// return this.$store.state.menuOperation.selected;
// },
domIdClose() { domIdClose() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
@ -130,16 +134,15 @@ export default {
}, },
watch: { watch: {
'$store.state.map.runLineTrainUpdate': function (val) { '$store.state.map.runLineTrainUpdate': function (val) {
if (val) { // if (val) {
this.getTrainList(); // // this.getTrainList();
this.status = true; // this.status = true;
} else { // } else {
this.tableData = []; // // this.tableData = [];
}
}
// '$store.state.training.runPathList':function(val) {
// console.log(val);
// } // }
// this.$refs.trainTable && this.$refs.trainTable.doLayout();
this.tableData = [...this.trainList];
}
}, },
mounted() { mounted() {
getSimulationDestinationList(this.$route.query.group).then(res=>{ getSimulationDestinationList(this.$route.query.group).then(res=>{
@ -154,13 +157,18 @@ export default {
console.log('展开进路预览'); console.log('展开进路预览');
}, },
doShow(operate, activeName) { doShow(operate, activeName) {
this.getTrainList(); // this.getTrainList();
// this.$store.dispatch('menuOperation/setSelected', {device: selected}); this.tableData = [];
this.tableData = [...this.trainList];
this.operate = operate;
this.activeName = activeName; this.activeName = activeName;
this.serviceNumberDataList = this.$store.state.runPlan.serviceNumberDataList;
// //
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$refs.runLineTable && this.$refs.runLineTable.setCurrentRow();
this.$refs.serviceTable && this.$refs.serviceTable.setCurrentRow();
}); });
}, },
getTrainList() { getTrainList() {
@ -177,6 +185,13 @@ export default {
this.tableData.push({code:train.groupNumber + ':' + train.serviceNumber, trainName:trainName, runPathName:destinationCode}); this.tableData.push({code:train.groupNumber + ':' + train.serviceNumber, trainName:trainName, runPathName:destinationCode});
}); });
}, },
getCellStyle(data) {
if (this.$store.state.map.activeTrainList.includes(data.row.code)) {
return { color: '#000' };
} else {
return { color: '#808080' };
}
},
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
@ -197,7 +212,6 @@ export default {
const trainInfo = this.selectedTrain.split(':'); const trainInfo = this.selectedTrain.split(':');
const params = { const params = {
groupNumber: trainInfo[0], groupNumber: trainInfo[0],
destinationCode: this.selectedRunPath,
serviceNumber: trainInfo[1] serviceNumber: trainInfo[1]
}; };
const steps = { const steps = {
@ -205,7 +219,14 @@ export default {
over: true, over: true,
param:params param:params
}; };
if (this.activeName === 'third') {
steps.cmdType = CMD.Train.CMD_TRAIN_DISTRIBUTE;
steps.operation = isClose ? OperationEvent.Train.trainDistribute.confirm.operation : OperationEvent.Command.common.apply.operation;
steps.param.serviceNumber = this.selectedService;
} else if (this.activeName === 'first') {
steps.cmdType = CMD.TrainWindow.CMD_TRAIN_SET_HEAD; steps.cmdType = CMD.TrainWindow.CMD_TRAIN_SET_HEAD;
steps.param.destinationCode = this.selectedRunPath;
}
this.$store.dispatch('training/nextNew', steps).then(({ valid }) => { this.$store.dispatch('training/nextNew', steps).then(({ valid }) => {
if (valid) { if (valid) {
this.loading = false; this.loading = false;
@ -213,7 +234,7 @@ export default {
this.doClose(); this.doClose();
} }
} }
}).catch(() => { }).catch((e) => {
isClose && this.doClose(); isClose && this.doClose();
this.loading = false; this.loading = false;
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();
@ -221,14 +242,32 @@ export default {
}, },
handleClick() { handleClick() {
this.selectedRunPath = '';
this.selectedService = '';
this.$refs.runLineTable && this.$refs.runLineTable.setCurrentRow();
this.$refs.serviceTable && this.$refs.serviceTable.setCurrentRow();
}, },
judgeCanCommit() { judgeCanCommit() {
if (this.selectedTrain && this.selectedRunPath) { if (this.selectedTrain && (this.selectedRunPath || this.selectedService)) {
this.status = false; this.status = false;
} else { } else {
this.status = true; this.status = true;
} }
}, },
handleServiceChange(row) {
if (!row) { return; }
const step = {
operation: OperationEvent.Train.trainDistribute.selected2.operation,
params: { serviceNumber: row.serviceNumber }
};
const _that = this;
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
_that.selectedService = row.serviceNumber;
_that.judgeCanCommit();
}
});
},
handleChange(row) { handleChange(row) {
if (row) { if (row) {
const runPath = row.runPath; const runPath = row.runPath;
@ -286,6 +325,10 @@ export default {
}, },
handleChangeTrain(row) { handleChangeTrain(row) {
if (row) { if (row) {
if (!this.$store.state.map.activeTrainList.includes(row.code)) {
this.$refs.trainTable && this.$refs.trainTable.setCurrentRow();
return;
}
const step = { const step = {
code: row.code, code: row.code,
operation: OperationEvent.Command.common.choose.operation, operation: OperationEvent.Command.common.choose.operation,
@ -304,8 +347,17 @@ export default {
} }
}, },
getTrainName(data) {
const nowDate = new Date();
const time = nowDate.getHours() * 3600 + nowDate.getMinutes() * 60 + nowDate.getSeconds();
const trip = data.tripNumberDataList.find((item) => {
return item.startSecondTime <= time && item.endSecondTime >= time;
});
if (trip) {
return data.serviceNumber + trip.tripNumber;
}
},
setRunPath(runPath, isShow) { setRunPath(runPath, isShow) {
// console.log(isShow, runPath);
runPath.forEach(sectionCode=>{ runPath.forEach(sectionCode=>{
const section = this.$store.getters['map/getDeviceByCode'](sectionCode); const section = this.$store.getters['map/getDeviceByCode'](sectionCode);
if (section && section.instance) { if (section && section.instance) {

View File

@ -2,25 +2,33 @@
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="500px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false"> <el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="500px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14">
<el-table :data="trainList" height="300px"> <el-table ref="trainTable" :data="tableData" height="300px" :highlight-current-row="true" @current-change="handleChangeTrain">
<el-table-column prop="code" label="列车" /> <el-table-column prop="code" label="列车">
<template slot-scope="scope">
<span>{{ scope.row }}</span>
</template>
</el-table-column>
<el-table-column prop="area" label="模式" /> <el-table-column prop="area" label="模式" />
<el-table-column prop="status" label="运行类型" /> <el-table-column prop="status" label="运行类型">
<template slot-scope="scope">
<span>{{ getRunType(scope.row) }}</span>
</template>
</el-table-column>
</el-table> </el-table>
</el-col> </el-col>
<el-col :span="10" style="padding-left: 5px;color: #000;"> <el-col :span="10" style="padding-left: 5px;color: #000;">
<el-table :data="runTypeList" height="250px"> <el-table ref="runTypeTable" :data="runTypeList" height="250px" :highlight-current-row="true" @current-change="handleChangeRunType">
<el-table-column prop="label" label="运行类型" /> <el-table-column prop="label" label="运行类型" />
</el-table> </el-table>
<div style="margin-top: 10px;"> <div style="margin-top: 10px;">
<el-checkbox v-model="allCheck" style="display: inline-block;">所有列车(I)</el-checkbox> <el-checkbox v-model="allCheck" :disabled="true" style="display: inline-block;">所有列车(I)</el-checkbox>
<el-button style="display: inline-block;">复位(R)</el-button> <el-button style="display: inline-block;">复位(R)</el-button>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="4" :offset="1"> <el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定(O)</el-button> <el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="commitDisabled" @click="commit">确定(O)</el-button>
</el-col> </el-col>
<el-col :span="4" :offset="2"> <el-col :span="4" :offset="2">
<el-button>应用(A)</el-button> <el-button>应用(A)</el-button>
@ -39,7 +47,7 @@
<script> <script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { mapGetters } from 'vuex'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'ModifyTrainNumber', name: 'ModifyTrainNumber',
@ -57,22 +65,28 @@ export default {
operate: {}, operate: {},
allCheck: false, allCheck: false,
slidingTime: 0, slidingTime: 0,
data: [], tableData: [],
trainId: '', trainId: '',
groupNumber: '', groupNumber: '',
selectTrainCode: '',
selectRunType: '',
runTypeList: [ runTypeList: [
{label: '节能', value: 1}, {label: '节能', value: 'ENERGY_CONSERVATION'},
{label: '中间的2', value: 2}, {label: '中间的2', value: 'MIDDLE_TWO'},
{label: '中间的1', value: 3}, {label: '中间的1', value: 'MIDDLE_ONE'},
{label: '正常', value: 4}, {label: '正常', value: 'NORMAL'},
{label: '加速', value: 5} {label: '加速', value: 'ACCELERATE'}
] ],
runTypeMap: {
ENERGY_CONSERVATION: '节能',
MIDDLE_TWO: '中间的2',
MIDDLE_ONE: '中间的1',
NORMAL: '正常',
ACCELERATE: '加速'
}
}; };
}, },
computed: { computed: {
...mapGetters('map', [
'trainList'
]),
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
@ -88,8 +102,11 @@ export default {
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : ''; return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
}, },
commitDisabled() {
return !(this.selectTrainCode && this.selectRunType);
},
title() { title() {
return '修改列车描述号'; return '设置列车运行类型';
} }
}, },
watch: { watch: {
@ -97,13 +114,21 @@ export default {
if (this.show) { if (this.show) {
this.commit(); this.commit();
} }
},
'$store.state.map.runLineTrainUpdate': function (val) {
this.tableData = [...this.$store.state.map.activeTrainList];
} }
}, },
methods: { methods: {
doShow(operate) { doShow(operate) {
// //
this.dialogShow = true; this.dialogShow = true;
this.selectRunType = '';
this.selectTrainCode = '';
this.tableData = [...this.$store.state.map.activeTrainList];
this.$nextTick(function () { this.$nextTick(function () {
this.$refs.trainTable && this.$refs.trainTable.setCurrentRow();
this.$refs.runTypeTable && this.$refs.runTypeTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
@ -112,10 +137,56 @@ export default {
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
commit() { getRunType(code) {
const train = this.$store.getters['map/getDeviceByCode'](code);
if (train) {
return this.runTypeMap[train.runType];
}
}, },
handleClick() { commit() {
const operate = {
over: true,
operation: OperationEvent.Train.trainSetRunType.confirm.operation,
cmdType: CMD.Train.CMD_TRAIN_SET_RUN_TYPE,
param: { runType: this.selectRunType, groupNumber: this.selectTrainCode }
};
this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) {
this.doClose();
}
}).catch(error => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleChangeRunType(row) {
if (row) {
this.selectRunType = row.value;
}
},
handleChangeTrain(code) {
this.selectTrainCode = code;
const train = this.$store.getters['map/getDeviceByCode'](code);
if (train) {
this.selectRunType = train.runType;
switch (train.runType) {
case 'ENERGY_CONSERVATION':
this.$refs.runTypeTable && this.$refs.runTypeTable.setCurrentRow(this.runTypeList[0]);
break;
case 'MIDDLE_TWO':
this.$refs.runTypeTable && this.$refs.runTypeTable.setCurrentRow(this.runTypeList[1]);
break;
case 'MIDDLE_ONE':
this.$refs.runTypeTable && this.$refs.runTypeTable.setCurrentRow(this.runTypeList([2]));
break;
case 'NORMAL':
this.$refs.runTypeTable && this.$refs.runTypeTable.setCurrentRow(this.runTypeList[3]);
break;
case 'ACCELERATE':
this.$refs.runTypeTable && this.$refs.runTypeTable.setCurrentRow(this.runTypeList[4]);
break;
}
}
}, },
cancel() { cancel() {
const operate = { const operate = {

View File

@ -269,7 +269,13 @@ export default {
CMD_TRAIN_ORDER_STOP: {value: 'Train_Order_Stop', label:'下令停车'}, CMD_TRAIN_ORDER_STOP: {value: 'Train_Order_Stop', label:'下令停车'},
/** 取消停车命令 */ /** 取消停车命令 */
CMD_TRAIN_CANCEL_ORDER_STOP: {value: 'Train_Cancel_Order_Stop', label:'取消停车命令'}, CMD_TRAIN_CANCEL_ORDER_STOP: {value: 'Train_Cancel_Order_Stop', label:'取消停车命令'},
CMD_TRAIN_SET_ROUTE: {value: 'Train_Set_Route', label: '列车排列进路'} CMD_TRAIN_SET_ROUTE: {value: 'Train_Set_Route', label: '列车排列进路'},
/** 列车发车(泰雷兹) */
CMD_TRAIN_DEPARTURE: {value: 'Train_Departure', label: '列车发车'},
/** 分配班次 */
CMD_TRAIN_DISTRIBUTE: {value: 'Train_Distribute', label: '分配班次'},
/** 设置运行类型 */
CMD_TRAIN_SET_RUN_TYPE : {value: 'Train_Set_Run_Type', label: '设置运行类型' }
}, },
TrainWindow: { TrainWindow: {
/** 修改列车识别号 */ /** 修改列车识别号 */

View File

@ -58,7 +58,6 @@ class CommandHandle {
getDefinition(cmdType) { getDefinition(cmdType) {
if (cmdType) { if (cmdType) {
const simulationRole = Handler.getSimulationRole(); const simulationRole = Handler.getSimulationRole();
if (simulationRole) { if (simulationRole) {
return this.definitionMap[simulationRole][cmdType.value] || this.definitionMap.Common[cmdType.value] || null; return this.definitionMap[simulationRole][cmdType.value] || this.definitionMap.Common[cmdType.value] || null;
} else { } else {

View File

@ -627,7 +627,7 @@ export const OperationEvent = {
// 锁闭区段 // 锁闭区段
line_sectionLock: { line_sectionLock: {
operation: '00c', operation: '00c',
domId: '_Tips-ningBo-line_sectionLock{TOP}', domId: '_Tips-ningBo-line_sectionLock{TOP}'
}, },
// 取消转换锁闭 // 取消转换锁闭
line_sectionLock_cancelTransferLock: { line_sectionLock_cancelTransferLock: {
@ -1294,6 +1294,14 @@ export const OperationEvent = {
secondaryConfirm: { secondaryConfirm: {
operation: '3014', operation: '3014',
domId: '_Tips-Signal-ArrangementRoute-SecondaryConfirm' domId: '_Tips-Signal-ArrangementRoute-SecondaryConfirm'
},
toStand: {
operation: '3015',
domId: '_Tips-Signal-ArrangementRoute-ToStand'
},
toSignal: {
operation: '3016',
domId: '_Tips-Signal-ArrangementRoute-ToSignal'
} }
}, },
// 取消进路 // 取消进路
@ -3076,6 +3084,42 @@ export const OperationEvent = {
operation: '70r1', operation: '70r1',
domId: '_Tips-Train-trainSetRoute-Confirm' domId: '_Tips-Train-trainSetRoute-Confirm'
} }
},
trainDistribute: {
menu: {
operation: '70s',
domId: '_Tips-Train-trainDistribute-Menu'
},
selected1: {
operation: '70s1',
domId: '_Tips-Train-trainDistribute-Selected1'
},
selected2: {
operation: '70s2',
domId: '_Tips-Train-trainDistribute-Selected2'
},
confirm: {
operation: '70s3',
domId: '_Tips-Train-trainDistribute-Confirm'
}
},
trainSetRunType: {
menu: {
operation: '70t',
domId: '_Tips-Train-trainSetRunType-Menu'
},
selected1: {
operation: '70t1',
domId: '_Tips-Train-trainSetRunType-Selected1'
},
selected2: {
operation: '70t2',
domId: '_Tips-Train-trainSetRunType-Selected2'
},
confirm: {
operation: '70t3',
domId: '_Tips-Train-trainSetRunType-Confirm'
}
} }
}, },

View File

@ -17,7 +17,8 @@ const runPlan = {
draftStations: [], // 草稿运行图车站列表 draftStations: [], // 草稿运行图车站列表
runPlanMap: {}, // 运行图数据map以id和version 为标识) runPlanMap: {}, // 运行图数据map以id和version 为标识)
runPlanInfo: {}, // 运行图信息 runPlanInfo: {}, // 运行图信息
loadRunPlanCount: 0 // 运行图加载数据完成 loadRunPlanCount: 0, // 运行图加载数据完成
serviceNumberDataList: [] // 运行图数据
}, },
getters: { getters: {
stations: (state) => { stations: (state) => {
@ -68,6 +69,7 @@ const runPlan = {
state.planData = data; state.planData = data;
state.editData = {}; state.editData = {};
if (data && data.serviceNumberDataList && data.serviceNumberDataList.length) { if (data && data.serviceNumberDataList && data.serviceNumberDataList.length) {
state.serviceNumberDataList = data.serviceNumberDataList;
const serviceList = data.serviceNumberDataList; const serviceList = data.serviceNumberDataList;
serviceList.forEach((service, i) => { serviceList.forEach((service, i) => {
const trainList = service.tripNumberDataList; const trainList = service.tripNumberDataList;
@ -117,6 +119,7 @@ const runPlan = {
state.planData = {}; state.planData = {};
state.editData = {}; state.editData = {};
state.selected = {}; state.selected = {};
state.serviceNumberDataList = [];
}, },
draftClear: (state) => { draftClear: (state) => {
state.draftPlanData = {}; state.draftPlanData = {};

View File

@ -2,10 +2,10 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪 // BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.8.169:9000'; // 旭强 // BASE_API = 'http://192.168.8.169:9000'; // 旭强
// BASE_API = 'http://192.168.8.119:9000'; // 张赛 BASE_API = 'http://192.168.8.119:9000'; // 张赛
// BASE_API = 'http://192.168.8.140:9000'; // 杜康 // BASE_API = 'http://192.168.8.140:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康