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 {
constructor() {
/** 透明填充 颜色*/
this.transparentColor = 'rgba(0,0,0,0)';
constructor() {
/** 透明填充 颜色*/
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字号*/
this.trainHSDATextFontSize = 9;
/** 列车HDSA字号*/
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 = {
lineDash: [3, 3],
stroke: '#FFFFFF',
fill: 'rgba(0,0,0,0)'
};
/** 字体包围框样式 */
this.textBorderStyle={
lineDash: [3, 3],
stroke: '#FFFFFF',
fill: '#00FFFF'
};
}
/** 灯包围框样式 */
this.arcBorderStyle = {
lineDash: [3, 3],
stroke: '#FFFFFF',
fill: 'rgba(0,0,0,0)'
};
/** 字体包围框样式 */
this.textBorderStyle = {
lineDash: [3, 3],
stroke: '#FFFFFF',
fill: '#00FFFF'
};
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -41,54 +41,6 @@
</el-button-group>
</div>
</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>
</template>
@ -136,17 +88,15 @@ export default {
position: { x: 0, y: 0 },
controlled:false,
isCreateControlMode:false,
isCreateCounter:false,
isCreateDelayedUnlock:false,
isCreateTurnBack:false
// isCreateCounter:false,
// isCreateDelayedUnlock:false,
isCreateTurnBack:false,
turnBackList: [], //
controlModePoint: { x: 0, y: 0 } //
},
addModel: {
sectionCode: []
},
pullBackModel: {
code: '',
position: { x: 0, y: 0 }
},
skins: [],
mergeRules: {
sectionCode: [
@ -186,7 +136,9 @@ export default {
{ 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: '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: {
@ -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: '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: 'isCreateControlMode', label: '是否创建控制模式', type: 'checkbox' },
{ prop: 'isCreateCounter', label: '是否创建计数器', type: 'checkbox' },
{ prop: 'isCreateDelayedUnlock', label: '是否创建延迟解锁', type: 'checkbox' },
{ prop: 'isCreateTurnBack', label: '是否创建按图折返', type: 'checkbox' }
{ prop: 'runPlanName', label: this.$t('map.stationRunPlanName'), type: 'input' }
]
}
}
@ -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() {
let list = [];
if (this.sectionList && this.sectionList.length) {
@ -421,6 +334,13 @@ export default {
this.$refs['dataform'].validate((valid) => {
if (valid) {
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);
}
});
@ -441,9 +361,6 @@ export default {
_that.$message.info(this.$t('tip.cancelledDelete'));
});
}
},
editPullBack() {
console.log(111);
}
}
};