This commit is contained in:
fan 2020-03-18 19:05:12 +08:00
commit 838f2311f8
30 changed files with 1733 additions and 1106 deletions

View File

@ -484,7 +484,7 @@ class SkinCode extends defaultStyle {
lamp: {
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
controlColor: 'red' // 控制灯颜色 (灰色)
}
};

View File

@ -104,9 +104,16 @@ export default class Automactic extends Group {
this.add(this.text);
}
recover() {
this.control && this.control.setStyle({ fill: this.style.AutoTurnBack.lamp.controlColor });
}
handleSignal() {
this.control.setStyle({ fill: 'green' });
}
// 设置状态
setState(model) {
// model.show && this.handleSignal();
this.recover();
model.green && this.handleSignal();
}
createMouseEvent() {

View File

@ -40,7 +40,8 @@ export default class AxleReset extends Group {
r: this.style.AxleReset.lamp.radiusR
},
style: {
lineWidth: 0,
stroke: '##b5b3b3',
lineWidth: 1.5,
fill: this.style.AxleReset.lamp.controlColor
}
});

View File

@ -362,7 +362,7 @@ class Signal extends Group {
// 引导
guid() {
if (this.style.Signal.lamp.guidName == 'ningbo_01' && this.count == 1) {
if (this.style.Signal.lamp.guidName == 'ningbo_01') {
this.lamps[1].show();
}
if (this.count == 2 && !this.model.lightType && this.style.Signal.lamp.guidName != 'chengdu_03') { // 双灯 物理点灯 允许引导信号
@ -485,7 +485,7 @@ class Signal extends Group {
if (this.style.Signal.lamp.guidName == 'chengdu_03') {
this.lamps[0].setStyle({ lineWidth: this.style.Signal.lamp.borderWidth });
}
if (this.style.Signal.lamp.guidName == 'ningbo_01' && this.count == 1) {
if (this.style.Signal.lamp.guidName == 'ningbo_01') {
this.lamps[1].hide();
}
}

View File

@ -0,0 +1,198 @@
<template>
<el-dialog
v-dialogDrag
class="beijing-01__systerm"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
title="密码校验"
:close-on-click-modal="false"
append-to-body
>
<el-row>
<el-col :span="22" :offset="1">
<el-input v-model="encryptionPassword" placeholder="请使用软键盘输入" size="medium" :disabled="true" />
</el-col>
</el-row>
<el-row v-if="showMistake">
<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="4" :offset="1">
<el-button @click="inputNum">7</el-button>
</el-col>
<el-col :span="4" :offset="4">
<el-button @click="inputNum">8</el-button>
</el-col>
<el-col :span="4" :offset="4">
<el-button @click="inputNum">9</el-button>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button @click="inputNum">4</el-button>
</el-col>
<el-col :span="4" :offset="4">
<el-button @click="inputNum">5</el-button>
</el-col>
<el-col :span="4" :offset="4">
<el-button @click="inputNum">6</el-button>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button @click="inputNum">1</el-button>
</el-col>
<el-col :span="4" :offset="4">
<el-button @click="inputNum">2</el-button>
</el-col>
<el-col :span="4" :offset="4">
<el-button @click="inputNum">3</el-button>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button @click="inputNum">0</el-button>
</el-col>
<el-col :span="4" :offset="4">
<el-button @click="inputClear">C</el-button>
</el-col>
<el-col :span="4" :offset="4">
<el-button @click="backSpace"> &lt; </el-button>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="4" :offset="12">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'PasswordBox',
data() {
return {
/* 写死的初始密码*/
correctPassword: '1',
dialogShow: false,
operation: null,
checkHasInput: false,
/* 输入值*/
passwordCheck: '',
/* 输入值替换为对应长度的星号*/
encryptionPassword: '',
loading: false,
showMistake: false
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel: {
get: function () {
return this.dialogShow ? OperationEvent.Command.close.password.domId : '';
},
set: function () {
}
},
domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operate.operateNext) : '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate) {
this.operate = operate || {};
this.dialogShow = true;
this.checkHasInput = false;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.showMistake = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() { //
if (this.passwordCheck === this.correctPassword) {
this.$emit('checkOver', this.operate);
this.doClose();
this.inputClear();
} else {
this.showMistake = true;
}
},
/* 软键盘输入*/
inputNum(e) {
this.showMistake = false;
this.passwordCheck += e.path[0].innerText;
this.encryptionPassword = this.passwordCheck.replace(/./g, '*');
},
/* 软键盘清除*/
inputClear() {
this.showMistake = false;
this.passwordCheck = '';
this.encryptionPassword = '';
},
/* 软键盘回退*/
backSpace() {
this.showMistake = false;
const password = this.passwordCheck;
if (password !== '') {
this.passwordCheck = password.substring(0, password.length - 1);
this.encryptionPassword = this.passwordCheck;
}
},
cancel() {
const operate = {
send: false,
type: this.operate.type,
operation: OperationEvent.Command.close.password.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.inputClear();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.loading = false;
this.$refs.noticeInfo && this.$refs.noticeInfo.doShow(operate);
});
}
}
};
</script>
<style>
.notice-info .context {
padding-bottom: 40px !important;
border: 1px solid lightgray;
}
.password-error {
color: red;
}
</style>

View File

@ -1,455 +0,0 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="beijing-01__systerm section-cmd-control"
:title="title"
:visible.sync="show"
width="800px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div style="padding: 10px 20px; border: 1px solid lightgray;">
<span class="base-label">命令信息</span>
<el-form label-position="center" size="mini">
<el-row>
<el-col :span="8">
<el-form-item label="类型" label-width="40px">
<el-select v-model="operation" size="small" disabled>
<el-option
v-for="option in typeList"
:key="option.code"
:label="option.name"
:value="option.code"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="车站名称" label-width="80px">
<el-input v-model="stationName" size="small" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="区段名称" label-width="100px">
<el-input v-model="sectionName" size="small" disabled />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table
ref="tempData"
class="table"
:data="tempData"
border
style="width: 100%"
size="mini"
highlight-current-row
height="200"
>
<el-table-column prop="order" :width="50" label="序号" />
<el-table-column prop="date" :width="160" label="时间" />
<el-table-column prop="context" :width="180" label="执行过程" />
<el-table-column prop="result" label="执行结果" />
</el-table>
<span class="notice">{{ message }}</span>
<el-row class="button-group">
<el-col :span="2" :offset="2">
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">下达<span
v-show="timeCountCommand>0"
>({{ timeCountCommand }})</span></el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdConfirm1" type="primary" :disabled="cmdDisabled[1]" @click="confirm1">确认1
</el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdConfirm2" type="primary" :disabled="cmdDisabled[2]" @click="confirm2">确认2<span
v-show="timeCountConfirm>0"
>({{ timeCountConfirm }})</span></el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">中止</el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdClose" @click="close">关闭</el-button>
</el-col>
</el-row>
</el-dialog>
</div>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus';
import { now } from '@/utils/date';
export default {
name: 'SectionCmdControl',
data() {
return {
dialogShow: false,
backOperate: '',
selected: '',
order: 0,
row: null,
timer: null,
operation: '',
cmdDisabled: [true, true, true],
stpDisabled: true,
tempData: [],
message: '',
timeCountCommand: -1,
timeCountConfirm: -1,
stationName: '',
sectionName: ''
};
},
computed: {
typeList() {
return [
{ code: OperationEvent.Section.unlock.menu.operation, name: '区段解封' },
{ code: OperationEvent.Section.fault.menu.operation, name: '区段故障解锁' },
{ code: OperationEvent.Section.axlePreReset.menu.operation, name: '区段计轴预复位' }
];
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCommand() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Section.fault.menu.operation) {
/** 区段故障解锁*/
return OperationEvent.Section.fault.order.domId;
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
/** 区段计轴预复位*/
return OperationEvent.Section.axlePreReset.order.domId;
} else {
return '';
}
} else {
return '';
}
},
domIdConfirm1() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Section.fault.menu.operation) {
/** 区段故障解锁*/
return OperationEvent.Section.fault.confirm1.domId;
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
/** 区段计轴预复位*/
return OperationEvent.Section.axlePreReset.confirm1.domId;
} else {
return '';
}
} else {
return '';
}
},
domIdConfirm2() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Section.fault.menu.operation) {
/** 区段故障解锁*/
return OperationEvent.Section.fault.confirm2.domId;
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
/** 区段计轴预复位*/
return OperationEvent.Section.axlePreReset.confirm2.domId;
} else {
return '';
}
} else {
return '';
}
},
domIdStop() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Section.fault.menu.operation) {
/** 区段故障解锁*/
return OperationEvent.Section.fault.stop.domId;
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
/** 区段计轴预复位*/
return OperationEvent.Section.axlePreReset.stop.domId;
} else {
return '';
}
} else {
return '';
}
},
domIdClose() {
if (this.dialogShow) {
return OperationEvent.Command.close.menu.domId;
} else {
return '';
}
},
title() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Section.fault.menu.operation) {
return '区段故障解锁';
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
return '区段计轴预复位';
} else {
return '';
}
} else {
return '';
}
}
},
watch: {
cmdDisabled: {
handler(val, oldVal) {
this.stpDisabled = true;
val.forEach((elem, index) => {
// 1
if (elem == false && index >= 1 && index <= 2) {
this.stpDisabled = false;
}
});
},
deep: true
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
this.timer = setInterval(() => {
if (!this.$store.state.menuOperation.break) {
if (this.timeCountCommand > 0) {
this.timeCountCommand--;
} else if (this.timeCountCommand == 0) {
this.setButtonEnable({ step: 0 });
this.timeCountCommand = -1;
}
if (this.timeCountConfirm > 0) {
this.timeCountConfirm--;
} else if (this.timeCountConfirm == 0) {
this.setButtonEnable({ step: 0 });
this.timeCountConfirm = -1;
}
}
}, 1000);
},
beforeDestroy() {
clearInterval(this.timer);
this.timer = null;
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.sectionName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
if (selected.type === '02') {
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
if (section) {
this.sectionName += section.name;
}
}
this.sectionName += selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
this.order = 0;
this.operation = operate.operation || '';
this.dialogShow = true;
this.tempData = [];
this.timeCountCommand = -1;
this.timeCountConfirm = -1;
this.cmdDisabled = [false, true, true];
}
this.stpDisabled = true;
this.setMessage('请点击“下达”按钮,下达命令!');
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
command() {
if (this.operation == OperationEvent.Section.fault.menu.operation ||
this.operation == OperationEvent.Section.unlock.menu.operation ||
this.operation == OperationEvent.Section.cancelSpeed.menu.operation ||
this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
/** 第一步不带弹框处理*/
this.commandNoPopUp();
} else {
/** 第一步带弹框处理*/
this.commandHasPopUp();
}
},
commandHasPopUp() {
},
commandNoPopUp() {
const operate = {
type: MapDeviceType.Section.type
};
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
/** 区段解封*/
operate.operation = OperationEvent.Section.unlock.order.operation;
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
/** 区段故障解锁*/
operate.operation = OperationEvent.Section.fault.order.operation;
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
/** 区段计轴预复位*/
operate.operation = OperationEvent.Section.axlePreReset.order.operation;
}
this.setMessage('请点击“确认1”按钮确认命令');
this.writeRecord({ order: ++this.order, date: now(), context: '点击下达命令', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 1 });
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行成功' });
} else {
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行失败' });
}
}).catch(() => {
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行异常' });
});
},
confirm1() {
const operate = {
type: MapDeviceType.Section.type
};
if (this.operation == OperationEvent.Section.fault.menu.operation) {
/** 区段故障解锁*/
operate.operation = OperationEvent.Section.fault.confirm1.operation;
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
/** 区段计轴预复位*/
operate.operation = OperationEvent.Section.axlePreReset.confirm1.operation;
}
this.setMessage('请点击“确认2”按钮确认命令');
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认1', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.timeCountCommand = -1;
this.timeCountConfirm = 10;
this.setButtonEnable({ step: 2 });
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行成功' });
} else {
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行失败' });
}
}).catch(() => {
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行异常' });
});
},
confirm2() {
const operate = {
send: true,
type: MapDeviceType.Section.type
};
if (this.operation == OperationEvent.Section.fault.menu.operation) {
/** 区段故障解锁*/
operate.operation = OperationEvent.Section.fault.confirm2.operation;
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
/** 区段计轴预复位*/
operate.operation = OperationEvent.Section.axlePreReset.confirm2.operation;
}
this.setMessage('');
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认2', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.timeCountCommand = -1;
this.timeCountConfirm = -1;
this.setButtonEnable({ step: -1 });
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行成功' });
} else {
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行失败' });
}
}).catch(() => {
this.timeCountCommand = -1;
this.timeCountConfirm = -1;
this.setButtonEnable({ step: -1 });
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行异常' });
});
},
stop() {
const operate = {
type: MapDeviceType.Section.type
};
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
/** 区段解封*/
operate.operation = OperationEvent.Section.unlock.stop.operation;
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
/** 区段故障解锁*/
operate.operation = OperationEvent.Section.fault.stop.operation;
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
/** 区段计轴预复位*/
operate.operation = OperationEvent.Section.axlePreReset.stop.operation;
}
this.writeRecord({ order: ++this.order, date: now(), context: '点击终止', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 0 });
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行成功' });
} else {
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行失败' });
}
}).catch(() => {
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行异常' });
});
},
close() {
const operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.close.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
},
getOperate(operate) {
/** 弹框返回值处理*/
},
setButtonEnable(param) {
this.cmdDisabled = [true, true, true];
if (param && param.step >= 0) {
this.cmdDisabled[param.step] = false;
}
},
setMessage(message) {
this.message = message;
},
writeRecord(param) {
this.tempData.push(param);
},
editRecord(param) {
this.tempData.forEach(elem => {
if (elem.order == param.order) {
for (var prop in param) {
elem[prop] = param[prop];
}
}
});
}
}
};
</script>

