新建列车调整

This commit is contained in:
fan 2020-05-22 11:09:00 +08:00
parent 1c9301a3d5
commit d7c5a1303d
13 changed files with 223 additions and 29 deletions

View File

@ -116,8 +116,7 @@ export default {
}, },
mounted() { mounted() {
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
const isTest = process.env.NODE_ENV === 'test'; if (isDev) {
if (isDev || isTest) {
this.menuNormal.Center.push({ this.menuNormal.Center.push({
label: '新建计划车', label: '新建计划车',
handler: this.addPlanTrain, handler: this.addPlanTrain,

View File

@ -102,8 +102,7 @@ export default {
}, },
mounted() { mounted() {
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
const isTest = process.env.NODE_ENV === 'test'; if (isDev) {
if (isDev || isTest) {
this.menuNormal.Center.push( { this.menuNormal.Center.push( {
label: '新建计划列车', label: '新建计划列车',
handler: this.createPlanTrain, handler: this.createPlanTrain,

View File

@ -106,8 +106,7 @@ export default {
}, },
mounted() { mounted() {
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
const isTest = process.env.NODE_ENV === 'test'; if (isDev) {
if (isDev || isTest) {
this.menuNormal.Center.push( { this.menuNormal.Center.push( {
label: '新建计划列车', label: '新建计划列车',
handler: this.createPlanTrain, handler: this.createPlanTrain,

View File

@ -117,8 +117,7 @@ export default {
}, },
mounted() { mounted() {
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
const isTest = process.env.NODE_ENV === 'test'; if (isDev) {
if (isDev || isTest) {
this.menuNormal.Center.push({ this.menuNormal.Center.push({
label: '新建计划车', label: '新建计划车',
handler: this.addPlanTrain, handler: this.addPlanTrain,

View File

@ -164,8 +164,7 @@ export default {
}, },
mounted() { mounted() {
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
const isTest = process.env.NODE_ENV === 'test'; if (isDev) {
if (isDev || isTest) {
this.menuNormal.Center.push({ this.menuNormal.Center.push({
label: '新建计划车', label: '新建计划车',
handler: this.addPlanTrain, handler: this.addPlanTrain,

View File

@ -111,8 +111,7 @@ export default {
}, },
mounted() { mounted() {
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
const isTest = process.env.NODE_ENV === 'test'; if (isDev) {
if (isDev || isTest) {
this.menuNormal.Center.push({ this.menuNormal.Center.push({
label: '新建计划车', label: '新建计划车',
handler: this.createPlanTrain, handler: this.createPlanTrain,

View File

@ -135,8 +135,7 @@ export default {
}, },
mounted() { mounted() {
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
const isTest = process.env.NODE_ENV === 'test'; if (isDev) {
if (isDev || isTest) {
this.menuNormal.Center.push({ this.menuNormal.Center.push({
label: '新建计划车', label: '新建计划车',
handler: this.addPlanTrain, handler: this.addPlanTrain,

View File

@ -0,0 +1,180 @@
<template>
<el-dialog v-dialogDrag class="xian-01__systerm train-control" :title="title" :visible.sync="show" width="370px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-select
v-model="groupNumber"
filterable
:disabled="true"
>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.groupNumber"
/>
</el-select>
<el-table :data="tableData" :show-header="false">
<el-table-column prop="key" label="key" />
<el-table-column prop="value" label="value" />
</el-table>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import Handler from '@/scripts/cmdPlugin/Handler';
import { menuOperate, commitOperate } from '../utils/menuOperate';
export default {
name: 'TrainControl',
components: {
},
data() {
return {
trainList: [],
tableData: [],
baseInfo: [],
marshallingInfo: [],
planInfo: [],
atcInfo: [],
operation: null,
dialogShow: false,
loading: false,
groupNumber: ''
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdConfirm() {
return OperationEvent.Train.trainDetailInfo.confirm.operation;
},
domIdCancel() {
return OperationEvent.Command.cancel.menu.domId;
},
title() {
return '列车详细运行信息';
}
},
watch: {},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
const model = this.$store.getters['map/getDeviceByCode'](selected.code);
this.groupNumber = model.groupNumber;
this.baseInfo = [
{key: '车组号', value: model.groupNumber},
{key: '车次号', value: ''},
{key: '表号', value: ''},
{key: '目的地号', value: ''},
{key: '类型', value: ''},
{key: '司机号', value: ''},
{key: '车站', value: ''},
{key: '所处设备', value: ''},
{key: '跟踪模式', value: ''},
{key: 'ATP切除', value: ''},
{key: '停站状态', value: ''}
];
this.marshallingInfo = [
{key: '车组号', value: ''},
{key: '设备ID', value: ''},
{key: '车头号1', value: ''},
{key: '车头号2', value: ''},
{key: '车厢号1', value: ''},
{key: '车厢号2', value: ''},
{key: '车厢号3', value: ''},
{key: '车厢号4', value: ''},
{key: '车厢号5', value: ''},
{key: '车厢号6', value: ''},
{key: '车厢号7', value: ''},
{key: '车厢号8', value: ''}
];
this.planInfo = [
{key: '车组号', value: ''},
{key: '车次号', value: ''},
{key: '表号', value: ''},
{key: '运行等级', value: ''},
{key: '状态', value: ''},
{key: '计划偏离', value: ''},
{key: '停站时间', value: ''},
{key: '计划到站', value: ''},
{key: '计划到点', value: ''},
{key: '计划发点', value: ''},
{key: '终端发车站台', value: ''},
{key: '终端发车时间', value: ''},
{key: '预计离开站台', value: ''},
{key: '预计离开时间', value: ''},
{key: '预计到达站台', value: ''},
{key: '预计到达时间', value: ''},
{key: '区间运行时分', value: ''}
];
this.atcInfo = [
{key: '车组号', value: ''},
{key: '车次号', value: ''},
{key: '表号', value: ''},
{key: '运行方向', value: ''},
{key: '扣车状态', value: ''},
{key: '车门状态', value: ''},
{key: '驾驶模式', value: ''},
{key: '目的地号', value: ''}
];
this.tableData = this.baseInfo;
/** 加载列车数据*/
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},
commit() {
const operate = {
operation: OperationEvent.Train.trainDetailInfo.confirm.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -148,8 +148,7 @@ export default {
}, },
mounted() { mounted() {
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
const isTest = process.env.NODE_ENV === 'test'; if (isDev) {
if (isDev || isTest) {
this.menuNormal.Center.push({ this.menuNormal.Center.push({
label: '新建计划车', label: '新建计划车',
handler: this.addPlanTrain, handler: this.addPlanTrain,

View File

@ -52,12 +52,12 @@ export default {
{ {
label: this.$t('menu.menuTrain.addTrainId'), label: this.$t('menu.menuTrain.addTrainId'),
handler: this.addTrainId, handler: this.addTrainId,
cmdType:CMD.TrainWindow.CMD_TRAIN_ADD_TRAIN_TRACE cmdType:''
}, },
{ {
label: this.$t('menu.menuTrain.deleteTrainId'), label: this.$t('menu.menuTrain.deleteTrainId'),
handler: this.delTrainId, handler: this.delTrainId,
cmdType:CMD.TrainWindow.CMD_TRAIN_REMOVE_TRAIN_TRACE cmdType:''
}, },
{ {
label: this.$t('menu.menuTrain.editTrainId'), label: this.$t('menu.menuTrain.editTrainId'),
@ -67,17 +67,32 @@ export default {
{ {
label: this.$t('menu.menuTrain.editTrainNo'), label: this.$t('menu.menuTrain.editTrainNo'),
handler: this.editTrainNo, handler: this.editTrainNo,
cmdType:CMD.TrainWindow.CMD_SWITCH_SINGLE_LOCK cmdType:''
}, },
{ {
label: this.$t('menu.menuTrain.moveTrainId'), label: this.$t('menu.menuTrain.moveTrainId'),
handler: this.moveTrainId, handler: this.moveTrainId,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK cmdType:''
}, },
{ {
label: this.$t('menu.menuTrain.switchTrainId'), label: this.$t('menu.menuTrain.switchTrainId'),
handler: this.switchTrainId, handler: this.switchTrainId,
cmdType:CMD.Switch.CMD_SWITCH_REMOVE_FAULT cmdType:''
},
{
label: '标记ATP切除',
handler: this.undeveloped(),
cmdType: CMD.TrainWindow.CMD_TRAIN_TAG_ATP_CUT
},
{
label: '标记ATP激活',
handler: this.undeveloped(),
cmdType: CMD.TrainWindow.CMD_TRAIN_TAG_ATP_RECOVER
},
{
label: '查看列车详细运行信息',
handler: this.undeveloped(),
cmdType: CMD.TrainWindow.CMD_TRAIN_INFO
} }
] ]
}, },
@ -139,10 +154,6 @@ export default {
if (this.operatemode === OperateMode.FAULT) { if (this.operatemode === OperateMode.FAULT) {
this.menu = [...this.menuForce, ...this.menuSpeed]; this.menu = [...this.menuForce, ...this.menuSpeed];
} }
// this.menu = this.menuNormal.Center;
// console.log(this.menu, '222222222222222');
// this.menu = MenuContextHandler.covert(this.menu);
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();
@ -306,6 +317,7 @@ export default {
} }
}); });
}, },
undeveloped() {},
// //
switchTrainId() { switchTrainId() {
const step = { const step = {

View File

@ -154,8 +154,7 @@ export default {
}, },
mounted() { mounted() {
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
const isTest = process.env.NODE_ENV === 'test'; if (isDev) {
if (isDev || isTest) {
this.menuNormal.Center.push({ this.menuNormal.Center.push({
label: '新建计划车', label: '新建计划车',
handler: this.addPlanTrain, handler: this.addPlanTrain,

View File

@ -17,7 +17,8 @@ class CommandHandle {
Local: {}, Local: {},
Common: { Common: {
Set_Fault:{operate: 'Set_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]}, Set_Fault:{operate: 'Set_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]},
Cancel_Fault: {operate:'Cancel_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]} Cancel_Fault: {operate:'Cancel_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]},
Train_Init_Plan: {operate: 'Train_Init_Plan', paramList: [{name: 'sectionCode'}, {name: 'serviceNumber'}, {name: 'tripNumber'}]}
} }
}; };
(list || []).forEach(definition => { (list || []).forEach(definition => {

View File

@ -1954,8 +1954,18 @@ export const OperationEvent = {
operation: '70e4', operation: '70e4',
domId: '_Tips-Train-createPlanTrain-ChangeTripNumber' domId: '_Tips-Train-createPlanTrain-ChangeTripNumber'
} }
},
// 查看列车详细信息
trainDetailInfo: {
menu: {
operation: '70f',
domId: '_Tip-Train_trainDetailInfo-Menu'
},
confirm: {
operation: '70f1',
domId: '_Tips-Train-trainDetailInfo-Confirm'
}
} }
}, },
// 取消全线临时限速 // 取消全线临时限速