佛山有轨电车 区段道岔操作代码调整

This commit is contained in:
joylink_cuiweidong 2020-03-23 17:25:18 +08:00
parent 09a51635f5
commit 3d6f5a2537
9 changed files with 134 additions and 987 deletions

View File

@ -1,427 +0,0 @@
<template>
<el-dialog v-dialogDrag :z-index="2000" class="ningbo-01__systerm alxe-effective" :title="title" :visible.sync="show" width="420px" :before-close="doClose" :modal="false" :close-on-click-modal="false">
<div style="padding: 10px 20px;border: 1px solid lightgray;">
<span class="base-label">准备</span>
<div style="margin-top: -10px">
<el-row type="flex" justify="left">
<el-col :span="9">车站</el-col>
<el-col :span="9">轨道/计轴</el-col>
</el-row>
<el-row type="flex" justify="left">
<el-col :span="9">
<el-input v-model="model.stationName" :type="type" size="mini" :disabled="true" />
</el-col>
<el-col :span="9">
<el-input v-model="model.sectionName" :type="type" size="mini" :disabled="true" />
</el-col>
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm1" size="mini" :disabled="type==='password'" @click="commitOnce">确认</el-button>
</el-col>
</el-row>
</div>
</div>
<div style="padding: 10px 20px;border: 1px solid lightgray;margin-top: 10px">
<span class="base-label">确认</span>
<div style="margin-top: -10px">
<el-row type="flex" justify="left">
<el-col :span="9">车站</el-col>
<el-col :span="9">轨道/计轴</el-col>
</el-row>
<el-row type="flex" justify="left">
<el-col :span="9">
<el-select
:id="domIdChoose1"
v-model="model.confirmStationName"
filterable
size="mini"
:disabled="type==='text'"
@change="stationSelectChange"
>
<el-option v-for="(option,index) in filterStationList" :key="index" :label="option.name" :value="option.name" />
</el-select>
</el-col>
<el-col :span="9">
<el-select
:id="domIdChoose2"
v-model="model.confirmSectionName"
filterable
size="mini"
:disabled="type==='text'"
@change="sectionSelectChange"
>
<el-option v-for="(option,index) in randomSectionList" :key="index" :label="option.name" :value="option.name" />
</el-select>
</el-col>
<el-col :span="4" :offset="1">
<el-button
:id="domIdConfirm2"
size="mini"
:loading="loading"
:disabled="type==='text'"
@click="commit"
>确认</el-button>
</el-col>
</el-row>
</div>
</div>
<el-row type="flex" justify="left" style="margin-top:20px;margin-bottom: 10px;">
<el-col :span="6" :offset="1">操作倒计时</el-col>
<el-col :span="16">
<el-input v-model="model.time" size="mini" :readonly="true" />
</el-col>
</el-row>
<el-row>
<el-col :offset="1">状态</el-col>
</el-row>
<el-row>
<el-col :offset="1" :span="23">
<el-input v-model="model.status" type="textarea" :rows="2" placeholder />
</el-col>
</el-row>
<el-row class="botton-group" style="margin-top:20px">
<el-col :span="4" :offset="10">
<el-button :id="domIdCancel" @click="cancel">关闭</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
<popup-alarm ref="popupAlarm" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import PopupAlarm from './childDialog/popupAlarm';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'AlxeEffective',
components: {
NoticeInfo,
PopupAlarm
},
data() {
return {
dialogShow: false,
loading: false,
type: 'text',
timeout: 1000,
timenum: 30,
stepNum: 0,
task: null,
model: {
stationName: '',
sectionName: '',
confirmStationName: '',
confirmSectionName: '',
status: '',
time: 0
},
selected: null,
operate: null,
operation: '',
randomSectionList: []
};
},
computed: {
...mapGetters('map', ['stationList', 'sectionList']),
filterStationList() {
const list = [];
if (this.stationList) {
this.stationList.forEach(elem => {
if (
list.findIndex(it => {
return it.name == elem.name;
}) < 0
) {
list.push({ name: elem.name });
}
});
}
return list;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdConfirm1() {
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
return OperationEvent.Section.alxeEffective.confirm1.domId;
} else if (this.operation == OperationEvent.Switch.alxeEffective.menu.operation) {
return OperationEvent.Switch.alxeEffective.confirm1.domId;
}
return '';
},
domIdConfirm2() {
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
return OperationEvent.Section.alxeEffective.confirm2.domId;
} else if (this.operation == OperationEvent.Switch.alxeEffective.menu.operation) {
return OperationEvent.Switch.alxeEffective.confirm2.domId;
}
return '';
},
domIdChoose1() {
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
return OperationEvent.Section.alxeEffective.choose1.domId;
} else if (this.operation == OperationEvent.Switch.alxeEffective.menu.operation) {
return OperationEvent.Switch.alxeEffective.choose1.domId;
}
return '';
},
domIdChoose2() {
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
return OperationEvent.Section.alxeEffective.choose2.domId;
} else if (this.operation == OperationEvent.Switch.alxeEffective.menu.operation) {
return OperationEvent.Switch.alxeEffective.choose2.domId;
}
return '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
title() {
if ( this.operation == OperationEvent.Section.alxeEffective.menu.operation || this.operation == OperationEvent.Switch.alxeEffective.menu.operation ) {
return '确认计轴恢复工作';
}
return '';
}
},
watch: {
'model.sectionName': function(name) {
const index = Math.floor(Math.random(1) * 5);
for (var i = 0; i < 5; i++) {
if (i == index) {
this.randomSectionList.push({ name });
} else {
const section = this.sectionList[
Math.floor(Math.random(1) * this.sectionList.length)
];
if (section.type != '02') {
if (
this.randomSectionList.findIndex(it => {
return it.name == section.name;
}) < 0
) {
this.randomSectionList.push({ name: section.name });
} else {
i--;
}
} else {
i--;
}
}
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
stopTask() {
if (this.task) {
clearInterval(this.task);
this.task = null;
}
if (this.stepNum < 3) {
this.$store.dispatch('training/backSteps', this.stepNum);
this.$store.dispatch('training/emitTipFresh');
this.model.name = '';
this.model.time = '';
this.type = 'text';
}
},
doShow(operate, selected) {
this.selected = selected;
this.operate = operate || {};
this.operation = operate.operation;
this.status = '';
this.model.stationName = '';
this.model.sectionName = '';
this.model.confirmStationName = '';
this.model.confirmSectionName = '';
if (selected) {
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
if (selected.isSwitchSection) {
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
if (section) {
this.model.sectionName = section.name;
}
} else {
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
if (section) {
this.model.sectionName = section.name;
this.model.sectionName = `${section.name}-${selected.name}`;
} else {
this.model.sectionName = `${selected.name}`;
}
}
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
const section = this.$store.getters['map/getDeviceByCode'](selected.switchSectionCode);
if (section) {
this.model.sectionName = section.name;
}
}
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.model.stationName = station.name;
}
}
this.stepNum = 0;
this.loading = false;
this.dialogShow = true;
this.stopTask();
this.$nextTick(function() {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
waitSelectEvent() {
if (!this.$store.state.menuOperation.break) {
this.model.time -= 1;
if (this.model.time <= 0) {
this.stopTask();
}
}
},
commitOnce() {
this.stepNum = 1;
const operate = {
operation: ''
};
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
operate.operation = OperationEvent.Section.alxeEffective.confirm1.operation;
} else if (this.operation == OperationEvent.Switch.alxeEffective.menu.operation) {
operate.operation = OperationEvent.Switch.alxeEffective.confirm1.operation;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.type = 'password';
this.model.time = this.timenum;
this.task = setInterval(this.waitSelectEvent, this.timeout);
}
});
},
stationSelectChange() {
if (this.model.confirmStationName === this.model.stationName) {
this.stepNum = 2;
} else {
this.model.time = 0;
}
const operate = {
operation: ''
};
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
operate.operation = OperationEvent.Section.alxeEffective.choose1.operation;
} else if (this.operation == OperationEvent.Switch.alxeEffective.menu.operation) {
operate.operation = OperationEvent.Switch.alxeEffective.choose1.operation;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
});
},
sectionSelectChange() {
if (this.model.confirmSectionName === this.model.sectionName) {
this.stepNum = 2;
} else {
this.model.time = 0;
}
const operate = {
operation: ''
};
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
operate.operation = OperationEvent.Section.alxeEffective.choose2.operation;
} else if (this.operation == OperationEvent.Switch.alxeEffective.menu.operation) {
operate.operation = OperationEvent.Switch.alxeEffective.choose2.operation;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', {
break: true
});
});
},
/** 确认计轴恢复工作*/
commit() {
const operate = {
over: true,
operation: '',
cmdType: ''
};
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
operate.operation = OperationEvent.Section.alxeEffective.confirm2.operation;
operate.cmdType = CMD.Section.CMD_SECTION_COMFIRMATION_AXLE;
} else if (this.operation == OperationEvent.Switch.alxeEffective.menu.operation) {
operate.operation = OperationEvent.Switch.alxeEffective.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE;
}
this.model.status = '';
if (this.model.stationName == this.model.confirmStationName && this.model.sectionName == this.model.confirmSectionName) {
this.stepNum = 3;
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.type = 'text';
this.stopTask();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.popupAlarm.doShow(
Object.assign(this.operate, {val: operate.val}), [`集中站 ${this.model.stationName} 区段 ${this.model.sectionName}报告恢复计轴有效`]
);
}
}).catch((error) => {
this.loading = false;
this.$refs.noticeInfo.doShow(operate, error.message);
});
} else {
if (this.model.stationName != this.model.confirmStationName) {
this.model.status = '车站选择错误';
} else if (
this.model.sectionName != this.model.confirmSectionName
) {
this.model.status = '区段选择错误';
}
}
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store
.dispatch('training/nextNew', operate)
.then(({ valid }) => {
if (valid) {
this.doClose();
}
})
.catch(() => {
this.doClose();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.alxe-effective .context {
height: 80px !important;
}
</style>

View File

@ -1,89 +0,0 @@
<template>
<el-dialog class="ningbo-01__systerm popup-alarm" :title="title" :visible.sync="show" width="500px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
<el-row>
<el-col :offset="2">
<span v-for="(message, index) in messages" :key="index">{{message}}</span><br>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="8">
<el-button :id="domIdSure" type="primary" @click="commit">确定</el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'Popup-Alarm',
data() {
return {
dialogShow: false,
messages: [],
operate: null,
operation: '',
}
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
return '弹出式告警';
},
domIdSure() {
return this.dialogShow ? OperationEvent.Command.close.alarm.domId : '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operate, messages) {
this.operate = operate || {};
this.operation = operate.operation;
this.dialogShow = true;
this.messages = messages || [];
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
//
this.alxeEffective();
}
},
alxeEffective() {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.alarm.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
})
}
}
}
</script>
<style>
.popup-alarm .context {
padding-bottom: 40px !important;
border: 1px solid lightgray;
}
</style>