View File

@ -22,7 +22,7 @@
<el-input v-model="sectionName" size="small" disabled />
</el-col>
</el-row>
<el-row style="margin-top: 10px;">
<el-row v-if="isDisplay" style="margin-top: 10px;">
<el-col :span="11">
<el-radio v-model="radio" label="1" :disabled="radio == 2" style="display: block; text-align: center;">
激活</el-radio>
@ -63,7 +63,8 @@ export default {
operation: '',
stationName: '',
sectionName: '',
radio: ''
radio: '',
isDisplay: false
};
},
computed: {
@ -78,11 +79,13 @@ export default {
},
title() {
if (this.operation == OperationEvent.Section.split.menu.operation) {
this.radio = '2';
return '区段控制';
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
this.radio = '1';
return '区段控制';
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
return '区故解';
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
return '计轴复位';
} else {
return '';
}
@ -97,6 +100,17 @@ export default {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
if (this.operation == OperationEvent.Section.split.menu.operation) {
this.radio = '2';
this.isDisplay = true;
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
this.radio = '1';
this.isDisplay = true;
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
this.isDisplay = false;
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
this.isDisplay = false;
}
this.sectionName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
@ -133,8 +147,32 @@ export default {
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
/** 轨道区段激活*/
this.active();
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
/** 区故解*/
this.faultUnlock();
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
/** 计轴预复位*/
this.axlePreReset();
}
},
//
faultUnlock() {
const operate = {
over: true,
operation: OperationEvent.Section.fault.menu.operation,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
};
this.sendCommand(operate);
},
//
axlePreReset() {
const operate = {
over: true,
operation: OperationEvent.Section.axlePreReset.menu.operation,
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET
};
this.sendCommand(operate);
},
//
split() {
const operate = {

View File

@ -95,7 +95,7 @@ export default {
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
return '区段控制';
} else if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
return '道岔解';
return '道岔';
} else {
return '';
}

View File

@ -224,7 +224,7 @@
<button
id="mbm_12"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown('mbm_12')"
@click="buttonDown(Switch.turnoutForce.menu.operation)"
>
<span style="color: black">
<center>
@ -237,6 +237,7 @@
</center>
</span>
</button>
<password-box ref="password" @checkOver="passWordCommit" />
</div>
</template>
@ -244,11 +245,15 @@
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import Handler from '@/scripts/cmdPlugin/Handler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
// import { deepAssign } from '@/utils/index';
// import PasswordBox from './dialog/childDialog/passwordInputBox.vue';
import PasswordBox from './dialog/childDialog/passwordInputBox.vue';
export default {
name: 'MapButtonMenu',
components: {
PasswordBox
},
data() {
return {
point: {
@ -345,33 +350,126 @@ export default {
}
});
},
selectedChange() {
//
if (this.$store.state.menuOperation.buttonOperation) {
const model = this.$store.state.menuOperation.selected;
if (model && model._type) {
// const deviceType = MapDeviceType[model._type];
const operate = {
send: true,
model: model,
code: model.code,
// type: deviceType.type,
operation: this.$store.state.menuOperation.buttonOperation,
tempData: this.tempData
};
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
if (valid) {
if (response) {
this.tempData = response.data;
}
}
});
} else {
Handler.clear();
this.$store.dispatch('menuOperation/setButtonOperation', null);
passWordCommit(data) {
const operate = {
operation: data.operation,
over:true,
cmdType:data.cmdType
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
});
},
selectedChange() {
const model = this.$store.state.menuOperation.selected;
if (model && model._type) {
switch (this.$store.state.menuOperation.buttonOperation) {
case OperationEvent.Station.guideLock.button.operation : {
if (model && model._type == 'GuideLock') {
const operate = {
start: true,
over: true,
operation: OperationEvent.Station.guideLock.button.operation,
param:{
stationCode:model.stationCode
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (model.setting) {
operate.cmdType = CMD.Station.CMD_STATION_CANCEL_MASTER_GUIDE_LOCK;
} else {
operate.cmdType = CMD.Station.CMD_STATION_SET_MASTER_GUIDE_LOCK;
}
this.$refs.password.doShow(operate);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
});
}
break;
}
case OperationEvent.MixinCommand.functionButton.button.operation : {
if (model && model._type == 'AutoTurnBack' && !model.setting) {
const operate = {
start: true,
over: true,
operation: OperationEvent.Station.guideLock.button.operation,
param:{
cycleCode:model.cycleCode
},
cmdType : CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK
};
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
});
}
break;
}
case OperationEvent.MixinCommand.totalCancel.button.operation: {
if (model && model._type == 'AutoTurnBack' && model.setting) {
const operate = {
start: true,
over: true,
operation: OperationEvent.Station.guideLock.button.operation,
param:{
cycleCode:model.cycleCode,
cancelRoute:false
},
cmdType : CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK
};
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
});
}
break;
}
}
} else {
Handler.clear();
this.$store.dispatch('menuOperation/setButtonOperation', null);
}
//
// if (this.$store.state.menuOperation.buttonOperation) {
// const model = this.$store.state.menuOperation.selected;
// if (model && model._type) {
// // const deviceType = MapDeviceType[model._type];
// const operate = {
// send: true,
// model: model,
// code: model.code,
// // type: deviceType.type,
// operation: this.$store.state.menuOperation.buttonOperation,
// tempData: this.tempData
// };
// this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
// if (valid) {
// if (response) {
// this.tempData = response.data;
// }
// }
// });
// } else {
// Handler.clear();
// this.$store.dispatch('menuOperation/setButtonOperation', null);
// }
// }
}
}
};

