大铁线路 分路不良 输入密码操作

This commit is contained in:
joylink_cuiweidong 2023-02-13 10:58:33 +08:00
parent c071b6a98d
commit 595dcf0374
6 changed files with 296 additions and 37 deletions

View File

@ -63,7 +63,7 @@
</el-row>
<notice-info ref="noticeInfo" :pop-class="popClass" />
<password-box ref="passwordBox" :pop-class="popClass" @checkOver="passWordCommit" />
<ning-bo-confirm-tip ref="ningBoConfirmTip" @close="doClose"/>
<ning-bo-confirm-tip ref="ningBoConfirmTip" @close="doClose" />
</el-dialog>
</template>
@ -158,7 +158,7 @@ export default {
},
methods: {
doShow(operate, selected) {
this.$root.$emit('dialogOpen', selected);
this.$root.$emit('dialogOpen', selected);
this.selected = selected;
if (!this.dialogShow) {
this.switchName = '';
@ -198,7 +198,7 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.$root.$emit('dialogClose', this.selected);
this.$root.$emit('dialogClose', this.selected);
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},

View File

@ -250,6 +250,16 @@ export const menuOperate = {
// 取消分路不良
operation: OperationEvent.Switch.cancelDefectiveShunting.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_CANCEL_DEFECTIVE_SHUNTING
},
beforeForkDirective:{
// 岔前分路不良
operation: OperationEvent.Switch.defectiveShunting.before.operation,
cmdType: CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_FRONT
},
locateForkDirective:{
// 定位分路不良
operation: OperationEvent.Switch.defectiveShunting.locate.operation,
cmdType: CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_FIXED
}
},
StationStand:{

View File

@ -0,0 +1,112 @@
<template>
<el-dialog
v-dialogDrag
class="switch-control chengdou-03__systerm"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row justify="center" style="text-align: center;margin-bottom: 10px;">
分路不良请输入第1重密码
</el-row>
<el-row justify="center" style="text-align:center;">
<el-input v-model="passwordCheck" placeholder="" size="medium" type="password" style="width: 180px;display: inline-block;margin-bottom: 10px;" />
</el-row>
<el-row v-if="showMistake" style="margin-bottom: 10px;text-align: center;">
<el-col :span="22" :offset="1">
<span class="password-error">*密码输入错误请重新输入*</span>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="3">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'DefectivePasswordBox',
components: {
},
data() {
return {
/* 写死的初始密码*/
correctPassword: '123',
/* 输入值*/
passwordCheck: '',
dialogShow: false,
loading: false,
title:'铅封按钮,请输入密码',
selected: null,
showMistake: false,
operation: ''
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Switch.defectiveShunting.twoConfirm.domId : '';
}
},
methods:{
doShow(operate) {
this.operation = operate.operation;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
commit() {
if (this.passwordCheck === this.correctPassword) {
this.$emit('checkOver', this.operation);
this.doClose();
this.inputClear();
} else {
this.showMistake = true;
}
},
inputClear() {
this.showMistake = false;
this.passwordCheck = '';
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$root.$emit('dialogClose', this.selected);
this.$store.dispatch('training/emitTipFresh');
}
}
};
//
</script>
<style lang="scss">
.password-error {
color: red;
}
</style>

View File

@ -0,0 +1,146 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="switch-control chengdou-03__systerm"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row justify="center" class="ForkDirectiveTips">
下发 "分路不良" 命令吗
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="3">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
<defective-password-box ref="defectivePasswordBox" pop-class="chengdou-03__systerm" @checkOver="passWordCommit" />
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
</div>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import DefectivePasswordBox from './childDialog/defectivePasswordBox';
import { UserOperationType } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'ForkDirective',
components: {
DefectivePasswordBox,
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
title:'分路不良',
selected: null,
operation: ''
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Switch.defectiveShunting.confirm.domId : '';
}
},
methods: {
doShow(operate, selected) {
this.selected = selected;
this.operation = operate.operation;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
commit() {
this.openPasswordBox(OperationEvent.Switch.defectiveShunting);
},
//
openPasswordBox(operator) {
const operate = {
operation: operator.confirm.operation
};
this.loading = true;
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.defectivePasswordBox.doShow({operation:this.operation});
}
}).catch(() => {
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
passWordCommit(data) {
const operate = {
over: true,
operation: data,
userOperationType: UserOperationType.LEFTCLICK
};
switch (data) {
case OperationEvent.Switch.defectiveShunting.before.operation: {
operate.cmdType = CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_FRONT;
break;
}
case OperationEvent.Switch.defectiveShunting.locate.operation: {
operate.cmdType = CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_FIXED;
break;
}
case OperationEvent.Switch.defectiveShunting.reverse.operation: {
operate.cmdType = CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_REVERSE;
break;
}
}
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
}).catch(() => {
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$root.$emit('dialogClose', this.selected);
this.$store.dispatch('training/emitTipFresh');
}
}
};
</script>
<style lang="scss">
.ForkDirectiveTips{
margin-bottom: 16px;
text-align: center;
font-size: 15px;
font-weight: bold;
}
</style>

View File

@ -8,6 +8,7 @@
<set-fault ref="setFault" pop-class="datie-02__systerm" />
<draw-select ref="drawSelect" />
<route-cancel ref="routeCancel" />
<fork-directive ref="forkDirective" />
</div>
</template>
@ -27,6 +28,7 @@ import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuO
import RouteCancel from './menuDialog/routeCancel';
import { UserOperationType } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import ForkDirective from './dialog/forkDirective';
export default {
name: 'SwitchMenu',
@ -38,7 +40,8 @@ export default {
SetFault,
SwitchHookLock,
DrawSelect,
RouteCancel
RouteCancel,
ForkDirective
},
mixins: [
CancelMouseState
@ -338,50 +341,26 @@ export default {
},
//
beforeForkDirective() {
const operate = {
over: true,
cmdType:CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_FRONT,
operation: OperationEvent.Switch.defectiveShunting.before.operation,
userOperationType: UserOperationType.RIGHTCLICK,
param:{
sectionCode:this.selected.sectionACode
commitOperate(menuOperate.Switch.beforeForkDirective, {sectionCode:this.selected.sectionACode}, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.forkDirective.doShow(operate, this.selected);
}
};
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
// if (valid) {
// }
});
},
//
locateForkDirective() {
const operate = {
over: true,
cmdType:CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_FIXED,
operation: OperationEvent.Switch.defectiveShunting.locate.operation,
userOperationType: UserOperationType.RIGHTCLICK,
param:{
sectionCode:this.selected.sectionACode
commitOperate(menuOperate.Switch.locateForkDirective, {sectionCode:this.selected.sectionACode}, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.forkDirective.doShow(operate, this.selected);
}
};
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
// if (valid) {
// }
});
},
//
reverseForkDirective() {
const operate = {
over: true,
cmdType:CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_REVERSE,
operation: OperationEvent.Switch.defectiveShunting.reverse.operation,
userOperationType: UserOperationType.RIGHTCLICK,
param:{
sectionCode:this.selected.sectionACode
commitOperate(menuOperate.Switch.locateForkDirective, {sectionCode:this.selected.sectionACode}, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.forkDirective.doShow(operate, this.selected);
}
};
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
// if (valid) {
// }
});
},
//

View File

@ -1309,6 +1309,18 @@ export const OperationEvent = {
before:{
operation: '11g',
domId: '_Tips-Switch-DefectiveShunting-Before{TOP}'
},
confirm:{
operation: '11h',
domId: '_Tips-Switch-DefectiveShunting-confirm{TOP}'
},
password:{
operation: '11i',
domId: '_Tips-Switch-DefectiveShunting-password{TOP}'
},
twoConfirm:{
operation: '11j',
domId: '_Tips-Switch-DefectiveShunting-twoConfirm{TOP}'
}
},