This commit is contained in:
zyy 2019-12-03 14:42:07 +08:00
commit c089ce1187
29 changed files with 647 additions and 593 deletions

View File

@ -9,10 +9,11 @@ export function getMapTree() {
} }
/** 草稿地图列表*/ /** 草稿地图列表*/
export function listMap() { export function listMap(params) {
return request({ return request({
url: '/api/mapBuild/list', url: '/api/mapBuild/list',
method: 'get' method: 'get',
params: params
}); });
} }

View File

@ -554,5 +554,6 @@ export default {
coordinateMode: 'Coordinate mode', coordinateMode: 'Coordinate mode',
sectionAssociationMode: 'Section association mode', sectionAssociationMode: 'Section association mode',
leftAssociatedSection: 'Left associated section', leftAssociatedSection: 'Left associated section',
rightAssociatedSection: 'Right associated section' rightAssociatedSection: 'Right associated section',
chargeStationList:'Managed station list'
}; };

View File

@ -548,5 +548,6 @@ export default {
coordinateMode: '坐标方式', coordinateMode: '坐标方式',
sectionAssociationMode: '区段关联方式', sectionAssociationMode: '区段关联方式',
leftAssociatedSection: '左关联区段', leftAssociatedSection: '左关联区段',
rightAssociatedSection: '右关联区段' rightAssociatedSection: '右关联区段',
chargeStationList:'管理车站列表'
}; };

View File

@ -151,7 +151,6 @@ class SkinCode extends defaultStyle {
text: { text: {
show: true, // 信号机名称显示 show: true, // 信号机名称显示
distance: 3, // 文字和灯杆的距离 distance: 3, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: false, // 信号字体对其方式 isAlignCenter: false, // 信号字体对其方式
fontSize: 11, // 信号机名称字体大小 fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细 fontWeight: 'bold', // 信号机名称字体粗细

View File

@ -151,7 +151,6 @@ class SkinCode extends defaultStyle {
text: { text: {
show: true, // 信号机名称显示 show: true, // 信号机名称显示
distance: 3, // 文字和灯杆的距离 distance: 3, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: false, // 信号字体对其方式 isAlignCenter: false, // 信号字体对其方式
fontSize: 11, // 信号机名称字体大小 fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细 fontWeight: 'bold', // 信号机名称字体粗细

View File

@ -154,7 +154,6 @@ class SkinCode extends defaultStyle {
text: { text: {
show: true, // 信号机名称显示 show: true, // 信号机名称显示
distance: 3, // 文字和灯杆的距离 distance: 3, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: false, // 信号字体对其方式 isAlignCenter: false, // 信号字体对其方式
fontSize: 11, // 信号机名称字体大小 fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细 fontWeight: 'bold', // 信号机名称字体粗细

View File

@ -151,7 +151,6 @@ class SkinCode extends defaultStyle {
text: { text: {
show: true, // 信号机名称显示 show: true, // 信号机名称显示
distance: 3, // 文字和灯杆的距离 distance: 3, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: false, // 信号字体对其方式 isAlignCenter: false, // 信号字体对其方式
fontSize: 11, // 信号机名称字体大小 fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细 fontWeight: 'bold', // 信号机名称字体粗细

View File

@ -27,7 +27,7 @@ class SkinCode extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式 textVerticalAlign: 'middle' // 文字垂直对齐方式
}, },
logicText: { logicText: {
show: false, // 逻辑区段名称显示 show: true, // 逻辑区段名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 6, // 文字离区段距离 distance: 6, // 文字离区段距离
fontSize: 8, // 字体大小 fontSize: 8, // 字体大小
@ -144,7 +144,6 @@ class SkinCode extends defaultStyle {
text: { text: {
show: true, // 信号机名称显示 show: true, // 信号机名称显示
distance: 0, // 文字和灯杆的距离 distance: 0, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: true, // 信号字体对其方式 isAlignCenter: true, // 信号字体对其方式
fontSize: 11, // 信号机名称字体大小 fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细 fontWeight: 'bold', // 信号机名称字体粗细

View File

@ -2,69 +2,69 @@ import Polyline from 'zrender/src/graphic/shape/Polyline';
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
class ESigPost extends Group { class ESigPost extends Group {
constructor(model) { constructor(model) {
super(); super();
this.model = model; this.model = model;
this.create(); this.create();
} }
create() { create() {
const model = this.model; const model = this.model;
const style = this.model.style; const style = this.model.style;
this.ver = new Polyline({ this.ver = new Polyline({
_subType: 'SignalLamp', _subType: 'SignalLamp',
_val: '3', _val: '3',
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
shape: { shape: {
points: [ points: [
[model.x, model.y + style.Signal.lamp.radiusR * 1.2], [model.x, model.y + style.Signal.lamp.radiusR * 1.2],
[model.x, model.y - style.Signal.lamp.radiusR * 1.2] [model.x, model.y - style.Signal.lamp.radiusR * 1.2]
] ]
}, },
style: { style: {
lineWidth: style.Signal.post.standardWidth, lineWidth: style.Signal.post.standardWidth,
stroke: style.Signal.post.standardColor stroke: style.Signal.post.standardColor
} }
}); });
this.hor = new Polyline({ this.hor = new Polyline({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
shape: { shape: {
points: [ points: [
[model.x, model.y], [model.x, model.y],
[model.x + model.drict * style.Signal.lamp.radiusR * 1.2, model.y] [model.x + model.drict * style.Signal.lamp.radiusR * 1.2, model.y]
] ]
}, },
style: { style: {
lineWidth: style.Signal.post.standardWidth, lineWidth: style.Signal.post.standardWidth,
stroke: style.Signal.post.standardColor stroke: style.Signal.post.standardColor
} }
}); });
this.add(this.ver); this.add(this.ver);
this.add(this.hor); this.add(this.hor);
model.type === '01' ? this.hor.hide() : this.hor.show(); model.type === '01' ? this.hor.hide() : this.hor.show();
} }
getLampPosition(type) { getLampPosition(type) {
const model = this.model; const model = this.model;
const style = this.model.style; const style = this.model.style;
if (type === '01') { if (type === '01') {
return { return {
x: model.x + model.drict * style.Signal.lamp.radiusR * 3 / 2, x: model.x + model.drict * style.Signal.lamp.radiusR * 3 / 2,
y: model.y y: model.y
}; };
} else { } else {
return { return {
x: this.hor.shape.points[1][0] + model.drict * style.Signal.lamp.radiusR, x: this.hor.shape.points[1][0] + model.drict * style.Signal.lamp.radiusR,
y: this.hor.shape.points[1][1] y: this.hor.shape.points[1][1]
}; };
} }
} }
} }
export default ESigPost; export default ESigPost;

View File

@ -14,503 +14,502 @@ import Group from 'zrender/src/container/Group';
import BoundingRect from 'zrender/src/core/BoundingRect'; import BoundingRect from 'zrender/src/core/BoundingRect';
class Signal extends Group { class Signal extends Group {
constructor(model, style) { constructor(model, style) {
super(); super();
this._code = model.code; this._code = model.code;
this._type = model._type; this._type = model._type;
this.model = model; this.model = model;
this.style = style; this.style = style;
this.count = parseInt(model.lampPositionType); this.count = parseInt(model.lampPositionType);
this.lamps = new Array(this.count); this.lamps = new Array(this.count);
this.zlevel = model.zlevel; this.zlevel = model.zlevel;
this.z = 7; this.z = 7;
this.create(); this.create();
this.createMouseEvent(); this.createMouseEvent();
this.transformRotation(this); this.transformRotation(this);
this.setState(model); this.setState(model);
} }
create() { create() {
const model = this.model; const model = this.model;
const style = this.style; const style = this.style;
const drict = this.model.directionShowType == '01' ? -1 : 1; // 朝向 左:右 const drict = this.model.directionShowType == '01' ? -1 : 1; // 朝向 左:右
const posit = this.model.positionType == '01' ? -1 : 1; // 位置 上:下 const posit = this.model.positionType == '01' ? -1 : 1; // 位置 上:下
// 信号机高柱矮柱 // 信号机高柱矮柱
this.sigPost = new ESigPost({ this.sigPost = new ESigPost({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
style: style, style: style,
drict: drict, drict: drict,
type: model.lampPostType, type: model.lampPostType,
x: model.position.x, x: model.position.x,
y: model.position.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR) y: model.position.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR)
}); });
// 信号灯 // 信号灯
const endPoint = this.sigPost.getLampPosition(model.lampPostType); const endPoint = this.sigPost.getLampPosition(model.lampPostType);
this.lamps = []; this.lamps = [];
for (let i = 0; i < this.count; i++) { for (let i = 0; i < this.count; i++) {
const lamp = new ESigLamp({ const lamp = new ESigLamp({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
style: style, style: style,
drict: drict, drict: drict,
x: endPoint.x + i * drict * style.Signal.lamp.radiusR * 2, x: endPoint.x + i * drict * style.Signal.lamp.radiusR * 2,
y: endPoint.y, y: endPoint.y,
originX: model.position.x, originX: model.position.x,
originY: model.position.y originY: model.position.y
}); });
this.lamps.push(lamp); this.lamps.push(lamp);
} }
// 信号机名称 // 信号机名称
const sigNameX = model.position.x - drict * (style.Signal.post.standardWidth) + model.namePosition.x; const sigNameX = model.position.x - drict * (style.Signal.post.standardWidth) + model.namePosition.x;
const sigNameY = model.position.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance); const sigNameY = model.position.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance);
const textAlign = style.Signal.text.isAlignCenter ? 'middle': this.model.directionShowType == '01'? 'right': 'left'; const textAlign = style.Signal.text.isAlignCenter ? 'middle' : this.model.directionShowType == '01' ? 'right' : 'left';
const textVerticalAlign = posit == 1 ? 'top' : 'bottom'; const textVerticalAlign = posit == 1 ? 'top' : 'bottom';
this.sigName = new ESigName({ this.sigName = new ESigName({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
silent: false, silent: false,
isNoRotation: style.Signal.text.isNoRotation, style: style,
style: style, x: sigNameX,
x: sigNameX, y: sigNameY,
y: sigNameY, text: model.name,
text: model.name, fontWeight: style.Signal.text.fontWeight,
fontWeight: style.Signal.text.fontWeight, fontSize: style.Signal.text.fontSize,
fontSize: style.Signal.text.fontSize, fontFamily: style.fontFamily,
fontFamily: style.fontFamily, textFill: style.Signal.text.defaultColor,
textFill: style.Signal.text.defaultColor, textAlign: textAlign,
textAlign: textAlign, textVerticalAlign: textVerticalAlign
textVerticalAlign: textVerticalAlign });
});
// 自动进路 // 自动进路
const sigRouteH = style.Signal.route.direction ? this.count * style.Signal.lamp.radiusR * 2 : -style.Signal.lamp.radiusR * 2; const sigRouteH = style.Signal.route.direction ? this.count * style.Signal.lamp.radiusR * 2 : -style.Signal.lamp.radiusR * 2;
const sigRouteX = endPoint.x + (style.Signal.route.offset.x + sigRouteH) * drict; const sigRouteX = endPoint.x + (style.Signal.route.offset.x + sigRouteH) * drict;
const sigRouteY = endPoint.y + (style.Signal.route.offset.y); const sigRouteY = endPoint.y + (style.Signal.route.offset.y);
this.sigRoute = new ESigRoute({ this.sigRoute = new ESigRoute({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
style: style, style: style,
x: sigRouteX, x: sigRouteX,
y: sigRouteY, y: sigRouteY,
drict: drict drict: drict
}); });
// 自动通过 // 自动通过
const sigAutoH = style.Signal.auto.direction ? this.count * style.Signal.lamp.radiusR * 2 : -style.Signal.lamp.radiusR * 2; const sigAutoH = style.Signal.auto.direction ? this.count * style.Signal.lamp.radiusR * 2 : -style.Signal.lamp.radiusR * 2;
const sigAutoX = endPoint.x + (style.Signal.auto.offset.x + sigAutoH) * drict; const sigAutoX = endPoint.x + (style.Signal.auto.offset.x + sigAutoH) * drict;
const sigAutoY = endPoint.y + (style.Signal.auto.offset.y); const sigAutoY = endPoint.y + (style.Signal.auto.offset.y);
this.sigAuto = new ESigAuto({ this.sigAuto = new ESigAuto({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
style: style, style: style,
count: this.count, count: this.count,
drict: drict, drict: drict,
x: sigAutoX, x: sigAutoX,
y: sigAutoY, y: sigAutoY,
width: style.Signal.auto.width, width: style.Signal.auto.width,
fill: style.Signal.auto.autoRoute, fill: style.Signal.auto.autoRoute,
lineWidth: 0.6, lineWidth: 0.6,
stroke: style.sidelineColor stroke: style.sidelineColor
}); });
// 延迟解锁 // 延迟解锁
const sigDelayH = style.Signal.delay.direction ? this.count * style.Signal.lamp.radiusR * 2 : -style.Signal.lamp.radiusR * 2; const sigDelayH = style.Signal.delay.direction ? this.count * style.Signal.lamp.radiusR * 2 : -style.Signal.lamp.radiusR * 2;
const sigDelayX = endPoint.x + (style.Signal.delay.offset.x + sigDelayH) * drict; const sigDelayX = endPoint.x + (style.Signal.delay.offset.x + sigDelayH) * drict;
const sigDelayY = endPoint.y - (style.Signal.delay.offset.y) * posit; const sigDelayY = endPoint.y - (style.Signal.delay.offset.y) * posit;
this.sigDelay = new ESigDelay({ this.sigDelay = new ESigDelay({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
style: style, style: style,
x: sigDelayX, x: sigDelayX,
y: sigDelayY, y: sigDelayY,
fontWeight: style.Signal.delay.fontWeight, fontWeight: style.Signal.delay.fontWeight,
fontSize: style.Signal.delay.fontSize, fontSize: style.Signal.delay.fontSize,
fontFamily: style.fontFamily, fontFamily: style.fontFamily,
text: this.model.delayCount || '0', text: this.model.delayCount || '0',
textFill: style.Signal.delay.fontColor, textFill: style.Signal.delay.fontColor,
textAlign: drict > 0 ? 'right' : 'left', textAlign: drict > 0 ? 'right' : 'left',
textVerticalAlign: 'middle' textVerticalAlign: 'middle'
}); });
// 信号灯按钮 // 信号灯按钮
this.sigButton = new ESigButton({ this.sigButton = new ESigButton({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
style: style, style: style,
posit: posit, posit: posit,
show: model.buttonShow, show: model.buttonShow,
x: model.buttonPosition.x, x: model.buttonPosition.x,
y: model.buttonPosition.y - posit * (style.Signal.button.distance + style.Signal.lamp.radiusR * 2) y: model.buttonPosition.y - posit * (style.Signal.button.distance + style.Signal.lamp.radiusR * 2)
}); });
this.add(this.sigPost); this.add(this.sigPost);
this.lamps.forEach(lamp => { this.add(lamp); }); this.lamps.forEach(lamp => { this.add(lamp); });
this.style.Signal.text.show ? this.add(this.sigName) : null; this.style.Signal.text.show ? this.add(this.sigName) : null;
this.add(this.sigAuto); this.add(this.sigAuto);
this.add(this.sigRoute); this.add(this.sigRoute);
this.add(this.sigDelay); this.add(this.sigDelay);
// this.add(this.sigButton); // this.add(this.sigButton);
} }
createMouseEvent() { createMouseEvent() {
if (this.style.Signal.mouseOverStyle) { if (this.style.Signal.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); }); this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); }); this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
} }
} }
// 整体旋转信号灯 // 整体旋转信号灯
transformRotation(device) { transformRotation(device) {
if (this.model.rotate) { if (this.model.rotate) {
device.eachChild(item => { device.eachChild(item => {
if (item instanceof Group) { if (item instanceof Group) {
this.transformRotation(item); this.transformRotation(item);
} else if (item && item.model && item.model.isNoRotation) { } else if (item) {
item.origin = [this.model.position.x, this.model.position.y]; item.origin = [this.model.position.x, this.model.position.y];
item.rotation = -Math.PI / 180 * Number(this.model.rotate); item.rotation = -Math.PI / 180 * Number(this.model.rotate);
item.dirty(); item.dirty();
} }
}); });
} }
} }
// 关闭 // 关闭
close() { close() {
if (this.count == 2 && this.model.lightType == '01') { // 双灯 物理点灯 if (this.count == 2 && this.model.lightType == '01') { // 双灯 物理点灯
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(false); this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.redColor); this.lamps[0].setColor(this.style.Signal.lamp.redColor);
} }
if (this.lamps[1]) { if (this.lamps[1]) {
this.lamps[1].setStop(false); this.lamps[1].setStop(false);
this.lamps[1].setColor(this.style.backgroundColor); this.lamps[1].setColor(this.style.backgroundColor);
} }
} else if (this.count == 2 && this.model.lightType == '02') { // 双灯 逻辑点灯 } else if (this.count == 2 && this.model.lightType == '02') { // 双灯 逻辑点灯
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(true); this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.redColor); this.lamps[0].setColor(this.style.Signal.lamp.redColor);
} }
if (this.lamps[1]) { if (this.lamps[1]) {
this.lamps[1].setStop(true); this.lamps[1].setStop(true);
this.lamps[1].setColor(this.style.backgroundColor); this.lamps[1].setColor(this.style.backgroundColor);
} }
} else if (this.count == 1 && this.model.lightType == '01') { // 单灯 物理点灯 } else if (this.count == 1 && this.model.lightType == '01') { // 单灯 物理点灯
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(false); this.lamps[0].setStop(false);
if (this.model.useType == '05') { if (this.model.useType == '05') {
this.lamps[0].setColor(this.style.Signal.lamp.blueColor); this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
} else { } else {
this.lamps[0].setColor(this.style.Signal.lamp.redColor); this.lamps[0].setColor(this.style.Signal.lamp.redColor);
} }
} }
} else if (this.count == 1 && this.model.lightType == '02') { // 单灯 逻辑点灯 } else if (this.count == 1 && this.model.lightType == '02') { // 单灯 逻辑点灯
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(true); this.lamps[0].setStop(true);
if (this.model.useType == '05') { if (this.model.useType == '05') {
this.lamps[0].setColor(this.style.Signal.lamp.blueColor); this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
} else { } else {
this.lamps[0].setColor(this.style.Signal.lamp.redColor); this.lamps[0].setColor(this.style.Signal.lamp.redColor);
} }
} }
} else if (this.count == 1) { } else if (this.count == 1) {
if (this.lamps[0]) { if (this.lamps[0]) {
if (this.model.useType == '05') { if (this.model.useType == '05') {
this.lamps[0].setColor(this.style.Signal.lamp.blueColor); this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
} else { } else {
this.lamps[0].setColor(this.style.Signal.lamp.redColor); this.lamps[0].setColor(this.style.Signal.lamp.redColor);
} }
} }
} }
} }
/* count 1单灯 2双灯 lightType 01物理点灯 02逻辑点灯*/ /* count 1单灯 2双灯 lightType 01物理点灯 02逻辑点灯*/
openPositive() { openPositive() {
if (this.count == 2 && this.model.lightType == '01') { if (this.count == 2 && this.model.lightType == '01') {
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(false); this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor); this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
} }
if (this.lamps[1]) { if (this.lamps[1]) {
this.lamps[1].setStop(false); this.lamps[1].setStop(false);
this.lamps[1].setColor(this.style.backgroundColor); this.lamps[1].setColor(this.style.backgroundColor);
} }
} else if (this.count == 2 && this.model.lightType == '02') { } else if (this.count == 2 && this.model.lightType == '02') {
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(true); this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor); this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
} }
if (this.lamps[1]) { if (this.lamps[1]) {
this.lamps[1].setStop(true); this.lamps[1].setStop(true);
this.lamps[1].setColor(this.style.backgroundColor); this.lamps[1].setColor(this.style.backgroundColor);
} }
} else if (this.count == 1 && this.model.lightType == '01') { } else if (this.count == 1 && this.model.lightType == '01') {
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(false); this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor); this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
} }
} else if (this.count == 1 && this.model.lightType == '02') { } else if (this.count == 1 && this.model.lightType == '02') {
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(true); this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor); this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
} }
} }
} }
/* count 1单灯 2双灯 lightType 01物理点灯 02逻辑点灯*/ /* count 1单灯 2双灯 lightType 01物理点灯 02逻辑点灯*/
openLateral() { openLateral() {
if (this.count == 2 && this.model.lightType == '01') { if (this.count == 2 && this.model.lightType == '01') {
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(false); this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.backgroundColor); this.lamps[0].setColor(this.style.backgroundColor);
} }
if (this.lamps[1]) { if (this.lamps[1]) {
this.lamps[1].setStop(false); this.lamps[1].setStop(false);
this.lamps[1].setColor(this.style.Signal.lamp.yellowColor); this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
} }
} else if (this.count == 2 && this.model.lightType == '02') { } else if (this.count == 2 && this.model.lightType == '02') {
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(true); this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.backgroundColor); this.lamps[0].setColor(this.style.backgroundColor);
} }
if (this.lamps[1]) { if (this.lamps[1]) {
this.lamps[1].setStop(true); this.lamps[1].setStop(true);
this.lamps[1].setColor(this.style.Signal.lamp.yellowColor); this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
} }
} else if (this.count == 1 && this.model.lightType == '01') { } else if (this.count == 1 && this.model.lightType == '01') {
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(false); this.lamps[0].setStop(false);
// 出站信号机/阻隔信号机 // 出站信号机/阻隔信号机
if (['02', '06'].includes(this.model.useType)) { if (['02', '06'].includes(this.model.useType)) {
this.lamps[0].setColor(this.style.Signal.lamp.greenColor); this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
} else { } else {
this.lamps[0].setColor(this.style.Signal.lamp.whiteColor); this.lamps[0].setColor(this.style.Signal.lamp.whiteColor);
} }
} }
} else if (this.count == 1 && this.model.lightType == '02') { } else if (this.count == 1 && this.model.lightType == '02') {
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(true); this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor); this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
} }
} }
} }
// 列车进路 // 列车进路
trainRoute() { trainRoute() {
if (this.count == 1) { if (this.count == 1) {
/** 单灯 列兼调信号*/ /** 单灯 列兼调信号*/
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor); this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
} }
} }
// 调车进路 // 调车进路
shuntRoute() { shuntRoute() {
if (this.count == 1) { if (this.count == 1) {
/** 单灯 列兼调信号*/ /** 单灯 列兼调信号*/
/** 单灯 阻挡兼调车信号*/ /** 单灯 阻挡兼调车信号*/
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.whiteColor); this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.whiteColor);
} }
} }
// 引导 // 引导
guid() { guid() {
if (this.count == 2 && this.model.lightType == '01' && this.style.Signal.lamp.guidName != 'chengdu_03') { // 双灯 物理点灯 允许引导信号 if (this.count == 2 && this.model.lightType == '01' && this.style.Signal.lamp.guidName != 'chengdu_03') { // 双灯 物理点灯 允许引导信号
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(false); this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.redColor); this.lamps[0].setColor(this.style.Signal.lamp.redColor);
} }
if (this.lamps[1]) { if (this.lamps[1]) {
this.lamps[1].setStop(false); this.lamps[1].setStop(false);
this.lamps[1].setColor(this.style.Signal.lamp.yellowColor); this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
} }
} else if (this.count == 1 && this.model.lightType == '01' && this.style.Signal.lamp.guidName == 'chengdu_03') { } else if (this.count == 1 && this.model.lightType == '01' && this.style.Signal.lamp.guidName == 'chengdu_03') {
this.lamps[0].setStop(false); this.lamps[0].setStop(false);
this.lamps[0].setStyle({ fill: this.style.Signal.lamp.yellowColor, stroke: this.style.Signal.lamp.redColor, lineWidth: 2.5 }); this.lamps[0].setStyle({ fill: this.style.Signal.lamp.yellowColor, stroke: this.style.Signal.lamp.redColor, lineWidth: 2.5 });
} }
} }
// 封锁 // 封锁
block() { block() {
if (this.count == 1) { if (this.count == 1) {
this.lamps[0].setColor(this.style.Signal.lamp.redColor); this.lamps[0].setColor(this.style.Signal.lamp.redColor);
// this.siglamp.setNameBorder(1) // this.siglamp.setNameBorder(1)
} }
this.sigName.setColor(this.style.Signal.text.blockColor); this.sigName.setColor(this.style.Signal.text.blockColor);
if (this.style.Signal.text.nameBorderShow) { if (this.style.Signal.text.nameBorderShow) {
this.sigName.setStyle({textBorderWidth: 1}); this.sigName.setStyle({textBorderWidth: 1});
this.sigName.setColor('#fff'); this.sigName.setColor('#fff');
} }
} }
// 功能封锁 // 功能封锁
functionBlock() { functionBlock() {
if (this.count == 1) { if (this.count == 1) {
this.lamps[0].setColor(this.style.Signal.lamp.redColor); this.lamps[0].setColor(this.style.Signal.lamp.redColor);
// this.siglamp.setRectBlockByIndex(1, true); // this.siglamp.setRectBlockByIndex(1, true);
} }
} }
// 信号保护区段监视状态显示 // 信号保护区段监视状态显示
signalCheck() { signalCheck() {
if (this.count == 1) { if (this.count == 1) {
this.lamps[0].setColor(this.style.Signal.lamp.redColor); this.lamps[0].setColor(this.style.Signal.lamp.redColor);
this.sigName.setColor(this.style.Signal.text.checkColor); this.sigName.setColor(this.style.Signal.text.checkColor);
} }
} }
// 故障 // 故障
fault() { fault() {
if (this.count == 2 && this.model.lightType == '01') { // 双灯 物理点灯 if (this.count == 2 && this.model.lightType == '01') { // 双灯 物理点灯
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(false); this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.blueColor); this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
} }
if (this.lamps[1]) { if (this.lamps[1]) {
this.lamps[1].setStop(false); this.lamps[1].setStop(false);
this.lamps[1].setColor(this.style.Signal.lamp.blueColor); this.lamps[1].setColor(this.style.Signal.lamp.blueColor);
} }
} }
} }
// 物理点灯 // 物理点灯
logicalLight() { logicalLight() {
this.lamps.forEach(lamp => { lamp.setStop(false); }); this.lamps.forEach(lamp => { lamp.setStop(false); });
} }
// 逻辑点灯 // 逻辑点灯
physicsLight() { physicsLight() {
this.lamps.forEach(lamp => { lamp.setStop(true); }); this.lamps.forEach(lamp => { lamp.setStop(true); });
} }
// 设置自动进路模式状态类型 // 设置自动进路模式状态类型
setAutoRouteOpen() { setAutoRouteOpen() {
this.sigAuto.setColor(this.style.Signal.auto.autoRoute); this.sigAuto.setColor(this.style.Signal.auto.autoRoute);
if (this.model.linkageAutoRouteShow) { if (this.model.linkageAutoRouteShow) {
this.sigAuto.show(); this.sigAuto.show();
} else { } else {
this.sigAuto.hide(); this.sigAuto.hide();
} }
} }
// 信号机进路自动触发模式状态类型 // 信号机进路自动触发模式状态类型
setAutoTriggerOpen() { setAutoTriggerOpen() {
this.sigAuto.setColor(this.style.Signal.auto.autoTrigger); this.sigAuto.setColor(this.style.Signal.auto.autoTrigger);
if (this.model.atsAutoTriggerShow) { if (this.model.atsAutoTriggerShow) {
this.sigAuto.show(); this.sigAuto.show();
} else { } else {
this.sigAuto.hide(); this.sigAuto.hide();
} }
} }
// 设置自动信号模式状态类型 // 设置自动信号模式状态类型
setAutoSignalOpen() { setAutoSignalOpen() {
this.sigRoute.show(); this.sigRoute.show();
} }
// 隐藏自动信号和自动进路 // 隐藏自动信号和自动进路
setAutoClose() { setAutoClose() {
this.sigAuto.hide(); this.sigAuto.hide();
this.sigAuto.setColor(this.style.backgroundColor); this.sigAuto.setColor(this.style.backgroundColor);
this.sigRoute.hide(); this.sigRoute.hide();
} }
// 自动信号和自动进路开始动画 // 自动信号和自动进路开始动画
setAutoFlicker() { setAutoFlicker() {
this.sigAuto.arrowsAnimation(); this.sigAuto.arrowsAnimation();
} }
// 设置延时解锁 // 设置延时解锁
setDelayUnlock() { setDelayUnlock() {
this.sigDelay.show(); this.sigDelay.show();
} }
// 恢复状态 // 恢复状态
recover() { recover() {
this.sigName.setStyle({textBorderWidth: 0}); this.sigName.setStyle({textBorderWidth: 0});
this.sigAuto.hide(); this.sigAuto.hide();
this.sigRoute.hide(); this.sigRoute.hide();
this.sigDelay.hide(); this.sigDelay.hide();
this.sigAuto.animationRecover(); this.sigAuto.animationRecover();
this.sigName.setColor(this.style.Signal.text.defaultColor); this.sigName.setColor(this.style.Signal.text.defaultColor);
if (this.style.Signal.lamp.guidName == 'chengdu_03') { if (this.style.Signal.lamp.guidName == 'chengdu_03') {
this.lamps[0].setStyle({ lineWidth: this.style.Signal.lamp.borderWidth }); this.lamps[0].setStyle({ lineWidth: this.style.Signal.lamp.borderWidth });
} }
} }
setState(model) { setState(model) {
this.recover(); this.recover();
/** 设置状态 (点灯类型)*/ /** 设置状态 (点灯类型)*/
switch (model.status) { switch (model.status) {
case '01': this.close(); break; // 关闭 case '01': this.close(); break; // 关闭
case '02': this.openPositive(); break; // 开放正向 case '02': this.openPositive(); break; // 开放正向
case '03': this.openLateral(); break; // 开放侧向 case '03': this.openLateral(); break; // 开放侧向
case '04': this.guid(); break; // 引导 case '04': this.guid(); break; // 引导
case '05': this.block(); break; // 封锁 case '05': this.block(); break; // 封锁
case '06': this.fault(); break; // 故障 case '06': this.fault(); break; // 故障
case '07': this.block(); break; // 功能封锁 case '07': this.block(); break; // 功能封锁
case '08': this.signalCheck(); break; // 信号保护区段检测 case '08': this.signalCheck(); break; // 信号保护区段检测
} }
/** 进路性质类型*/ /** 进路性质类型*/
switch (model.natureType) { switch (model.natureType) {
case '01': this.trainRoute(); break; // 列车进路 case '01': this.trainRoute(); break; // 列车进路
case '02': this.shuntRoute(); break; // 调车进路 case '02': this.shuntRoute(); break; // 调车进路
} }
/** 设置点灯类型*/ /** 设置点灯类型*/
switch (model.lightType) { switch (model.lightType) {
case '01': this.logicalLight(); break; // 设置逻辑点灯 case '01': this.logicalLight(); break; // 设置逻辑点灯
case '02': this.physicsLight(); break; // 设置物理点灯 case '02': this.physicsLight(); break; // 设置物理点灯
} }
/** 设置自动类型*/ /** 设置自动类型*/
switch (model.autoType) { switch (model.autoType) {
case '01': this.setAutoClose(); break; // 隐藏 隐藏自动信号和自动进路 case '01': this.setAutoClose(); break; // 隐藏 隐藏自动信号和自动进路
case '02': this.setAutoSignalOpen(); break; // 显示 设置自动信号模式状态类型 case '02': this.setAutoSignalOpen(); break; // 显示 设置自动信号模式状态类型
case '03': this.setAutoRouteOpen(); break; // 显示 设置自动进路模式状态类型 case '03': this.setAutoRouteOpen(); break; // 显示 设置自动进路模式状态类型
case '04': this.setAutoTriggerOpen(); break; // 显示 信号机进路自动触发模式状态类型 case '04': this.setAutoTriggerOpen(); break; // 显示 信号机进路自动触发模式状态类型
} }
/** 延时解锁*/ /** 延时解锁*/
switch (model.delayType) { switch (model.delayType) {
case '01': break; // 未延时解锁 case '01': break; // 未延时解锁
case '02': this.setDelayUnlock(); break; // 人工闭塞延时解锁 case '02': this.setDelayUnlock(); break; // 人工闭塞延时解锁
case '03': this.setDelayUnlock(); break; // 自动闭塞延时解锁 case '03': this.setDelayUnlock(); break; // 自动闭塞延时解锁
} }
/** 信号机进路办理,先停止动画,再判断当前颜色是否闪烁*/ /** 信号机进路办理,先停止动画,再判断当前颜色是否闪烁*/
if (model.routeSetting && (model.autoType == '03' || model.autoType == '04')) { if (model.routeSetting && (model.autoType == '03' || model.autoType == '04')) {
this.setAutoFlicker(); this.setAutoFlicker();
} }
} }
getBoundingRect() { getBoundingRect() {
const rect = this.sigPost.getBoundingRect(); const rect = this.sigPost.getBoundingRect();
this.lamps.forEach(elem => { this.lamps.forEach(elem => {
rect.union(elem.getBoundingRect()); rect.union(elem.getBoundingRect());
}); });
return rect; return rect;
} }
getShapeTipPoint(opts) { getShapeTipPoint(opts) {
var rect = new BoundingRect(0, 0, 0, 0); var rect = new BoundingRect(0, 0, 0, 0);
var drict = this.model.directionShowType == '01' ? -1 : 1; // 朝向 左:右 var drict = this.model.directionShowType == '01' ? -1 : 1; // 朝向 左:右
var offsetY = this.model.positionType == '01' ? this.style.Signal.text.fontSize : 0; // 位置 上:下 var offsetY = this.model.positionType == '01' ? this.style.Signal.text.fontSize : 0; // 位置 上:下
if (opts.val == '1' || opts.val == '2') { if (opts.val == '1' || opts.val == '2') {
rect = this.sigButton.getBoundingRect(); rect = this.sigButton.getBoundingRect();
} else { } else {
rect = this.sigPost.getBoundingRect(); rect = this.sigPost.getBoundingRect();
} }
return { return {
x: rect.x + drict * this.style.Signal.post.standardWidth, x: rect.x + drict * this.style.Signal.post.standardWidth,
y: rect.y - offsetY y: rect.y - offsetY
}; };
} }
} }
export default Signal; export default Signal;

View File

@ -24,7 +24,6 @@ export default class StationControl extends Group {
} }
create() { create() {
debugger;
const model = this.model; const model = this.model;
// 紧急站控 // 紧急站控
if (this.style.StationControl.lamp.emergencyControlShow) { if (this.style.StationControl.lamp.emergencyControlShow) {

View File

@ -99,7 +99,7 @@ export default {
this.loading = true; this.loading = true;
this.treeData = this.treeList = []; this.treeData = this.treeList = [];
try { try {
const res = await listMap(); const res = await listMap({ drawWay:'0'});
res.data && res.data.forEach(elem=>{ res.data && res.data.forEach(elem=>{
elem.type = 'map'; elem.type = 'map';
elem.children = [ elem.children = [

View File

@ -143,7 +143,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'0'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -152,7 +152,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'0'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -162,7 +162,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'0'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -245,7 +245,7 @@ export default {
} }
}, },
acquireMapList() { acquireMapList() {
listMap().then(response => { listMap({ drawWay:'0'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -175,7 +175,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'0'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -127,7 +127,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'0'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -87,7 +87,7 @@ export default {
this.loading = true; this.loading = true;
this.treeData = this.treeList = []; this.treeData = this.treeList = [];
try { try {
const res = await listMap(); const res = await listMap({ drawWay:'1'});
res.data && res.data.forEach(elem=>{ res.data && res.data.forEach(elem=>{
elem.type = 'map'; elem.type = 'map';
elem.children = [ elem.children = [

View File

@ -143,7 +143,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'1'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -152,7 +152,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'1'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -162,7 +162,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'1'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -245,7 +245,7 @@ export default {
} }
}, },
acquireMapList() { acquireMapList() {
listMap().then(response => { listMap({ drawWay:'1'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -175,7 +175,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({drawWay: '1'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -127,7 +127,7 @@ export default {
}, },
acquireMapList() { acquireMapList() {
// //
listMap().then(response => { listMap({ drawWay:'1'}).then(response => {
this.mapList = response.data; this.mapList = response.data;
}); });
}, },

View File

@ -41,6 +41,26 @@
</template> </template>
</el-form-item> </el-form-item>
</template> </template>
<template v-if="checkFieldType(item, 'multiSelect')">
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
<el-select
v-model="formModel[item.prop]"
filterable
multiple
:placeholder="item.placeholder"
:disabled="item.disabled"
:clearable="item.clearable"
@change="item.deviceChange"
>
<el-option
v-for="option in item.options"
:key="option[item.optionValue]"
:label="handleLabel(option, item.optionLabel)"
:value="option[item.optionValue]"
/>
</el-select>
</el-form-item>
</template>
<template v-if="checkFieldType(item, 'selectHover')"> <template v-if="checkFieldType(item, 'selectHover')">
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required"> <el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
<el-select <el-select
@ -97,7 +117,7 @@
<template v-if="checkFieldType(item, 'radio')"> <template v-if="checkFieldType(item, 'radio')">
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required"> <el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
<el-radio-group v-model="formModel[item.prop]" :disabled="item.disabled"> <el-radio-group v-model="formModel[item.prop]" :disabled="item.disabled">
<el-radio v-for="(opts, indexs) in item.radioList" :key="indexs" :border="item.border" :label="opts.value">{{ opts.label }}</el-radio> <el-radio v-for="(opts, indexs) in item.radioList" :key="indexs" :border="item.border" :label="opts[item.optionValue]||opts.value">{{ opts[item.optionLabel]||opts.label }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</template> </template>

View File

@ -32,45 +32,46 @@
@click="hover('selectSingalCode')" @click="hover('selectSingalCode')"
>{{ $t('map.activate') }}</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item label="信号机名称:" prop="name">
<el-input v-model="addModel.name" style="width: 178px;" />
</el-form-item>
<el-form-item :label="$t('map.leftOrRight')" prop="leftOrRight"> <el-form-item :label="$t('map.leftOrRight')" prop="leftOrRight">
<el-select v-model="addModel.leftOrRight" filterable> <el-radio-group v-model="addModel.leftOrRight">
<el-option <el-radio
v-for="item in SignalLeftOrRightList" v-for="item in SignalLeftOrRightList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.value"
:value="item.value" border
/> size="mini"
</el-select> >
</el-form-item> {{ item.label }}</el-radio>
<el-form-item :label="$t('map.directionType')" prop="directionType"> </el-radio-group>
<el-select v-model="addModel.directionType" filterable>
<el-option
v-for="item in SignalDirectionTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.signalDirectionTypeX')" prop="directionShowType"> <el-form-item :label="$t('map.signalDirectionTypeX')" prop="directionShowType">
<el-select v-model="addModel.directionShowType" filterable> <el-radio-group v-model="addModel.directionShowType">
<el-option <el-radio
v-for="item in SignalDirectionList" v-for="item in SignalDirectionList"
:key="item.code" :key="item.code"
:label="item.name" :label="item.code"
:value="item.code" border
/> size="mini"
</el-select> >
{{ item.name }}
</el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.positionType')" prop="positionType"> <el-form-item :label="$t('map.positionType')" prop="positionType">
<el-select v-model="addModel.positionType" filterable> <el-radio-group v-model="addModel.positionType">
<el-option <el-radio
v-for="item in SignalPositionTypeList" v-for="item in SignalPositionTypeList"
:key="item.code" :key="item.code"
:label="item.name" :label="item.code"
:value="item.code" border
/> size="mini"
</el-select> >
{{ item.name }}
</el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.equipmentStation')" prop="stationCode"> <el-form-item :label="$t('map.equipmentStation')" prop="stationCode">
<el-select v-model="addModel.stationCode" filterable> <el-select v-model="addModel.stationCode" filterable>
@ -125,7 +126,6 @@ export default {
SignalPotLampTypeList: [], SignalPotLampTypeList: [],
SignalLampPostTypeList: [], SignalLampPostTypeList: [],
SignalLampPositionTypeList: [], SignalLampPositionTypeList: [],
SignalDirectionTypeList: [],
SignalPositionTypeList: [], SignalPositionTypeList: [],
SignalUseTypeList: [], SignalUseTypeList: [],
failTypes: [ failTypes: [
@ -141,7 +141,6 @@ export default {
lampPositionType: '', lampPositionType: '',
potLampType: '01', potLampType: '01',
directionShowType: '', directionShowType: '',
directionType: '',
positionType: '', positionType: '',
namePosition: { x: 0, y: 0 }, namePosition: { x: 0, y: 0 },
useType: '', useType: '',
@ -158,7 +157,7 @@ export default {
field: '', field: '',
addModel: { addModel: {
sectionCode: '', sectionCode: '',
directionType: '01', name: '',
directionShowType: '01', directionShowType: '01',
leftOrRight: '0', leftOrRight: '0',
positionType: '01', positionType: '01',
@ -168,9 +167,6 @@ export default {
sectionCode: [ sectionCode: [
{ required: true, message: this.$t('rules.selectPhysicalExtentName'), trigger: 'change' } { required: true, message: this.$t('rules.selectPhysicalExtentName'), trigger: 'change' }
], ],
directionType: [
{ required: true, message: this.$t('map.pleaseSelect') + '' + this.$t('map.directionType'), trigger: 'change' }
],
directionShowType: [ directionShowType: [
{ required: true, message: this.$t('map.pleaseSelect') + '' + this.$t('map.directionType'), trigger: 'change' } { required: true, message: this.$t('map.pleaseSelect') + '' + this.$t('map.directionType'), trigger: 'change' }
], ],
@ -181,7 +177,7 @@ export default {
{ required: true, message: this.$t('map.pleaseSelect') + '' + this.$t('map.positionType'), trigger: 'change' } { required: true, message: this.$t('map.pleaseSelect') + '' + this.$t('map.positionType'), trigger: 'change' }
], ],
stationCode: [ stationCode: [
{ required: true, message: this.$t('map.pleaseSelect') + '' + this.$t('map.equipmentStation'), trigger: 'change' } { required: false, message: this.$t('map.pleaseSelect') + '' + this.$t('map.equipmentStation'), trigger: 'change' }
] ]
} }
}; };
@ -228,10 +224,10 @@ export default {
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' }, { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' } { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }, ] },
{ prop: 'lampPostType', label: this.$t('map.lampPostType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalLampPostTypeList }, { prop: 'lampPostType', label: this.$t('map.lampPostType'), type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.SignalLampPostTypeList },
{ prop: 'lampPositionType', label: this.$t('map.lampPositionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalLampPositionTypeList }, { prop: 'lampPositionType', label: this.$t('map.lampPositionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalLampPositionTypeList },
{ prop: 'directionShowType', label: this.$t('map.signalDirectionTypeX'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalDirectionList }, { prop: 'directionShowType', label: this.$t('map.signalDirectionTypeX'), type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.SignalDirectionList },
{ prop: 'positionType', label: this.$t('map.signalPositionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalPositionTypeList }, { prop: 'positionType', label: this.$t('map.signalPositionType'), type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.SignalPositionTypeList },
{ prop: 'rotate', label: this.$t('map.rotateAngle'), type: 'number', min: -90, max: 90, placeholder: this.$t('tip.angle') }, { prop: 'rotate', label: this.$t('map.rotateAngle'), type: 'number', min: -90, max: 90, placeholder: this.$t('tip.angle') },
{ prop: 'namePosition', label: this.$t('map.signalNamePosition'), type: 'coordinate', width: '140px', children: [ { prop: 'namePosition', label: this.$t('map.signalNamePosition'), type: 'coordinate', width: '140px', children: [
{ prop: 'namePosition.x', firstLevel: 'namePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' }, { prop: 'namePosition.x', firstLevel: 'namePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
@ -253,7 +249,6 @@ export default {
name: this.$t('map.mapData'), name: this.$t('map.mapData'),
item: [ item: [
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList }, { prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList },
{ prop: 'directionType', label: this.$t('map.signalDirectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalDirectionTypeList },
{ prop: 'uniqueName', label: this.$t('map.signalUniqueName'), type: 'input' }, { prop: 'uniqueName', label: this.$t('map.signalUniqueName'), type: 'input' },
{ prop: 'useType', label: this.$t('map.signalUseType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalUseTypeList }, { prop: 'useType', label: this.$t('map.signalUseType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalUseTypeList },
{ prop: 'potLampType', label: this.$t('map.potLampType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalPotLampTypeList }, { prop: 'potLampType', label: this.$t('map.potLampType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalPotLampTypeList },
@ -320,10 +315,6 @@ export default {
this.SignalLampPositionTypeList = list; this.SignalLampPositionTypeList = list;
}); });
this.$Dictionary.signalDirectionType().then(list => {
this.SignalDirectionTypeList = list;
});
this.$Dictionary.signalPositionType().then(list => { this.$Dictionary.signalPositionType().then(list => {
this.SignalPositionTypeList = list; this.SignalPositionTypeList = list;
}); });
@ -369,7 +360,6 @@ export default {
uniqueName: uid, uniqueName: uid,
sectionCode: this.addModel.sectionCode, sectionCode: this.addModel.sectionCode,
positionType: this.addModel.positionType, positionType: this.addModel.positionType,
directionType: this.addModel.directionType,
directionShowType: this.addModel.directionShowType, directionShowType: this.addModel.directionShowType,
nameShow: true, nameShow: true,
namePosition: { x: 0, y: 0 }, namePosition: { x: 0, y: 0 },
@ -383,7 +373,7 @@ export default {
}; };
this.sectionList.forEach(elem => { this.sectionList.forEach(elem => {
if (elem.code === this.addModel.sectionCode) { if (elem.code === this.addModel.sectionCode) {
model.name = 'Signal_' + elem.name.replace('Section_', ''); model.name = this.addModel.name || 'Signal_' + elem.name.replace('Section_', '');
model.linkCode = elem.code; model.linkCode = elem.code;
if (this.addModel.leftOrRight === '0') { if (this.addModel.leftOrRight === '0') {
const beg = elem.points[0]; const beg = elem.points[0];

View File

@ -67,6 +67,7 @@ export default {
return { return {
activeName: 'first', activeName: 'first',
field: '', field: '',
chargeStation:[],
editModel: { editModel: {
centralized: false, centralized: false,
concentrateStationCode: '', concentrateStationCode: '',
@ -83,10 +84,12 @@ export default {
kmPostFont: '', kmPostFont: '',
kmPostFontColor: '#FFFFFF', kmPostFontColor: '#FFFFFF',
isShowControlMode: '', isShowControlMode: '',
chargeStationCodeList:[],
position: { position: {
x: 0, x: 0,
y: 0 y: 0
} },
controlled:false
}, },
addModel: { addModel: {
sectionCode: '' sectionCode: ''
@ -135,9 +138,10 @@ export default {
map: { map: {
name: this.$t('map.mapData'), name: this.$t('map.mapData'),
item: [ item: [
{ prop: 'concentrateStationCode', label: this.$t('map.concentrateStationCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.stationList }, { prop: 'concentrateStationCode', label: this.$t('map.concentrateStationCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.stationList, disabled:this.editModel.controlled },
{ prop: 'centralized', label: this.$t('map.centralized'), type: 'checkbox' }, { prop: 'centralized', label: this.$t('map.centralized'), type: 'checkbox', disabled:this.editModel.controlled, change:true, deviceChange:this.changeCentralized },
{ prop: 'zcCode', label: this.$t('map.zcCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.zcList, isHidden: !this.isZcCode }, { prop: 'zcCode', label: this.$t('map.zcCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.zcList, isHidden: !this.isZcCode },
{ prop: 'chargeStationCodeList', label: this.$t('map.chargeStationList'), type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.chargeStation, isHidden: !this.isZcCode, deviceChange:this.changeChargeStation},
{ prop: 'runPlanName', label: this.$t('map.stationRunPlanName'), type: 'input' } { prop: 'runPlanName', label: this.$t('map.stationRunPlanName'), type: 'input' }
] ]
} }
@ -194,6 +198,9 @@ export default {
this.activeName = 'first'; this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected); this.editModel = deepAssign(this.editModel, selected);
this.editModel.runPlanName = selected.runPlanName || ''; this.editModel.runPlanName = selected.runPlanName || '';
this.chargeStation = this.stationList.filter(data=>{
return !data.centralized && data.code != this.editModel.code && !(data.controlled && data.concentrateStationCode != this.editModel.code);
});
} }
if (this.field.toUpperCase() === 'selectStationCode'.toUpperCase()) { if (this.field.toUpperCase() === 'selectStationCode'.toUpperCase()) {
this.addModel.sectionCode = selected.code; this.addModel.sectionCode = selected.code;
@ -202,6 +209,45 @@ export default {
this.$emit('stationSectionCode', ''); this.$emit('stationSectionCode', '');
} }
}, },
changeChargeStation(data) {
if (data.length > 0) {
this.chargeStation.forEach(station=>{
const newModal = Object.assign({}, station);
newModal.controlled = false;
newModal.concentrateStationCode = '';
data.forEach(each=>{
switch (each) {
case station.code: {
newModal.controlled = true;
newModal.concentrateStationCode = this.editModel.code;
break;
}
}
});
this.$emit('updateMapModel', newModal);
});
} else {
this.chargeStation.forEach(station=>{
const newModal = Object.assign({}, station);
newModal.controlled = false;
newModal.concentrateStationCode = '';
this.$emit('updateMapModel', newModal);
});
}
this.edit();
},
changeCentralized(data) {
if (!data) {
this.editModel.chargeStationCodeList = [];
this.edit();
this.chargeStation.forEach(station=>{
const newModal = Object.assign({}, station);
newModal.controlled = false;
newModal.concentrateStationCode = '';
this.$emit('updateMapModel', newModal);
});
}
},
hover(field) { hover(field) {
this.field = field === this.field ? '' : field; this.field = field === this.field ? '' : field;
this.$emit('stationSectionCode', this.field); this.$emit('stationSectionCode', this.field);
@ -224,7 +270,9 @@ export default {
kmPostFont: '8px consolas', kmPostFont: '8px consolas',
kmPostFontColor: '#FFFFFF', kmPostFontColor: '#FFFFFF',
centralized: false, centralized: false,
concentrateStationCode: '' concentrateStationCode: '',
controlled:false,
chargeStationCodeList:[]
}; };
this.sectionList.forEach(elem => { this.sectionList.forEach(elem => {
if (elem.code === this.addModel.sectionCode) { if (elem.code === this.addModel.sectionCode) {

View File

@ -28,7 +28,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.equipmentStation')" prop="deviceStationCode"> <el-form-item :label="$t('map.equipmentStation')" prop="deviceStationCode">
<el-select v-model="addModel.deviceStationCode" filterable> <el-select v-model="addModel.deviceStationCode" filterable disabled>
<el-option <el-option
v-for="item in stationList" v-for="item in stationList"
:key="item.code" :key="item.code"
@ -149,7 +149,7 @@ export default {
map: { map: {
name: this.$t('map.mapData'), name: this.$t('map.mapData'),
item: [ item: [
{ prop: 'deviceStationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.stationList, change: true, deviceChange:this.updateView }, { prop: 'deviceStationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.stationList, change: true, deviceChange:this.updateView, disabled:true},
{ prop: 'stationCode', label: this.$t('map.belongsStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, change: true, deviceChange:this.updateView } { prop: 'stationCode', label: this.$t('map.belongsStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, change: true, deviceChange:this.updateView }
] ]
} }