View File

@ -2,7 +2,6 @@
<div>
<pop-menu ref="popMenu" :menu="menu" />
<section-control ref="sectionControl" />
<section-cmd-control ref="sectionCmdControl" />
<speed-limit-control ref="speedLimitControl" />
<speed-cmd-control ref="speedCmdControl" />
<train-create ref="trainCreate" />
@ -14,7 +13,6 @@
<script>
import PopMenu from '@/components/PopMenu';
import SectionControl from './dialog/sectionControl';
import SectionCmdControl from './dialog/sectionCmdControl';
import SpeedCmdControl from './dialog/speedCmdControl';
import SpeedLimitControl from './dialog/speedLimitControl';
import TrainCreate from './dialog/trainCreate';
@ -22,7 +20,8 @@ import AlxeEffective from './dialog/alxeEffective';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { DeviceMenu } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
@ -31,7 +30,6 @@ export default {
components: {
PopMenu,
SectionControl,
SectionCmdControl,
SpeedLimitControl,
SpeedCmdControl,
TrainCreate,
@ -172,7 +170,7 @@ export default {
},
operationHandler(buttonOperation, selectType) {
switch (buttonOperation) {
case OperationEvent.Section.fault.menu.operation: {
case OperationEvent.Section.fault.button.operation: {
//
if (selectType.fault) {
this.faultUnlock(selectType);
@ -181,10 +179,11 @@ export default {
}
break;
}
// case OperationEvent: {
// //
// break;
// }
case OperationEvent.Section.axlePreReset.button.operation: {
//
this.axlePreReset(selectType);
break;
}
}
},
// //
@ -216,13 +215,12 @@ export default {
operation: OperationEvent.Section.fault.menu.operation,
param: {
sectionCode: selectType.code
},
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.sectionCmdControl.doShow(operate, this.selected);
this.$refs.sectionControl.doShow(operate, this.selected);
}
});
},
@ -285,22 +283,40 @@ export default {
});
},
//
axlePreReset() {
axlePreReset(selectType) {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Section.axlePreReset.menu.operation,
param: {
sectionCode: `${this.selected.code}`
sectionCode: selectType.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionCmdControl.doShow(operate, this.selected);
this.$refs.sectionControl.doShow(operate, this.selected);
// this.$refs.sectionCmdControl.doShow(operate, this.selected);
}
});
},
//
// axlePreReset() {
// const operate = {
// start: true,
// code: this.selected.code,
// operation: OperationEvent.Section.axlePreReset.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.sectionCmdControl.doShow(operate, this.selected);
// }
// });
// },
//
setSpeed() {
const operate = {

View File

@ -7,6 +7,7 @@
<route-hand-control ref="routeHandControl" />
<route-detail ref="routeDetail" />
<notice-info ref="noticeInfo" />
<password-box ref="password" @checkOver="passWordCommit" />
</div>
</template>
@ -25,6 +26,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu } from '@/scripts/ConstDic';
import { mouseCancelState } from './utils/menuItemStatus';
import PasswordBox from './dialog/childDialog/passwordInputBox.vue';
export default {
name: 'SignalMenu',
@ -35,7 +37,8 @@ export default {
RouteCmdControl,
RouteHandControl,
RouteDetail,
NoticeInfo
NoticeInfo,
PasswordBox
},
props: {
selected: {
@ -220,12 +223,21 @@ export default {
}
break;
}
case OperationEvent.Signal.cancelTrainRoute.button.operation: {
case OperationEvent.MixinCommand.totalCancel.button.operation: {
//
const occupy = this.isTrainOccupy(selectType);
if (occupy) {
//
this.signalCloseByLow(selectType);
} else {
//
this.cancelTrainRouteByLow(selectType);
}
break;
}
case OperationEvent.Signal.humanTrainRoute.button.operation: {
//
this.humanTrainRoute(selectType);
break;
}
case OperationEvent.Signal.reopenSignal.button.operation: {
@ -243,10 +255,6 @@ export default {
//
break;
}
case 'mbm_06': {
//
break;
}
case OperationEvent.Signal.setAutoInterlock.button.operation: {
//
if (selectType.fleetMode != undefined) {
@ -263,6 +271,19 @@ export default {
}
}
},
isTrainOccupy(selectType) {
const data = this.$store.getters['map/getApproachSectionByCode'](selectType.code);
if (data && data.routeSectionList.length > 0) {
let isTrainOccupy = false;
data.routeSectionList.forEach(sectionCode=>{
const section = this.$store.getters['map/getDeviceByCode'](sectionCode);
if (section && (section.ctOccupied || section.nctOccupied) ) {
isTrainOccupy = isTrainOccupy || true;
}
});
return isTrainOccupy;
}
},
//
setStoppage() {
const operate = {
@ -371,7 +392,43 @@ export default {
}
});
},
//
cancelTrainRouteByLow(selectType) {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
param: {
signalCode: selectType.code
},
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
//
humanTrainRoute(selectType) {
const step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Signal.humanTrainRoute.menu.operation,
param: {
signalCode: `${this.selected.code}`
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
step.cmdType = CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE;
this.$refs.password.doShow(step);
}
});
},
//
reopenSignalByRoute(selectType) {
const operate = {
@ -426,6 +483,25 @@ export default {
}
});
},
//
signalCloseByLow(selectType) {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Signal.signalClose.menu.operation,
param: {
signalCode: selectType.code
},
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
//
humanControl() {
const operate = {
@ -532,6 +608,20 @@ export default {
this.$refs.routeDetail.doShow(step, this.selected, routes);
}
});
},
passWordCommit(data) {
const operate = {
operation: data.operation,
over:true,
cmdType:data.cmdType
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
});
}
}
};

