北京一号线区段操作步骤代码调整

This commit is contained in:
joylink_cuiweidong 2020-04-02 18:57:04 +08:00
parent 187ca7317e
commit e5067edcce
3 changed files with 134 additions and 135 deletions

View File

@ -1,148 +1,154 @@
<template> <template>
<el-dialog class="beijing-01__systerm confirm-control-speed" :title="title" :visible.sync="show" width="540px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag> v-dialogDrag
<div style="height: 60px; padding-left: 20px"> class="beijing-01__systerm confirm-control-speed"
<span style="font-size: 18px">{{message}}</span> :title="title"
</div> :visible.sync="show"
<el-row justify="center" class="button-group"> width="540px"
<el-col :span="6" :offset="6"> :before-close="doClose"
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button> :z-index="2000"
</el-col> :modal="false"
<el-col :span="10" :offset="2"> :close-on-click-modal="false"
<el-button :id="domIdCancel" @click="cancel"> </el-button> append-to-body
</el-col> >
</el-row> <div style="height: 60px; padding-left: 20px">
</el-dialog> <span style="font-size: 18px">{{ message }}</span>
</div>
<el-row justify="center" class="button-group">
<el-col :span="6" :offset="6">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="10" :offset="2">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template> </template>
<script> <script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default { export default {
name: 'ConfirmControlSpeed', name: 'ConfirmControlSpeed',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
type: '', operation: '',
operation: '', message: ''
message: '', };
} },
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
computed: { title() {
show() { if (this.dialogShow) {
return this.dialogShow && !this.$store.state.menuOperation.break; if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
}, return '区段设置限速';
title() { } else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
if (this.dialogShow) { return '区段取消限速';
if (this.operation === OperationEvent.Section.setSpeed.order.operation) { } else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
return "区段设置限速"; return '道岔设置限速';
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) { } else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
return "区段取消限速"; return '道岔取消限速';
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
return "道岔设置限速";
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
return "道岔取消限速";
}
}
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
if (this.dialogShow) {
if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
/** 区段设置限速*/
return OperationEvent.Section.setSpeed.confirm.domId;
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
/** 区段取消限速*/
return OperationEvent.Section.cancelSpeed.confirm.domId;
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
/** 道岔设置限速*/
return OperationEvent.Switch.setSpeed.confirm.domId;
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
/** 道岔取消限速*/
return OperationEvent.Switch.cancelSpeed.confirm.domId;
}
} }
} }
}, },
mounted() { domIdCancel() {
this.$nextTick(() => { return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
this.$store.dispatch('training/tipReload');
})
}, },
methods: { domIdConfirm() {
doShow(operate) { if (this.dialogShow) {
if (!this.dialogShow) {
this.type = operate.type;
this.operation = operate.operation;
this.message = operate.message;
}
this.loading = false;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
let operate = {
type: this.type
}
if (this.operation === OperationEvent.Section.setSpeed.order.operation) { if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
/** 区段设置限速*/ /** 区段设置限速*/
operate.operation = OperationEvent.Section.setSpeed.confirm.operation; return OperationEvent.Section.setSpeed.confirm.domId;
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) { } else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
/** 区段取消限速*/ /** 区段取消限速*/
operate.operation = OperationEvent.Section.cancelSpeed.confirm.operation; return OperationEvent.Section.cancelSpeed.confirm.domId;
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) { } else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
/** 道岔设置限速*/ /** 道岔设置限速*/
operate.operation = OperationEvent.Switch.setSpeed.confirm.operation; return OperationEvent.Switch.setSpeed.confirm.domId;
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) { } else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
/** 道岔取消限速*/ /** 道岔取消限速*/
operate.operation = OperationEvent.Switch.cancelSpeed.confirm.operation; return OperationEvent.Switch.cancelSpeed.confirm.domId;
} }
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
this.$emit('setOperate', { step: 1, success: true });
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.$emit('setOperate', { step: 0, success: false });
this.doClose();
})
},
cancel() {
let operate = {
type: this.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
this.$emit('setOperate', { step: 0, success: false });
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
}).catch(error => {
this.doClose();
});
} }
} }
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate) {
if (!this.dialogShow) {
this.operation = operate.operation;
this.message = operate.message;
}
this.loading = false;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
const operate = {
};
if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
/** 区段设置限速*/
operate.operation = OperationEvent.Section.setSpeed.confirm.operation;
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
/** 区段取消限速*/
operate.operation = OperationEvent.Section.cancelSpeed.confirm.operation;
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
/** 道岔设置限速*/
operate.operation = OperationEvent.Switch.setSpeed.confirm.operation;
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
/** 道岔取消限速*/
operate.operation = OperationEvent.Switch.cancelSpeed.confirm.operation;
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
this.$emit('setOperate', { step: 1, success: true });
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.$emit('setOperate', { step: 0, success: false });
this.doClose();
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
this.$emit('setOperate', { step: 0, success: false });
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
} }
};
</script> </script>
<style> <style>
@ -150,4 +156,4 @@
padding-bottom: 40px !important; padding-bottom: 40px !important;
border: 1px solid lightgray; border: 1px solid lightgray;
} }
</style> </style>

