This commit is contained in:
fan 2019-12-04 18:41:55 +08:00
commit 117d3a3d0b
13 changed files with 286 additions and 434 deletions

View File

@ -1,124 +1,124 @@
export default class defaultStyle { export default class defaultStyle {
constructor() { constructor() {
/** 透明填充 颜色*/ /** 透明填充 颜色*/
this.transparentColor = 'rgba(0,0,0,0)'; this.transparentColor = 'rgba(0,0,0,0)';
/** 默认背景 颜色*/ /** 默认背景 颜色*/
this.backgroundColor = '#000000'; this.backgroundColor = '#000000';
/** 默认提示背景 颜色*/ /** 默认提示背景 颜色*/
this.tipBackgroundColor = 'yellow'; this.tipBackgroundColor = 'yellow';
/** 默认边线 颜色*/ /** 默认边线 颜色*/
this.sidelineColor = '#FFFFFF'; this.sidelineColor = '#FFFFFF';
/** 默认字体 大小*/ /** 默认字体 大小*/
this.textFontSize = 10; this.textFontSize = 10;
/** 默认字体 族类*/ /** 默认字体 族类*/
this.fontFamily = '宋体'; this.fontFamily = '宋体';
/** 默认字体颜色*/ /** 默认字体颜色*/
this.textFontColor = '#C0C0C0'; this.textFontColor = '#C0C0C0';
/** 默认提示字体大小*/ /** 默认提示字体大小*/
this.arrowFontSize = 10; this.arrowFontSize = 10;
/** 列车长度*/ /** 列车长度*/
this.trainWidth = 40; this.trainWidth = 40;
/** 列车高度*/ /** 列车高度*/
this.trainHeight = 20; this.trainHeight = 20;
/** 列车字号*/ /** 列车字号*/
this.trainTextFontSize = 12; this.trainTextFontSize = 12;
/** 列车HDSA字号*/ /** 列车HDSA字号*/
this.trainHSDATextFontSize = 9; this.trainHSDATextFontSize = 9;
/** 列车信号的半径*/ /** 列车信号的半径*/
this.trainConflictR = 3; this.trainConflictR = 3;
/** 列车信号距离车的距离*/ /** 列车信号距离车的距离*/
this.trainConflictDistance = 5; this.trainConflictDistance = 5;
/** 列车车头比车身高出的长度;上下相比车体伸出去的边框*/ /** 列车车头比车身高出的长度;上下相比车体伸出去的边框*/
this.trainMoreLength = 0; this.trainMoreLength = 0;
/** 列车和车头之间的间距*/ /** 列车和车头之间的间距*/
this.trainHeadDistance = 4; this.trainHeadDistance = 4;
/** 列车竖杠的宽度*/ /** 列车竖杠的宽度*/
this.trainConntWidth = 3; this.trainConntWidth = 3;
/** 列车竖杠和方向之间的间隔*/ /** 列车竖杠和方向之间的间隔*/
this.trainPadding = 4; this.trainPadding = 4;
/** 列车方向的宽度*/ /** 列车方向的宽度*/
this.trainArrowWidth = 6; this.trainArrowWidth = 6;
/** 列车和区段之间的距离*/ /** 列车和区段之间的距离*/
this.trainDistance = 30; this.trainDistance = 30;
/** 列车边线颜色*/ /** 列车边线颜色*/
this.trainSidelineColor = '#C0C0C0'; this.trainSidelineColor = '#C0C0C0';
/** 列车背景*/ /** 列车背景*/
this.trainBackground = '#000000'; this.trainBackground = '#000000';
/** 列车 灰色*/ /** 列车 灰色*/
this.trainGrayColor = '#C0C0C0'; this.trainGrayColor = '#C0C0C0';
/** 列车 白色*/ /** 列车 白色*/
this.trainWitheColor = '#FFFFFF'; this.trainWitheColor = '#FFFFFF';
/** 列车 棕色*/ /** 列车 棕色*/
this.trainBrownColor = '#A0522D'; this.trainBrownColor = '#A0522D';
/** 列车 黄色*/ /** 列车 黄色*/
this.trainYellowColor = '#FFFF00'; this.trainYellowColor = '#FFFF00';
/** 列车 棕灰色 */ /** 列车 棕灰色 */
this.trainBrown1Color = '#725A64'; this.trainBrown1Color = '#725A64';
/** 列车 绿色*/ /** 列车 绿色*/
this.trainGreenColor = '#00FF00'; this.trainGreenColor = '#00FF00';
/** 列车 蓝色*/ /** 列车 蓝色*/
this.trainBlueColor = '#3265FF'; this.trainBlueColor = '#3265FF';
/** 列车 红色*/ /** 列车 红色*/
this.trainRedColor = '#FF0000'; this.trainRedColor = '#FF0000';
/** 列车 橘色*/ /** 列车 橘色*/
this.trainOrangeColor = 'orange'; this.trainOrangeColor = 'orange';
/** 列车 紫色*/ /** 列车 紫色*/
this.trainPurpleColor = 'purple'; this.trainPurpleColor = 'purple';
/** 列车 粉色*/ /** 列车 粉色*/
this.trainPinkColor = 'pink'; this.trainPinkColor = 'pink';
/** 车次窗高度*/ /** 车次窗高度*/
this.trainWindowWidth = 40; this.trainWindowWidth = 40;
/** 车次窗高度*/ /** 车次窗高度*/
this.trainWindowHeight = 15; this.trainWindowHeight = 15;
/** 列车文字颜色*/ /** 列车文字颜色*/
this.trainTextColor = '#ffffff'; this.trainTextColor = '#ffffff';
/** 灯包围框样式 */ /** 灯包围框样式 */
this.arcBorderStyle = { this.arcBorderStyle = {
lineDash: [3, 3], lineDash: [3, 3],
stroke: '#FFFFFF', stroke: '#FFFFFF',
fill: 'rgba(0,0,0,0)' fill: 'rgba(0,0,0,0)'
}; };
/** 字体包围框样式 */ /** 字体包围框样式 */
this.textBorderStyle={ this.textBorderStyle = {
lineDash: [3, 3], lineDash: [3, 3],
stroke: '#FFFFFF', stroke: '#FFFFFF',
fill: '#00FFFF' fill: '#00FFFF'
}; };
} }
} }