View File

@ -22,7 +22,7 @@
<el-input v-model="sectionName" size="small" disabled /> <el-input v-model="sectionName" size="small" disabled />
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="isShow" style="margin-top: 10px;"> <el-row style="margin-top: 10px;">
<el-col :span="11"> <el-col :span="11">
<el-radio v-model="radio" label="1" :disabled="radio == 2" style="display: block; text-align: center;"> <el-radio v-model="radio" label="1" :disabled="radio == 2" style="display: block; text-align: center;">
激活</el-radio> 激活</el-radio>
@ -61,7 +61,6 @@ export default {
loading: false, loading: false,
selected: null, selected: null,
operation: '', operation: '',
isShow: false,
stationName: '', stationName: '',
sectionName: '', sectionName: '',
radio: '' radio: ''
@ -78,9 +77,7 @@ export default {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : ''; return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
}, },
title() { title() {
if (this.operation == OperationEvent.Section.lock.menu.operation) { if (this.operation == OperationEvent.Section.split.menu.operation) {
return '区段封锁';
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
return '区段控制'; return '区段控制';
} else if (this.operation == OperationEvent.Section.active.menu.operation) { } else if (this.operation == OperationEvent.Section.active.menu.operation) {
return '区段控制'; return '区段控制';
@ -114,13 +111,10 @@ export default {
} }
} }
this.operation = operate.operation || ''; this.operation = operate.operation || '';
this.isShow = false;
if (this.operation == OperationEvent.Section.split.menu.operation) { if (this.operation == OperationEvent.Section.split.menu.operation) {
this.radio = '2'; this.radio = '2';
this.isShow = true;
} else if (this.operation == OperationEvent.Section.active.menu.operation) { } else if (this.operation == OperationEvent.Section.active.menu.operation) {
this.radio = '1'; this.radio = '1';
this.isShow = true;
} }
} }
this.dialogShow = true; this.dialogShow = true;
@ -135,10 +129,7 @@ export default {
this.mouseCancelState(this.selected); this.mouseCancelState(this.selected);
}, },
commit() { commit() {
if (this.operation == OperationEvent.Section.lock.menu.operation) { if (this.operation == OperationEvent.Section.split.menu.operation) {
/** 区段封锁*/
this.lock();
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
/** 轨道区段切除*/ /** 轨道区段切除*/
this.split(); this.split();
} else if (this.operation == OperationEvent.Section.active.menu.operation) { } else if (this.operation == OperationEvent.Section.active.menu.operation) {
@ -146,16 +137,6 @@ export default {
this.active(); this.active();
} }
}, },
//
lock() {
const operate = {
over: true,
operation: this.operation,
cmdType: CMD.Section.CMD_SECTION_BLOCK
};
this.sendCommand(operate);
},
// //
split() { split() {
const operate = { const operate = {

View File

@ -101,9 +101,7 @@ export default {
return this.dialogShow ? OperationEvent.Section.unlock.confirm.domId : ''; return this.dialogShow ? OperationEvent.Section.unlock.confirm.domId : '';
}, },
title() { title() {
if (this.operation == OperationEvent.Section.unlock.menu.operation) { if (this.operation == OperationEvent.Section.fault.menu.operation) {
return '解除封锁';
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
return '区故解'; return '区故解';
} }
return ''; return '';
@ -156,9 +154,7 @@ export default {
val: this.messageText2 val: this.messageText2
}; };
if (this.operation == OperationEvent.Section.unlock.menu.operation) { if (this.operation == OperationEvent.Section.fault.menu.operation) {
operate.operation = OperationEvent.Section.unlock.choose.operation;
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
operate.operation = OperationEvent.Section.fault.choose.operation; operate.operation = OperationEvent.Section.fault.choose.operation;
} }
@ -176,9 +172,7 @@ export default {
operation: '' operation: ''
}; };
if (this.operation == OperationEvent.Section.unlock.menu.operation) { if (this.operation == OperationEvent.Section.fault.menu.operation) {
operate.operation = OperationEvent.Section.unlock.confirm1.operation;
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
operate.operation = OperationEvent.Section.fault.confirm1.operation; operate.operation = OperationEvent.Section.fault.confirm1.operation;
} }
@ -201,10 +195,7 @@ export default {
cmdType: '' cmdType: ''
}; };
if (this.operation == OperationEvent.Section.unlock.menu.operation) { if (this.operation == OperationEvent.Section.fault.menu.operation) {
operate.operation = OperationEvent.Section.unlock.confirm2.operation;
operate.cmdType = CMD.Section.CMD_SECTION_UNBLOCK;
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
operate.operation = OperationEvent.Section.fault.confirm2.operation; operate.operation = OperationEvent.Section.fault.confirm2.operation;
operate.cmdType = CMD.Section.CMD_SECTION_FAULT_UNLOCK; operate.cmdType = CMD.Section.CMD_SECTION_FAULT_UNLOCK;
} }
@ -226,9 +217,7 @@ export default {
operation: '' operation: ''
}; };
if (this.operation == OperationEvent.Section.unlock.menu.operation) { if (this.operation == OperationEvent.Section.fault.menu.operation) {
operate.operation = OperationEvent.Section.unlock.confirm.operation;
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
operate.operation = OperationEvent.Section.fault.confirm.operation; operate.operation = OperationEvent.Section.fault.confirm.operation;
} }

View File

@ -22,16 +22,6 @@
<el-input v-model="switchName" size="small" disabled /> <el-input v-model="switchName" size="small" disabled />
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="isActive" style="margin-top: 10px;">
<el-col :span="11">
<el-radio v-model="activeRadio" label="1" :disabled="activeRadio == 2" style="display: block; text-align: center;">
激活</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio v-model="activeRadio" label="2" :disabled="activeRadio == 1" style="display: block; text-align: center;">
切除</el-radio>
</el-col>
</el-row>
<el-row v-if="isLock" style="margin-top: 10px;"> <el-row v-if="isLock" style="margin-top: 10px;">
<el-col :span="11"> <el-col :span="11">
<el-radio v-model="lockRadio" label="1" style="display: block; text-align: center;"> <el-radio v-model="lockRadio" label="1" style="display: block; text-align: center;">
@ -86,7 +76,6 @@ export default {
switchName: '', switchName: '',
isLock: false, isLock: false,
isTurnBlock: false, isTurnBlock: false,
isActive: false,
turnRadio: '1', turnRadio: '1',
lockRadio: '1', lockRadio: '1',
activeRadio: '1' activeRadio: '1'
@ -140,7 +129,6 @@ export default {
this.operation = operate.operation; this.operation = operate.operation;
this.isLock = false; this.isLock = false;
this.isTurnBlock = false; this.isTurnBlock = false;
this.isActive = false;
if (this.operation == OperationEvent.Switch.locate.menu.operation) { if (this.operation == OperationEvent.Switch.locate.menu.operation) {
this.isTurnBlock = true; this.isTurnBlock = true;
this.turnRadio = '1'; this.turnRadio = '1';
@ -149,12 +137,6 @@ export default {
this.turnRadio = '2'; this.turnRadio = '2';
} else if (this.operation == OperationEvent.Switch.lock.menu.operation) { } else if (this.operation == OperationEvent.Switch.lock.menu.operation) {
this.isLock = true; this.isLock = true;
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
this.isActive = true;
this.activeRadio = '2';
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
this.isActive = true;
this.activeRadio = '1';
} }
} }
this.dialogShow = true; this.dialogShow = true;
@ -181,12 +163,6 @@ export default {
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) { } else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
/** 道岔反位*/ /** 道岔反位*/
this.reverse(); this.reverse();
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
/** 区段切除*/
this.split();
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
/** 区段激活*/
this.active();
} }
}, },
// //
@ -229,24 +205,6 @@ export default {
this.sendCommand(operate); this.sendCommand(operate);
}, },
//
split() {
const operate = {
over: true,
operation: OperationEvent.Switch.split.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
};
this.sendCommand(operate);
},
//
active() {
const operate = {
over: true,
operation: OperationEvent.Switch.active.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
};
this.sendCommand(operate);
},
cancel() { cancel() {
const operate = { const operate = {
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation

View File

@ -4,7 +4,6 @@
<section-control ref="sectionControl" /> <section-control ref="sectionControl" />
<section-un-lock ref="sectionUnLock" /> <section-un-lock ref="sectionUnLock" />
<speed-limit-control ref="speedLimitControl" /> <speed-limit-control ref="speedLimitControl" />
<alxe-effective ref="alxeEffective" />
<notice-info ref="noticeInfo" /> <notice-info ref="noticeInfo" />
</div> </div>
</template> </template>
@ -14,7 +13,6 @@ import PopMenu from '@/components/PopMenu';
import SectionControl from './dialog/sectionControl'; import SectionControl from './dialog/sectionControl';
import SectionUnLock from './dialog/sectionUnLock'; import SectionUnLock from './dialog/sectionUnLock';
import SpeedLimitControl from './dialog/speedLimitControl'; import SpeedLimitControl from './dialog/speedLimitControl';
import AlxeEffective from './dialog/alxeEffective';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
@ -29,7 +27,6 @@ export default {
SectionControl, SectionControl,
SectionUnLock, SectionUnLock,
SpeedLimitControl, SpeedLimitControl,
AlxeEffective,
NoticeInfo NoticeInfo
}, },
props: { props: {
@ -59,16 +56,6 @@ export default {
label: '区段切除跟踪', label: '区段切除跟踪',
handler: this.split, handler: this.split,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF cmdType: CMD.Section.CMD_SECTION_CUT_OFF
},
{
label: '区段封锁',
handler: this.lock,
cmdType: CMD.Section.CMD_SECTION_BLOCK
},
{
label: '区段解封',
handler: this.unlock,
cmdType: CMD.Section.CMD_SECTION_UNBLOCK
} }
], ],
Center: [ Center: [
@ -81,17 +68,12 @@ export default {
label: '区段跟踪切除', label: '区段跟踪切除',
handler: this.split, handler: this.split,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF cmdType: CMD.Section.CMD_SECTION_CUT_OFF
},
{
label: '确认计轴有效',
handler: this.alxeEffective,
cmdType: CMD.Section.CMD_SECTION_COMFIRMATION_AXLE
},
{
label: '设置临时限速',
handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
} }
// {
// label: '',
// handler: this.setSpeed,
// cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
// }
] ]
}, },
menuForce: [ menuForce: [
@ -205,23 +187,6 @@ export default {
} }
}); });
}, },
//
alxeEffective() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Section.alxeEffective.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.alxeEffective.doShow(operate, this.selected);
}
});
},
// //
active() { active() {
const operate = { const operate = {
@ -238,58 +203,24 @@ export default {
this.$refs.sectionControl.doShow(operate, this.selected); this.$refs.sectionControl.doShow(operate, this.selected);
} }
}); });
},
//
lock() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Section.lock.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionControl.doShow(operate, this.selected);
}
});
},
//
unlock() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Section.unlock.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionUnLock.doShow(operate, this.selected);
}
});
},
//
setSpeed() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Section.setSpeed.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.speedLimitControl.doShow(operate, this.selected);
}
});
} }
// //
// setSpeed() {
// const operate = {
// start: true,
// code: this.selected.code,
// operation: OperationEvent.Section.setSpeed.menu.operation,
// param: {
// sectionCode: this.selected.code
// }
// };
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.speedLimitControl.doShow(operate, this.selected);
// }
// });
// }
} }
}; };
</script> </script>

