宁波一 计轴复位按钮操作

This commit is contained in:
fan 2021-02-22 10:27:32 +08:00
parent efcb9ff262
commit dc3e3d7b7e
11 changed files with 141 additions and 102 deletions

View File

@ -31,10 +31,10 @@ export default class EMouse extends Group {
if (e.target && e.target._subType == 'Text') {
this.text.show();
} else {
this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
this.device.control.setTextColor(this.device.style.LcControl.mouseOverStyle.textColor);
this.device.control.setTextBorder(true);
this.device.control.setArcBorder(true);
// this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
// this.device.control.setTextColor(this.device.style.LcControl.mouseOverStyle.textColor);
// this.device.control.setTextBorder(true);
// this.device.control.setArcBorder(true);
}
}
@ -43,10 +43,10 @@ export default class EMouse extends Group {
if (e.target && e.target._subType == 'Text') {
this.text.hide();
} else {
this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);
this.device.control.setTextColor('#FFFFFF');
this.device.control.setTextBorder(false);
this.device.control.setArcBorder(false);
// this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);
// this.device.control.setTextColor('#FFFFFF');
// this.device.control.setTextBorder(false);
// this.device.control.setArcBorder(false);
}
}
}

View File

@ -421,6 +421,11 @@ export const menuOperate = {
setPreReset: {
operation: OperationEvent.Station.setPreReset.menu.operation,
cmdType: CMD.Station.CMD_STATION_PRE_RESET
},
// 取消计轴预复位
cancelPreReset: {
operation: OperationEvent.Station.cancelPreReset.menu.operation,
cmdType: CMD.Station.CMD_STATION_PRE_RESET
}
},
// 设置/取消强制点灯

View File

