This commit is contained in:
joylink_cuiweidong 2020-08-14 10:30:32 +08:00
commit ace50b3e50
9 changed files with 177 additions and 17 deletions

View File

@ -255,4 +255,9 @@ deviceRender[deviceType.StationTurnBack] = {
_type: deviceType.StationTurnBack,
zlevel: 1
};
// 延时保护计时
deviceRender[deviceType.OverAp] = {
_type: deviceType.OverAp,
zlevel: 1
};
export default deviceRender;

View File

@ -44,7 +44,8 @@ const deviceType = {
SwitchFault: 'SwitchFault',
Arrow: 'Arrow',
Power: 'Power',
StationTurnBack: 'StationTurnBack'
StationTurnBack: 'StationTurnBack',
OverAp: 'OverAp'
};
export default deviceType;

View File

@ -425,6 +425,21 @@ class Jlmap {
if (index === -1) {
signalDeviceList.push(signalDevice);
}
} else if (elem.deviceType == 'OVERLAP') {
const overlapRoute = store.state.map.overlapData[elem.code];
const model = this.mapDevice[overlapRoute.pathList[0].sectionList[0]];
console.log(overlapRoute.pathList[0].sectionList[0], model.name, model.code);
model['timeRight'] = overlapRoute.pathList[0].right;
model['remainTime'] = elem.remainTime;
// if (overlapRoute.pathList[0].right) {
// elem['points'] = { x: model.points[0].x, y: model.points[0].y };
// } else {
// elem['points'] = { x: model.points[model.points.length - 1].x, y: model.points[model.points.length - 1].y };
// }
// elem['type'] = 'OverAp';
// elem['_type'] = 'OverAp';
// this.$painter.update(elem);
this.$painter.update(model);
} else if (elem.deviceType === 'CYCLE') {
store.dispatch('map/updateAutoReentryState', elem);
const autoReentryData = this.logicData.autoReentryData[code];

View File

@ -161,6 +161,9 @@ class Painter {
} else {
const instance = device.instance;
if (instance) {
if (device._type == 'OverAp') {
console.log(transitionDeviceStatus(device));
}
instance.setState(transitionDeviceStatus(device)); // 改变试图状态
}
}

View File

@ -0,0 +1,77 @@
import Group from 'zrender/src/container/Group';
// import {isShowThePrdType} from '../../utils/handlePath';
import ETextName from '../element/ETextName'; // 名称文字 (共有)
import BoundingRect from 'zrender/src/core/BoundingRect';
export default class OverAp extends Group {
constructor(model, style) {
super();
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
this.model = model;
this.style = style;
this.z = 6;
this.isShowShape = true;
this.create();
this.setState(model);
}
create() {
const model = this.model;
const style = this.style;
if (model.points) {
this.text = new ETextName({
zlevel: this.zlevel,
z: this.z + 2,
style: this.style,
silent: false,
x: model.points.x + 10,
y: model.points.y - style.Section.line.width * 2,
fontWeight: style.Section.text.fontWeight,
text: model.remainTime || 30,
textPosition: style.Section.text.textPosition,
fontSize: 12,
fontFamily: style.fontFamily,
textFill: '#FFF',
textAlign: 'center',
textVerticalAlign: 'middle'
});
this.add(this.text);
}
}
setState(model) {
this.text && this.text.hide();
if (model.remainTime) {
console.log(model, model.remainTime, '=====');
this.text && this.text.show();
this.text && this.text.attr({
style: {
text: model.remainTime
},
shape: {
x: model.points.x + 30,
y: model.points.y - this.style.Section.line.width * 2
}
});
}
}
getBoundingRect() {
if (this.text) {
return this.text.getBoundingRect().clone();
} else {
return new BoundingRect(0, 0, 0, 0);
}
}
// 设置显示模式
setShowMode() {
}
setShowStation(stationCode) {
}
screenShow() {
}
}

View File

@ -520,6 +520,7 @@ export default class Section extends Group {
}
}
// 创建延迟解锁计时
createReleaseText() {
const model = this.model;
const style = this.style;
@ -735,7 +736,6 @@ export default class Section extends Group {
/** 保护区段延时解锁 时间计时*/
protectiveTimeRelease() {
// console.log(this.model);
this.releaseName && this.releaseName.show();
// this.releaseName.setStyle('text', '20');
// this.section.setStyle({
// stroke: this.style.Section.line.protectiveLockColor,
@ -792,6 +792,27 @@ export default class Section extends Group {
}
}
showRemainTime(number) { // 区段延时保护倒计时显示
this.releaseName && this.releaseName.show();
// this.releaseName && this.releaseName.setStyle({ text: number });
// console.log(number, this.model.name, '====');
let pointX = this.model.points[0].x + 45;
let pointY = this.model.points[0].y;
if (!this.model.timeRight) {
pointX = this.model.points[this.model.points.length - 1].x - 45;
pointY = this.model.points[this.model.points.length - 1].y;
}
this.releaseName && this.releaseName.attr({
style: {
text: number
},
shape: {
x: pointX,
y: pointY - this.style.Section.line.width * 2
}
});
}
/** 设置状态*/
setState(model, flag = false) {
if (!this.isShowShape) return;
@ -831,6 +852,9 @@ export default class Section extends Group {
// 区段计轴预复位状态 (未处理)
// 区段故障锁闭
model.fault && this.faultLock();
// 区段延时保护倒计时显示
// model.remainTime = 10;
model.remainTime && this.showRemainTime(model.remainTime);
/** 道岔区段更新岔心颜色 */
if (model.type === '03' && model.switch) {
const sectionSwitch = store.getters['map/getDeviceByCode'](model.switch.code);

View File

@ -197,6 +197,23 @@ class Signal extends Group {
textVerticalAlign: textVerticalAlign
});
const timeNameY = model.position.y + model.positionPoint.y - posit * 15;
this.remainTImeName = new ESigName({
zlevel: this.zlevel,
z: this.z,
silent: false,
style: style,
x: sigNameX,
y: timeNameY,
text: model.remainTime || 0,
fontWeight: style.Signal.text.fontWeight,
fontSize: 12,
fontFamily: style.fontFamily,
textFill: '#FFF',
textAlign: 'center',
textVerticalAlign: 'middle'
});
// signalBackTriangle
// 北京一号线,宁波一号线 自动进路状态
// const signalRouteH=;
@ -276,6 +293,7 @@ class Signal extends Group {
this.style.Signal.text.show && model.nameShow ? this.sigName.show() : this.sigName.hide();
this.add(this.sigRoute);
this.add(this.sigDelay);
this.add(this.remainTImeName);
if (this.model.virtual) {
// 虚拟信号机显示
@ -558,6 +576,11 @@ class Signal extends Group {
.start();
}
}
// 信号显示延迟解锁
showRemainTime(number) {
this.remainTImeName.show();
this.remainTImeName && this.remainTImeName.setStyle({ text: number });
}
// 恢复状态
recover() {
@ -567,6 +590,7 @@ class Signal extends Group {
}
this.sigName.setStyle({ textBorderWidth: 0 });
this.sigName.setColor(this.style.Signal.text.defaultColor);
this.remainTImeName.hide();
this.sigDelay.hide();
if (this.style.Signal.auto.autoTriggerType != 'text') {
this.setAutoClose();
@ -615,6 +639,7 @@ class Signal extends Group {
model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放
model.fault && this.fault();// 信号机故障
model.remainTime && this.showRemainTime(model.remainTime);
if (!path.includes('/map/draw')) {
// 联锁自动进路通过
model.fleetMode && this.setAutoRouteOpen();

View File

@ -26,6 +26,7 @@ import SplitStation from './SplitStation/index';
import Arrow from './Arrow/index';
import Power from './Power/index';
import StationTurnBack from './StationTurnBack/index';
import OverAp from './OverAp/index.js';
/** 图库*/
const mapShape = {};
@ -73,6 +74,7 @@ mapShape[deviceType.SplitStation] = SplitStation;
mapShape[deviceType.Arrow] = Arrow;
mapShape[deviceType.Power] = Power;
mapShape[deviceType.StationTurnBack] = StationTurnBack;
mapShape[deviceType.OverAp] = OverAp;
function shapefactory(device, jmap) {
const type = device._type;

View File

@ -14,7 +14,7 @@
<div class="content cotnent_body">
<span class="base-label" style="left: 2px;">操作</span>
<div style="overflow: hidden;">
<div>{{ selected._type == 'Section' ? '操作设备' : '道岔' }}</div>
<div>{{ selectEdType ? '操作设备' : '道岔' }}</div>
<el-col :span="11">
<el-input :value="messageText1" placeholder="" size="mini" disabled />
</el-col>
@ -27,7 +27,7 @@
<div class="content cotnent_body">
<span class="base-label" style="left: 2px;">确认</span>
<div style="overflow: hidden;">
<div>{{ selected._type == 'Section' ? '操作设备' : '道岔' }}</div>
<div>{{ selectEdType ? '操作设备' : '道岔' }}</div>
<el-col :span="11">
<el-select :id="domIdChoose" v-model="messageText2" filterable size="mini" :disabled="disabledConfirm2" @change="SelectChange">
<el-option v-for="option in optionLists" :key="option.code" :label="option.name" :value="option.code" />
@ -98,6 +98,12 @@ export default {
'sectionList',
'switchList'
]),
selectEdType() {
if (this.selected && this.selected._type) {
return this.selected._type == 'Section';
}
return true;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
@ -163,19 +169,21 @@ export default {
},
optionLists() {
let list = [];
if (this.selected._type == 'Section') {
this.sectionList.forEach(section => {
let name = section.name;
if (section.type == '02') {
const sectionParent = this.$store.getters['map/getDeviceByCode'](section.parentCode);
name = `${sectionParent.name}${section.name}`;
}
if (section.stationCode == this.selected.stationCode) {
list.push({ name: name, code: section.code });
}
});
} else if (this.selected._type == 'Switch') {
list = this.switchList.filter(elem => elem.stationCode == this.selected.stationCode);
if (this.selected && this.selected._type) {
if (this.selected._type == 'Section') {
this.sectionList.forEach(section => {
let name = section.name;
if (section.type == '02') {
const sectionParent = this.$store.getters['map/getDeviceByCode'](section.parentCode);
name = `${sectionParent.name}${section.name}`;
}
if (section.stationCode == this.selected.stationCode) {
list.push({ name: name, code: section.code });
}
});
} else if (this.selected._type == 'Switch') {
list = this.switchList.filter(elem => elem.stationCode == this.selected.stationCode);
}
}
return list;
}