This commit is contained in:
fan 2022-05-27 09:51:51 +08:00
commit 5ebb0139ec
11 changed files with 468 additions and 200 deletions

View File

@ -1,3 +1,4 @@
/* 观的角度来看当前所处的位置。 */
import Group from 'zrender/src/container/Group';
import TrainBodyBox from './TrainBodyBox';
// import '../StationStand/EDetain';

View File

@ -501,6 +501,21 @@ export const menuOperate = {
deletDestionation: {
operation: OperationEvent.Train.deleteDestinationTrainId.menu.operation,
cmdType: CMD.TrainWindow.CMD_TRAIN_SET_MANUAL
},
updateTrip:{
// 修改车次号 (大铁线路 车次号 车组号)
operation: OperationEvent.Train.updateTrip.menu.operation,
cmdType: CMD.Train.CMD_TRAIN_UPDATE_TRIP_NUMBER_TRAIN
},
updateTripCommit:{
// 修改车次号 (大铁线路 车次号 车组号)
operation: OperationEvent.Train.updateTrip.confirm.operation,
cmdType: CMD.Train.CMD_TRAIN_UPDATE_TRIP_NUMBER_TRAIN
},
removeTrip:{
// 删车次号 (大铁线路 车组号)
operation: OperationEvent.Train.removeTrip.menu.operation,
cmdType: CMD.Train.CMD_TRAIN_REMOVE_TRAIN_TRACE
}
},
CTC: {

View File

@ -20,7 +20,7 @@
<div class="tripNumberTips">{{ messageTip1 }}</div>
</el-col>
<el-col :span="11" :offset="1">
<el-select v-model="addModel.right" size="mini">
<el-select v-model="addModel.right" size="mini" disabled>
<el-option :value="true" :label="rightTrueLabel" />
<el-option :value="false" :label="rightFalseLabel" />
</el-select>
@ -118,18 +118,22 @@ export default {
const figuresOfServiceMaxNumber = 6;
// this.$store.state.map.mapConfig.figuresOfServiceNumber;
const tripNumber = this.addModel.tripNumber;
const judge = /^[a-zA-Z0-9]{1,}$/.test(this.addModel.tripNumber);
const judge = /^[a-zA-Z0-9]*[\d]$/.test(this.addModel.tripNumber);
if (judge) {
if (tripNumber.toString().length > figuresOfServiceMaxNumber || tripNumber.toString().length < figuresOfServiceMinNumber) {
this.messageTip1 = '车次号长度' + figuresOfServiceMinNumber + '-' + figuresOfServiceMaxNumber + '位';
} else {
this.addModel.tripNumber = tripNumber;
this.messageTip1 = '';
const result = this.addModel.tripNumber.match(/[\d]$(?=[a-zA-Z0-9]*)/);
if (result) {
const is_even = result[0] % 2 == 0;
this.addModel.right = is_even;
}
}
} else {
// debugger;
this.addModel.tripNumber = '';
this.messageTip1 = '请输入车次号';
this.messageTip1 = '请输入车次号(最后一位必须是数字)';
}
},
commit() {
@ -143,10 +147,10 @@ export default {
result = true;
}
if (this.addModel.tripNumber && result) {
if (this.addModel.right === '') {
this.messageTip2 = '请选择上下行';
return;
}
// if (this.addModel.right === '') {
// this.messageTip2 = '';
// return;
// }
const params = {
tripNumber: this.addModel.tripNumber,
sectionCode: this.addModel.sectionCode,
@ -170,7 +174,6 @@ export default {
} else {
this.messageTip1 = '请输入车次号';
}
}
},
cancel() {

View File

@ -0,0 +1,165 @@
<template>
<el-dialog
v-dialogDrag
class="chengdou-03__systerm updateTrip"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div style="display: inline-block;margin-left:22px;">
<span class="tripNumberName">车次号:</span>
<div class="tripNumberClass">
<el-input v-model="tripNumber" size="mini" @blur="handleTripNumber" />
<div class="tripNumberTips">{{ messageTip1 }}</div>
</div>
</div>
<el-row justify="center" class="button-group">
<el-col :span="8" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'UpdateTrip',
components: {
NoticeInfo
},
data() {
return {
dialogShow:false,
tripNumber: '',
messageTip1:'',
loading: false
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.updateTrip.confirm.domId : '';
},
domIdChangeTripNumber() {
return this.dialogShow ? OperationEvent.Train.updateTrip.changeTripNumber.domId : '';
},
title() {
return '修改车次号';
}
},
methods: {
doShow(operate, tripNumber) {
this.tripNumber = tripNumber;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
handleTripNumber() {
const figuresOfServiceMinNumber = 2;
const figuresOfServiceMaxNumber = 6;
// this.$store.state.map.mapConfig.figuresOfServiceNumber;
const tripNumber = this.tripNumber;
const judge = /^[a-zA-Z0-9]*[\d]$/.test(this.tripNumber);
if (judge) {
if (tripNumber.toString().length > figuresOfServiceMaxNumber || tripNumber.toString().length < figuresOfServiceMinNumber) {
this.messageTip1 = '车次号长度' + figuresOfServiceMinNumber + '-' + figuresOfServiceMaxNumber + '位';
} else {
// this.tripNumber = tripNumber;
this.messageTip1 = '';
}
} else {
this.tripNumber = '';
this.messageTip1 = '请输入车次号(最后一位数字)';
}
},
commit() {
const figuresOfServiceMinNumber = 2;
const figuresOfServiceMaxNumber = 6;
let result = false;
const tripNumber = this.tripNumber;
if (tripNumber.toString().length > figuresOfServiceMaxNumber || tripNumber.toString().length < figuresOfServiceMinNumber) {
result = false;
} else {
result = true;
}
if (this.tripNumber && result) {
const params = {
tripNumber: this.tripNumber
};
this.messageTip1 = '';
this.loading = true;
commitOperate(menuOperate.Train.updateTripCommit, params, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
} else {
if (this.tripNumber) {
this.messageTip1 = '该车次号长度' + figuresOfServiceMinNumber + '-' + figuresOfServiceMaxNumber + '位';
} else {
this.messageTip1 = '请输入车次号(最后一位数字)';
}
}
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.tripNumber = '';
this.$store.dispatch('training/emitTipFresh');
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.tripNumberClass{
display: inline-block;
width:140px
}
.tripNumberName{
margin-left: 5px;
height: 22px;
vertical-align: top;
margin-right:10px;
display: inline-block;
}
.tripNumberTips{
margin-top: 10px;
color: #f00;
font-size: 13px;
text-align: left;
}
</style>

View File

@ -63,6 +63,11 @@ export default {
// label: '',
// handler: this.baDeTrCall
// }
{
label: ' 增加车次',
handler: this.addSpare,
cmdType: CMD.Section.CMD_TRAIN_LOAD_TRIP_NUMBER_TRAIN
}
],
Center: [
// {
@ -75,6 +80,11 @@ export default {
// handler: this.detail,
// cmdType: CMD.Section.CMD_SECTION_DETAILS
// }
{
label: ' 增加车次',
handler: this.addSpare,
cmdType: CMD.Section.CMD_TRAIN_LOAD_TRIP_NUMBER_TRAIN
}
]
},
menuForce: [
@ -92,17 +102,12 @@ export default {
label: '触发故障管理',
handler: this.triggerFaultManagement,
cmdType: CMD.Fault.CMD_TRIGGER_FAULT
},
}
// {
// label: '',
// handler: this.loadSpare,
// cmdType: CMD.Section.CMD_TRAIN_LOAD_SPARE_TRAIN
// }
{
label: '增加备用车',
handler: this.addSpare,
cmdType: CMD.Section.CMD_TRAIN_LOAD_TRIP_NUMBER_TRAIN
}
]
};
},
@ -173,7 +178,7 @@ export default {
// });
// },
addSpare() {
commitOperate(menuOperate.Section.addSpareTrain, {sectionCode:this.selected.code}).then(({valid, operate})=>{
commitOperate(menuOperate.Section.addSpareTrain, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.addSpareTrain.doShow(operate, this.selected);
}

View File

@ -9,7 +9,8 @@
<train-delete-number ref="trainDeleteNumber" />
<train-detail-info ref="trainDetailInfo" />
<set-fault ref="setFault" pop-class="chengdou-03__systerm" />
<train-set-plan ref="trainSetPlan" />
<!-- <train-set-plan ref="trainSetPlan" /> -->
<update-trip ref="updateTrip" />
</div>
</template>
@ -25,7 +26,8 @@ import TrainMoveNumber from './dialog/trainMoveNumber';
import TrainCreateNumber from './dialog/trainCreateNumber';
import TrainDeleteNumber from './dialog/trainDeleteNumber';
import TrainDetailInfo from './dialog/trainDetailInfo';
import TrainSetPlan from './dialog/trainSetPlan';
// import TrainSetPlan from './dialog/trainSetPlan';
import UpdateTrip from './dialog/updateTrip';
import CancelMouseState from '@/mixin/CancelMouseState';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
@ -44,7 +46,8 @@ export default {
TrainDeleteNumber,
TrainDetailInfo,
SetFault,
TrainSetPlan
UpdateTrip
// TrainSetPlan
},
mixins: [
CancelMouseState
@ -62,19 +65,34 @@ export default {
menu: [],
menuNormal: {
Local: [
// {
// label: '',
// handler: this.setPlanTrain,
// cmdType: CMD.TrainWindow.CMD_TRAIN_SET_PLAN
// },
{
label: '设置计划车',
handler: this.setPlanTrain,
cmdType: CMD.TrainWindow.CMD_TRAIN_SET_PLAN
label: '变更车次号',
handler: this.modifyTripNumber,
cmdType: CMD.Train.CMD_TRAIN_UPDATE_TRIP_NUMBER_TRAIN
},
{
label: '删车次号',
handler: this.removeTripNumber,
cmdType: CMD.Train.CMD_TRAIN_REMOVE_TRAIN_TRACE
}
],
Center: [
{
label: '设置计划车',
handler: this.setPlanTrain,
cmdType: CMD.TrainWindow.CMD_TRAIN_SET_PLAN
label: '变更车次号',
handler: this.modifyTripNumber,
cmdType: CMD.Train.CMD_TRAIN_UPDATE_TRIP_NUMBER_TRAIN
}
// {
// label: '',
// handler: this.setPlanTrain,
// cmdType: CMD.TrainWindow.CMD_TRAIN_SET_PLAN
// }
// {
// label: '',
// handler: this.createTrainNo
// },
@ -183,6 +201,10 @@ export default {
{
label: '发车',
handler: this.handleDepartTrain
},
{
label: '停车',
handler: this.handleParkingTrain
}
],
menuSpeed: [
@ -334,20 +356,20 @@ export default {
});
},
//
setPlanTrain() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.editTrainId.menu.operation,
param: {}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainSetPlan.doShow(operate, this.selected);
}
});
},
// setPlanTrain() {
// const operate = {
// start: true,
// code: this.selected.code,
// operation: OperationEvent.Train.editTrainId.menu.operation,
// param: {}
// };
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.trainSetPlan.doShow(operate, this.selected);
// }
// });
// },
//
setPlanTrainId() {
const operate = {
@ -576,6 +598,36 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
handleParkingTrain() {
const group = this.$route.query.group;
const param = {
commandType: 'Parking_Train',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error)=> {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
modifyTripNumber() {
commitOperate(menuOperate.Train.updateTrip, {groupNumber:this.selected.groupNumber}, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.updateTrip.doShow(operate, this.selected.tripNumber);
}
});
},
removeTripNumber() {
commitOperate(menuOperate.Train.removeTrip, {groupNumber:this.selected.groupNumber}, 3).then(({valid, operate})=>{
if (valid) {
}
}).catch((error)=> {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
undeveloped() {
this.doClose();
this.$alert('实现中......', '提示', {

View File

@ -180,7 +180,6 @@ export default {
CMD_TRAIN_LOAD_TRIP_NUMBER_TRAIN: {value: 'Train_Load_Trip_Number_Train', label: '增加备用车'},
/** 分路不良 大铁线路使用*/
CMD_SECTION_DEFECTIVE_SHUNTING: {value: 'Section_Defective_Shunting', label: '分路不良'}
},
// 站台
@ -335,7 +334,11 @@ export default {
/** 选择调度模式 */
CMD_TRAIN_REGULATION : { value:'Train_Regulation', label:'选择调度模式' },
/** 计算列车间隔 */
CMD_TRAIN_CALCULATE_INTERVAL : {value: 'Train_Calculate_Interval', label: '计算列车间隔'}
CMD_TRAIN_CALCULATE_INTERVAL : {value: 'Train_Calculate_Interval', label: '计算列车间隔'},
/** 修改车次号 大铁线路使用*/
CMD_TRAIN_UPDATE_TRIP_NUMBER_TRAIN: {value: 'Train_Update_Trip_Number_Train', label: '变更车次号'},
/** 删除车次号 大铁线路使用*/
CMD_TRAIN_REMOVE_TRAIN_TRACE:{value: 'Train_Remove_Train_Trace', label: '删车次号'}
},
TrainWindow: {
/** 修改列车识别号 */

View File

@ -40,6 +40,10 @@ class CommandHandle {
operate: 'Train_Load_Trip_Number_Train',
paramList:[{name: 'tripNumber'}, {name: 'sectionCode'}, {name: 'right'}]
},
// Train_Update_Trip_Number_Train:{
// operate: 'Train_Update_Trip_Number_Train',
// paramList:[{name: 'tripNumber'}, {name: 'groupNumber'}]
// },
Train_Trust: {
operate: 'Train_Trust',
paramList:[{name: 'groupNumber'}, {name: 'targetDeviceCode'}],

View File

@ -3397,6 +3397,26 @@ export const OperationEvent = {
operation: '70t3',
domId: '_Tips-Train-trainSetRunType-Confirm'
}
},
updateTrip: {
menu: {
operation: '70u',
domId: '_Tips-Train-updateTrip-Menu'
},
changeTripNumber: {
operation: '70u1',
domId: '_Tips-Train-updateTrip-ChangeTripNumber'
},
confirm: {
operation: '70u2',
domId: '_Tips-Train-updateTrip-Confirm'
}
},
removeTrip:{
menu: {
operation: '70v',
domId: '_Tips-Train-removeTrip-Menu'
}
}
},

View File

@ -11,7 +11,7 @@
<menu-dispather-contest v-if="isContest" ref="menuDispatherContest" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" @start="start" @end="end" />
</template>
<menu-train-list v-if="isDemon||isContest||isScript" />
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
<menu-system-time v-if="$route.query.lineCode !== '16'" ref="menuSystemTime" :offset="offset" :group="group" />
</div>
</template>
<script>