View File

@ -16,7 +16,8 @@ import StationSetRouteControlAll from './dialog/stationSetRouteControlAll';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { DeviceMenu } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mouseCancelState } from './utils/menuItemStatus';
@ -165,8 +166,6 @@ export default {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.stoppage.menu.operation
};
@ -187,8 +186,6 @@ export default {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.cancelStoppage.menu.operation
};
@ -209,8 +206,6 @@ export default {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.setAutoTrigger.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -227,8 +222,6 @@ export default {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.cancelAutoTrigger.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -244,8 +237,6 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.powerUnLock.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -260,8 +251,6 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.execKeyOperationTest.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -276,8 +265,6 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.humanControlALL.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -292,8 +279,6 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.atsAutoControlALL.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {

View File

@ -255,6 +255,8 @@ export default {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(error => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
/** 取消扣车 */
@ -273,6 +275,8 @@ export default {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(error => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
//

View File

@ -20,7 +20,8 @@ import AlxeEffective from './dialog/alxeEffective';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import {OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import {DeviceMenu } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mouseCancelState } from './utils/menuItemStatus';
@ -184,6 +185,11 @@ export default {
}
break;
}
case OperationEvent.Switch.turnoutForce.menu.operation: {
//
// this.switchTurnoutForce(selectType);
break;
}
}
},
//
@ -247,6 +253,8 @@ export default {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(error => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
//
@ -264,8 +272,29 @@ export default {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, selectType);
}
}).catch(error => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
//
switchTurnoutForce(selectType) {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Switch.turnoutForce.menu.operation,
param:{
switchCode:selectType.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
}
});
},
//
locate(selectType) {
const operate = {
@ -281,6 +310,8 @@ export default {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(error => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
@ -299,6 +330,8 @@ export default {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(error => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
//

File diff suppressed because it is too large Load Diff

View File

@ -2,14 +2,241 @@
<div id="haerbin-01__menuButton">
<div class="haerbin-01__systerm button">
<el-row>
<el-col :span="4" />
<el-col :span="11">
<div class="nav-border">
<el-row class="nav-border-row">
<template v-for="(item, index) in centralizedStationList">
<div :key="index" class="nav-border-row row-width-box flex-row">
<div v-if="item.name" class="fake-button-active" :class="{'active': item.show}" @click="clickCommand(item)">{{ item.name }}</div>
<div v-else class="fake-button" />
</div>
</template>
</el-row>
</div>
</el-col>
<el-col :span="10">
<div class="nav-border">
<div class="nav-border-top">
<el-button class="fl" :class="{'disabled': canCommand}" style="line-height: 18px; margin-top: 4px;" plain :disabled="canCommand" @click="command">执行</el-button>
<el-button class="fr" style="line-height: 18px; margin-top: 4px;" plain>取消</el-button>
</div>
<div class="nav-border-bottom">
<el-table
ref="table"
:data="tempData"
border
:cell-style="tableStyle"
style="width: 100%;background: #E0E0E0;border: none;outline: none;"
size="mini"
height="56"
class="haerbin_table"
highlight-current-row
:show-header="false"
@row-click="clickEvent"
>
<el-table-column prop="name" style="margin-left:10px" class-name="abc" />
</el-table>
</div>
</div>
</el-col>
<el-col :span="3">
<div class="nav-border flex-box">
<el-button style="line-height: 18px; width: 100px; margin: 0;" plain>联锁</el-button>
<el-button style="line-height: 18px; width: 100px; margin: 0;" plain>时刻表</el-button>
<el-button style="line-height: 18px; width: 100px; margin: 0;" plain>ATS</el-button>
</div>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { deepAssign } from '@/utils/index';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
components: {
NoticeInfo
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
tempData: [],
canCommand: true,
operate: '',
cmdType: '',
param: {},
tableStyle: {
'border-bottom': 'none',
'border-right': 'none',
'padding': 0
},
oldClickObj: null, //
route: null, //
centralizedStationList: new Array(15).fill({}),
swicthParamList: [
{ name: '封锁道岔', cmdType: CMD.Switch.CMD_SWITCH_BLOCK, operate: OperationEvent.Switch.block.menu.operation, show: false },
{ name: '解封道岔', cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK, operate: OperationEvent.Switch.unblock.menu.operation, show: false },
{ name: '取消锁定', cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK, operate: OperationEvent.Switch.unlock.menu.operation, show: false },
{ name: '单锁道岔', cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK, operate: OperationEvent.Switch.lock.menu.operation, show: false },
{ name: '转换定位', cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION, operate: OperationEvent.Switch.locate.menu.operation, show: false },
{ name: '转换反位', cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION, operate: OperationEvent.Switch.reverse.menu.operation, show: false }
],
signalParamList: [
{ name: '追踪单开', cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER, operate: OperationEvent.Signal.setAutoTrigger.menu.operation, show: false },
{ name: '追踪单关', cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER, operate: OperationEvent.Signal.cancelAutoTrigger.menu.operation, show: false },
{ name: '自排单开', cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING, operate: OperationEvent.Signal.atsAutoControl.menu.operation, show: false },
{ name: '自排单关', cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING, operate: OperationEvent.Signal.humanControl.menu.operation, show: false },
{ name: '重复开放', cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL, operate: OperationEvent.Signal.reopenSignal.menu.operation, show: false },
{ name: '封锁信号', cmdType: CMD.Signal.CMD_SIGNAL_BLOCK, operate: OperationEvent.Signal.lock.menu.operation, show: false },
{ name: '解封信号', cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK, operate: OperationEvent.Signal.unlock.menu.operation, show: false },
{ name: '关单信号', cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL, operate: OperationEvent.Signal.cancelAutoTrigger.menu.operation, show: false }
],
routeParamList: [
{ name: 'ATP进路', cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE, operate: OperationEvent.Signal.arrangementRoute.menu.operation, show: false },
{ name: '取消ATP', cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, operate: OperationEvent.Signal.cancelTrainRoute.menu.operation, show: false },
{ name: '联锁进路', cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE, operate: OperationEvent.Signal.arrangementRoute.menu.operation, show: false },
{ name: '取消联锁', cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, operate: OperationEvent.Signal.cancelTrainRoute.menu.operation, show: false },
{ name: '引导进路', cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE, operate: OperationEvent.Signal.guide.menu.operation, show: false },
{ name: '取消引导', cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE, operate: OperationEvent.Signal.humanTrainRoute.menu.operation, show: false }
]
};
},
computed: {
...mapGetters('map', [
'routeList'
])
},
watch: {
'$store.state.menuOperation.setMenuChangeCount': function (val) {
if (this.selected._type) {
this.canCommand = true;
// console.log(this.selected, 'selected');
switch (this.selected._type) {
case 'Switch':
this.handleSwicthMenu();
break;
case 'Signal':
if (this.oldClickObj && this.oldClickObj.code != this.selected.code) {
this.checkSignal();
} else {
this.handleSingalMenu();
}
break;
}
}
}
},
methods: {
clickCommand(row) {
this.clearAllMenuShow();
if (this.tempData.length) {
row.show = true;
this.operate = row.operate;
this.cmdType = row.cmdType;
this.canCommand = false;
}
},
clearAllMenuShow() {
this.centralizedStationList.forEach(item => {
if (item.name) {
item.show = false;
}
});
},
handleSwicthMenu() { //
this.centralizedStationList = new Array(15).fill({});
this.swicthParamList.forEach((swicth, index) => {
this.centralizedStationList[index] = swicth;
});
this.tempData = [];
this.tempData.push(this.selected);
this.param = {
switchCode: this.selected.code
};
},
handleSingalMenu() {
this.oldClickObj = deepAssign({}, this.selected);
this.centralizedStationList = new Array(15).fill({});
this.signalParamList.forEach((swicth, index) => {
this.centralizedStationList[index] = swicth;
});
this.tempData = [];
this.tempData.push(this.selected);
this.param = {
signalCode: this.selected.code
};
},
handleRouteMenu() { //
this.centralizedStationList = new Array(15).fill({});
this.routeParamList.forEach((swicth, index) => {
this.centralizedStationList[index] = swicth;
});
this.tempData = [];
this.tempData.push(this.route);
this.param = {
routeCode: this.route.code
};
},
//
checkSignal() {
this.route = null;
this.routeList.forEach(item => {
if (item.startSignalCode == this.oldClickObj.code && item.endSignalCode == this.selected.code) {
this.route = item;
}
});
if (this.route && this.route.code) {
this.handleRouteMenu();
} else {
this.handleSingalMenu();
}
},
handleParam() {
if (this.operate == OperationEvent.Signal.cancelTrainRoute.menu.operation || this.operate == OperationEvent.Signal.humanTrainRoute.menu.operation) {
this.param = {
signalCode: this.route.startSignalCode
};
}
},
command() {
this.handleParam();
const step = {
over: true,
cmdType: this.cmdType,
operation: this.operate,
param: this.param
};
// console.log(step);
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch((error) => {
this.doClose();
this.$refs.noticeInfo.doShow(step, error.message);
});
},
doClose() {
this.operate = ''; //
this.cmdType = '';
this.oldClickObj = null; //
this.param = {};
this.tempData = []; //
this.canCommand = true; //
this.clearAllMenuShow();
}
}
};
</script>
<style lang="scss">
@ -18,10 +245,88 @@ export default {
bottom: 0;
height: 90px;
width: 100%;
background: #ccc;
background: #E0E0E0;
z-index: 2;
}
// .display-draft{
// bottom:105px !important;
// }
.nav-border {
font-size: 12px;
color: #000;
height: 90px;
text-align: center;
border-top: 2px solid #7E8076;
border-left: 2px solid #6A6B64;
border-right: 2px solid #FBFBFA;
border-bottom: 2px solid #FBFBFA;
}
.nav-border-top{
height: 30px;
padding: 0 20px;
width: 100%;
font-size: 12px;
color: #000;
border-bottom: 2px solid #FBFBFA;
.fl {
float: left;
width: 100px;
&.disabled{
border: none!important;
color: #ccc!important;
}
}
.fr{
float: right;
width: 100px;
}
}
.nav-border-bottom{
height: 56px;
width: 100%;
font-size: 12px;
}
.flex-box{
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
}
.nav-border-row{
height: 29px;
&.row-width-box{
width: 20%;
float: left;
}
}
.flex-row{
display: flex;
justify-content: center;
align-items: center;
}
.fake-button{
width: 80px;
height: 20px;
border-radius: 5px !important;
border: 1px solid #D0CEC5;
box-shadow: -1px 0px 1px #BFBEB7 inset, 1px 0px 1px #BFBEB7 inset, 0px 1px 1px #BFBEB7 inset, 0px -1px 1px #BFBEB7 inset;
}
.fake-button-active{
width: 80px;
height: 20px;
border-radius: 5px !important;
line-height: 18px;
border: 1px solid #426688;
cursor: pointer;
box-shadow: -1px 0px 1px #fff inset, 1px 0px 1px #fff inset, 0px 1px 1px #fff inset, 0px -1px 1px #fff inset;
&:hover, &.active{
background: #b1b1b1;
}
}
.haerbin_table .abc:hover{
background-color:#2b68c3!important;
color: #fff;
}
.haerbin_table .el-table__body tr.current-row .abc{
background-color: #2b68c3!important;
color: #fff;
}
</style>

View File

@ -25,7 +25,7 @@ import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import { querySignalStatus } from '@/api/simulation';
// import { querySignalStatus } from '@/api/simulation';
export default {
name: 'SignalMenu',

View File

@ -0,0 +1,157 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm section-control"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="24">
<span style="margin-right: 10px;">区段:</span>
<el-select
:id="domIdChoose"
v-model="sectionCode"
filterable
size="mini"
@change="sectionSelectChange"
>
<el-option v-for="(option,index) in switchAndPhySicalSectionList" :key="index" :label="option.name" :value="option.name" />
</el-select>
</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="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SectionControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
operation: '',
sectionCode: ''
};
},
computed: {
...mapGetters('map', [
'sectionList'
]),
switchAndPhySicalSectionList() {
let list = [];
if (this.sectionList && this.sectionList.length) {
list = this.sectionList.filter(elem => { return elem.type === '01' || elem.type === '03'; });
}
return list;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.AxleReset.SetAxleReset.choose.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
return '计轴复位';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate) {
if (!this.dialogShow) {
this.sectionCode = '';
this.operation = operate.operation || '';
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
sectionSelectChange() {
const operate = {
operation: OperationEvent.AxleReset.SetAxleReset.choose.operation,
val: this.sectionCode
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
});
},
commit() {
const operate = {
over: true,
operation: this.operation,
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET,
param: {
sectionCode: this.sectionCode
}
};
this.sendCommand(operate);
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
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>

View File

@ -4,6 +4,7 @@
<template v-show="isShowAll">
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
<!-- <menu-button ref="menuButton" /> -->
<menu-axle-reset ref="menuAxleReset" :selected="selected" />
<menu-auto-trun-route ref="menuAutoTrunRoute" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-station-control ref="menuStationControl" :selected="selected" />>
@ -25,6 +26,7 @@ import { mapGetters } from 'vuex';
import MenuCancel from './menuCancel';
import MenuSignal from './menuSignal';
// import MenuButton from './menuButton';
import MenuAxleReset from './menuAxleReset';
import MenuAutoTrunRoute from './menuAutoTrunRoute';
import MenuStationStand from './menuStationStand';
import MenuStationControl from './menuStationControl';
@ -43,6 +45,7 @@ export default {
components: {
MenuBar,
// MenuButton,
MenuAxleReset,
MenuAutoTrunRoute,
MenuCancel,
MenuSignal,

View File

@ -0,0 +1,108 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<section-alxe-reset ref="sectionAlxeReset" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import SectionAlxeReset from './dialog/sectionAlxeReset';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
export default {
name: 'MenuLimit',
components: {
PopMenu,
SectionAlxeReset
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [],
menuNormal: {
Local: [
{
label: '计轴复位',
handler: this.handleAxleReset,
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET
}
],
Center: [
]
}
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.AxleReset) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
handleAxleReset() {
const operate = {
start: true,
operation: OperationEvent.AxleReset.SetAxleReset.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionAlxeReset.doShow(operate);
}
});
}
}
};
</script>

View File

@ -105,6 +105,7 @@ export const DeviceMenu = {
TrainWindow: '09',
LimitControl: '10',
AutoTurnBack: '11',
AxleReset: '12',
Map: '100',
PrdCategory: '101',

View File

@ -1946,6 +1946,23 @@ export const OperationEvent = {
}
},
AxleReset: {
SetAxleReset: {
menu: {
operation: '1000',
domId: '_Tips-Axle-Reset-Menu'
},
choose: {
operation: '10001',
domId: '_Tips-Axle-Reset-Choose-Menu'
},
confirm: {
operation: '10002',
domId: '_Tips-Axle-Reset-confirm-Menu'
}
}
},
// 混合指令
MixinCommand: {
/** 控制模式操作 */

View File

@ -183,6 +183,8 @@ const map = {
routeList: [], // 进路list
autoReentryData: {}, // 自动折返数据
autoReentryList: [], // 自动折返list
signalApproachSectionData: {}, // 信号机接近区段数据
signalApproachSectionList: [], // 信号机接近区段list
stepData: [], // 缓存数据
mapConfig: [], // 地图所属线路配置
recoverStepData: [], // 缓存恢复数据
@ -224,6 +226,12 @@ const map = {
autoReentryList: (state) => {
return state.autoReentryList;
},
signalApproachSectionData: (state) => {
return state.signalApproachSectionData;
},
signalApproachSectionList: (state) => {
return state.signalApproachSectionList;
},
seclectDeviceList: (state) => {
return state.seclectDeviceList;
},
@ -446,6 +454,9 @@ const map = {
getDeviceByCode: (state) => (code) => {
return state.mapDevice[code];
},
getApproachSectionByCode: (state) => (code) => {
return state.signalApproachSectionData[code];
},
// 查询区段关联的计数器
getCounterBySectionCode: (state) => (code, type) => {
@ -664,6 +675,12 @@ const map = {
});
state.autoReentryList = autoReentryList;
},
setSignalApproachSectionData: (state, signalApproachSectionList) => {
signalApproachSectionList.forEach(data => {
state.signalApproachSectionData[data.signalCode] = data;
});
state.signalApproachSectionList = signalApproachSectionList;
},
updateRouteState: (state, status) => {
state.routeData[status.code] = deepAssign(state.routeData[status.code], status);
},
@ -701,6 +718,9 @@ const map = {
setAutoReentryData: ({ commit }, autoReentryData) => {
commit('setAutoReentryData', autoReentryData);
},
setSignalApproachSectionData: ({ commit }, signalApproachSectionList) => {
commit('setSignalApproachSectionData', signalApproachSectionList);
},
updateRouteState: ({ commit }, status) => { // 设置进路数据状态
commit('updateRouteState', status);
},

View File

@ -13,6 +13,7 @@ const menuOperation = {
selected: {}, // 选中的地图对象
subType: '', // 选中的设备子元素类型
selectedCount: 0, // 选中对象变更标识
setMenuChangeCount: 0, // 哈尔滨线路左键点击变更标识
menu: null, // 弹出菜单设备
menuPosition: {}, // 弹出菜单位置
menuCount: 0, // 弹出菜单变更标识
@ -79,6 +80,11 @@ const menuOperation = {
state.subType = selected.subType;
state.selectedCount += 1;
},
setMenuChange: (state, selected) => {
state.selected = selected.device;
state.subType = selected.subType;
state.setMenuChangeCount += 1;
},
mbmpCountIncrement: (state) => {
state.mbmpCount += 1;
},
@ -175,6 +181,10 @@ const menuOperation = {
setSelected: ({ commit }, selected) => {
commit('setSelected', selected);
},
// 改变哈尔滨底部菜单
setMenuChange: ({ commit }, selected) => {
commit('setMenuChange', selected);
},
/**
* 设置菜单

View File

@ -49,8 +49,10 @@ export function loadNewMapDataByGroup(group) {
});
const routeData = resp.data.logicDataNew.routeList; // 设置进路数据
const autoReentryData = resp.data.logicDataNew.autoReentryList; // 自动折返数据
const signalApproachSectionData = resp.data.logicDataNew.signalApproachSectionList; // 信号机接近区段数据
store.dispatch('map/setRouteData', routeData);
store.dispatch('map/setAutoReentryData', autoReentryData);
store.dispatch('map/setSignalApproachSectionData', signalApproachSectionData);
const mapConfig = resp.data.configVO;
store.dispatch('map/setMapConfig', mapConfig);
store.dispatch('map/setMapVersion', resp.data.version);

View File

@ -5,7 +5,7 @@
<span v-if="countTime" class="display-score">{{ $t('display.demon.trialTime') }} {{ countTime }}</span>
</el-row>
</div>
<div class="display-draft">
<div class="display-draft" :class="{'display-type-hb': $route.query.lineCode == '07'}">
<el-button-group>
<el-button v-if="isShowScheduling" type="primary" @click="jumpScheduling">{{ $t('display.demon.dispatchingPlan') }}</el-button>
<el-button type="jumpjlmap3d" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
@ -275,4 +275,7 @@ export default {
right: 20px;
bottom: 15px;
}
.display-type-hb{
bottom: 105px;
}
</style>

View File

@ -105,6 +105,9 @@ export default {
}
this.selected = device;
this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType});
if (this.$route.query.lineCode == '07') {
this.$store.dispatch('menuOperation/setMenuChange', {device: device, subType: em.subType});
}
this.$store.dispatch('training/emitTipFresh');
},

View File

@ -131,8 +131,8 @@ export default {
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] },
{ prop:'automaticRouteCode', label: '自动进路code:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenAutomaticRoute, change: true, deviceChange: this.ChangeEditStation },
{ prop:'cycleCode', label: '自动折返进路code:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenMapCycleButtonVO, change: true, deviceChange: this.ChangeEditStation },
{ prop:'automaticRouteCode', label: '自动进路code:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenAutomaticRoute, change: true, deviceChange: this.changeEditStation },
{ prop:'cycleCode', label: '自动折返进路code:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenMapCycleButtonVO, change: true, deviceChange: this.changeEditStation },
{ prop:'stationCode', label: '所属集中站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, disabled: this.isDisabledStation, isHidden: !this.isHiddenStation }
]
}
@ -150,8 +150,8 @@ export default {
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop:'automaticRouteCode', label: '自动进路code:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenCreateAutomaticRoute, change: true, deviceChange: this.ChangeStation },
{ prop:'cycleCode', label: '自动折返进路code:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenCreateMapCycleButtonVO, change: true, deviceChange: this.ChangeStation },
{ prop:'automaticRouteCode', label: '自动进路code:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenCreateAutomaticRoute, change: true, deviceChange: this.changeStation },
{ prop:'cycleCode', label: '自动折返进路code:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenCreateMapCycleButtonVO, change: true, deviceChange: this.changeStation },
{ prop:'stationCode', label: '所属集中站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, disabled: this.isDisabledCreateStation, isHidden: !this.isHiddenCreateStation }
]
};
@ -206,9 +206,16 @@ export default {
}
},
mounted() {
},
methods: {
setStation(data) {
if (data.automaticRouteCode) {
this.changeEditStation(data.automaticRouteCode);
}
if (data.cycleCode) {
this.changeEditStation(data.cycleCode);
}
},
typeChange(type) { //
this.$refs.dataform.resetFields();
this.$refs.make.resetFields();
@ -239,14 +246,14 @@ export default {
break;
}
},
ChangeStation(code) { //
changeStation(code) { //
this.autoList.forEach(elem => {
if (elem.code == code) {
this.addModel.stationCode = elem.stationCode;
}
});
},
ChangeEditStation(code) { //
changeEditStation(code) { //
this.autoList.forEach(elem => {
if (elem.code == code) {
this.editModel.stationCode = elem.stationCode;
@ -267,6 +274,9 @@ export default {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.editModel.type = selected._type;
this.$nextTick(() => {
this.setStation(selected);
});
}
},
async getAutoMaticList() { //

View File

@ -29,7 +29,7 @@
<systerm-out ref="systermOut" />
<add-task ref="addTask" @dispatchOperate="dispatchOperate" @refresh="refresh" />
<delete-task ref="deleteTask" @dispatchOperate="dispatchOperate" @refresh="refresh" />
<modifying-task ref="modifyingTask" @dispatchOperate="dispatchOperate" />
<modifying-task ref="modifyingTask" @dispatchOperate="dispatchOperate" @refresh="refresh" />
<edit-station-between-time ref="editStationBetweenTime" />

View File

@ -409,9 +409,10 @@ export default {
} else {
//
updatePlanTrip(this.buildModel()).then(resp => {
this.$emit('dispatchOperate', {
dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
});
// this.$emit('dispatchOperate', {
// dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
// });
this.$emit('refresh');
this.$message.success(this.$t('planMonitor.modifying.modifyTaskSuccess'));
}).catch(() => {
this.$messageBox(this.$t('planMonitor.modifying.modifyTaskFailed'));