View File

@ -4,7 +4,6 @@
<switch-control ref="switchControl" /> <switch-control ref="switchControl" />
<switch-un-lock ref="switchUnLock" /> <switch-un-lock ref="switchUnLock" />
<speed-limit-control ref="speedLimitControl" /> <speed-limit-control ref="speedLimitControl" />
<alxe-effective ref="alxeEffective" />
<notice-info ref="noticeInfo" /> <notice-info ref="noticeInfo" />
</div> </div>
</template> </template>
@ -14,7 +13,6 @@ import PopMenu from '@/components/PopMenu';
import SwitchControl from './dialog/switchControl'; import SwitchControl from './dialog/switchControl';
import SwitchUnLock from './dialog/switchUnLock'; import SwitchUnLock from './dialog/switchUnLock';
import SpeedLimitControl from './dialog/speedLimitControl'; import SpeedLimitControl from './dialog/speedLimitControl';
import AlxeEffective from './dialog/alxeEffective';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
@ -30,7 +28,6 @@ export default {
SwitchControl, SwitchControl,
SwitchUnLock, SwitchUnLock,
SpeedLimitControl, SpeedLimitControl,
AlxeEffective,
NoticeInfo NoticeInfo
}, },
props: { props: {
@ -47,12 +44,12 @@ export default {
menuNormal: { menuNormal: {
Local: [ Local: [
{ {
label: '', label: '道岔总定',
handler: this.locate, handler: this.locate,
cmdType: CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN cmdType: CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN
}, },
{ {
label: '', label: '道岔总反',
handler: this.reverse, handler: this.reverse,
cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN
}, },
@ -67,7 +64,7 @@ export default {
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
}, },
{ {
label: '道岔封', label: '道岔封',
handler: this.block, handler: this.block,
cmdType: CMD.Switch.CMD_SWITCH_BLOCK cmdType: CMD.Switch.CMD_SWITCH_BLOCK
}, },
@ -76,52 +73,14 @@ export default {
handler: this.unblock, handler: this.unblock,
cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK
} }
//
], ],
Center: [ Center: [
{ // {
label: '定操', // label: '',
handler: this.locate, // handler: this.setSpeed,
cmdType: CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN // cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
}, // },
{
label: '反操',
handler: this.reverse,
cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN
},
{
type: 'separator'
},
{
label: '区段激活',
handler: this.active,
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
},
{
label: '区段切除',
handler: this.split,
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
},
{
type: 'separator'
},
{
label: '确认计轴有效',
handler: this.alxeEffective,
cmdType: CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE
},
{
label: '设置临时限速',
handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
},
{
type: 'separator'
},
{
label: '查看公里标',
handler: this.undeveloped,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
}
] ]
}, },
menuForce: [ menuForce: [
@ -329,74 +288,23 @@ export default {
} }
}); });
}, },
//
split() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Switch.split.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
}
});
},
//
active() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Switch.active.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
}
});
},
// //
setSpeed() { // setSpeed() {
const operate = { // const operate = {
start: true, // start: true,
code: this.selected.code, // code: this.selected.code,
operation: OperationEvent.Switch.setSpeed.menu.operation, // operation: OperationEvent.Switch.setSpeed.menu.operation,
param: { // param: {
switchCode: this.selected.code // switchCode: this.selected.code
} // }
}; // };
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 });
this.$refs.speedLimitControl.doShow(operate, this.selected); // this.$refs.speedLimitControl.doShow(operate, this.selected);
} // }
}); // });
}, // },
//
alxeEffective() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Switch.alxeEffective.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.alxeEffective.doShow(operate, this.selected);
}
});
},
undeveloped() { undeveloped() {
this.doClose(); this.doClose();
this.$alert('实现中......', '提示', { this.$alert('实现中......', '提示', {

View File

@ -22,6 +22,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from './utils/menuOperate';
export default { export default {
name: 'SwitchMenu', name: 'SwitchMenu',
@ -229,172 +230,62 @@ export default {
}, },
// //
locate() { locate() {
const operate = { commitOperate(menuOperate.Switch.locate, {switchCode:this.selected.code}, 0).then((data)=>{
start: true, this.$refs.switchControl.doShow(data.operate, this.selected);
code: this.selected.code,
operation: OperationEvent.Switch.locate.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
}
}); });
}, },
// //
reverse() { reverse() {
const operate = { commitOperate(menuOperate.Switch.reverse, {switchCode:this.selected.code}, 0).then((data)=>{
start: true, this.$refs.switchControl.doShow(data.operate, this.selected);
code: this.selected.code,
operation: OperationEvent.Switch.reverse.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
}
}); });
}, },
// //
lock() { lock() {
const operate = { commitOperate(menuOperate.Switch.lock, {switchCode:this.selected.code}, 0).then((data)=>{
start: true, this.$refs.switchControl.doShow(data.operate, this.selected);
code: this.selected.code,
operation: OperationEvent.Switch.lock.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
}
}); });
}, },
// //
unlock() { unlock() {
const operate = { commitOperate(menuOperate.Switch.unlock, {switchCode:this.selected.code}, 0).then((data)=>{
start: true, this.$refs.switchUnLock.doShow(data.operate, this.selected);
code: this.selected.code,
operation: OperationEvent.Switch.unlock.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchUnLock.doShow(operate, this.selected);
}
}); });
}, },
// //
block() { block() {
const operate = { commitOperate(menuOperate.Switch.block, {switchCode:this.selected.code}, 0).then((data)=>{
start: true, this.$refs.switchControl.doShow(data.operate, this.selected);
code: this.selected.code,
operation: OperationEvent.Switch.block.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
}
}); });
}, },
// //
unblock() { unblock() {
const operate = { commitOperate(menuOperate.Switch.unblock, {switchCode:this.selected.code}, 0).then((data)=>{
start: true, this.$refs.switchUnLock.doShow(data.operate, this.selected);
code: this.selected.code,
operation: OperationEvent.Switch.unblock.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchUnLock.doShow(operate, this.selected);
}
}); });
}, },
// //
split() { split() {
const operate = { commitOperate(menuOperate.Switch.split, {switchCode:this.selected.code}, 0).then((data)=>{
start: true, this.$refs.switchControl.doShow(data.operate, this.selected);
code: this.selected.code,
operation: OperationEvent.Switch.split.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
}
}); });
}, },
// //
active() { active() {
const operate = { commitOperate(menuOperate.Switch.active, {switchCode:this.selected.code}, 0).then((data)=>{
start: true, this.$refs.switchControl.doShow(data.operate, this.selected);
code: this.selected.code,
operation: OperationEvent.Switch.active.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
}
}); });
}, },
// //
setSpeed() { setSpeed() {
const operate = { commitOperate(menuOperate.Switch.setSpeed, {switchCode:this.selected.code}, 0).then((data)=>{
start: true, this.$refs.speedLimitControl.doShow(data.operate, this.selected);
code: this.selected.code,
operation: OperationEvent.Switch.setSpeed.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.speedLimitControl.doShow(operate, this.selected);
}
}); });
}, },
// //
alxeEffective() { alxeEffective() {
const operate = { commitOperate(menuOperate.Switch.alxeEffective, {switchCode:this.selected.code}, 0).then((data)=>{
start: true, this.$refs.alxeEffective.doShow(data.operate, this.selected);
code: this.selected.code,
operation: OperationEvent.Switch.alxeEffective.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.alxeEffective.doShow(operate, this.selected);
}
}); });
}, },
undeveloped() { undeveloped() {

View File

@ -113,53 +113,58 @@ export const menuOperate = {
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE
} }
}, },
// Switch:{ Switch:{
// lock:{ lock:{
// // 道岔单锁 // 道岔单锁
// operation: OperationEvent.Switch.lock.menu.operation, operation: OperationEvent.Switch.lock.menu.operation,
// cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
// }, },
// unlock:{ unlock:{
// // 道岔解锁 // 道岔解锁
// operation: OperationEvent.Switch.unlock.menu.operation, operation: OperationEvent.Switch.unlock.menu.operation,
// cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
// }, },
// turnoutForce:{ block:{
// // 道岔强扳 // 道岔封锁
// operation: OperationEvent.Switch.turnoutForce.menu.operation operation: OperationEvent.Switch.block.menu.operation,
// }, cmdType: CMD.Switch.CMD_SWITCH_BLOCK
// locate:{ },
// // 单操到定位 unblock:{
// operation: OperationEvent.Switch.locate.menu.operation, // 道岔解封
// cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION operation: OperationEvent.Switch.unblock.menu.operation,
// }, cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK
// reverse:{ },
// // 单操到反位 locate:{
// operation: OperationEvent.Switch.reverse.menu.operation, // 单操到定位
// cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION operation: OperationEvent.Switch.locate.menu.operation,
// }, cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
// split:{ },
// // 区段切除 reverse:{
// operation: OperationEvent.Switch.split.menu.operation, // 单操到反位
// cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF operation: OperationEvent.Switch.reverse.menu.operation,
// }, cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
// active:{ },
// // 区段激活 split:{
// operation: OperationEvent.Switch.active.menu.operation, // 区段切除
// cmdType: CMD.Switch.CMD_SWITCH_ACTIVE operation: OperationEvent.Switch.split.menu.operation,
// }, cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
// setSpeed:{ },
// // 设置临时限速 active:{
// operation: OperationEvent.Switch.setSpeed.menu.operation, // 区段激活
// cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED operation: OperationEvent.Switch.active.menu.operation,
// }, cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
// alxeEffective:{ },
// // 确认计轴有效 setSpeed:{
// operation: OperationEvent.Switch.alxeEffective.menu.operation, // 设置临时限速
// cmdType: CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE operation: OperationEvent.Switch.setSpeed.menu.operation,
// } cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
},
// }, alxeEffective:{
// 确认计轴有效
operation: OperationEvent.Switch.alxeEffective.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE
}
},
StationStand:{ StationStand:{
setDetainTrain:{ setDetainTrain:{
// 设置扣车 // 设置扣车