View File

@ -102,7 +102,7 @@
</template> </template>
<script> <script>
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import ConfirmControlSpeed from './childDialog/confirmControlSpeed'; import ConfirmControlSpeed from './childDialog/confirmControlSpeed';
import { now } from '@/utils/date'; import { now } from '@/utils/date';
@ -378,7 +378,6 @@ export default {
this.cmdDisabled = [true, true, true]; this.cmdDisabled = [true, true, true];
this.stpDisabled = true; this.stpDisabled = true;
this.order = 0; this.order = 0;
this.type = operate.type;
this.operation = operate.operation; this.operation = operate.operation;
this.setMessage('请选择限速值后,点击“下达”按钮,下达命令!'); this.setMessage('请选择限速值后,点击“下达”按钮,下达命令!');
if (this.isCancelSpeed) { if (this.isCancelSpeed) {
@ -400,7 +399,6 @@ export default {
}, },
speedSelectChange(val) { speedSelectChange(val) {
const operate = { const operate = {
type: this.type,
val: val val: val
}; };
@ -422,7 +420,6 @@ export default {
}, },
command() { command() {
const operate = { const operate = {
type: this.type
}; };
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
@ -445,6 +442,7 @@ export default {
this.setMessage('请点击“确认1”按钮确认命令'); this.setMessage('请点击“确认1”按钮确认命令');
this.writeRecord({ order: ++this.order, date: now(), context: '点击下达命令', result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: '点击下达命令', result: '' });
debugger;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
@ -459,7 +457,6 @@ export default {
}, },
confirm1() { confirm1() {
const operate = { const operate = {
type: this.type
}; };
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
@ -495,7 +492,6 @@ export default {
confirm2() { confirm2() {
const operate = { const operate = {
over:true, over:true,
type: this.type,
val: this.speed, val: this.speed,
param: { param: {
speedLimitValue: `${this.speed}` speedLimitValue: `${this.speed}`
@ -539,7 +535,6 @@ export default {
}, },
stop() { stop() {
const operate = { const operate = {
type: this.type
}; };
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
@ -571,7 +566,6 @@ export default {
}, },
close() { close() {
const operate = { const operate = {
type: this.type,
operation: OperationEvent.Command.close.menu.operation operation: OperationEvent.Command.close.menu.operation
}; };
this.writeRecord({ order: ++this.order, date: now(), context: '点击关闭', result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: '点击关闭', result: '' });

View File

@ -1095,7 +1095,6 @@ export const OperationList = {
{ deviceType: '06', orderNum: 3, operateCode: '511', tip: '鼠标左键点击【确定】按钮' } { deviceType: '06', orderNum: 3, operateCode: '511', tip: '鼠标左键点击【确定】按钮' }
] ]
}, },
{ {
maxDuration: 15, maxDuration: 15,
minDuration: 8, minDuration: 8,
@ -1137,7 +1136,7 @@ export const OperationList = {
{ deviceType: '03', orderNum: 1, operateCode: '407', tip: '鼠标右键菜单选择【设置临时限速】' }, { deviceType: '03', orderNum: 1, operateCode: '407', tip: '鼠标右键菜单选择【设置临时限速】' },
{ deviceType: '03', orderNum: 2, operateCode: '4076', tip: '鼠标左键选择【限速值15】', val: '15' }, { deviceType: '03', orderNum: 2, operateCode: '4076', tip: '鼠标左键选择【限速值15】', val: '15' },
{ deviceType: '03', orderNum: 3, operateCode: '4071', tip: '鼠标左键点击【下达】按钮' }, { deviceType: '03', orderNum: 3, operateCode: '4071', tip: '鼠标左键点击【下达】按钮' },
{ deviceType: '03', orderNum: 4, operateCode: '4072', tip: '鼠标左键点击【确】按钮' }, { deviceType: '03', orderNum: 4, operateCode: '4072', tip: '鼠标左键点击【确】按钮' },
{ deviceType: '03', orderNum: 5, operateCode: '4073', tip: '鼠标左键点击【确认1】按钮' }, { deviceType: '03', orderNum: 5, operateCode: '4073', tip: '鼠标左键点击【确认1】按钮' },
{ deviceType: '03', orderNum: 6, operateCode: '4074', tip: '鼠标左键点击【确认2】按钮' }, { deviceType: '03', orderNum: 6, operateCode: '4074', tip: '鼠标左键点击【确认2】按钮' },
{ deviceType: '03', orderNum: 7, operateCode: '001', tip: '鼠标左键点击【关闭】按钮' } { deviceType: '03', orderNum: 7, operateCode: '001', tip: '鼠标左键点击【关闭】按钮' }
@ -1205,7 +1204,7 @@ export const OperationList = {
{ deviceType: '02', orderNum: 1, operateCode: '113', tip: '鼠标右键菜单选择【设置临时限速】' }, { deviceType: '02', orderNum: 1, operateCode: '113', tip: '鼠标右键菜单选择【设置临时限速】' },
{ deviceType: '02', orderNum: 2, operateCode: '1136', tip: '鼠标左键选择【限速值35】', val: '35' }, { deviceType: '02', orderNum: 2, operateCode: '1136', tip: '鼠标左键选择【限速值35】', val: '35' },
{ deviceType: '02', orderNum: 3, operateCode: '1131', tip: '鼠标左键点击【下达】按钮' }, { deviceType: '02', orderNum: 3, operateCode: '1131', tip: '鼠标左键点击【下达】按钮' },
{ deviceType: '02', orderNum: 4, operateCode: '1132', tip: '鼠标左键点击【确】按钮' }, { deviceType: '02', orderNum: 4, operateCode: '1132', tip: '鼠标左键点击【确】按钮' },
{ deviceType: '02', orderNum: 5, operateCode: '1133', tip: '鼠标左键点击【确认1】按钮' }, { deviceType: '02', orderNum: 5, operateCode: '1133', tip: '鼠标左键点击【确认1】按钮' },
{ deviceType: '02', orderNum: 6, operateCode: '1134', tip: '鼠标左键点击【确认2】按钮' }, { deviceType: '02', orderNum: 6, operateCode: '1134', tip: '鼠标左键点击【确认2】按钮' },
{ deviceType: '02', orderNum: 7, operateCode: '001', tip: '鼠标左键点击【关闭】按钮' } { deviceType: '02', orderNum: 7, operateCode: '001', tip: '鼠标左键点击【关闭】按钮' }