宁波三号线操作调整

This commit is contained in:
fan 2021-04-09 13:18:51 +08:00
parent c58609528a
commit 8e9afa9c9b
7 changed files with 275 additions and 84 deletions

View File

@ -437,3 +437,10 @@ export function getPathListByStandCodeOrSignalCode( group, params ) {
params
});
}
/** 查询未该列车以建立的进路 */
export function getRouteListForTrain( group, groupNumber ) {
return request({
url: `/simulation/${group}/queryEstablishedRoutes/${groupNumber}`,
method: 'get'
});
}

View File

@ -382,6 +382,11 @@ class SkinCode extends defaultStyle {
fillColor: '#FF00FE', // 联锁预留道岔 颜色
strokeColor: '#784F20',
operateFillColor: '#FF9600' // 操作员预留道岔 颜色
},
artificialArc: {
fillColor: 'rgba(0, 0, 0, 0)',
strokeColor: '#0001FC',
shapeR: 10
}
};

View File

@ -12,7 +12,6 @@ import ESwBlock from './ESwBlock';
import EMouse from './EMouse';
import EHighlight from '../element/EHighlight';
import ETriangle from './ETriangle';
import store from '@/store/index';
export default class Switch extends Group {
constructor(model, {style, mapDevice}) {
@ -24,8 +23,8 @@ export default class Switch extends Group {
this.zlevel = model.zlevel;
this.z = 6;
this.isShowShape = true;
this.switchPosition = '';
this.mapDevice = mapDevice;
this.switchPosition = '';
this.mapDevice = mapDevice;
this.triangle = new JTriangle(model.intersection, model.skew);
this.create();
this.createLockRect(); // 创建单锁矩形框显示
@ -257,6 +256,20 @@ export default class Switch extends Group {
this.add(this.lockArc);
this.lockArc.hide();
}
if (this.style.Switch.artificialArc) {
this.artificialArc = new ELockArc({ // 宁波三道岔人工模式
zlevel: this.zlevel,
z: this.z + 6,
x: this.model.intersection.x,
y: this.model.intersection.y,
shapeR: this.style.Switch.artificialArc.shapeR,
lineWidth: 2,
stroke: this.style.Switch.artificialArc.strokeColor,
fill: this.style.Switch.artificialArc.fillColor
});
this.add(this.artificialArc);
this.artificialArc.hide();
}
}
setCiConfirm() {
@ -315,6 +328,7 @@ export default class Switch extends Group {
this.enabledName && this.enabledName.hide(); // 使能隐藏
this.lossShow && this.lossShow.hide(); // 道岔失去矩形
this.lossShow && this.lossShow.stopAnimation(false);
this.artificialArc && this.artificialArc.hide();
}
/** 定位*/
@ -323,7 +337,7 @@ export default class Switch extends Group {
this.shapeModelB.hide();
this.shapeModelC.hide();
} else {
this.shapeModelB.show();
this.shapeModelB.show();
this.shapeModelB.setColor(this.style.Section.line.spareColor);
this.shapeModelC.show();
this.shapeModelC.setColor(this.style.backgroundColor);
@ -643,60 +657,61 @@ export default class Switch extends Group {
}
setState(model) {
if (!this.isShowShape) return;
this.recover();
this.recover();
// 只响应前端自定义类型的状态变化
if (model._free) {
if (model.normalPosition) {
this.switchPosition = 'normal';
this.setLocationAction(model); /** 定位*/
if (model.routeLock) {
this.setSectionState(model);
}
} else if (model.reversePosition) {
this.switchPosition = 'reverse';
this.setInversionAction(model); /** 反位*/
if (model.routeLock) {
this.setSectionState(model);
}
} else {
this.setAshShow()
}
} else {
this.setSwitchFault(model.fault, model.normalPosition, model.reversePosition);
if (model.normalPosition) {
this.switchPosition = 'normal';
this.setLocationAction(model); /** 定位*/
} else if (model.reversePosition) {
this.switchPosition = 'reverse';
this.setInversionAction(model); /** 反位*/
} else {
this.setLossAction(model.fault); // 失去
}
model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示
// 只响应前端自定义类型的状态变化
if (model._free) {
if (model.normalPosition) {
this.switchPosition = 'normal';
this.setLocationAction(model); /** 定位*/
if (model.routeLock) {
this.setSectionState(model);
}
} else if (model.reversePosition) {
this.switchPosition = 'reverse';
this.setInversionAction(model); /** 反位*/
if (model.routeLock) {
this.setSectionState(model);
}
} else {
this.setAshShow();
}
} else {
this.setSwitchFault(model.fault, model.normalPosition, model.reversePosition);
if (model.normalPosition) {
this.switchPosition = 'normal';
this.setLocationAction(model); /** 定位*/
} else if (model.reversePosition) {
this.switchPosition = 'reverse';
this.setInversionAction(model); /** 反位*/
} else {
this.setLossAction(model.fault); // 失去
}
model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示
model.singleLock && this.setMonolock(model.normalPosition, model.reversePosition); // 道岔单锁
model.blockade && this.block(model.normalPosition, model.reversePosition); // 道岔封锁
model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态
const path = window.location.href;
if (!path.includes('/map/draw')) {
this.setSectionState(this.model); // 处理元素颜色
}
model.fpLock && this.handleFpLock(); // 道岔侧防
model.routeLock && this.handleRouteLock(); // 道岔进路锁闭
model.overlapLock && this.handleOverlapLock(); // 道岔进路延续保护
// this.interlockingReserved(); // 联锁预留道岔
model.preReset && this.preReset(model.normalPosition, model.reversePosition); // 道岔预复位
model.singleLock && this.setMonolock(model.normalPosition, model.reversePosition); // 道岔单锁
model.blockade && this.block(model.normalPosition, model.reversePosition); // 道岔封锁
model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态
const path = window.location.href;
if (!path.includes('/map/draw')) {
this.setSectionState(this.model); // 处理元素颜色
}
model.fpLock && this.handleFpLock(); // 道岔侧防
model.routeLock && this.handleRouteLock(); // 道岔进路锁闭
model.overlapLock && this.handleOverlapLock(); // 道岔进路延续保护
// this.interlockingReserved(); // 联锁预留道岔
model.preReset && this.preReset(model.normalPosition, model.reversePosition); // 道岔预复位
if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色
const switchModel = this.mapDevice[model.code];
const sectionB = this.mapDevice[switchModel.sectionBCode];
sectionB && sectionB.instance && sectionB.instance.setState(sectionB);
const sectionC = this.mapDevice[switchModel.sectionCCode];
sectionC && sectionC.instance && sectionC.instance.setState(sectionC);
}
model.noStatus && this.setAshShow();
}
if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色
const switchModel = this.mapDevice[model.code];
const sectionB = this.mapDevice[switchModel.sectionBCode];
sectionB && sectionB.instance && sectionB.instance.setState(sectionB);
const sectionC = this.mapDevice[switchModel.sectionCCode];
sectionC && sectionC.instance && sectionC.instance.setState(sectionC);
}
model.noStatus && this.setAshShow();
!model.auto && this.artificialArc && this.artificialArc.show();
}
}
setLimitState(flag, limitValue) {
if (flag) {

View File

@ -1,18 +1,46 @@
<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-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="800px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-table ref="table" :data="data" height="200px">
<el-table-column prop="code" label="进路" />
<el-table-column prop="area" label="区域" />
<el-table-column prop="status" label="状态" />
</el-table>
<el-col :span="6">
<el-table ref="trainTable" :data="activeTrainList" height="400px" highlight-current-row @current-change="handleTrainChange">
<el-table-column label="列车">
<template slot-scope="scope">{{ scope.row }}</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="18">
<div class="simulate_table">
<div style="display: flex;">
<div class="simulate_table_header" style="width: 190px;">进路</div>
<div class="simulate_table_header" style="width: 190px;">区域</div>
<div class="simulate_table_header" style="width: 170px;">状态</div>
</div>
<template v-for="item in routeList">
<div :key="item.code" class="defaultStand" :class="{'selectedStand' :selectedRouteList.includes(item.code)}" @click="handleRouteChange(item)">
<div style="width: 190px;padding-left: 10px;">{{ item.name }}</div>
<div style="width: 190px;padding-left: 10px;">{{ getArea(item) }}</div>
<div style="width: 170px;padding-left: 10px;">建立</div>
</div>
</template>
</div>
<!--<el-table ref="table" :data="routeList" height="400px" highlight-current-row @current-change="handleRouteChange">-->
<!--<el-table-column prop="code" label="进路" />-->
<!--<el-table-column prop="area" label="区域">-->
<!--<template slot-scope="scope">-->
<!--<span>{{ getArea(scope.row) }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column prop="status" label="状态">建立</el-table-column>-->
<!--</el-table>-->
</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">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="buttonDisabled" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>应用(A)</el-button>
<el-button :disabled="buttonDisabled" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
@ -28,7 +56,8 @@
<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 { getRouteListForTrain } from '@/api/simulation';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mapGetters } from 'vuex';
export default {
@ -47,7 +76,10 @@ export default {
operate: {},
allCheck: false,
slidingTime: 0,
data: []
routeList: [],
activeTrainList: [],
selectedTrainCode: '',
selectedRouteList: []
};
},
computed: {
@ -68,6 +100,9 @@ export default {
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
buttonDisabled() {
return !(this.selectedTrainCode && this.selectedRouteList.length);
},
title() {
return '取消CBTC列车进路';
}
@ -77,6 +112,9 @@ export default {
if (this.show) {
this.commit();
}
},
'$store.state.map.activeTrainListUpdate': function (val) {
this.activeTrainList = [...this.$store.state.map.activeTrainList];
}
},
methods: {
@ -84,21 +122,94 @@ export default {
this.operate = operate;
//
this.dialogShow = true;
this.activeTrainList = [...this.$store.state.map.activeTrainList];
this.routeList = [];
this.selectedTrainCode = '';
this.selectedRouteList = [];
this.$nextTick(function () {
this.$refs.table.setCurrentRow();
this.$refs.trainTable && this.$refs.trainTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
commit() {
},
handleClick() {
commit(isClose = false) {
const step = {
over: true,
cmdType: CMD.Train.CMD_TRAIN_CANCEL_CBTC_ROUTE,
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
param: { routeCodes: this.selectedRouteList }
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (isClose) {
this.$store.dispatch('menuOperation/setSelected', {device: {}});
this.doClose();
}
}
}).catch((e) => {
console.error(e);
isClose && this.doClose();
this.$refs.noticeInfo.doShow();
});
},
getArea(row) {
const signal = this.$store.getters['map/getDeviceByCode'][row.startSignalCode];
if (signal && signal.belongStationCode) {
const station = this.$store.getters['map/getDeviceByCode'][signal.belongStationCode];
return (station || {}).name;
} else {
return '';
}
},
handleTrainChange(val) {
const step = {
code: val,
operation: OperationEvent.Signal.cancelTrainRoute.choose.operation,
val: val
};
const _that = this;
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.selectedTrainCode = val;
this.routeList = [];
getRouteListForTrain(_that.$route.query.group, val).then(resp => {
const routeData = this.$store.state.map.routeData;
(resp.data || []).forEach(item => {
_that.routeList.push(routeData[item]);
});
});
}
}).catch((e) => {
console.error(e);
this.$refs.noticeInfo.doShow();
});
},
handleRouteChange(row) {
const index = this.selectedRouteList.indexOf(row.code);
if (index === -1) {
this.selectedRouteList.push(row.code);
} else {
this.selectedRouteList.splice(index, 1);
}
const step = {
operation: OperationEvent.Signal.cancelTrainRoute.choose1.operation,
val: this.selectedRouteList
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((e) => {
console.error(e);
this.$refs.noticeInfo.doShow();
});
},
cancel() {
const operate = {
@ -139,4 +250,38 @@ export default {
z-index: 22;
left: 10px;
}
.simulate_table_header{
padding-left: 10px;
border-right: 1px solid #BDBDBD;
border-bottom: 1px solid #BDBDBD;
height: 20px;
background: #F0F0F0;
line-height: 20px;
font-size: 14px;
color: #000;
font-weight: bold;
}
.simulate_table {
height: 400px;
overflow-y: scroll;
background: #fff;
border-top: 2px solid #959595;
border-left: 2px solid #959595;
border-right: 2px solid #E9E9E9;
border-bottom: 2px solid #E9E9E9;
}
.defaultStand{
display: flex;
background: #fff;
color: #000;
height: 20px;
line-height: 20px;
font-size: 14px;
border-bottom: 1px solid #fff;
}
.selectedStand{
display: flex;
background: #3399FF;
color: #fff;
}
</style>

View File

@ -31,13 +31,13 @@
<el-col :span="6">
<div class="radio-box-title">设置模式</div>
<div class="radio-box">
<el-radio v-model="mode" label="auto" :disabled="mode === 'artificial'" style="display: block;margin-bottom: 10px;">自动</el-radio>
<el-radio v-model="mode" label="artificial" :disabled="mode === 'auto'" style="display: block;">人工</el-radio>
<el-radio v-model="mode" label="auto" :disabled="!!selectedSwitch.auto" style="display: block;margin-bottom: 10px;">自动</el-radio>
<el-radio v-model="mode" label="artificial" :disabled="!selectedSwitch.auto" style="display: block;">人工</el-radio>
</div>
<div class="radio-box-title">设置位置</div>
<div class="radio-box">
<el-radio v-model="position" label="normal" :disabled="position === 'reverse'" style="display: block;margin-bottom: 10px;">定位</el-radio>
<el-radio v-model="position" label="reverse" :disabled="position === 'normal'" style="display: block;">反位</el-radio>
<el-radio v-model="position" label="normal" :disabled="!!(selectedSwitch.normalPosition || selectedSwitch.auto)" style="display: block;margin-bottom: 10px;">定位</el-radio>
<el-radio v-model="position" label="reserve" :disabled="!!(selectedSwitch.reversePosition || selectedSwitch.auto)" style="display: block;">反位</el-radio>
</div>
<div class="radio-box-title">设置预留</div>
<div class="radio-box">
@ -85,7 +85,7 @@ export default {
dialogShow: false,
loading: false,
selectedSwitchCode: '',
selectedSwitch: null,
selectedSwitch: {},
mode: '',
position: '',
reserved: ''
@ -123,6 +123,8 @@ export default {
doShow(operate) {
//
this.dialogShow = true;
this.mode = '';
this.position = '';
this.$nextTick(function () {
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
@ -135,16 +137,24 @@ export default {
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
const params = {
switchCode: this.selectedSwitchCode,
auto: null,
reserve: null,
normal: null
};
if (this.mode) {
params.auto = this.mode === 'auto';
}
if (this.position) {
params.reserve = this.position === 'reserve';
params.normal = this.position === 'normal';
}
const step = {
over: true,
cmdType: CMD.Switch.CMD_SWITCH_COMMAND,
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
param: {
switchCode: this.selectedSwitchCode,
auto: this.mode === 'auto',
reserve: this.position === 'reserve',
normal: this.position === 'normal'
}
param: params
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
@ -155,7 +165,8 @@ export default {
this.doClose();
}
}
}).catch(() => {
}).catch((e) => {
console.error(e);
isClose && this.doClose();
this.$refs.noticeInfo.doShow();
});
@ -165,7 +176,9 @@ export default {
commitOperate(menuOperate.Switch.turnout, {code:val.code}).then(({valid, operate})=>{
if (valid) {
this.position = '';
const elem = this.$store.getters['map/getDeviceByCode'](val.code);
const switchModel = this.$store.getters['map/getDeviceByCode'](val.code);
this.selectedSwitchCode = val.code;
this.selectedSwitch = switchModel;
// this.mode = elem.auto ? 'artificial' : 'auto';
// if (!elem.auto) {
// if (elem.normalPosition) { this.position = 'reverse'; }

View File

@ -277,7 +277,9 @@ export default {
/** 分配班次 */
CMD_TRAIN_DISTRIBUTE: {value: 'Train_Distribute', label: '分配班次'},
/** 设置运行类型 */
CMD_TRAIN_SET_RUN_TYPE : {value: 'Train_Set_Run_Type', label: '设置运行类型' }
CMD_TRAIN_SET_RUN_TYPE : {value: 'Train_Set_Run_Type', label: '设置运行类型' },
/** 取消列车CBTC进路 */
CMD_TRAIN_CANCEL_CBTC_ROUTE : { value: 'Train_Cancel_CBTC_Route', label: '取消列车CBTC进路' }
},
TrainWindow: {
/** 修改列车识别号 */

View File

@ -1329,6 +1329,10 @@ export const OperationEvent = {
secondaryConfirm: {
operation: '3034',
domId: '_Tips-Signal-CancelTrainRoute-SecondaryConfirm'
},
choose1: {
operation: '3035',
domId: '_Tips-Signal-CancelTrainRoute-Choose1'
}
},
// 信号重开