View File

@ -270,10 +270,10 @@ class SkinCode extends defaultStyle {
fontWeight: 'normal', // 控制模式字体粗细 fontWeight: 'normal', // 控制模式字体粗细
textAlign: 'middle', // 控制模式水平对齐 textAlign: 'middle', // 控制模式水平对齐
textVerticalAlign: 'top', // 控制模式垂直对齐 textVerticalAlign: 'top', // 控制模式垂直对齐
centerControlText: '中控', // 中控文字内容 centerControlText: '中控', // 中控文字内容
substationControlText: '站控', // 站控文字内容 substationControlText: '站控', // 站控文字内容
emergencyControlText:'紧急站控', // 紧急站控文字内容 emergencyControlText:'紧急站控', // 紧急站控文字内容
interconnectedControlText:'连锁控' // 连锁控文字内容 interconnectedControlText:'连锁控' // 连锁控文字内容
// stationCenterControlText: '站中控', // 站中控文字内容 // stationCenterControlText: '站中控', // 站中控文字内容
// generalAlarmControlText: '总报警' // 总报警文字内容 // generalAlarmControlText: '总报警' // 总报警文字内容
}, },
@ -326,7 +326,16 @@ class SkinCode extends defaultStyle {
// }, // },
kmPostShow: true, // 公里标显示 kmPostShow: true, // 公里标显示
kilometerPosition: 'down', // 公里标位置 kilometerPosition: 'down', // 公里标位置
fontWeight: 'bold' // 文字错细 fontWeight: 'bold', // 文字错细
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
controlColor: '#FFFF00' // 控制灯颜色
}
}; };
this[deviceType.Switch] = { this[deviceType.Switch] = {

View File

@ -274,10 +274,10 @@ class SkinCode extends defaultStyle {
fontWeight: 'normal', // 字体粗细 fontWeight: 'normal', // 字体粗细
textAlign: 'middle', // 字体水平对齐 textAlign: 'middle', // 字体水平对齐
textVerticalAlign: 'top', // 字体垂直对齐 textVerticalAlign: 'top', // 字体垂直对齐
centerControlText: '中控', // 中控文字内容 centerControlText: '中控', // 中控文字内容
substationControlText: '站控', // 站控文字内容 substationControlText: '站控', // 站控文字内容
emergencyControlText:'紧急站控', // 紧急站控文字内容 emergencyControlText:'紧急站控', // 紧急站控文字内容
interconnectedControlText:'连锁控' // 连锁控文字内容 interconnectedControlText:'连锁控' // 连锁控文字内容
// stationCenterControlText: '站中控', // 站中控文字内容 // stationCenterControlText: '站中控', // 站中控文字内容
// generalAlarmControlText: '总报警' // 总报警文字内容 // generalAlarmControlText: '总报警' // 总报警文字内容
}, },
@ -321,7 +321,16 @@ class SkinCode extends defaultStyle {
// show: true // 公里标名称显示 // show: true // 公里标名称显示
// }, // },
kmPostShow: false, // 公里标显示 kmPostShow: false, // 公里标显示
kilometerPosition: 'up' // 公里标朝向 kilometerPosition: 'up', // 公里标朝向
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
controlColor: '#FFFF00' // 控制灯颜色
}
}; };
this[deviceType.Switch] = { this[deviceType.Switch] = {
@ -391,18 +400,6 @@ class SkinCode extends defaultStyle {
} }
}; };
this[deviceType.ButtonControl] = {
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
controlColor: '#FFFF00' // 控制灯颜色
}
};
this[deviceType.Line] = { this[deviceType.Line] = {
lineColor: '#FFFFFF' // 线条颜色 lineColor: '#FFFFFF' // 线条颜色
}; };