@ -9,43 +9,44 @@
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<el-row>
<el-col></el-col>
<el-col :span="8" style="font-size: 16px;color: #000;">集中站</el-col>
<el-col :span="16" style="font-size: 16px;" class="shadow-box">{{ stationName }}</el-col>
</el-row>
<el-row style="margin-top: 10px;">
<el-col :span="8" style="font-size: 16px;color: #000;">按钮</el-col>
<el-col :span="16" style="font-size: 16px;" class="shadow-box">{{ buttonName }}</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-button @click="commit">确定</el-button>
<el-col :span="12">
<el-button @click="confirm">确定</el-button>
</el-col>
<el-col :span="12">
<el-button @click="doClose">关闭</el-button>
</el-col>
</el-row>
<confirm-tip ref="confirmTip" />
</el-dialog>
</template>
<script>
import {commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import ConfirmTip from './childDialog/confirmTip';
export default {
name: 'ConfirmTip',
name: 'ButtonDown',
components: {
ConfirmTip
},
data() {
return {
dialogShow: false,
message: '',
operation: '',
title: '按钮按下',
value1: '',
value2: '',
options: [
{ label: '车站折返变通', value: '1' },
{ label: '站遥控按钮', value: '2' },
{ label: 'FSA', value: '3'},
{ label: 'NJYXLZ', value: '4'},
{ label: '强制点灯', value: '5' }
],
time: '',
status: '',
confirmIndex: false,
timer: null
stationName: '',
buttonName: ''
};
},
computed: {
@ -60,48 +61,35 @@ export default {
},
methods: {
doShow(operate) {
this.message = operate.message || '';
doShow(operate, selected) {
this.dialogShow = true;
this.confirmIndex = false;
this.operation = operate.operation;
if (this.operation === OperationEvent.StationLight.SetOrCancelForceLight.confirm1.operation) {
this.value1 = '5';
this.stationName = selected.name;
if (this.operation === OperationEvent.Station.setPreReset.confirm.operation || this.operation === OperationEvent.Station.cancelPreReset.confirm.operation) {
this.buttonName = '计轴复位';
}
},
doClose() {
this.dialogShow = false;
if (this.timer) { clearInterval(this.timer); }
},
confirm1() {
this.status = '发送First request消息成功请等待服务器';
setTimeout(() => {
this.confirmIndex = true;
this.time = 30;
this.status = '收到First request消息';
this.timer = setInterval(() => {
this.time = this.time - 1;
if (this.time < 0) { this.doClose(); }
}, 1000);
}, 1000);
},
confirm2() {
if (this.value1 !== this.value2) {
this.status = '确认操作失败!';
return;
}
if (this.operation === OperationEvent.StationLight.SetOrCancelForceLight.confirm1.operation) {
commitOperate({operate: this.operation, cmdType: CMD.Station.CMD_STATION_SET_OR_CANCEL_FORCE_PHYSICAL_SIGNAL}, {}, 2).then(({valid, operate})=>{
confirm() {
commitOperate({operation: this.operation}, {}, 1).then(({valid, operate})=>{
if (valid) {
this.status = '发送 Second Confirm消息成功请等待服务器';
setTimeout(() => {
const nextOperate = {
operation: this.operation
};
if (this.operation === OperationEvent.Station.setPreReset.confirm.operation) {
nextOperate.message = `命令:按钮按下/设置操作<br/>集中站:${this.stationName}<br/>按钮:计轴复位`;
} else if (this.operation === OperationEvent.Station.cancelPreReset.confirm.operation) {
nextOperate.message = `命令:按钮按下/取消操作<br/>集中站:${this.stationName}<br/>按钮:计轴复位`;
}
this.doClose();
}, 1000);
this.$refs.confirmTip.doShow(nextOperate);
}
});
}
}
}
};
</script>
@ -114,12 +102,11 @@ export default {
display: block;
margin: 0 auto;
}
.status-box {
width: 100%;
height: 70px;
border-top: #928F92 1px solid;
border-left: #928F92 1px solid;
border-right: #E6E3E6 1px solid;
border-bottom: #E6E3E6 1px solid;
.shadow-box {
padding: 2px;
border-top: #7E7B7E 2px solid ;
border-right: #F9F6F9 2px solid;
border-left: #7E7B7E 2px solid;
border-bottom: #F9F6F9 2px solid;
}
</style>

View File

@ -258,6 +258,26 @@ export default {
this.doClose();
}
}).catch(() => { this.doClose(); this.$refs.noticeInfo.doShow(); });
} else if (this.operation === OperationEvent.Station.setPreReset.confirm.operation) {
const step = {
operation: OperationEvent.Command.common.affirm.operation,
cmdType: CMD.Station.CMD_STATION_PRE_RESET
};
commitOperate(step, {}, 2).then(({valid}) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); this.$refs.noticeInfo.doShow(); });
} else if (this.operation === OperationEvent.Station.cancelPreReset.confirm.operation) {
const step = {
operation: OperationEvent.Command.common.affirm.operation,
cmdType: CMD.Station.CMD_STATION_CANCEL_PRE_RESET
};
commitOperate(step, {}, 2).then(({valid}) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); this.$refs.noticeInfo.doShow(); });
}
},
doClose() {

View File

@ -13,6 +13,7 @@
<menu-station ref="menuStation" :selected="selected" />
<menu-limit ref="menuLimit" :selected="selected" />
<menu-station-light ref="menuStationLight" :selected="selected" />
<menu-station-pre-reset ref="menuStationPreReset" />
<!--<passive-alarm ref="passiveAlarm" />-->
<passive-contorl ref="passiveControl" pop-class="ningbo-01__systerm" />
<!--<passive-Timeout ref="passiveTimeout" />-->
@ -34,6 +35,7 @@ import MenuBar from './menuBar';
import MenuLimit from './menuLimit';
import MenuStationTurnBack from './menuStationTurnBack';
import MenuStationLight from './menuStationLight';
import MenuStationPreReset from './menuStationPreReset';
// import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
// import PassiveTimeout from './passiveDialog/timeout';
@ -55,7 +57,8 @@ export default {
MenuLimit,
// PassiveAlarm,
PassiveContorl,
MenuStationLight
MenuStationLight,
MenuStationPreReset
// PassiveTimeout
},
props: {

View File

@ -1,31 +1,25 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<password-input ref="passwordInput" @confirm="forceLightConfirm" />
<operateConfirm ref="operateConfirm" @executeConfirm="forceLightConfirm1" />
<button-confirm ref="buttonConfirm" />
<button-down ref="buttonDown" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import PasswordInput from './dialog/passwordInput';
import { mapGetters } from 'vuex';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperateConfirm from './dialog/childDialog/operateConfirm';
import ButtonConfirm from './dialog/childDialog/buttonConfirm';
import ButtonDown from './dialog/buttonDown';
export default {
name: 'StationControlLight',
components: {
PopMenu,
PasswordInput,
OperateConfirm,
ButtonConfirm
ButtonDown
},
data() {
return {
@ -40,7 +34,7 @@ export default {
{
label: '取消',
handler: this.cancelPreReset,
cmdType: CMD.Station.CMD_STATION_PRE_RESET
cmdType: CMD.Station.CMD_STATION_CANCEL_PRE_RESET
}
],
Center: [
@ -52,7 +46,7 @@ export default {
{
label: '取消',
handler: this.cancelPreReset,
cmdType: CMD.Station.CMD_STATION_PRE_RESET
cmdType: CMD.Station.CMD_STATION_CANCEL_PRE_RESET
}
]
},
@ -71,7 +65,7 @@ export default {
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationLight) && !this.buttonOperation) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationPreReset) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
@ -97,6 +91,7 @@ export default {
doShow(point) {
this.clickEvent();
this.initMenu();
console.log(this.menu, this.$refs.popMenu);
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
@ -114,14 +109,22 @@ export default {
commitOperate(menuOperate.Station.setPreReset, {stationCode:this.selected.code}, 0).then(({valid, operate})=>{
if (valid) {
const nextOperate = {
operation: OperationEvent.StationLight.SetOrCancelForceLight.password.operation
operation: OperationEvent.Station.setPreReset.confirm.operation
};
this.$refs.passwordInput.doShow(nextOperate, this.selected);
this.$refs.buttonDown.doShow(nextOperate, this.selected);
}
});
},
cancelPreReset() {
//
commitOperate(menuOperate.Station.cancelPreReset, {stationCode:this.selected.code}, 0).then(({valid, operate})=>{
if (valid) {
const nextOperate = {
operation: OperationEvent.Station.cancelPreReset.confirm.operation
};
this.$refs.buttonDown.doShow(nextOperate, this.selected);
}
});
},
forceLightConfirm() {
const nextOperate = {

View File

@ -80,6 +80,7 @@ export const DeviceMenu = {
StationTurnBack: '14',
Power:'15',
StationLight: '16',
StationPreReset: '17',
Map: '100',
PrdCategory: '101',

View File

@ -230,16 +230,18 @@ export default {
CMD_STATION_CANCEL_CI_AUTO: {value: 'Station_Cancel_CI_Auto', label: '全站取消自动通过'},
/** 设置/取消强制点灯 */
CMD_STATION_SET_OR_CANCEL_FORCE_PHYSICAL_SIGNAL: {value: 'Station_Set_Or_Cancel_Force_Physical_Signal', label: '设置/取消强制点灯'},
/** 区域选择(请求区域控制权【泰雷兹】 */
/** 区域选择(请求区域控制权【泰雷兹】、【宁波一】 */
CMD_STATION_CONTROL_APPLY: {value: 'Station_Control_Apply', label: '请求区域控制权'},
/** 授权转移 (【泰雷兹】) */
CMD_STATION_CONTROL_TRANSFER: {value: 'Station_Control_Transfer', label: '授权转移'},
/** 下放站控 (【泰雷兹】) */
/** 下放站控 (【泰雷兹】、【宁波一】) */
CMD_STATION_CONTROL_DEVOLVE: {value: 'Station_Control_Devolve', label: '下放站控'},
/** 收回站控 (【泰雷兹】) */
/** 收回站控 (【泰雷兹】、【宁波一】) */
CMD_STATION_CONTROL_REVOKE: {value: 'Station_Control_Revoke', label: '收回站控'},
/** 计轴预复位 */
CMD_STATION_PRE_RESET : {value: 'Station_Pre_Reset', label: '计轴预复位'}
/** 设置计轴预复位 */
CMD_STATION_PRE_RESET : {value: 'Station_Pre_Reset', label: '计轴预复位'},
/** 取消计轴预复位 */
CMD_STATION_CANCEL_PRE_RESET: {value: 'Station_Cancel_Pre_Reset', label: '取消计轴预复位'}
},
// 列车

View File

@ -2518,6 +2518,17 @@ export const OperationEvent = {
operation: '6171',
domId: '_Tips-Station-setPreReset-Confirm'
}
},
// 取消计轴复位
cancelPreReset: {
menu: {
operation: '618',
domId: '_Tips-Station-cancelPreReset-Menu'
},
confirm: {
operation: '6181',
domId: '_Tips-Station-cancelPreReset-Confirm'
}
}
},

View File

@ -143,6 +143,13 @@ export default {
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
this.$store.dispatch('training/emitTipFresh');
return;
} else if (em.subType == 'preReset' && em.deviceType == 'Station') { // 线
const equipment = this.getDeviceByEm(em);
this.$store.dispatch('menuOperation/setSelected', { device: equipment, subType: em.subType });
menu = getDeviceMenuByDeviceType('StationPreReset');
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
this.$store.dispatch('training/emitTipFresh');
return;
} else if (em.subType == 'enabled' && em.deviceType == 'Switch') {
menu = getDeviceMenuByDeviceType('Enabled');
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });