This commit is contained in:
fan 2021-01-19 16:08:04 +08:00
commit b4059db243
2 changed files with 241 additions and 71 deletions

View File

@ -113,64 +113,95 @@
</el-row>
</div>
</div>
<el-dialog
v-else
v-dialogDrag
class="haerbin-01__systerm __menuButton"
style="pointer-events: none"
title="Dialog"
:visible.sync="dialogVisible"
:modal="false"
:close-on-click-modal="false"
width="30%"
append-to-body
:before-close="handleClose"
>
<div style="margin-bottom: 30px">
<template v-if="secondConfirm">
<el-row>
<div style="display: flex;justify-content: space-between;margin: 10px 3px">
<el-button :id="cr1ConfrimId" class="fl" :class="{'disabled': cr1Confrim}" style="line-height: 18px; margin-top: 4px;" :disabled="cr1Confrim" plain @click="clickCr1Confirm">CR1</el-button>
<el-button :id="cr2ConfirmId" class="fr" :class="{'disabled': !cr1Confrim}" style="line-height: 18px; margin-top: 4px;" :disabled="!cr1Confrim" plain @click="clickCr2Confirm">CR2</el-button>
</div>
</el-row>
<el-row>
<el-col :span="5">
<img :src="banIcon" class="ban-img">
</el-col>
<el-col :span="19">
<div style="display: flex;justify-content: flex-start;margin-top: 10px;">
<div style="height: 10px;width: 70px;background-color: #F00;" />
<div style="height: 10px;width: 70px;background-color: #0F0;margin-left: 40px;" />
<div style="height: 10px;width: 70px;background-color: #00F;margin-left: 40px;" />
<div v-else>
<el-dialog
v-dialogDrag
class="haerbin-01__systerm __menuButton"
style="pointer-events: none"
title="Dialog"
:visible.sync="dialogVisible"
:modal="false"
:close-on-click-modal="false"
width="30%"
append-to-body
:before-close="handleClose"
>
<div style="margin-bottom: 30px">
<template v-if="secondConfirm">
<el-row>
<div style="display: flex;justify-content: space-between;margin: 10px 3px">
<el-button :id="cr1ConfrimId" class="fl" :class="{'disabled': cr1Confrim}" style="line-height: 18px; margin-top: 4px;" :disabled="cr1Confrim" plain @click="clickCr1Confirm">CR1</el-button>
<el-button :id="cr2ConfirmId" class="fr" :class="{'disabled': !cr1Confrim}" style="line-height: 18px; margin-top: 4px;" :disabled="!cr1Confrim" plain @click="clickCr2Confirm">CR2</el-button>
</div>
<div class="color-strip-container" style="">
<div style="height: 10px;width: 70px;background-color: #F00;" />
<div style="height: 10px;width: 70px;background-color: #0F0;margin-left: 40px;" />
<div style="height: 10px;width: 70px;background-color: #00F;margin-left: 40px;" />
</div>
</el-col>
</el-row>
</template>
<template v-else>
<el-row style="text-align: center">
<template v-for="(item, index) in centralizedStationList">
<div :key="index" class="nav-border-row row-width-box flex-row">
<div v-if="item.name && (item.disabled || !item.cmdType)" :id="item.operate.domId" class="fake-button-disabled">{{ item.name }}</div>
<div v-else-if="item.name && item.securityCommand" :id="item.operate.domId" :class="[stationContorl.controlMode != item.mode || item.mode == 'None'? 'fake-button-active': 'fake-button-disabled']" @click="clickCommand(item, index)">{{ item.name }}</div>
<div v-else-if="item.name && !item.securityCommand" :id="item.operate.domId" :class="[stationContorl.controlMode != item.mode || item.mode == 'None'? 'fake-button': 'fake-button-disabled', (stationContorl.controlMode != item.mode || item.mode == 'None') && item.next && paramIndex == index ? 'active': '']" @click="clickCommand(item, index)">{{ item.name }}</div>
<div v-else class="fake-button-grayk" />
</div>
</template>
</el-row>
</template>
</div>
<div class="separator">
<el-button :id="commandId" class="fl" :class="{'disabled': canCommand || secondConfirm}" style="line-height: 18px; margin-top: 4px;" plain :disabled="canCommand || secondConfirm" @click="command">执行</el-button>
<el-button class="fr" style="line-height: 18px; margin-top: 4px;" plain @click="cancle">取消</el-button>
<el-button class="fr" style="line-height: 18px; margin-top: 4px;" plain @click="handleClose">关闭</el-button>
</div>
</el-dialog>
</el-row>
<el-row>
<el-col :span="5">
<img :src="banIcon" class="ban-img">
</el-col>
<el-col :span="19">
<div style="display: flex;justify-content: flex-start;margin-top: 10px;">
<div style="height: 10px;width: 70px;background-color: #F00;" />
<div style="height: 10px;width: 70px;background-color: #0F0;margin-left: 40px;" />
<div style="height: 10px;width: 70px;background-color: #00F;margin-left: 40px;" />
</div>
<div class="color-strip-container" style="">
<div style="height: 10px;width: 70px;background-color: #F00;" />
<div style="height: 10px;width: 70px;background-color: #0F0;margin-left: 40px;" />
<div style="height: 10px;width: 70px;background-color: #00F;margin-left: 40px;" />
</div>
</el-col>
</el-row>
</template>
<template v-else>
<el-row style="text-align: center">
<template v-for="(item, index) in centralizedStationList">
<div :key="index" class="nav-border-row row-width-box flex-row">
<div v-if="item.name && (item.disabled || !item.cmdType)" :id="item.operate.domId" class="fake-button-disabled">{{ item.name }}</div>
<div v-else-if="item.name && item.securityCommand" :id="item.operate.domId" :class="[stationContorl.controlMode != item.mode || item.mode == 'None'? 'fake-button-active': 'fake-button-disabled']" @click="clickCommand(item, index)">{{ item.name }}</div>
<div v-else-if="item.name && !item.securityCommand" :id="item.operate.domId" :class="[stationContorl.controlMode != item.mode || item.mode == 'None'? 'fake-button': 'fake-button-disabled', (stationContorl.controlMode != item.mode || item.mode == 'None') && item.next && paramIndex == index ? 'active': '']" @click="clickCommand(item, index)">{{ item.name }}</div>
<div v-else class="fake-button-grayk" />
</div>
</template>
</el-row>
</template>
</div>
<div class="separator">
<el-button :id="commandId" class="fl" :class="{'disabled': canCommand || secondConfirm}" style="line-height: 18px; margin-top: 4px;" plain :disabled="canCommand || secondConfirm" @click="command">执行</el-button>
<el-button class="fr" style="line-height: 18px; margin-top: 4px;" plain @click="cancle">取消</el-button>
<el-button class="fr" style="line-height: 18px; margin-top: 4px;" plain @click="handleClose">关闭</el-button>
</div>
</el-dialog>
<el-dialog
v-dialogDrag
class="haerbin-01__systerm __menuButton"
style="pointer-events: none"
title="IBP"
:visible.sync="stationDialogVisible"
:modal="false"
:close-on-click-modal="false"
width="30%"
append-to-body
:before-close="handleStationClose"
>
<div class="station_buttonGroup">
<div class="station_buttonGroupL">
<!-- cancelTrain -->
<!-- menuButton -->
<div :id="setDetainTrainId" class="stationButton station_detainTrain" @click="stationDetainTrain">此站扣车</div>
</div>
<div class="station_buttonGroupR">
<div :id="cancelTrainId" class="stationButton station_cnacleSetting" @click="stationCancleTrain">取消设置</div>
<div :id="setJumpStopId" class="stationButton station_jumpTrain" @click="stationJumpTrain">此站不停</div>
</div>
</div>
<div class="station_line" />
<div class="station_commandGroup">
<el-button plain class="station_updateStatus">更新</el-button>
<el-button plain class="station_close" @click="handleStationClose">关闭</el-button>
<el-button :id="commandId" plain class="station_command" :class="{'disabled': isAllowCommand}" :disabled="isAllowCommand" @click="stationToCommand">执行</el-button>
</div>
</el-dialog>
</div>
<notice-info ref="noticeInfo" pop-class="haerbin-01__systerm" />
</div>
</template>
@ -236,7 +267,9 @@ export default {
formModelNewTrip: '',
dialogVisible: false,
tipList: [],
modeMatch: false
modeMatch: false,
stationDialogVisible:false,
isAllowCommand:true
};
},
computed: {
@ -254,6 +287,15 @@ export default {
commandId() {
return OperationEvent.Command.commandHaerbin.confirm.domId;
},
setDetainTrainId() {
return OperationEvent.StationStand.setDetainTrain.menuButton.domId;
},
cancelTrainId() {
return OperationEvent.StationStand.cancelTrain.menuButton.domId;
},
setJumpStopId() {
return OperationEvent.StationStand.setJumpStop.menuButton.domId;
},
cr1ConfrimId() {
return OperationEvent.Command.commandHaerbin.confrimCr1.domId;
},
@ -337,11 +379,11 @@ export default {
this.deviceHighLight(this.selectedObj, true);
this.oldDevice = this.selectedObj;
break;
case 'StationStand':
if (this.$store.state.menuOperation.subType == 'trainSetButton') {
this.handleStandMenu();
}
break;
// case 'StationStand':
// if (this.$store.state.menuOperation.subType == 'trainSetButton') {
// this.handleStandMenu();
// }
// break;
}
}
}).catch((error) => {
@ -362,8 +404,13 @@ export default {
},
'selected': function (val) {
this.initMenus();
if (val.code && val._event == MouseEvent.Left && val._type != 'Psd') {
this.dialogVisible = !this.isLocal;
if (val.code && val._event == MouseEvent.Left) {
if (val._type != 'Psd' && val._type != 'StationStand') {
this.dialogVisible = !this.isLocal;
}
if (val._type == 'StationStand' && this.$store.state.menuOperation.subType == 'trainSetButton') {
this.stationDialogVisible = true;
}
} else if (!val.code) {
this.dialogVisible = false;
if (this.$store.state.training.mode != TrainingMode.TEACH) {
@ -778,6 +825,12 @@ export default {
handleClose() {
this.dialogVisible = false;
},
handleStationClose() {
this.cmdType = '';
this.operate = ''; //
this.isAllowCommand = true;
this.stationDialogVisible = false;
},
handleTrainParam() {
if (this.selectedObj.type === '01') {
this.formModelSectionName = this.selectedObj.name;
@ -839,6 +892,59 @@ export default {
this.$refs.noticeInfo.doShow('请输入正确的车次号');
}
},
stationToCommand() {
const step = {
operation: OperationEvent.Command.commandHaerbin.confirm.operation,
over:true,
cmdType:this.cmdType
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.handleStationClose();
}
}).catch((error) => {
console.error(error);
this.handleStationClose();
this.$refs.noticeInfo.doShow();
});
},
stationCommand(row) {
const step = {};
this.operate = row.operation;
step.operate = this.operate;
step.start = true;
step.param = {'standCode':this.selectedObj.code};
this.cmdType = row.cmdType;
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.isAllowCommand = false;
// this.securityCommand = row.securityCommand || row.next;
} else if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
stationDetainTrain() {
const row = {};
row.operation = OperationEvent.StationStand.setDetainTrain.menuButton.operation;
row.cmdType = CMD.Stand.CMD_STAND_SET_HOLD_TRAIN;
this.stationCommand(row);
},
stationCancleTrain() {
const row = {};
row.operation = OperationEvent.StationStand.cancelTrain.menuButton.operation;
row.cmdType = CMD.Stand.CMD_STAND_CANCEL_SETTING;
this.stationCommand(row);
},
stationJumpTrain() {
const row = {};
row.operation = OperationEvent.StationStand.setJumpStop.menuButton.operation;
row.cmdType = CMD.Stand.CMD_STAND_SET_JUMP_STOP;
this.stationCommand(row);
},
initMenus() {
this.basicParamList = this.$store.state.training.prdType === '01' ? [
{ name: '' },
@ -979,12 +1085,12 @@ export default {
// { name: '', cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING, operate: OperationEvent.Station.atsAutoControlALL.menuButton },
// { name: '', cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING, operate: OperationEvent.Station.humanControlALL.menuButton }
// ];
this.standParamList = this.$store.state.training.prdType === '01' ? [] : [
{ name: '扣车', cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN, operate: OperationEvent.StationStand.setDetainTrain.menuButton, disabledCb: (selectedObj) => !this.modeMatch },
{ name: '取消扣车', cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN, operate: OperationEvent.StationStand.cancelDetainTrain.menuButton, disabledCb: (selectedObj) => !this.modeMatch },
{ name: '越站', cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP, operate: OperationEvent.StationStand.setJumpStop.menuButton, disabledCb: (selectedObj) => !this.modeMatch },
{ name: '取消越站', cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP, operate: OperationEvent.StationStand.cancelJumpStop.menuButton, disabledCb: (selectedObj) => !this.modeMatch }
];
// this.standParamList = this.$store.state.training.prdType === '01' ? [] : [
// { name: '', cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN, operate: OperationEvent.StationStand.setDetainTrain.menuButton, show: false },
// { name: '', cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN, operate: OperationEvent.StationStand.cancelDetainTrain.menuButton, show: false },
// { name: '', cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP, operate: OperationEvent.StationStand.setJumpStop.menuButton, show: false },
// { name: '', cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP, operate: OperationEvent.StationStand.cancelJumpStop.menuButton, show: false }
// ];
this.routeParamList = [
{ name: '排列进路', cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE, operate: OperationEvent.Signal.arrangementRoute.menuButton, disabledCb: (selectedObj) => !this.modeMatch },
{ name: '取消进路', cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, operate: OperationEvent.Signal.cancelTrainRoute.menuButton, disabledCb: (selectedObj) => !this.modeMatch }
@ -1232,4 +1338,62 @@ export default {
from {transform: rotate(0);}
to {transform: rotate(360deg);}
}
.station_buttonGroup{
display: inline-block;
margin-top: 5px;
width: 100%;
}
.station_buttonGroupL{
margin-left: 10px;
float: left;
}
.station_detainTrain{}
.station_buttonGroupR{
float: right;
margin-right: 10px;
}
.station_cnacleSetting{}
.station_jumpTrain{
margin-top: 15px;
}
.station_line{
padding: 0px 10px;
width: 100%;
height: 20px;
margin-top: 10px;
&::before{
content:'';
border:1px #ccc solid;
width: 100%;
display: inline-block;
height: 20px;
}
}
.station_commandGroup{
margin-top: 10px;
padding: 10px;
}
.station_updateStatus{}
.station_command{
float: right;
}
.station_close{
float: right;
}
.stationButton{
font-size: 12px;
width: 100px;
border-radius: 1px !important;
border: 1px solid #426688;
background: #DDDDDD;
color: #000;
cursor: pointer;
text-align: center;
padding: 4px 0px;
cursor: pointer;
&:hover, &.active{
background: #CFE8FC;
}
}
</style>

View File

@ -1887,6 +1887,12 @@ export const OperationEvent = {
operation: '519',
domId: '_Tips-Stand-openPsdByHand-Menu'
}
},
cancelTrain:{
menuButton: {
operation: '520',
domId: '_Tips-Stand-CancelTrain-MenuButton{BOTTOM}'
}
}
},