This commit is contained in:
joylink_cuiweidong 2022-04-22 17:23:27 +08:00
commit 3772012be2
4 changed files with 56 additions and 50 deletions

View File

@ -482,6 +482,7 @@ export default class Section extends Group {
this.setAshShow(); this.setAshShow();
model.preGreen && this.line.setStyle({stroke: '#00FF00'}); model.preGreen && this.line.setStyle({stroke: '#00FF00'});
model.preBlue && this.line.setStyle({stroke: '#4A76B7'}); model.preBlue && this.line.setStyle({stroke: '#4A76B7'});
model.preWhite && this.line.setStyle({stroke: '#fff'})
} else { } else {
this.handleSwitchSection(model, flag); this.handleSwitchSection(model, flag);
// 顺序代表优先级 // 顺序代表优先级

View File

@ -178,26 +178,6 @@ export default {
getDeviceByCode(code) { getDeviceByCode(code) {
return this.mapDevice[code]; return this.mapDevice[code];
}, },
//
// changePrdType(val) {
// const nameList = Object.keys(this.$store.state.map.map || {});
// let list = [];
// let showMode = '';
// nameList.forEach((item) => {
// if (item !== 'skinVO') {
// const data = this.$store.state.map.map[item];
// if (data && data.constructor === Array) {
// list = [...list, ...data];
// }
// }
// });
// if (val === '01') {
// showMode = '03';
// } else if (val === '02') {
// showMode = '02';
// }
// this.map.updatePrdType(list, showMode, val);
// },
setShowStation(stationCode, setCenter) { setShowStation(stationCode, setCenter) {
const list = []; const list = [];
const mapDevice = this.$store.state.map.mapDevice; const mapDevice = this.$store.state.map.mapDevice;

View File

@ -1,21 +1,21 @@
<template> <template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="1100px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false"> <el-dialog v-dialogDrag top="12vh" class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="1100px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row> <el-row>
<el-col :span="3">列车车次</el-col> <el-col :span="2">列车车次</el-col>
<el-col :span="21"><span>{{ selected.tripNumber }}</span></el-col> <el-col :span="21"><span>{{ selected.tripNumber }}</span></el-col>
</el-row> </el-row>
<el-row> <el-row style="margin-top: 10px;">
<el-col :span="3">进路描述</el-col> <el-col :span="2">进路描述</el-col>
<el-col :span="21"> <el-col :span="21">
<div style="width: 100%;height: 50px;"> <div style="width: 100%;height: 50px;background: #DFE3E6;padding: 10px;">
<span>{{ `${type === 'dep' ? '发车/通过': '接车/通过'} 股道:${selected.trackName};进路按钮:${getRouteNames(selected)}` }}</span> <span>{{ `${type === 'dep' ? '发车/通过': '接车/通过'} 股道:${selected.trackName};进路按钮:${getRouteNames()}` }}</span>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row style="margin-top: 10px;">
<el-col :span="3">进路显示</el-col> <el-col :span="2">进路显示</el-col>
<el-col :span="21"> <el-col :span="21">
<map-visual ref="map" :map-data="mapData" :width="780" :height="600" /> <map-visual ref="map" :map-data="mapData" :width="960" :height="600" />
</el-col> </el-col>
</el-row> </el-row>
<!--<el-row :gutter="24">--> <!--<el-row :gutter="24">-->
@ -51,6 +51,19 @@
<!--<map-visual ref="map" :map-data="mapData" :width="780" :height="600" />--> <!--<map-visual ref="map" :map-data="mapData" :width="780" :height="600" />-->
<!--</el-col>--> <!--</el-col>-->
<!--</el-row>--> <!--</el-row>-->
<el-row style="margin-top: 10px;margin-bottom: 10px;">
<el-col :span="21" :offset="2">
<el-radio disabled v-model="radio" label="禁用">分段办理</el-radio>
</el-col>
</el-row>
<div style="display: flex;justify-content: space-between;margin-bottom: 10px;">
<el-button size="mini" v-if="type === 'rec'" :type="selected.receivingRouteAutoTrigger?'warning':''" :disabled="!!route.lock" @click="commit">办理接车</el-button>
<el-button size="mini" v-if="type === 'dep'" :type="selected.departureRouteAutoTrigger?'warning':''" :disabled="!!route.lock" @click="commit">办理发车</el-button>
<el-button size="mini" disabled>办理通过</el-button>
<el-button size="mini" disabled>进路单锁</el-button>
<el-button size="mini" :disabled="!!!route.lock" @click="commit">取消进路</el-button>
<el-button size="mini" @click="doClose">关闭</el-button>
</div>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" /> <notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
<confirm-tip ref="confirmTip" @close="doClose" /> <confirm-tip ref="confirmTip" @close="doClose" />
</el-dialog> </el-dialog>
@ -76,6 +89,7 @@ export default {
}, },
data() { data() {
return { return {
radio:'',
beforeSectionList: [], beforeSectionList: [],
beforeSwitchList: [], beforeSwitchList: [],
dialogShow: false, dialogShow: false,
@ -116,8 +130,10 @@ export default {
this.mapData = JSON.parse(JSON.stringify(this.$store.state.map.map)); this.mapData = JSON.parse(JSON.stringify(this.$store.state.map.map));
}, },
methods: { methods: {
getRouteNames(data) { getRouteNames() {
const receivingRoute = this.$store.state.map.routeData[this.selected.receivingRouteCode];
const departureRoute = this.$store.state.map.routeData[this.selected.departureRouteCode];
return (receivingRoute?receivingRoute.name: '') + ',' + (departureRoute?departureRoute.name: '');
}, },
doShow(selected, type) { doShow(selected, type) {
// this.$root.$emit('dialogOpen', selected); // this.$root.$emit('dialogOpen', selected);
@ -134,13 +150,20 @@ export default {
this.beforeSectionList = []; this.beforeSectionList = [];
if (this.mapData) { if (this.mapData) {
this.$refs.map.loadData(this.mapData); this.$refs.map.loadData(this.mapData);
setTimeout(() => {
if (this.type === 'rec'){
this.clickEvent(this.selected.receivingRouteCode);
} else if (this.type === 'dep'){
this.clickEvent(this.selected.departureRouteCode);
}
}, 100);
} }
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.route = null; this.route = {};
this.restoreBeforeDevices(); this.restoreBeforeDevices();
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected); mouseCancelState(this.selected);
@ -150,8 +173,7 @@ export default {
if (this.beforeSectionList && this.beforeSectionList.length) { if (this.beforeSectionList && this.beforeSectionList.length) {
this.beforeSectionList.forEach(el => { this.beforeSectionList.forEach(el => {
el.routeLock = false; el.routeLock = false;
el.preBlue = false; el.preWhite = false;
el.preGreen = false;
}); });
} }
@ -179,10 +201,8 @@ export default {
const containSwitchList = []; const containSwitchList = [];
if (!route.setting) { if (!route.setting) {
const signalBegin = this.$refs.map.getDeviceByCode(route.startSignalCode); const signalBegin = this.$refs.map.getDeviceByCode(route.startSignalCode);
const signalEnd = this.$refs.map.getDeviceByCode(route.endSignalCode); const code = route.startSignalCode;
const diff = signalBegin.position.x - signalEnd.position.x; const signal = signalBegin;
const code = diff > 0 ? route.endSignalCode : route.startSignalCode;
const signal = diff > 0 ? signalEnd : signalBegin;
const switchCodeList = []; const switchCodeList = [];
this.$refs.map.setCenterWithOffset(code, 50, signal.position.y); this.$refs.map.setCenterWithOffset(code, 50, signal.position.y);
@ -191,10 +211,10 @@ export default {
const section = deepAssign({}, this.$refs.map.getDeviceByCode(code)); const section = deepAssign({}, this.$refs.map.getDeviceByCode(code));
if (section.logicSectionCodeList && section.logicSectionCodeList.length) { if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach(sectionCode => { section.logicSectionCodeList.forEach(sectionCode => {
containSectionList.push({code: sectionCode, preGreen: true, preBlue: false}); containSectionList.push({code: sectionCode, preWhite: true});
}); });
} else { } else {
containSectionList.push({code, preGreen: true, preBlue: false}); containSectionList.push({code, preWhite: true});
} }
if (section.switchSection && section.switch) { if (section.switchSection && section.switch) {
@ -213,10 +233,10 @@ export default {
containSwitchList.push({code: el.switchCode, routeLock: true, pos:el.pos }); containSwitchList.push({code: el.switchCode, routeLock: true, pos:el.pos });
if (el.normal) { if (el.normal) {
containSectionList.push({code: sectionA.code, routeLock:true }); containSectionList.push({code: sectionA.code, routeLock:true });
containSectionList.push({code: sectionC.code, preBlue: true }); // containSectionList.push({code: sectionC.code, preBlue: true });
} else { } else {
containSectionList.push({code: sectionC.code, routeLock:true }); containSectionList.push({code: sectionC.code, routeLock:true });
containSectionList.push({code: sectionB.code, preBlue: true }); // containSectionList.push({code: sectionB.code, preBlue: true });
} }
}); });
} }
@ -224,6 +244,7 @@ export default {
this.$refs.map.updateMapDevice([...containSectionList, ...containSwitchList]); this.$refs.map.updateMapDevice([...containSectionList, ...containSwitchList]);
this.beforeSectionList = containSectionList; this.beforeSectionList = containSectionList;
this.beforeSwitchList = containSwitchList; this.beforeSwitchList = containSwitchList;
console.log(this.beforeSectionList, this.beforeSwitchList, '======');
// //
const operate = { const operate = {
@ -242,17 +263,21 @@ export default {
} }
}, },
commit() { commit() {
if (this.row && this.row.canSetting) { if (this.route) {
this.loading = true; this.loading = true;
commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:this.row.code}, 1).then(({valid, operate})=>{ const type = this.route.lock ? menuOperate.Signal.cancelTrainRoute :menuOperate.Signal.arrangementRoute;
const param = this.route.lock ? { signalCode: this.route.startSignalCode } : { routeCode:this.route.code };
console.log(this.route.startSignalCode, '-----------', type, param);
commitOperate(type, param, 3).then(({valid, operate})=>{
this.loading = false; this.loading = false;
if (valid) { if (valid) {
const signal = this.$store.getters['map/getDeviceByCode'](this.row.startSignalCode); // const signal = this.$store.getters['map/getDeviceByCode'](this.row.startSignalCode);
operate.message = `命令:进路设置<br/>始端信号机:${signal.name}<br/>进路:${this.row.name}`; // operate.message = `<br/>${signal.name}<br/>${this.row.name}`;
// this.doClose(); this.doClose();
this.$refs.confirmTip.doShow(operate); this.$refs.confirmTip.doShow(operate);
} }
}).catch(() => { }).catch((e) => {
console.error(e);
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();

View File

@ -41,7 +41,7 @@
@click="doShowRoute(item, 'rec')"> @click="doShowRoute(item, 'rec')">
{{ '接路' + (item.receivingRouteLock ? '':getRouteName(item.receivingRouteCode)) }} {{ '接路' + (item.receivingRouteLock ? '':getRouteName(item.receivingRouteCode)) }}
</div> </div>
<div :style="{ background: item.arrive ? '#29CA42': '#ccc' }" class="button-box-fir" style="margin-left: 10px;">到点</div> <div :style="{ background: item.arrive ? '#29CA42': '#ccc' }" class="button-box-fir" style="margin-left: 10px;cursor: default;">到点</div>
</div> </div>
<div> <div>
<div>{{item.arriveTime}}</div> <div>{{item.arriveTime}}</div>
@ -60,7 +60,7 @@
@click="doShowRoute(item, 'dep')"> @click="doShowRoute(item, 'dep')">
{{ '发路' + (item.departureRouteLock ? '':getRouteName(item.departureRouteCode)) }} {{ '发路' + (item.departureRouteLock ? '':getRouteName(item.departureRouteCode)) }}
</div> </div>
<div :style="{ background: item.departure ? '#29CA42': '#ccc' }" class="button-box-fir" style="margin-left: 10px;">发点</div> <div :style="{ background: item.departure ? '#29CA42': '#ccc' }" class="button-box-fir" style="margin-left: 10px;cursor: default;">发点</div>
</div> </div>
<div>{{ item.tripNumber }}</div> <div>{{ item.tripNumber }}</div>
<div>{{ item.trackName }}</div> <div>{{ item.trackName }}</div>