宁波三号线 信号机 引导 操作代码调整
This commit is contained in:
parent
c841a6457c
commit
58c9ac7df7
@ -18,8 +18,7 @@
|
||||
<switch-block ref="switchBlock" />
|
||||
<switch-active ref="switchActive" />
|
||||
<switch-detail ref="switchDetail" />
|
||||
<initialize-signal-guide ref="initializeSignalGuide" />
|
||||
<!-- <signal-guide ref="signalGuide" /> -->
|
||||
<signal-guide ref="signalGuide" />
|
||||
<initialzed-signal-can-block ref="initializeSignalCanBlock" />
|
||||
<signal-can-block ref="signalCanBlock" />
|
||||
<route-command ref="routeCommand" />
|
||||
@ -71,8 +70,7 @@ import InitializeSwitchBlock from './menuDialog/initializeSwitchBlock';
|
||||
import SwitchBlock from './menuDialog/switchBlock';
|
||||
import SwitchActive from './menuDialog/switchActive';
|
||||
import SwitchDetail from './menuDialog/switchDetail';
|
||||
import InitializeSignalGuide from './menuDialog/initializeSignalGuide';
|
||||
// import SignalGuide from './menuDialog/signalGuide';
|
||||
import SignalGuide from './menuDialog/signalGuide';
|
||||
import InitialzedSignalCanBlock from './menuDialog/initializeSignalCanBlock';
|
||||
import SignalCanBlock from './menuDialog/signalCanBlock';
|
||||
import RouteCommand from './menuDialog/routeCommand';
|
||||
@ -124,8 +122,7 @@ export default {
|
||||
SwitchBlock,
|
||||
SwitchActive,
|
||||
SwitchDetail,
|
||||
InitializeSignalGuide,
|
||||
// SignalGuide,
|
||||
SignalGuide,
|
||||
InitialzedSignalCanBlock,
|
||||
SignalCanBlock,
|
||||
RouteCommand,
|
||||
@ -452,7 +449,8 @@ export default {
|
||||
children: [
|
||||
{
|
||||
title: '初始化',
|
||||
operate: OperationEvent.Command.commandNingBo3.line_signal_guide
|
||||
operate: OperationEvent.Command.commandNingBo3.line_signal_guide,
|
||||
click: this.setInitialSignalGuide
|
||||
},
|
||||
{
|
||||
title: '确定/取消',
|
||||
@ -1244,7 +1242,8 @@ export default {
|
||||
children: [
|
||||
{
|
||||
title: '初始化',
|
||||
operate: OperationEvent.Command.commandNingBo3.line_signal_guide
|
||||
operate: OperationEvent.Command.commandNingBo3.line_signal_guide,
|
||||
click:this.setInitialSignalGuide
|
||||
},
|
||||
{
|
||||
title: '确定/取消',
|
||||
@ -2091,8 +2090,15 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 初始化 信号引导
|
||||
setInitialSignalGuide(item) {
|
||||
this.setSignalGuideCommand(item, true);
|
||||
},
|
||||
// 信号引导
|
||||
setSignalGuide(item) {
|
||||
this.setSignalGuideCommand(item, false);
|
||||
},
|
||||
setSignalGuideCommand(item, isInitial) {
|
||||
const operate = {
|
||||
type: 'bar',
|
||||
operation: item.operation
|
||||
@ -2101,10 +2107,10 @@ export default {
|
||||
if (valid) {
|
||||
this.$refs.menuBar.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', {break: true});
|
||||
this.$refs.initializeSignalGuide.doShow();
|
||||
// this.$refs.signalGuide.doShow();
|
||||
this.$refs.signalGuide.doShow(operate, isInitial);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
setSignalCanBlock(item) {
|
||||
const operate = {
|
||||
|
@ -1,238 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<el-row>
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="signalList"
|
||||
highlight-current-row
|
||||
height="300px"
|
||||
:id="domIdChoose"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column prop="name" label="信号机" />
|
||||
<el-table-column prop="blockStatus" label="显示">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getSignalShow(scope.row.code) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="blockProcess" label="可引导">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getCanGuide(scope.row.code) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unblockProcess" label="引导过程" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getProcess(scope.row.code) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unblockProcess" width="150" label="区间信号引导过程" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected || !selected.callOn" @click="commit(true)">确定(O)</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="2">
|
||||
<el-button :id="domIdApply" type="primary" :loading="loading" :disabled="!selected || !selected.callOn" @click="commit(false)">应用(A)</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="2">
|
||||
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="2">
|
||||
<el-button>帮助(H)</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
|
||||
<signal-guide ref="signalGuide" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import SignalGuide from './signalGuide';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'StandDetain',
|
||||
components: {
|
||||
SignalGuide,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
status: false,
|
||||
standStatus: true,
|
||||
allChecked: false,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: '',
|
||||
initEle: null,
|
||||
commandEleCode: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'signalList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
selected() {
|
||||
return this.$store.state.menuOperation.selected;
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.choose.domId : ''
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.confirm.domId : '';
|
||||
},
|
||||
domIdClose() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.close.domId : '';
|
||||
},
|
||||
domIdApply() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.apply.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '初始化引导';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.keyboardEnterCount': function (val) {
|
||||
if (this.show) {
|
||||
this.commit();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.initEle = null;
|
||||
this.commandEleCode = null;
|
||||
this.operate = operate;
|
||||
// 如果不是断点激活,而是第一次显示,则需要设置初始值
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$refs.table.setCurrentRow();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$refs.table.setCurrentRow();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
getSignalShow(code) {
|
||||
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (signalEle.redOpen && !signalEle.yellowOpen && !signalEle.greenOpen) {
|
||||
return '红';
|
||||
} else if (!signalEle.redOpen && !signalEle.yellowOpen && signalEle.greenOpen) {
|
||||
return '绿';
|
||||
} else if (!signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
|
||||
return '黄';
|
||||
} else if (signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
|
||||
return '引导';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
getCanGuide(code) {
|
||||
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (signalEle.callOn) {
|
||||
return '是';
|
||||
} else {
|
||||
return '否';
|
||||
}
|
||||
},
|
||||
getProcess(code) {
|
||||
if (this.commandEleCode === code) {
|
||||
return '完成';
|
||||
} else if (this.initEle && this.initEle.code === code) {
|
||||
return '等待确认/取消';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
commit(isClose = false) {
|
||||
const step = {
|
||||
operation: isClose
|
||||
? OperationEvent.Command.common.confirm.operation
|
||||
: OperationEvent.Command.common.apply.operation,
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.signalGuide.doShow(step, this.selected);
|
||||
this.initEle = this.selected;
|
||||
isClose && this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
isClose && this.doClose();
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
if (!val) { return; }
|
||||
this.initEle = null;
|
||||
this.commandEleCode = null;
|
||||
const step = {
|
||||
code: `${val.code}`,
|
||||
operation: OperationEvent.Command.common.choose.operation,
|
||||
val: val.code,
|
||||
param: {
|
||||
signalCode: val.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch('menuOperation/setSelected', {device: val});
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
commandSuccess(code) {
|
||||
this.commandEleCode = code;
|
||||
},
|
||||
cancelCommand() {
|
||||
this.initEle = null;
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.common.close.operation
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.menu-li {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
text-align: left;
|
||||
list-style:none;
|
||||
padding-left: 5px;
|
||||
border-right: 2px solid #696969;
|
||||
color: #000;
|
||||
}
|
||||
/deep/ {
|
||||
.el-radio {
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
}
|
||||
.el-cascader-node>.el-radio, .el-radio:last-child{
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<el-row>
|
||||
<el-col :span="18">
|
||||
<el-col :span="isInitial?24:18">
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="signalList"
|
||||
@ -28,7 +28,7 @@
|
||||
<el-table-column prop="unblockProcess" width="150" label="区间信号引导过程" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col v-show="!isInitial" :span="6">
|
||||
<div class="radio-box-title">命令</div>
|
||||
<div class="radio-box">
|
||||
<el-radio v-model="command" :label="true" style="display: block;margin-bottom: 10px;">确认</el-radio>
|
||||
@ -74,7 +74,11 @@ export default {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
command: true,
|
||||
operate: ''
|
||||
isInitial:true,
|
||||
operate: '',
|
||||
title:'',
|
||||
initEle: null,
|
||||
commandEleCode: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -87,21 +91,21 @@ export default {
|
||||
selected() {
|
||||
return this.$store.state.menuOperation.selected;
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.choose1.domId : ''
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.choose1.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.confirm1.domId : '';
|
||||
},
|
||||
domIdClose() {
|
||||
},
|
||||
domIdClose() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.close1.domId : '';
|
||||
},
|
||||
domIdApply() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.apply1.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '确认/取消引导';
|
||||
}
|
||||
// title() {
|
||||
// return '';
|
||||
// }
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.keyboardEnterCount': function (val) {
|
||||
@ -111,8 +115,14 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
doShow(operate, isInitial) {
|
||||
this.operate = operate;
|
||||
this.isInitial = isInitial;
|
||||
if (isInitial) {
|
||||
this.title = '初始化引导';
|
||||
} else {
|
||||
this.title = '确认/取消引导';
|
||||
}
|
||||
// 如果不是断点激活,而是第一次显示,则需要设置初始值
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
@ -124,24 +134,40 @@ export default {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$refs.table.setCurrentRow();
|
||||
this.$store.dispatch('menuOperation/setSelected', {device: {}});
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit(isClose = false) {
|
||||
const operate = {
|
||||
cmdType: this.command
|
||||
? CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
|
||||
: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE,
|
||||
operation: this.command
|
||||
? OperationEvent.Command.common.confirm1.operation
|
||||
: OperationEvent.Command.common.apply1.operation,
|
||||
over: true,
|
||||
param: {signalCode: this.selected.code}
|
||||
};
|
||||
let operate;
|
||||
if (this.isInitial) {
|
||||
operate = {
|
||||
cmdType: this.command
|
||||
? CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
|
||||
: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE,
|
||||
operation: this.command
|
||||
? OperationEvent.Command.common.confirm1.operation
|
||||
: OperationEvent.Command.common.apply1.operation,
|
||||
over: true,
|
||||
param: {signalCode: this.selected.code}
|
||||
};
|
||||
|
||||
} else {
|
||||
operate = {
|
||||
cmdType: this.command
|
||||
? CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
|
||||
: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE,
|
||||
operation: this.command
|
||||
? OperationEvent.Command.common.confirm1.operation
|
||||
: OperationEvent.Command.common.apply1.operation,
|
||||
over: true,
|
||||
param: {signalCode: this.selected.code}
|
||||
};
|
||||
}
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
isClose && this.doClose();
|
||||
this.$emit('commandSuccess', this.selected.code);
|
||||
// this.$emit('commandSuccess', this.selected.code);
|
||||
this.commandEleCode = this.selected.code;
|
||||
}
|
||||
}).catch(() => {
|
||||
isClose && this.doClose();
|
||||
@ -171,14 +197,40 @@ export default {
|
||||
}
|
||||
},
|
||||
getProcess(code) {
|
||||
if (this.selected && this.selected.code === code) {
|
||||
// if (this.selected && this.selected.code === code) {
|
||||
// return '等待确认/取消';
|
||||
// } else {
|
||||
// return '';
|
||||
// }
|
||||
if (this.commandEleCode === code) {
|
||||
return '完成';
|
||||
} else if (this.initEle && this.initEle.code === code) {
|
||||
return '等待确认/取消';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.$refs.table.setCurrentRow(this.selected);
|
||||
// this.$refs.table.setCurrentRow(this.selected);
|
||||
if (!val) { return; }
|
||||
this.initEle = null;
|
||||
this.commandEleCode = null;
|
||||
const step = {
|
||||
code: `${val.code}`,
|
||||
operation: OperationEvent.Command.common.choose.operation,
|
||||
val: val.code,
|
||||
param: {
|
||||
signalCode: val.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch('menuOperation/setSelected', {device: val});
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
@ -186,7 +238,8 @@ export default {
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$emit('cancelCommand');
|
||||
// this.$emit('cancelCommand');
|
||||
this.initEle = null;
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user