修改signal 状态管理
This commit is contained in:
parent
71381ff174
commit
e71c68f7bc
@ -147,14 +147,17 @@ class SkinStyle extends defaultStyle {
|
||||
},
|
||||
route: {
|
||||
direction: false, // 自动进路方向
|
||||
offset: { x: 4, y: -2 }, // 自动进路偏移量
|
||||
offset: { x: 1, y: -2 }, // 自动进路偏移量
|
||||
routeColor: '#00FF00' // 自动进路
|
||||
},
|
||||
auto: {
|
||||
direction: true, // 自动通过方向
|
||||
offset: { x: 4, y: 0}, // 自动通过偏移量
|
||||
width: 5, // 自动宽度
|
||||
autoRoute: '#00FF00', // 自动进路
|
||||
autoTrigger: '#FFFF00' // 自动触发
|
||||
autoTrigger: '#FFFF00', // 自动触发
|
||||
manualControl: '#FFFF00', // 人工控制
|
||||
outConflict: '#C00808' // 出车冲突
|
||||
},
|
||||
delay: {
|
||||
direction: false, // 延时解锁方向
|
||||
|
@ -156,6 +156,7 @@ class SkinStyle extends defaultStyle {
|
||||
auto: {
|
||||
direction: false, // 自动通过方向
|
||||
offset: { x: -4, y: 0}, // 自动通过偏移量
|
||||
width: 5, // 自动宽度
|
||||
manualControl: '#FFFF00', // 人工控制
|
||||
autoRoute: '#00FF00', // 自动进路
|
||||
autoTrigger: '#FFFF00', // 自动触发
|
||||
|
@ -148,8 +148,11 @@ class SkinStyle extends defaultStyle {
|
||||
auto: {
|
||||
direction: false, // 自动通过方向
|
||||
offset: { x: -4, y: 0}, // 自动通过偏移量
|
||||
width: 5, // 自动宽度
|
||||
autoRoute: '#00FF00', // 自动进路
|
||||
autoTrigger: '#FFFF00' // 自动触发
|
||||
autoTrigger: '#FFFF00', // 自动触发
|
||||
manualControl: '#FFFF00', // 人工控制
|
||||
outConflict: '#C00808' // 出车冲突
|
||||
},
|
||||
delay: {
|
||||
direction: true, // 延时解锁方向
|
||||
|
@ -14,15 +14,15 @@ class ESigPass extends Group {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
const rotation = model.drict != 1? 0 : Math.PI;
|
||||
const point = arrow(model.x, model.y, style.Signal.signalAutoWidth, style.Signal.lamp.radiusR * 0.8);
|
||||
|
||||
this.isNew = true;
|
||||
this.arrow = new Polygon({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
origin: [model.x, model.y],
|
||||
rotation: rotation,
|
||||
shape: {
|
||||
points: point
|
||||
points: arrow(model.x, model.y, style.Signal.auto.width, style.Signal.lamp.radiusR * 0.8)
|
||||
},
|
||||
style: {
|
||||
stroke: model.stroke,
|
||||
@ -55,9 +55,9 @@ class ESigPass extends Group {
|
||||
|
||||
this.arrow.animateStyle(true)
|
||||
.when(1000, { fill: style.backgroundColor, stroke: style.backgroundColor })
|
||||
.when(2000, { fill: fill, stroke: style.Signal.sidelineColor })
|
||||
.when(2000, { fill: fill, stroke: style.sidelineColor })
|
||||
.when(3000, { fill: style.backgroundColor, stroke: style.backgroundColor })
|
||||
.when(4000, { fill: fill, stroke: style.Signal.sidelineColor })
|
||||
.when(4000, { fill: fill, stroke: style.sidelineColor })
|
||||
.start();
|
||||
}
|
||||
|
||||
|
@ -113,8 +113,8 @@ class Signal extends Group {
|
||||
drict: drict,
|
||||
x: sigAutoX,
|
||||
y: sigAutoY,
|
||||
width: style.Signal.signalAutoWidth,
|
||||
fill: style.Signal.lamp.autoRoute,
|
||||
width: style.Signal.auto.width,
|
||||
fill: style.Signal.auto.autoRoute,
|
||||
lineWidth: 0.6,
|
||||
stroke: style.sidelineColor
|
||||
});
|
||||
@ -383,24 +383,22 @@ class Signal extends Group {
|
||||
|
||||
// 设置自动进路模式状态类型
|
||||
setAutoRouteOpen() {
|
||||
this.sigAuto.setColor(this.style.Signal.auto.autoRoute);
|
||||
if (this.model.linkageAutoRouteShow) {
|
||||
this.sigAuto.show();
|
||||
} else {
|
||||
this.sigAuto.hide();
|
||||
}
|
||||
|
||||
this.sigAuto.setColor(this.style.Signal.auto.autoRoute);
|
||||
}
|
||||
|
||||
// 信号机进路自动触发模式状态类型
|
||||
setAutoAccessOpen() {
|
||||
this.sigAuto.setColor(this.style.Signal.auto.autoTrigger);
|
||||
if (this.model.atsAutoTriggerShow) {
|
||||
this.sigAuto.show();
|
||||
} else {
|
||||
this.sigAuto.hide();
|
||||
}
|
||||
|
||||
this.sigAuto.setColor(this.style.Signal.auto.autoTrigger);
|
||||
}
|
||||
|
||||
// 设置自动信号模式状态类型
|
||||
@ -427,6 +425,8 @@ class Signal extends Group {
|
||||
|
||||
// 恢复状态
|
||||
recover() {
|
||||
this.sigAuto.hide();
|
||||
this.sigRoute.hide();
|
||||
this.sigDelay.hide();
|
||||
this.sigAuto.animationRecover();
|
||||
this.sigName.setColor(this.style.Signal.text.defaultColor);
|
||||
@ -458,7 +458,6 @@ class Signal extends Group {
|
||||
}
|
||||
|
||||
/** 设置自动类型*/
|
||||
model.autoType = '04';
|
||||
switch (model.autoType) {
|
||||
case '01': this.setAutoClose(); break; // 隐藏 隐藏自动信号和自动进路
|
||||
case '02': this.setAutoSignalOpen(); break; // 显示 设置自动信号模式状态类型
|
||||
@ -475,7 +474,6 @@ class Signal extends Group {
|
||||
|
||||
/** 信号机进路办理,先停止动画,再判断当前颜色是否闪烁*/
|
||||
if (model.routeSetting && (model.autoType == '03' || model.autoType == '04')) {
|
||||
console.log(11111111111111111111);
|
||||
this.setAutoFlicker();
|
||||
}
|
||||
}
|
||||
|
@ -129,12 +129,12 @@ export default class Train extends Group {
|
||||
if (this.style.Train.trainStatusStyle.serverNoType.length>0) {
|
||||
const flag = this.style.Train.trainStatusStyle.serverNoType.some((item) =>{
|
||||
if (type === item.type) {
|
||||
this.trainB.setTextTrainServerColor(item.showColor);
|
||||
this.trainB && this.trainB.setTextTrainServerColor(item.showColor);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (this.style.Train.trainStatusStyle.defaultServerNoColor && !flag) {
|
||||
this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultServerNoColor);
|
||||
this.trainB && this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultServerNoColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -146,13 +146,13 @@ export default class Train extends Group {
|
||||
if (status === item.status) {
|
||||
switch (this.style.Train.trainStatusStyle.destinationStatusSetText) {
|
||||
case 'trainTarget':
|
||||
this.trainB.setTextTrainTargetColor(item.showColor);
|
||||
this.trainB && this.trainB.setTextTrainTargetColor(item.showColor);
|
||||
break;
|
||||
case 'trainServer':
|
||||
this.trainB.setTextTrainServerColor(item.showColor);
|
||||
this.trainB && this.trainB.setTextTrainServerColor(item.showColor);
|
||||
break;
|
||||
default:
|
||||
this.trainB.setTextTrainTargetColor(item.showColor);
|
||||
this.trainB && this.trainB.setTextTrainTargetColor(item.showColor);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -160,13 +160,13 @@ export default class Train extends Group {
|
||||
if (this.style.Train.trainStatusStyle.defaultDestinationColor && !flag) {
|
||||
switch (this.style.Train.trainStatusStyle.destinationStatusSetText) {
|
||||
case 'trainTarget':
|
||||
this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
break;
|
||||
case 'trainServer':
|
||||
this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
this.trainB && this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
break;
|
||||
default:
|
||||
this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -177,10 +177,10 @@ export default class Train extends Group {
|
||||
if (this.style.Train.trainStatusStyle.directionType.length > 0) {
|
||||
this.style.Train.trainStatusStyle.directionType.some((item) => {
|
||||
if (type === item.type) {
|
||||
this.trainL.setLineShow(item.lineLShow);
|
||||
this.trainL.setArrowShow(item.arrowLShow);
|
||||
this.trainR.setLineShow(item.lineRShow);
|
||||
this.trainR.setArrowShow(item.arrowRShow);
|
||||
this.trainL && this.trainL.setLineShow(item.lineLShow);
|
||||
this.trainL && this.trainL.setArrowShow(item.arrowLShow);
|
||||
this.trainR && this.trainR.setLineShow(item.lineRShow);
|
||||
this.trainR && this.trainR.setArrowShow(item.arrowRShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@ -191,8 +191,8 @@ export default class Train extends Group {
|
||||
if (this.style.Train.trainStatusStyle.directionStopType.length > 0) {
|
||||
this.style.Train.trainStatusStyle.directionStopType.some((item) => {
|
||||
if (type === item.type) {
|
||||
this.trainL.setLineShow(item.lineLShow);
|
||||
this.trainR.setLineShow(item.lineRShow);
|
||||
this.trainL && this.trainL.setLineShow(item.lineLShow);
|
||||
this.trainR && this.trainR.setLineShow(item.lineRShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@ -215,8 +215,8 @@ export default class Train extends Group {
|
||||
if (this.style.Train.trainStatusStyle.runModeStatus.length > 0) {
|
||||
this.style.Train.trainStatusStyle.runModeStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainL.setColor(item.trainLColor);
|
||||
this.trainR.setColor(item.trainRColor);
|
||||
this.trainL && this.trainL.setColor(item.trainLColor);
|
||||
this.trainR &&this.trainR.setColor(item.trainRColor);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@ -227,8 +227,8 @@ export default class Train extends Group {
|
||||
if (this.style.Train.trainStatusStyle.runControlStatus.length > 0) {
|
||||
this.style.Train.trainStatusStyle.runControlStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainB.setHShow(item.hShow);
|
||||
this.trainB.setSShow(item.sShow);
|
||||
this.trainB && this.trainB.setHShow(item.hShow);
|
||||
this.trainB && this.trainB.setSShow(item.sShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@ -239,7 +239,7 @@ export default class Train extends Group {
|
||||
if (this.style.Train.trainStatusStyle.doorStatus.length > 0) {
|
||||
this.style.Train.trainStatusStyle.doorStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainB.setDShow(item.dShow);
|
||||
this.trainB && this.trainB.setDShow(item.dShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@ -250,7 +250,7 @@ export default class Train extends Group {
|
||||
if (this.style.Train.trainStatusStyle.communicationStatus.length > 0) {
|
||||
this.style.Train.trainStatusStyle.communicationStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainB.setTrainColor(item.trainColor);
|
||||
this.trainB && this.trainB.setTrainColor(item.trainColor);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@ -261,7 +261,7 @@ export default class Train extends Group {
|
||||
if (this.style.Train.trainStatusStyle.alarmStatus.length >0) {
|
||||
this.style.Train.trainStatusStyle.alarmStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainB.setAShow(item.aShow);
|
||||
this.trainB && this.trainB.setAShow(item.aShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@ -314,7 +314,7 @@ export default class Train extends Group {
|
||||
this.style.Train.common.trainWidth = this.size * this.fontSize * (2 / 3) -16;
|
||||
}
|
||||
removeTrainDetail() {
|
||||
this.trainB.removeTrainDetail();
|
||||
this.trainB && this.trainB.removeTrainDetail();
|
||||
}
|
||||
|
||||
getBoundingRect() {
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="batong-01__systerm view-display" title="设备显示设置" :visible.sync="show" width="240px" :before-close="doClose"
|
||||
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="batong-01__systerm view-display"
|
||||
title="设备显示设置"
|
||||
:visible.sync="show"
|
||||
width="240px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-checkbox-group v-model="deviceLevels">
|
||||
<div>
|
||||
<el-checkbox :label="1">车次窗</el-checkbox>
|
||||
@ -17,33 +26,34 @@
|
||||
</el-checkbox-group>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="8" :offset="2">
|
||||
<el-button class="commit" :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
<el-button :id="domIdConfirm" class="commit" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="3">
|
||||
<el-button class="cancal" :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
<el-button :id="domIdCancel" class="cancal" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
import deviceType from '@/jmap/constant/deviceType';
|
||||
|
||||
export default {
|
||||
export default {
|
||||
name: 'ViewDevice',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
operation: '',
|
||||
deviceLevels: [2, 3, 4, 5],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
deviceLevels: [2, 3, 4, 5]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
@ -61,11 +71,11 @@
|
||||
this.$nextTick(() => {
|
||||
this.setDeviceDisplay();
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
//如果不是断点激活,而是第一次显示,需要初始化数据
|
||||
// 如果不是断点激活,而是第一次显示,需要初始化数据
|
||||
if (!this.dialogShow) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
@ -82,24 +92,24 @@
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
over: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
val: this.deviceLevels.sort().join('::')
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
@ -108,56 +118,56 @@
|
||||
this.doClose();
|
||||
this.setDeviceDisplay();
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
})
|
||||
});
|
||||
},
|
||||
setDeviceDisplay() {
|
||||
let show = false;
|
||||
let deviceList = [];
|
||||
const deviceList = [];
|
||||
|
||||
//区段边界设置
|
||||
let sectionList = this.$store.getters['map/sectionList'];
|
||||
// 区段边界设置
|
||||
const sectionList = this.$store.getters['map/sectionList'];
|
||||
if (sectionList && sectionList.length > 0) {
|
||||
sectionList.forEach(elem => {
|
||||
//区段边界
|
||||
show = this.deviceLevels.indexOf(2) !== -1 ? true : false;
|
||||
// 区段边界
|
||||
show = this.deviceLevels.indexOf(2) !== -1;
|
||||
elem.borderBorderShow = show;
|
||||
elem.type = deviceType.Section;
|
||||
deviceList.push(elem);
|
||||
});
|
||||
}
|
||||
|
||||
//车次窗设置
|
||||
let trainWindowList = this.$store.getters['map/trainWindowList'];
|
||||
// 车次窗设置
|
||||
const trainWindowList = this.$store.getters['map/trainWindowList'];
|
||||
if (trainWindowList && trainWindowList.length > 0) {
|
||||
trainWindowList.forEach(elem => {
|
||||
//车次窗
|
||||
show = this.deviceLevels.indexOf(1) !== -1 ? true : false;
|
||||
// 车次窗
|
||||
show = this.deviceLevels.indexOf(1) !== -1;
|
||||
elem.type = deviceType.Section;
|
||||
elem.trainWindowShow = show;
|
||||
deviceList.push(elem);
|
||||
});
|
||||
}
|
||||
|
||||
//联锁自动进路表示灯和ATS自动触发表示灯设置
|
||||
let signalList = this.$store.getters['map/signalList'];
|
||||
// 联锁自动进路表示灯和ATS自动触发表示灯设置
|
||||
const signalList = this.$store.getters['map/signalList'];
|
||||
if (signalList && signalList.length > 0) {
|
||||
signalList.forEach(elem => {
|
||||
//联锁自动进路表示灯
|
||||
show = this.deviceLevels.indexOf(3) !== -1 ? true : false;
|
||||
// 联锁自动进路表示灯
|
||||
show = this.deviceLevels.indexOf(3) !== -1;
|
||||
elem.linkageAutoRouteShow = show;
|
||||
//ATS自动触发表示灯
|
||||
show = this.deviceLevels.indexOf(4) !== -1 ? true : false;
|
||||
// ATS自动触发表示灯
|
||||
show = this.deviceLevels.indexOf(4) !== -1;
|
||||
elem.atsAutoTriggerShow = show;
|
||||
deviceList.push(elem);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
this.$store.dispatch('map/updateMapDevices', deviceList);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__systerm view-display" title="设备显示设置" :visible.sync="show" width="240px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__systerm view-display"
|
||||
title="设备显示设置"
|
||||
:visible.sync="show"
|
||||
width="240px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-checkbox-group v-model="deviceLevels">
|
||||
<div>
|
||||
<el-checkbox :label="1">车次窗</el-checkbox>
|
||||
@ -17,34 +26,35 @@
|
||||
</el-checkbox-group>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="8" :offset="2">
|
||||
<el-button class="commit" :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定
|
||||
<el-button :id="domIdConfirm" class="commit" type="primary" :loading="loading" @click="commit">确定
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="3">
|
||||
<el-button class="cancal" :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
<el-button :id="domIdCancel" class="cancal" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
import deviceType from '@/jmap/constant/deviceType';
|
||||
|
||||
export default {
|
||||
export default {
|
||||
name: 'ViewDevice',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
operation: '',
|
||||
deviceLevels: [2, 3, 4, 5],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
deviceLevels: [2, 3, 4, 5]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
@ -62,11 +72,11 @@
|
||||
this.$nextTick(() => {
|
||||
this.setDeviceDisplay();
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
//如果不是断点激活,而是第一次显示,需要初始化数据
|
||||
// 如果不是断点激活,而是第一次显示,需要初始化数据
|
||||
if (!this.dialogShow) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
@ -83,24 +93,24 @@
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
over: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
val: this.deviceLevels.sort().join('::')
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
@ -109,54 +119,57 @@
|
||||
this.doClose();
|
||||
this.setDeviceDisplay();
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
})
|
||||
});
|
||||
},
|
||||
setDeviceDisplay() {
|
||||
let show = false;
|
||||
let deviceList = [];
|
||||
const deviceList = [];
|
||||
|
||||
//区段边界设置
|
||||
let sectionList = this.$store.getters['map/sectionList'];
|
||||
// 区段边界设置
|
||||
const sectionList = this.$store.getters['map/sectionList'];
|
||||
if (sectionList && sectionList.length > 0) {
|
||||
sectionList.forEach(elem => {
|
||||
//区段边界
|
||||
show = this.deviceLevels.indexOf(2) !== -1 ? true : false;
|
||||
// 区段边界
|
||||
show = this.deviceLevels.indexOf(2) !== -1;
|
||||
elem._type = deviceType.Section;
|
||||
elem.borderBorderShow = show;
|
||||
deviceList.push(elem);
|
||||
});
|
||||
}
|
||||
|
||||
//车次窗设置
|
||||
let trainWindowList = this.$store.getters['map/trainWindowList'];
|
||||
// 车次窗设置
|
||||
const trainWindowList = this.$store.getters['map/trainWindowList'];
|
||||
if (trainWindowList && trainWindowList.length > 0) {
|
||||
trainWindowList.forEach(elem => {
|
||||
//车次窗
|
||||
show = this.deviceLevels.indexOf(1) !== -1 ? true : false;
|
||||
// 车次窗
|
||||
show = this.deviceLevels.indexOf(1) !== -1;
|
||||
elem._type = deviceType.TrainWindow;
|
||||
elem.trainWindowShow = show;
|
||||
deviceList.push(elem);
|
||||
});
|
||||
}
|
||||
|
||||
//联锁自动进路表示灯和ATS自动触发表示灯设置
|
||||
let signalList = this.$store.getters['map/signalList'];
|
||||
// 联锁自动进路表示灯和ATS自动触发表示灯设置
|
||||
const signalList = this.$store.getters['map/signalList'];
|
||||
if (signalList && signalList.length > 0) {
|
||||
signalList.forEach(elem => {
|
||||
//联锁自动进路表示灯
|
||||
show = this.deviceLevels.indexOf(3) !== -1 ? true : false;
|
||||
elem._type = deviceType.Signal;
|
||||
// 联锁自动进路表示灯
|
||||
show = this.deviceLevels.indexOf(3) !== -1;
|
||||
elem.linkageAutoRouteShow = show;
|
||||
//ATS自动触发表示灯
|
||||
show = this.deviceLevels.indexOf(4) !== -1 ? true : false;
|
||||
// ATS自动触发表示灯
|
||||
show = this.deviceLevels.indexOf(4) !== -1;
|
||||
elem.atsAutoTriggerShow = show;
|
||||
deviceList.push(elem);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
this.$store.dispatch('map/updateMapDevices', deviceList);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="chengdou-03__systerm view-display" title="设备显示设置" :visible.sync="show" width="240px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="chengdou-03__systerm view-display"
|
||||
title="设备显示设置"
|
||||
:visible.sync="show"
|
||||
width="240px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-checkbox-group v-model="deviceLevels">
|
||||
<div>
|
||||
<el-checkbox :label="1">车次窗</el-checkbox>
|
||||
@ -17,34 +26,35 @@
|
||||
</el-checkbox-group>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="8" :offset="2">
|
||||
<el-button class="commit" :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定
|
||||
<el-button :id="domIdConfirm" class="commit" type="primary" :loading="loading" @click="commit">确定
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="3">
|
||||
<el-button class="cancal" :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
<el-button :id="domIdCancel" class="cancal" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
import deviceType from '@/jmap/constant/deviceType';
|
||||
|
||||
export default {
|
||||
export default {
|
||||
name: 'ViewDevice',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
operation: '',
|
||||
deviceLevels: [2, 3, 4, 5],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
deviceLevels: [2, 3, 4, 5]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
@ -62,11 +72,11 @@
|
||||
this.$nextTick(() => {
|
||||
this.setDeviceDisplay();
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
//如果不是断点激活,而是第一次显示,需要初始化数据
|
||||
// 如果不是断点激活,而是第一次显示,需要初始化数据
|
||||
if (!this.dialogShow) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
@ -83,24 +93,24 @@
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
over: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
val: this.deviceLevels.sort().join('::')
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
@ -109,54 +119,57 @@
|
||||
this.doClose();
|
||||
this.setDeviceDisplay();
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
})
|
||||
});
|
||||
},
|
||||
setDeviceDisplay() {
|
||||
let show = false;
|
||||
let deviceList = [];
|
||||
const deviceList = [];
|
||||
|
||||
//区段边界设置
|
||||
let sectionList = this.$store.getters['map/sectionList'];
|
||||
// 区段边界设置
|
||||
const sectionList = this.$store.getters['map/sectionList'];
|
||||
if (sectionList && sectionList.length > 0) {
|
||||
sectionList.forEach(elem => {
|
||||
//区段边界
|
||||
show = this.deviceLevels.indexOf(2) !== -1 ? true : false;
|
||||
// 区段边界
|
||||
show = this.deviceLevels.indexOf(2) !== -1;
|
||||
elem._type = deviceType.Section;
|
||||
elem.borderBorderShow = show;
|
||||
deviceList.push(elem);
|
||||
});
|
||||
}
|
||||
|
||||
//车次窗设置
|
||||
let trainWindowList = this.$store.getters['map/trainWindowList'];
|
||||
// 车次窗设置
|
||||
const trainWindowList = this.$store.getters['map/trainWindowList'];
|
||||
if (trainWindowList && trainWindowList.length > 0) {
|
||||
trainWindowList.forEach(elem => {
|
||||
//车次窗
|
||||
show = this.deviceLevels.indexOf(1) !== -1 ? true : false;
|
||||
// 车次窗
|
||||
show = this.deviceLevels.indexOf(1) !== -1;
|
||||
elem._type = deviceType.TrainWindow;
|
||||
elem.trainWindowShow = show;
|
||||
deviceList.push(elem);
|
||||
});
|
||||
}
|
||||
|
||||
//联锁自动进路表示灯和ATS自动触发表示灯设置
|
||||
let signalList = this.$store.getters['map/signalList'];
|
||||
// 联锁自动进路表示灯和ATS自动触发表示灯设置
|
||||
const signalList = this.$store.getters['map/signalList'];
|
||||
if (signalList && signalList.length > 0) {
|
||||
signalList.forEach(elem => {
|
||||
//联锁自动进路表示灯
|
||||
show = this.deviceLevels.indexOf(3) !== -1 ? true : false;
|
||||
elem._type = deviceType.Signal;
|
||||
// 联锁自动进路表示灯
|
||||
show = this.deviceLevels.indexOf(3) !== -1;
|
||||
elem.linkageAutoRouteShow = show;
|
||||
//ATS自动触发表示灯
|
||||
show = this.deviceLevels.indexOf(4) !== -1 ? true : false;
|
||||
// ATS自动触发表示灯
|
||||
show = this.deviceLevels.indexOf(4) !== -1;
|
||||
elem.atsAutoTriggerShow = show;
|
||||
deviceList.push(elem);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
this.$store.dispatch('map/updateMapDevices', deviceList);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm view-name" title="名称显示设置" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm view-name"
|
||||
title="名称显示设置"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-checkbox-group v-model="nameLevels">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
@ -59,27 +68,27 @@
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import deviceType from '@/jmap/constant/deviceType';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
import deviceType from '@/jmap/constant/deviceType';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'viewName',
|
||||
export default {
|
||||
name: 'ViewName',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
nameLevels: [1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
nameLevels: [1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
@ -96,7 +105,7 @@
|
||||
this.$nextTick(() => {
|
||||
this.setNameDisplay();
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
@ -117,24 +126,24 @@
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
over: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
val: this.nameLevels.sort().join('::')
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
@ -143,58 +152,57 @@
|
||||
this.doClose();
|
||||
this.setNameDisplay();
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
})
|
||||
});
|
||||
},
|
||||
setNameDisplay() {
|
||||
let show = false;
|
||||
let deviceList = [];
|
||||
const deviceList = [];
|
||||
|
||||
// 信号机
|
||||
show = this.nameLevels.indexOf(1) !== -1 ? true : false;
|
||||
let signalList = this.$store.getters['map/signalList'];
|
||||
show = this.nameLevels.indexOf(1) !== -1;
|
||||
const signalList = this.$store.getters['map/signalList'];
|
||||
if (signalList && signalList.length > 0) {
|
||||
signalList.forEach(elem => {
|
||||
elem._type = deviceType.Signal;
|
||||
elem.nameShow = show;
|
||||
deviceList.push(elem);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// 按钮名称
|
||||
show = this.nameLevels.indexOf(3) !== -1 ? true : false;
|
||||
|
||||
show = this.nameLevels.indexOf(3) !== -1;
|
||||
|
||||
// 道岔
|
||||
let switchList = this.$store.getters['map/switchList'];
|
||||
const switchList = this.$store.getters['map/switchList'];
|
||||
if (switchList && switchList.length > 0) {
|
||||
switchList.forEach(elem => {
|
||||
elem._type = deviceType.Switch;
|
||||
// 道岔名称
|
||||
show = this.nameLevels.indexOf(7) !== -1 ? true : false;
|
||||
show = this.nameLevels.indexOf(7) !== -1;
|
||||
elem.nameShow = show;
|
||||
// 道岔轨名称
|
||||
show = this.nameLevels.indexOf(9) !== -1 ? true : false;
|
||||
show = this.nameLevels.indexOf(9) !== -1;
|
||||
elem.switchSectionNameShow = show;
|
||||
deviceList.push(elem);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// 控制模式
|
||||
show = this.nameLevels.indexOf(8) !== -1 ? true : false;
|
||||
let control = this.$store.getters['map/stationControlList'];
|
||||
show = this.nameLevels.indexOf(8) !== -1;
|
||||
const control = this.$store.getters['map/stationControlList'];
|
||||
if (control && control.length > 0) {
|
||||
control.forEach(elem => {
|
||||
elem._type = deviceType.StationControl;
|
||||
// 标识灯名称
|
||||
elem.indicatorShow = show;
|
||||
deviceList.push(elem);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// 区段
|
||||
let sectionList = this.$store.getters['map/sectionList'];
|
||||
const sectionList = this.$store.getters['map/sectionList'];
|
||||
if (sectionList && sectionList.length > 0) {
|
||||
sectionList.forEach(elem => {
|
||||
elem._type = deviceType.Section;
|
||||
@ -204,44 +212,44 @@
|
||||
} else {
|
||||
if (elem.type === '01') {
|
||||
// 计轴区段名称
|
||||
show = this.nameLevels.indexOf(11) !== -1 ? true : false;
|
||||
show = this.nameLevels.indexOf(11) !== -1;
|
||||
elem.nameShow = show;
|
||||
} else if (elem.type === '02') {
|
||||
// 股道轨名称
|
||||
show = this.nameLevels.indexOf(5) !== -1 ? true : false;
|
||||
show = this.nameLevels.indexOf(5) !== -1;
|
||||
elem.nameShow = show;
|
||||
} else if (elem.type === '03') {
|
||||
// 道岔区段名称
|
||||
show = this.nameLevels.indexOf(9) !== -1 ? true : false;
|
||||
show = this.nameLevels.indexOf(9) !== -1;
|
||||
elem.nameShow = show;
|
||||
}
|
||||
}
|
||||
|
||||
// 站台轨名称
|
||||
if (elem.isStandTrack) {
|
||||
show = this.nameLevels.indexOf(2) !== -1 ? true : false;
|
||||
show = this.nameLevels.indexOf(2) !== -1;
|
||||
elem.standTrackNameShow = show;
|
||||
}
|
||||
|
||||
// 折返轨名称
|
||||
if (elem.isReentryTrack) {
|
||||
show = this.nameLevels.indexOf(4) !== -1 ? true : false;
|
||||
show = this.nameLevels.indexOf(4) !== -1;
|
||||
elem.reentryTrackNameShow = show;
|
||||
}
|
||||
|
||||
// 转换轨名称
|
||||
if (elem.isTransferTrack) {
|
||||
show = this.nameLevels.indexOf(6) !== -1 ? true : false;
|
||||
show = this.nameLevels.indexOf(6) !== -1;
|
||||
elem.transferTrackNameShow = show;
|
||||
}
|
||||
|
||||
deviceList.push(elem);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// 车站
|
||||
show = this.nameLevels.indexOf(12) !== -1 ? true : false;
|
||||
let stationList = this.$store.getters['map/stationList'];
|
||||
show = this.nameLevels.indexOf(12) !== -1;
|
||||
const stationList = this.$store.getters['map/stationList'];
|
||||
if (stationList && stationList.length > 0) {
|
||||
stationList.forEach(elem => {
|
||||
elem._type = deviceType.Station;
|
||||
@ -249,11 +257,11 @@
|
||||
elem.kmPostShow = show;
|
||||
deviceList.push(elem);
|
||||
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
this.$store.dispatch('map/updateMapDevices', deviceList);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user