View File

@ -271,10 +271,10 @@ class SkinCode extends defaultStyle {
fontWeight: 'normal', // 字体粗细 fontWeight: 'normal', // 字体粗细
textAlign: 'middle', // 字体水平对齐 textAlign: 'middle', // 字体水平对齐
textVerticalAlign: 'top', // 字体垂直对齐 textVerticalAlign: 'top', // 字体垂直对齐
centerControlText: '中控', // 中控文字内容 centerControlText: '中控', // 中控文字内容
substationControlText: '站控', // 站控文字内容 substationControlText: '站控', // 站控文字内容
emergencyControlText:'紧急站控', // 紧急站控文字内容 emergencyControlText:'紧急站控', // 紧急站控文字内容
interconnectedControlText:'连锁控' // 连锁控文字内容 interconnectedControlText:'连锁控' // 连锁控文字内容
// stationCenterControlText: '站中控', // 站中控文字内容 // stationCenterControlText: '站中控', // 站中控文字内容
// generalAlarmControlText: '总报警' // 总报警文字内容 // generalAlarmControlText: '总报警' // 总报警文字内容
}, },
@ -318,7 +318,16 @@ class SkinCode extends defaultStyle {
// show: true // 公里标名称显示 // show: true // 公里标名称显示
// }, // },
kmPostShow: false, // 公里标显示 kmPostShow: false, // 公里标显示
kilometerPosition: 'up' // 公里标朝向 kilometerPosition: 'up', // 公里标朝向
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
controlColor: '#FFFF00' // 控制灯颜色
}
}; };
this[deviceType.Switch] = { this[deviceType.Switch] = {

View File

@ -308,7 +308,16 @@ class SkinCode extends defaultStyle {
// show: true // 公里标名称显示 // show: true // 公里标名称显示
// }, // },
kmPostShow: true, // 公里标显示 kmPostShow: true, // 公里标显示
kilometerPosition: 'up' // 公里标朝向 kilometerPosition: 'up', // 公里标朝向
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
controlColor: '#FFFF00' // 控制灯颜色
}
}; };
this[deviceType.Switch] = { this[deviceType.Switch] = {

View File

@ -11,7 +11,6 @@ const deviceType = {
StationStand: 'StationStand', StationStand: 'StationStand',
StationControl: 'StationControl', StationControl: 'StationControl',
StationCounter: 'StationCounter', StationCounter: 'StationCounter',
ButtonControl: 'ButtonControl',
StationDelayUnlock: 'StationDelayUnlock', StationDelayUnlock: 'StationDelayUnlock',
Train: 'Train', Train: 'Train',
TrainWindow: 'TrainWindow', TrainWindow: 'TrainWindow',

View File

@ -1,67 +0,0 @@
/*
* lC区域控制模式
*/
import Group from 'zrender/src/container/Group';
import EControl from '../element/EControl';
export default class ButtonControl extends Group {
constructor(model, style) {
super();
this.z = 20;
this._code = model.code;
this._type = model._type;
this.zlevel = 10;
this.model = model;
this.style = style;
this.create();
this.setState(model);
}
create() {
const model = this.model;
this.control = new EControl({
zlevel: this.zlevel,
z: this.z,
arc: {
shape: {
cx: model.position.x,
cy: model.position.y,
r: this.style.ButtonControl.lamp.radiusR
},
lineWidth: 0,
fill: this.style.ButtonControl.lamp.controlColor
},
text: {
position: [0, 0],
x: model.position.x,
y: model.position.y + this.style.ButtonControl.lamp.radiusR + this.style.ButtonControl.text.distance,
fontWeight: this.style.ButtonControl.text.fontWeight,
fontSize: this.style.ButtonControl.text.fontSize,
fontFamily: this.style.fontFamily,
text: model.text || '按图折返',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: this.style
});
this.add(this.control);
}
// 设置状态
setState(model) {
}
getShapeTipPoint() {
if (this.control) {
var distance = 2;
var rect = this.control.getBoundingRect();
return {
x: rect.x + rect.width / 2,
y: rect.y - distance
};
}
return null;
}
}

View File

@ -1,26 +0,0 @@
// import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
/** 名称元素*/
export default function ETextName(model) {
const TextName = new Text({
_subType: 'Text',
zlevel: model.zlevel,
z: model.z,
silent: model.silent || false,
style: {
x: model.x,
y: model.y,
fontWeight: model.fontWeight,
fontSize: model.fontSize,
fontFamily: model.fontFamily,
text: model.text,
textStrokeWidth: model.textStrokeWidth,
textFill: model.textFill,
textAlign: model.textAlign,
textPosition: model.textPosition || 'inside',
textVerticalAlign: model.textVerticalAlign || null
}
});
return TextName;
}

View File

@ -3,8 +3,8 @@
*/ */
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import ETextName from '../element/ETextName'; import ETextName from '../element/ETextName';
import EHighlight from '../element/EHighlight'; // 名称文字 (共有) // import EHighlight from '../element/EHighlight'; // 名称文字 (共有)
import EturnBack from './EturnBack'; import EControl from '../element/EControl';
export default class Station extends Group { export default class Station extends Group {
constructor(model, style) { constructor(model, style) {
@ -16,9 +16,9 @@ export default class Station extends Group {
this.model = model; this.model = model;
this.style = style; this.style = style;
this.create(); this.create();
this.createPullBack(); // 创建按图折返 // this.createTurnBack(); // 创建按图折返
this.setState(model); this.setState(model);
this.checkIsDrawMap(); // this.checkIsDrawMap();
} }
create() { create() {
@ -67,23 +67,35 @@ export default class Station extends Group {
} }
} }
} }
createPullBack() { createTurnBack() { // 创建按图折返
const model = this.model; const model = this.model;
const style = this.style; const style = this.style;
if (model.visible && model.isCreateTurnBack) { if (model.visible && model.isCreateTurnBack) {
this.turnBack = new EturnBack({ this.turnBack = new EControl({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
position: [0, 0], arc: {
x: model.position.x, shape: {
y: model.position.y, cx: model.pullBackModel.position.x,
fontWeight: model.fontWeight, cy: model.pullBackModel.position.y,
fontSize: model.kmPostFont || 18, r: style.Station.lamp.radiusR
fontFamily: style.fontFamily, },
text: model.kmPost, lineWidth: 0,
textAlign: 'middle', fill: style.Station.lamp.controlColor
textVerticalAlign: 'top', },
textFill: model.kmPostFontColor text: {
position: [0, 0],
x: model.pullBackModel.position.x,
y: model.pullBackModel.position.y + style.Station.lamp.radiusR + style.Station.text.distance,
fontWeight: style.Station.text.fontWeight,
fontSize: style.Station.text.fontSize,
fontFamily: style.fontFamily,
text: '按图折返',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: this.style
}); });
this.add(this.turnBack); this.add(this.turnBack);
} }
@ -100,13 +112,13 @@ export default class Station extends Group {
this.highlight && this.highlight.drawSelected(selected); this.highlight && this.highlight.drawSelected(selected);
} }
checkIsDrawMap() { // checkIsDrawMap() {
const path = window.location.href; // const path = window.location.href;
if (path.includes('/map/draw')) { // if (path.includes('/map/draw')) {
this.highlight = new EHighlight(this); // this.highlight = new EHighlight(this);
this.add(this.highlight); // this.add(this.highlight);
this.on('mouseout', () => { this.highlight.mouseout(); }); // this.on('mouseout', () => { this.highlight.mouseout(); });
this.on('mouseover', () => { this.highlight.mouseover(); }); // this.on('mouseover', () => { this.highlight.mouseover(); });
} // }
} // }
} }

View File

@ -6,101 +6,101 @@ import Rect from 'zrender/src/graphic/shape/Rect';
/** lc zc limit 单灯元素*/ /** lc zc limit 单灯元素*/
export default class EControl extends Group { export default class EControl extends Group {
constructor(model) { constructor(model) {
super(); super();
this.model = model; this.model = model;
this.zlevel = model.zlevel; this.zlevel = model.zlevel;
this.z = model.z; this.z = model.z;
this.style = model.style; this.style = model.style;
this.textStyle = model.text; this.textStyle = model.text;
this.arcStyle = model.arc; this.arcStyle = model.arc;
this.create(); this.create();
} }
create() { create() {
this.control = new Arc({ this.control = new Arc({
_subType: 'Control', _subType: 'Control',
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
shape: this.arcStyle.shape, shape: this.arcStyle.shape,
style: { style: {
lineWidth: this.arcStyle.lineWidth, lineWidth: this.arcStyle.lineWidth,
fill: this.arcStyle.fill fill: this.arcStyle.fill
}, },
onmouseover: this.arcStyle.mouseover, onmouseover: this.arcStyle.mouseover,
onmouseout: this.arcStyle.mouseout onmouseout: this.arcStyle.mouseout
}); });
this.text = new Text({ this.text = new Text({
_subType: 'Text', _subType: 'Text',
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
position: this.textStyle.position, position: this.textStyle.position,
style: { style: {
x: this.textStyle.x, x: this.textStyle.x,
y: this.textStyle.y, y: this.textStyle.y,
fontWeight: this.textStyle.fontWeight, fontWeight: this.textStyle.fontWeight,
fontSize: this.textStyle.fontSize, fontSize: this.textStyle.fontSize,
fontFamily: this.textStyle.fontFamily, fontFamily: this.textStyle.fontFamily,
text: this.textStyle.text, text: this.textStyle.text,
textFill: this.textStyle.textFill, textFill: this.textStyle.textFill,
textAlign: this.textStyle.textAlign, textAlign: this.textStyle.textAlign,
textVerticalAlign: this.textStyle.textVerticalAlign textVerticalAlign: this.textStyle.textVerticalAlign
}, },
onmouseover: this.textStyle.mouseover, onmouseover: this.textStyle.mouseover,
onmouseout: this.textStyle.mouseout onmouseout: this.textStyle.mouseout
}); });
const arcRect = this.getArcBoundingRect(); const arcRect = this.getArcBoundingRect();
const textRect = this.getTextBoundingRect(); const textRect = this.getTextBoundingRect();
this.arcBorder = new Rect({ this.arcBorder = new Rect({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
silent: true, silent: true,
shape: arcRect, shape: arcRect,
style: { style: {
lineDash: this.style.arcBorderStyle.lineDash, lineDash: this.style.arcBorderStyle.lineDash,
stroke: this.style.arcBorderStyle.stroke, stroke: this.style.arcBorderStyle.stroke,
fill: this.style.arcBorderStyle.fill fill: this.style.arcBorderStyle.fill
} }
}); });
this.textBorder = new Rect({ this.textBorder = new Rect({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z-1, z: this.z - 1,
silent: true, silent: true,
shape: textRect, shape: textRect,
style: { style: {
lineDash: this.style.textBorderStyle.lineDash, lineDash: this.style.textBorderStyle.lineDash,
stroke: this.style.textBorderStyle.stroke, stroke: this.style.textBorderStyle.stroke,
fill: this.style.textBorderStyle.fill fill: this.style.textBorderStyle.fill
} }
}); });
this.add(this.control); this.add(this.control);
this.add(this.text); this.add(this.text);
this.add(this.textBorder); this.add(this.textBorder);
this.add(this.arcBorder); this.add(this.arcBorder);
this.textBorder.hide(); this.textBorder.hide();
this.arcBorder.hide(); this.arcBorder.hide();
} }
setTextBorder(flag) { setTextBorder(flag) {
flag?this.textBorder.show():this.textBorder.hide(); flag ? this.textBorder.show() : this.textBorder.hide();
} }
setArcBorder(flag) { setArcBorder(flag) {
flag?this.arcBorder.show():this.arcBorder.hide(); flag ? this.arcBorder.show() : this.arcBorder.hide();
} }
getTextBoundingRect() { getTextBoundingRect() {
return createBoundingRect(this.text); return createBoundingRect(this.text);
} }
getArcBoundingRect() { getArcBoundingRect() {
return createBoundingRect(this.control); return createBoundingRect(this.control);
} }
setControlColor(color) { setControlColor(color) {
if (color) { if (color) {
this.control.setStyle('fill', color); this.control.setStyle('fill', color);
} }
} }
setTextColor(color) { setTextColor(color) {
if (color) { if (color) {
this.text.setStyle('textFill', color); this.text.setStyle('textFill', color);
} }
} }
} }

View File

@ -9,7 +9,6 @@ import LcControl from './LcControl/index.js';
import LimitControl from './LimitControl/index.js'; import LimitControl from './LimitControl/index.js';
import Switch from './Switch/index.js'; import Switch from './Switch/index.js';
import ZcControl from './ZcControl/index.js'; import ZcControl from './ZcControl/index.js';
import ButtonControl from './ButtonControl/index.js';
import StationCounter from './StationCounter/index.js'; import StationCounter from './StationCounter/index.js';
import StationDelayUnlock from './StationDelayUnlock/index.js'; import StationDelayUnlock from './StationDelayUnlock/index.js';
import StationStand from './StationStand/index.js'; import StationStand from './StationStand/index.js';
@ -31,7 +30,6 @@ mapShape[deviceType.LcControl] = LcControl;
mapShape[deviceType.LimitControl] = LimitControl; mapShape[deviceType.LimitControl] = LimitControl;
mapShape[deviceType.Switch] = Switch; mapShape[deviceType.Switch] = Switch;
mapShape[deviceType.ZcControl] = ZcControl; mapShape[deviceType.ZcControl] = ZcControl;
mapShape[deviceType.ButtonControl] = ButtonControl;
mapShape[deviceType.StationCounter] = StationCounter; mapShape[deviceType.StationCounter] = StationCounter;
mapShape[deviceType.StationDelayUnlock] = StationDelayUnlock; mapShape[deviceType.StationDelayUnlock] = StationDelayUnlock;
mapShape[deviceType.StationStand] = StationStand; mapShape[deviceType.StationStand] = StationStand;

View File

@ -87,10 +87,6 @@ export function parser(data, skinCode) {
mapDevice[elem.code] = createDevice(deviceType.ZcControl, elem, propConvert); mapDevice[elem.code] = createDevice(deviceType.ZcControl, elem, propConvert);
}, this); }, this);
zrUtil.each(data.buttonList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.ButtonControl, elem, propConvert);
}, this);
zrUtil.each(data.lcList || [], elem => { zrUtil.each(data.lcList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.LcControl, elem, propConvert); mapDevice[elem.code] = createDevice(deviceType.LcControl, elem, propConvert);
}, this); }, this);
@ -198,7 +194,6 @@ export function updateMapData(state, model) {
case deviceType.ZcControl: updateForList(model, state, 'zcControlList'); break; case deviceType.ZcControl: updateForList(model, state, 'zcControlList'); break;
case deviceType.StationDelayUnlock:updateForList(model, state, 'stationDelayUnlockList'); break; case deviceType.StationDelayUnlock:updateForList(model, state, 'stationDelayUnlockList'); break;
case deviceType.LcControl: updateForList(model, state, 'lcControlList'); break; case deviceType.LcControl: updateForList(model, state, 'lcControlList'); break;
case deviceType.ButtonControl: updateForList(model, state, 'buttonList'); break;
case deviceType.LimitControl: updateForList(model, state, 'tempSpeedLimitList'); break; case deviceType.LimitControl: updateForList(model, state, 'tempSpeedLimitList'); break;
case deviceType.ImageControl: updateForList(model, state, 'imageControl'); break; case deviceType.ImageControl: updateForList(model, state, 'imageControl'); break;
case deviceType.Train: updateForList(model, state, 'trainList'); break; case deviceType.Train: updateForList(model, state, 'trainList'); break;

View File

@ -41,54 +41,6 @@
</el-button-group> </el-button-group>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane v-if="editModel.isCreateControlMode" class="view-control" label="控制模式" name="three">
<div style="height: calc(100% - 46px);">
<el-scrollbar wrap-class="scrollbar-wrapper">
111
</el-scrollbar>
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</div>
</el-tab-pane>
<el-tab-pane v-if="editModel.isCreateCounter" class="view-control" label="计数器" name="four">
<div style="height: calc(100% - 46px);">
<el-scrollbar wrap-class="scrollbar-wrapper">
222
</el-scrollbar>
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</div>
</el-tab-pane>
<el-tab-pane v-if="editModel.isCreateDelayedUnlock" class="view-control" label="延迟解锁" name="five">
<div style="height: calc(100% - 46px);">
<el-scrollbar wrap-class="scrollbar-wrapper">
333
</el-scrollbar>
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</div>
</el-tab-pane>
<el-tab-pane v-if="editModel.isCreateTurnBack" class="view-control" label="按图折返" name="six">
<div style="height: calc(100% - 46px);">
<el-scrollbar wrap-class="scrollbar-wrapper">
<config-list ref="pullBackForm" :form="pullBackForm" :form-model="pullBackModel" :rules="pullBackRules" />
</el-scrollbar>
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="editPullBack">{{ $t('map.updateObj') }}</el-button>
</el-button-group>
</div>
</el-tab-pane>
</el-tabs> </el-tabs>
</template> </template>
@ -136,17 +88,15 @@ export default {
position: { x: 0, y: 0 }, position: { x: 0, y: 0 },
controlled:false, controlled:false,
isCreateControlMode:false, isCreateControlMode:false,
isCreateCounter:false, // isCreateCounter:false,
isCreateDelayedUnlock:false, // isCreateDelayedUnlock:false,
isCreateTurnBack:false isCreateTurnBack:false,
turnBackList: [], //
controlModePoint: { x: 0, y: 0 } //
}, },
addModel: { addModel: {
sectionCode: [] sectionCode: []
}, },
pullBackModel: {
code: '',
position: { x: 0, y: 0 }
},
skins: [], skins: [],
mergeRules: { mergeRules: {
sectionCode: [ sectionCode: [
@ -186,7 +136,9 @@ export default {
{ prop: 'kmRange', label: this.$t('map.stationKmRange'), type: 'number', min: 0, placeholder: this.$t('tip.meter') }, { prop: 'kmRange', label: this.$t('map.stationKmRange'), type: 'number', min: 0, placeholder: this.$t('tip.meter') },
{ prop: 'kmPost', label: this.$t('map.stationKmPost'), type: 'input' }, { prop: 'kmPost', label: this.$t('map.stationKmPost'), type: 'input' },
{ prop: 'kmPostFont', label: this.$t('map.stationKmPostFont'), type: 'font', placeholder: this.$t('tip.kilometerFont') }, { prop: 'kmPostFont', label: this.$t('map.stationKmPostFont'), type: 'font', placeholder: this.$t('tip.kilometerFont') },
{ prop: 'kmPostFontColor', label: this.$t('map.stationKmPostFontColor'), type: 'color' } { prop: 'kmPostFontColor', label: this.$t('map.stationKmPostFontColor'), type: 'color' },
{ prop: 'isCreateControlMode', label: '控制模式:', type: 'checkbox' },
{ prop: 'isCreateTurnBack', label: '按图折返:', type: 'checkbox' }
] ]
}, },
map: { map: {
@ -196,11 +148,7 @@ export default {
{ prop: 'centralized', label: this.$t('map.centralized'), type: 'checkbox', disabled:this.editModel.controlled, change:true, deviceChange:this.changeCentralized }, { 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: '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' }
{ prop: 'isCreateControlMode', label: '是否创建控制模式', type: 'checkbox' },
{ prop: 'isCreateCounter', label: '是否创建计数器', type: 'checkbox' },
{ prop: 'isCreateDelayedUnlock', label: '是否创建延迟解锁', type: 'checkbox' },
{ prop: 'isCreateTurnBack', label: '是否创建按图折返', type: 'checkbox' }
] ]
} }
} }
@ -228,41 +176,6 @@ export default {
] ]
}; };
}, },
pullBackForm() {
return {
labelWidth: '120px',
items: {
code: {
name: '',
item: []
},
draw: {
name: this.$t('map.drawData'),
item: [
{ prop: 'code', label: `${this.$t('map.code')}`, type: 'select', optionLabel: 'code', optionValue: 'code', options: this.buttonList, disabled: true },
{ prop: 'position', label: '坐标偏移量:', type: 'coordinate', width: '110px', children: [
{ 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' }
] }
]
},
map: {
name: this.$t('map.mapData'),
item: []
}
}
};
},
pullBackRules() {
return {
'position.x': [
{ required: true, message: this.$t('rules.pleaseEnterXCoordinate'), trigger: 'blur' }
],
'position.y': [
{ required: true, message: this.$t('rules.pleaseEnterYCoordinate'), trigger: 'blur' }
]
};
},
PhysicalSectionList() { PhysicalSectionList() {
let list = []; let list = [];
if (this.sectionList && this.sectionList.length) { if (this.sectionList && this.sectionList.length) {
@ -421,6 +334,13 @@ export default {
this.$refs['dataform'].validate((valid) => { this.$refs['dataform'].validate((valid) => {
if (valid) { if (valid) {
const data = Object.assign({_type: 'Station'}, this.editModel); const data = Object.assign({_type: 'Station'}, this.editModel);
if (data.isCreateTurnBack && !data.pullBackModel.code) {
data.pullBackModel.position = {
x: data.position.x + 100,
y: data.position.y + 50
};
data.pullBackModel.code = getUID('turnBackCode');
}
this.$emit('updateMapModel', data); this.$emit('updateMapModel', data);
} }
}); });
@ -441,9 +361,6 @@ export default {
_that.$message.info(this.$t('tip.cancelledDelete')); _that.$message.info(this.$t('tip.cancelledDelete'));
}); });
} }
},
editPullBack() {
console.log(111);
} }
} }
}; };