Merge branch 'dev' of git.cloud.tencent.com:joylink/jl-nclient into dev
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 6.1 KiB |
BIN
src/assets/ibp_images/elevatorArrow.png
Normal file
After Width: | Height: | Size: 794 B |
BIN
src/assets/ibp_images/elevatorArrow_on.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
src/assets/ibp_images/rotate_black.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
src/assets/ibp_images/rotate_red.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
src/assets/ibp_images/telephone_terminal.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
@ -54,6 +54,7 @@ export default {
|
||||
trainWindow: 'train window',
|
||||
line: 'line',
|
||||
text: 'text',
|
||||
button: 'button',
|
||||
|
||||
mapName: 'Name of the map:',
|
||||
skinName: 'Skin style:',
|
||||
@ -189,6 +190,8 @@ export default {
|
||||
linkLp: 'Link Start point coordinates:',
|
||||
linkRp: 'Link End point coordinates:',
|
||||
|
||||
linePoint: 'point:',
|
||||
|
||||
rulesChange: 'The rules change',
|
||||
splitMerge: 'Split/merge',
|
||||
linkSet: 'The Link set',
|
||||
|
@ -48,6 +48,7 @@ export default {
|
||||
zcZoneControl: 'zc区域控制',
|
||||
temporaryLimit: '全线临时限速',
|
||||
lcControl: 'Lc控制',
|
||||
buttonControl: '按钮',
|
||||
image: '图片',
|
||||
station: '车站',
|
||||
controlMode: '控制模式',
|
||||
@ -58,6 +59,7 @@ export default {
|
||||
trainWindow: '车次窗',
|
||||
line: '线条',
|
||||
text: '文字',
|
||||
button: '按钮',
|
||||
|
||||
mapName: '地图名称:',
|
||||
skinName: '皮肤:',
|
||||
@ -76,6 +78,7 @@ export default {
|
||||
lineCoding: '线条编码:',
|
||||
lineType: '线条类型:',
|
||||
lineWidth: '线条宽度:',
|
||||
linePoint: '坐标:',
|
||||
segmentCoordinates: '区段显示坐标:',
|
||||
|
||||
publishMapCreation: '从发布地图创建',
|
||||
@ -133,6 +136,8 @@ export default {
|
||||
failedCreateSignal: '创建自动信号失败',
|
||||
automaticSignalUpdateSucceeded: '更新自动信号成功!',
|
||||
automaticSignalUpdateFailed: '更新自动信号失败',
|
||||
interconnected: '联锁控名称',
|
||||
buttonType: '所属类型',
|
||||
|
||||
stationName: '车站名称:',
|
||||
|
||||
@ -341,6 +346,7 @@ export default {
|
||||
delayUnlockPosition: '延迟解锁坐标:',
|
||||
trainWindowPoints: '车次窗坐标:',
|
||||
textPoints: '坐标:',
|
||||
buttonText: '内容',
|
||||
|
||||
textCode: '文字编码:',
|
||||
textContent: '文本内容:',
|
||||
|
@ -252,6 +252,9 @@ export default {
|
||||
|
||||
enterScale: '请输入缩放比例',
|
||||
enterXOffset: '请输入X偏移',
|
||||
enterYOffset: '请输入Y偏移'
|
||||
enterYOffset: '请输入Y偏移',
|
||||
|
||||
pleaseSelectButtonType: '请选择按钮类型',
|
||||
pleaseSelectButtonContent: '请输入内容'
|
||||
|
||||
};
|
||||
|
@ -60,12 +60,11 @@ class IbpPan {
|
||||
return defaultStateDict;
|
||||
}
|
||||
setMap(config, ibpDevice) {
|
||||
// 保存皮肤类型
|
||||
// 保存平移缩放数据
|
||||
if (config.config) {
|
||||
this.$options.scaleRate = config.scaling;
|
||||
this.$options.offsetX = config.origin.x;
|
||||
this.$options.offsetY = config.origin.y;
|
||||
this.$painter.updateTransform({ scaleRate: config.scaling, offsetX: config.origin.x, offsetY: config.origin.y });
|
||||
}
|
||||
|
||||
// 保存原始数据
|
||||
@ -86,6 +85,7 @@ class IbpPan {
|
||||
// 视图加载完成 回调
|
||||
if (this.methods.viewLoaded instanceof Function) { this.methods.viewLoaded(this.ibpDevice); }
|
||||
|
||||
this.$painter.updateTransform(this.$options);
|
||||
}
|
||||
|
||||
setDefaultState() {
|
||||
|
@ -112,7 +112,7 @@ class Painter {
|
||||
* 更新transform变化
|
||||
* @param {*} opt
|
||||
*/
|
||||
updateTransform(opt,) {
|
||||
updateTransform(opt) {
|
||||
this.$transformHandle.updateTransform(opt);
|
||||
}
|
||||
|
||||
|
@ -20,11 +20,19 @@ export default class alarm extends Group {
|
||||
image: alarmpic,
|
||||
x: model.point.x,
|
||||
y: model.point.y,
|
||||
width: 70,
|
||||
width: 71,
|
||||
height: 74
|
||||
}
|
||||
});
|
||||
this.add(this.imageBg);
|
||||
this.transformScale();
|
||||
}
|
||||
|
||||
/** 缩放按钮 */
|
||||
transformScale() {
|
||||
this.imageBg.origin = [this.model.point.x, this.model.point.y];
|
||||
this.imageBg.scale =[this.model.width/71, this.model.width/71];
|
||||
this.imageBg.dirty();
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
|
@ -26,6 +26,7 @@ export default class button extends Group {
|
||||
]);
|
||||
constructor(device) {
|
||||
super();
|
||||
this.event = device.event;
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.create();
|
||||
@ -44,6 +45,14 @@ export default class button extends Group {
|
||||
}
|
||||
});
|
||||
this.add(this.imageBg);
|
||||
this.transformScale();
|
||||
}
|
||||
|
||||
/** 缩放按钮 */
|
||||
transformScale() {
|
||||
this.imageBg.origin = [this.model.point.x, this.model.point.y];
|
||||
this.imageBg.scale =[this.model.width/70, this.model.width/70];
|
||||
this.imageBg.dirty();
|
||||
}
|
||||
|
||||
getImagePic() {
|
||||
@ -52,7 +61,7 @@ export default class button extends Group {
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.arrow.attr('draggable', true);
|
||||
this.imageBg.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
@ -96,15 +105,17 @@ export default class button extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
mousedown() {
|
||||
this.event.disable();
|
||||
console.log('鼠标按下');
|
||||
}
|
||||
mousemove(e) {
|
||||
mousemove() {
|
||||
}
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + e.offsetX;
|
||||
this.model.point.y = this.model.point.y + e.offsetY;
|
||||
console.log('鼠标抬起', this.model);
|
||||
}
|
||||
// 关闭
|
||||
close() {
|
||||
|
96
src/ibp/shape/elevatorArrow.js
Normal file
@ -0,0 +1,96 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
import elevatorArrowPic from '@/assets/ibp_images/elevatorArrow.png';
|
||||
import elevatorArrowPicOn from '@/assets/ibp_images/elevatorArrow_on.png';
|
||||
|
||||
export default class elevatorArrow extends Group {
|
||||
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.imageBg = new Image({
|
||||
zlevel: this.zlevel,
|
||||
draggable: model.draggable || false,
|
||||
style: {
|
||||
image: this.getStatus(),
|
||||
x: model.point.x,
|
||||
y: model.point.y,
|
||||
width: 31,
|
||||
height: 60
|
||||
}
|
||||
});
|
||||
this.add(this.imageBg);
|
||||
this.getOrientate();
|
||||
}
|
||||
|
||||
getOrientate() {
|
||||
switch (this.model.orientation) {
|
||||
case 'top': {
|
||||
this.transformRotation(0);
|
||||
break;
|
||||
}
|
||||
case 'bottom': {
|
||||
this.transformRotation(180);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 整体旋转箭头
|
||||
transformRotation(rotate) {
|
||||
this.imageBg.origin = [this.model.point.x, this.model.point.y];
|
||||
this.imageBg.rotation = Math.PI / 180 * Number(rotate);
|
||||
this.imageBg.dirty();
|
||||
}
|
||||
|
||||
// /** 缩放按钮 */
|
||||
// transformScale() {
|
||||
// this.imageBg.origin = [this.model.point.x, this.model.point.y];
|
||||
// this.imageBg.scale =[this.model.width/68, this.model.width/68];
|
||||
// this.imageBg.dirty();
|
||||
// }
|
||||
|
||||
getStatus() {
|
||||
if (this.model.status) {
|
||||
switch (this.model.status) {
|
||||
case 'on': {
|
||||
return elevatorArrowPicOn;
|
||||
}
|
||||
case 'off': {
|
||||
return elevatorArrowPic;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return elevatorArrowPic;
|
||||
}
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.arrow.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
}
|
||||
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + e.offsetX;
|
||||
this.model.point.y = this.model.point.y + e.offsetY;
|
||||
}
|
||||
}
|
69
src/ibp/shape/elevatorBack.js
Normal file
@ -0,0 +1,69 @@
|
||||
import Circle from 'zrender/src/graphic/shape/Circle';
|
||||
import Polygon from 'zrender/src/graphic/shape/Polygon';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
|
||||
export default class elevatorBack extends Group {
|
||||
|
||||
constructor(device) {
|
||||
super();
|
||||
this.event = device.event;
|
||||
this.model = device.model;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.arrowCircle = new Circle({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
// path: 'M 0 0 Q -70 -50 0 -100 0 -100 L 150 -400 L 200 -400 Q 270 -350 200 -300 200 -300 L 50 0',
|
||||
// draggable: model.draggable || false,
|
||||
shape: {
|
||||
cx: model.point.x + model.width/6*5,
|
||||
cy: model.point.y + model.height/8,
|
||||
r: model.width/6
|
||||
},
|
||||
style: {
|
||||
fill: this.model.fillColor || '#adadad'
|
||||
}
|
||||
});
|
||||
|
||||
this.arrowPoly = new Polygon({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
// draggable: model.draggable || false,
|
||||
shape: {
|
||||
points: [ [model.point.x+model.width/6, model.point.y + model.height], [model.point.x+model.width/6*2, model.point.y + model.height],
|
||||
[model.point.x+model.width/6*5, model.point.y + model.height/8*2],
|
||||
[model.point.x+model.width/6*5, model.point.y],
|
||||
[model.point.x+model.width/6*4, model.point.y],
|
||||
[model.point.x+model.width/6, model.point.y + model.height/8*6]
|
||||
]
|
||||
},
|
||||
style: {
|
||||
stroke: model.stroke || '#adadad',
|
||||
lineWidth: model.lineWidth,
|
||||
fill: model.fill || '#adadad'
|
||||
}
|
||||
});
|
||||
|
||||
this.arrowCircleRight = new Circle({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
// path: 'M 0 0 Q -70 -50 0 -100 0 -100 L 150 -400 L 200 -400 Q 270 -350 200 -300 200 -300 L 50 0',
|
||||
// draggable: model.draggable || false,
|
||||
shape: {
|
||||
cx: model.point.x + model.width/6,
|
||||
cy: model.point.y + model.height/8*7,
|
||||
r: model.width/6
|
||||
},
|
||||
style: {
|
||||
fill: this.model.fillColor || '#adadad'
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.arrowPoly);
|
||||
this.add(this.arrowCircle);
|
||||
this.add(this.arrowCircleRight);
|
||||
}
|
||||
}
|
76
src/ibp/shape/rotateTip.js
Normal file
@ -0,0 +1,76 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
import rotateBlack from '@/assets/ibp_images/rotate_black.png';
|
||||
import rotateRed from '@/assets/ibp_images/rotate_red.png';
|
||||
|
||||
export default class rotateTip extends Group {
|
||||
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.imageBg = new Image({
|
||||
zlevel: this.zlevel,
|
||||
draggable: model.draggable || false,
|
||||
style: {
|
||||
image: this.getRotateColor(),
|
||||
x: model.point.x,
|
||||
y: model.point.y,
|
||||
width: 68,
|
||||
height: 60
|
||||
}
|
||||
});
|
||||
this.add(this.imageBg);
|
||||
this.transformScale();
|
||||
}
|
||||
|
||||
/** 缩放按钮 */
|
||||
transformScale() {
|
||||
this.imageBg.origin = [this.model.point.x, this.model.point.y];
|
||||
this.imageBg.scale =[this.model.width/68, this.model.width/68];
|
||||
this.imageBg.dirty();
|
||||
}
|
||||
|
||||
getRotateColor() {
|
||||
if (this.model.color) {
|
||||
switch (this.model.color) {
|
||||
case 'black': {
|
||||
return rotateBlack;
|
||||
}
|
||||
case 'red': {
|
||||
return rotateRed;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return rotateBlack;
|
||||
}
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.arrow.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
}
|
||||
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + e.offsetX;
|
||||
this.model.point.y = this.model.point.y + e.offsetY;
|
||||
}
|
||||
}
|
60
src/ibp/shape/teleTerminal.js
Normal file
@ -0,0 +1,60 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
import teleTerminalPic from '@/assets/ibp_images/telephone_terminal.png';
|
||||
|
||||
export default class alarm extends Group {
|
||||
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.imageBg = new Image({
|
||||
zlevel: this.zlevel,
|
||||
draggable: model.draggable || false,
|
||||
style: {
|
||||
image: teleTerminalPic,
|
||||
x: model.point.x,
|
||||
y: model.point.y,
|
||||
width: 64,
|
||||
height: 56
|
||||
}
|
||||
});
|
||||
this.add(this.imageBg);
|
||||
this.transformScale();
|
||||
}
|
||||
|
||||
/** 缩放按钮 */
|
||||
transformScale() {
|
||||
this.imageBg.origin = [this.model.point.x, this.model.point.y];
|
||||
this.imageBg.scale =[this.model.width/64, this.model.width/64];
|
||||
this.imageBg.dirty();
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.arrow.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
}
|
||||
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + e.offsetX;
|
||||
this.model.point.y = this.model.point.y + e.offsetY;
|
||||
}
|
||||
}
|
@ -33,7 +33,6 @@ class TransformHandle {
|
||||
view.decomposeTransform();
|
||||
this.revisibleView(view);
|
||||
}
|
||||
// return view;
|
||||
}
|
||||
|
||||
// 处理所有视图缩放/平移
|
||||
@ -48,6 +47,25 @@ class TransformHandle {
|
||||
|
||||
// 更新偏移量
|
||||
updateTransform(opts) {
|
||||
const elRect = this.parentLevel.getBoundingRect();
|
||||
const zrRect = this.rect;
|
||||
|
||||
if (elRect.x - opts.offsetX > 0) {
|
||||
opts.offsetX = -elRect.x;
|
||||
}
|
||||
|
||||
if (elRect.y - opts.offsetY > 0) {
|
||||
opts.offsetY = -elRect.y;
|
||||
}
|
||||
|
||||
if (elRect.x + elRect.width < zrRect.width) {
|
||||
opts.offsetX -= zrRect.width - (elRect.x + elRect.width);
|
||||
}
|
||||
|
||||
if (elRect.y + elRect.height < zrRect.height) {
|
||||
opts.offsetY -= zrRect.height - (elRect.y + elRect.height);
|
||||
}
|
||||
|
||||
this.transform = createTransform(opts);
|
||||
this.transformAll();
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ class SkinCode extends defaultStyle {
|
||||
emergencyControlShow: true, // 紧急站控显示
|
||||
centerControlShow: true, // 中控显示
|
||||
substationControlShow: true, // 站控按钮显示
|
||||
turnedAroundControlShow: false // 按图折返显示
|
||||
interconnectedControlShow: false // 联锁控显示
|
||||
},
|
||||
arrow: {
|
||||
show: false // 控制模式箭头显隐
|
||||
|
@ -276,7 +276,7 @@ class SkinCode extends defaultStyle {
|
||||
emergencyControlShow: true, // 紧急站控显示
|
||||
centerControlShow: true, // 中控显示
|
||||
substationControlShow: true, // 站控按钮显示
|
||||
turnedAroundControlShow: true // 按图折返显示
|
||||
interconnectedControlShow: true // 联锁控显示
|
||||
},
|
||||
arrow: {
|
||||
show: false // 控制模式箭头显隐
|
||||
@ -374,6 +374,18 @@ class SkinCode extends defaultStyle {
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.ButtonControl] = {
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 5 // 灯跟文字距离
|
||||
},
|
||||
lamp: {
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#FFFF00' // 控制灯颜色
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.Line] = {
|
||||
lineColor: '#FFFFFF' // 线条颜色
|
||||
};
|
||||
|
@ -273,7 +273,7 @@ class SkinCode extends defaultStyle {
|
||||
emergencyControlShow: true, // 紧急站控显示
|
||||
centerControlShow: true, // 中控显示
|
||||
substationControlShow: true, // 站控按钮显示
|
||||
turnedAroundControlShow: false // 按图折返显示
|
||||
interconnectedControlShow: false // 联锁控显示
|
||||
},
|
||||
arrow: {
|
||||
show: false // 控制模式箭头显隐
|
||||
|
@ -255,7 +255,7 @@ class SkinCode extends defaultStyle {
|
||||
emergencyControlShow: false, // 紧急站控显示
|
||||
centerControlShow: true, // 中控显示
|
||||
substationControlShow: true, // 站控按钮显示
|
||||
turnedAroundControlShow: false // 按图折返显示
|
||||
interconnectedControlShow: false // 联锁控显示
|
||||
},
|
||||
arrow: {
|
||||
show: true // 控制模式箭头显隐
|
||||
|
@ -11,6 +11,7 @@ const deviceType = {
|
||||
StationStand: 'StationStand',
|
||||
StationControl: 'StationControl',
|
||||
StationCounter: 'StationCounter',
|
||||
ButtonControl: 'ButtonControl',
|
||||
StationDelayUnlock: 'StationDelayUnlock',
|
||||
Train: 'Train',
|
||||
TrainWindow: 'TrainWindow',
|
||||
|
@ -292,6 +292,7 @@ class Jlmap {
|
||||
case deviceType.ZcControl: prop = 'zcControlList'; break;
|
||||
case deviceType.StationDelayUnlock: prop = 'stationDelayUnlockList'; break;
|
||||
case deviceType.LcControl: prop = 'lcControlList'; break;
|
||||
case deviceType.ButtonControl: prop = 'buttonList'; break;
|
||||
case deviceType.LimitControl: prop = 'tempSpeedLimitList'; break;
|
||||
case deviceType.ImageControl: prop = 'imageControl'; break;
|
||||
case deviceType.Train: prop = 'trainList'; break;
|
||||
|
67
src/jmap/shape/ButtonControl/index.js
Normal file
@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
}
|
@ -73,10 +73,10 @@ export default class StationControl extends Group {
|
||||
});
|
||||
this.add(this.substationControl);
|
||||
}
|
||||
// 按图折返
|
||||
if (this.style.StationControl.lamp.turnedAroundControlShow) {
|
||||
this.turnedAroundControl = new ESingleControl({
|
||||
_subType: 'turnedAround',
|
||||
// 联锁控
|
||||
if (this.style.StationControl.lamp.interconnectedControlShow) {
|
||||
this.interconnectedControl = new ESingleControl({
|
||||
_subType: 'interconnected',
|
||||
style: this.style,
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
@ -84,10 +84,10 @@ export default class StationControl extends Group {
|
||||
x: model.position.x + this.style.StationControl.lamp.distance * 3 / 2 + this.style.StationControl.lamp.offset.x,
|
||||
y: model.position.y + this.style.StationControl.lamp.offset.y
|
||||
},
|
||||
context: '按图折返',
|
||||
context: model.lskContent || '联锁控',
|
||||
pop: false
|
||||
});
|
||||
this.add(this.turnedAroundControl);
|
||||
this.add(this.interconnectedControl);
|
||||
}
|
||||
// 箭头
|
||||
if (this.style.StationControl.arrow.show) {
|
||||
|
@ -9,6 +9,7 @@ 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';
|
||||
@ -29,6 +30,7 @@ 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;
|
||||
|
@ -86,6 +86,10 @@ 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);
|
||||
|
@ -248,6 +248,13 @@ const map = {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
buttonList: (state) => {
|
||||
if (state.map) {
|
||||
return state.map.buttonList;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
signalList: (state) => {
|
||||
if (state.map) {
|
||||
return state.map.signalList;
|
||||
|
@ -3,8 +3,8 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.9.255:9000'; // 袁琪
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.4:9000' // 琰培
|
||||
} else {
|
||||
|
@ -1,104 +1,89 @@
|
||||
<template>
|
||||
<transition name="el-zoom-in-center">
|
||||
<div class="map-control">
|
||||
<el-card type="border-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<transition name="el-zoom-in-center">
|
||||
<div class="map-control">
|
||||
<el-card type="border-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>
|
||||
车站名称
|
||||
<b>请选择车站</b>
|
||||
</span>
|
||||
<el-button
|
||||
type="text"
|
||||
style="float: right; padding: 3px 0; margin-right: 5px;"
|
||||
@click="handleSave"
|
||||
>保存</el-button>
|
||||
</div>
|
||||
<el-tabs v-model="enabledTab" class="mapEdit" type="card">
|
||||
<el-tab-pane label="背景板" name="BgImage">
|
||||
<ibp-bg
|
||||
@createBg="createDataModel"
|
||||
></ibp-bg>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="文字" name="Text">
|
||||
<ibp-text
|
||||
@createText="createDataModel"
|
||||
>
|
||||
</ibp-text>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="功能提示" name="Tip">
|
||||
<ibp-tip
|
||||
@createTip="createDataModel"
|
||||
></ibp-tip>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="按键" name="Button">
|
||||
<ibp-button
|
||||
@createButton="createDataModel"
|
||||
>
|
||||
</ibp-button>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="圆形指示灯" name="CircularLamp">
|
||||
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="箭头" name="Arrow">
|
||||
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="扶梯框" name="AppendageBox">
|
||||
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="报警器" name="Alarm">
|
||||
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="旋转按钮" name="SpinButton">
|
||||
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
<el-button
|
||||
type="text"
|
||||
style="float: right; padding: 3px 0; margin-right: 5px;"
|
||||
@click="handleSave"
|
||||
>保存</el-button>
|
||||
</div>
|
||||
</transition>
|
||||
<el-tabs v-model="enabledTab" class="mapEdit" type="card">
|
||||
<el-tab-pane label="背景板" name="BgImage">
|
||||
<ibp-bg
|
||||
@createBg="createDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="文字" name="Text">
|
||||
<ibp-text
|
||||
@createText="createDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="功能提示" name="Tip">
|
||||
<ibp-tip
|
||||
@createTip="createDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="按键" name="Button">
|
||||
<ibp-button
|
||||
@createButton="createDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="圆形指示灯" name="CircularLamp" />
|
||||
<el-tab-pane label="箭头" name="Arrow" />
|
||||
<el-tab-pane label="扶梯框" name="AppendageBox" />
|
||||
<el-tab-pane label="报警器" name="Alarm" />
|
||||
<el-tab-pane label="旋转按钮" name="SpinButton" />
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
<script>
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import { updateIbpData } from '@/ibp/utils/parser';
|
||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import IbpText from './ibpText';
|
||||
import IbpTip from './ibpTip';
|
||||
import IbpButton from './ibpButton';
|
||||
import IbpBg from './ibpBg';
|
||||
import { updateIbpData } from '@/ibp/utils/parser';
|
||||
import IbpText from './ibpText';
|
||||
import IbpTip from './ibpTip';
|
||||
import IbpButton from './ibpButton';
|
||||
import IbpBg from './ibpBg';
|
||||
|
||||
export default {
|
||||
name: 'IbpOperate',
|
||||
components: {
|
||||
IbpText,
|
||||
IbpBg,
|
||||
IbpButton,
|
||||
IbpTip
|
||||
},
|
||||
mixins: [
|
||||
export default {
|
||||
name: 'IbpOperate',
|
||||
components: {
|
||||
IbpText,
|
||||
IbpBg,
|
||||
IbpButton,
|
||||
IbpTip
|
||||
},
|
||||
mixins: [
|
||||
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
enabledTab: 'BgImage',
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
enabledTab: 'BgImage'
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
createDataModel(textModel) {
|
||||
this.$store.dispatch('ibp/updateIbpDevices', textModel);
|
||||
updateIbpData(textModel,'update')
|
||||
},
|
||||
handleSave() {
|
||||
console.log(this.$store.state.ibp.ibp);
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
createDataModel(textModel) {
|
||||
this.$store.dispatch('ibp/updateIbpDevices', textModel);
|
||||
updateIbpData(textModel, 'update');
|
||||
},
|
||||
handleSave() {
|
||||
console.log(this.$store.state.ibp.ibp);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,67 +1,65 @@
|
||||
<template>
|
||||
<transition name="el-zoom-in-center">
|
||||
<div class="mapPaint">
|
||||
<div class="map-view">
|
||||
<ibp-plate ref="ibpPlate"/>
|
||||
</div>
|
||||
<div class="map-draft">
|
||||
<ibp-operate ref="ibpOperate"></ibp-operate>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
<transition name="el-zoom-in-center">
|
||||
<div class="mapPaint">
|
||||
<div class="map-view">
|
||||
<ibp-plate ref="ibpPlate" />
|
||||
</div>
|
||||
<div class="map-draft">
|
||||
<ibp-operate ref="ibpOperate" />
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
<script>
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import IbpPlate from '@/views/ibp/index';
|
||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import IbpOperate from './ibpOperate/index';
|
||||
import IbpPlate from '@/views/ibp/index';
|
||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import IbpOperate from './ibpOperate/index';
|
||||
|
||||
export default {
|
||||
name: 'MapView',
|
||||
components: {
|
||||
IbpPlate,
|
||||
IbpOperate
|
||||
},
|
||||
mixins: [
|
||||
WindowResizeHandler
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
mapSaveing: false,
|
||||
viewDraft: 'draft',
|
||||
autoSaveTask: null,
|
||||
selected: null,
|
||||
mapInfo: { name: "" },
|
||||
timeDemon: null
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
export default {
|
||||
name: 'MapView',
|
||||
components: {
|
||||
IbpPlate,
|
||||
IbpOperate
|
||||
},
|
||||
mixins: [
|
||||
WindowResizeHandler
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
mapSaveing: false,
|
||||
viewDraft: 'draft',
|
||||
autoSaveTask: null,
|
||||
selected: null,
|
||||
mapInfo: { name: '' },
|
||||
timeDemon: null
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.ibpPlate.show();
|
||||
this.$refs.ibpPlate.drawIbpInit();
|
||||
},
|
||||
beforeDestroy() {
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.ibpPlate.show();
|
||||
this.$refs.ibpPlate.drawIbpInit();
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
resizeHandler() {
|
||||
this._clientWidth = this._clientWidth || document.documentElement.clientWidth;
|
||||
this._clientHeight = this._clientHeight || document.documentElement.clientHeight;
|
||||
const width = this._clientWidth - 521;
|
||||
const height = this._clientHeight;
|
||||
this.$store.dispatch('config/resize', { width: width, height: height });
|
||||
},
|
||||
endViewLoading(isSuccess) {
|
||||
},
|
||||
methods: {
|
||||
resizeHandler() {
|
||||
this._clientWidth = this._clientWidth || document.documentElement.clientWidth;
|
||||
this._clientHeight = this._clientHeight || document.documentElement.clientHeight;
|
||||
const width = this._clientWidth - 521;
|
||||
const height = this._clientHeight - 60;
|
||||
this.$store.dispatch('config/resize', { width: width, height: height });
|
||||
},
|
||||
endViewLoading(isSuccess) {
|
||||
|
||||
},
|
||||
selectViewDraft(data) {
|
||||
this.viewDraft = data;
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
selectViewDraft(data) {
|
||||
this.viewDraft = data;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,62 +1,61 @@
|
||||
<template>
|
||||
<div id="mapMain" class="ibpDraft">
|
||||
<div class="map-list" :style="{width: widthLeft+'px'}">
|
||||
<span>车站列表</span>
|
||||
</div>
|
||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||
<transition>
|
||||
<router-view />
|
||||
</transition>
|
||||
<div id="mapMain" class="ibpDraft">
|
||||
<div class="map-list" :style="{width: widthLeft+'px'}">
|
||||
<span>车站列表</span>
|
||||
</div>
|
||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||
<transition>
|
||||
<router-view />
|
||||
</transition>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import localStore from 'storejs';
|
||||
import IbpPlate from '@/views/ibp/index';
|
||||
import DrapLeft from '@/views/components/drapLeft/index';
|
||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import localStore from 'storejs';
|
||||
// import IbpPlate from '@/views/ibp/index';
|
||||
import DrapLeft from '@/views/components/drapLeft/index';
|
||||
|
||||
export default {
|
||||
name: 'IbpDraft',
|
||||
components: {
|
||||
IbpPlate,
|
||||
DrapLeft
|
||||
},
|
||||
mixins: [
|
||||
WindowResizeHandler
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
widthLeft: 320
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
widthLeft(val) {
|
||||
this.setMapResize(val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.$refs.ibpPlate.show();
|
||||
this.resizeHandler();
|
||||
},
|
||||
methods: {
|
||||
drapWidth(width) {
|
||||
this.widthLeft = Number(width);
|
||||
},
|
||||
resizeHandler() {
|
||||
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
|
||||
this._clientWidth = this._clientWidth || document.documentElement.clientWidth;
|
||||
this._clientHeight = this._clientHeight || document.documentElement.clientHeight;
|
||||
const width = this._clientWidth - 521 - this.widthLeft;
|
||||
const height = this._clientHeight - 90;
|
||||
this.$store.dispatch('config/resize', { width: width, height: height });
|
||||
},
|
||||
setMapResize(LeftWidth) {
|
||||
const widths = this._clientWidth - 521 - LeftWidth;
|
||||
const heights = this._clientHeight - 90;
|
||||
this.$store.dispatch('config/resize', { width: widths, height: heights });
|
||||
}
|
||||
}
|
||||
};
|
||||
export default {
|
||||
name: 'IbpDraft',
|
||||
components: {
|
||||
DrapLeft
|
||||
},
|
||||
mixins: [
|
||||
WindowResizeHandler
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
widthLeft: 320
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
widthLeft(val) {
|
||||
this.setMapResize(val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.$refs.ibpPlate.show();
|
||||
this.resizeHandler();
|
||||
},
|
||||
methods: {
|
||||
drapWidth(width) {
|
||||
this.widthLeft = Number(width);
|
||||
},
|
||||
resizeHandler() {
|
||||
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
|
||||
this._clientWidth = this._clientWidth || document.documentElement.clientWidth;
|
||||
this._clientHeight = this._clientHeight || document.documentElement.clientHeight;
|
||||
const width = this._clientWidth - 521 - this.widthLeft;
|
||||
const height = this._clientHeight - 90;
|
||||
this.$store.dispatch('config/resize', { width: width, height: height });
|
||||
},
|
||||
setMapResize(LeftWidth) {
|
||||
const widths = this._clientWidth - 521 - LeftWidth;
|
||||
const heights = this._clientHeight - 90;
|
||||
this.$store.dispatch('config/resize', { width: widths, height: heights });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -38,6 +38,15 @@
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="路径单元" name="path">
|
||||
<path-operate
|
||||
ref="pathOperate"
|
||||
:card-height="cardHeight+25"
|
||||
:map-info="mapInfo"
|
||||
:selected="selected"
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="交路" name="routing">
|
||||
<routing-operate
|
||||
ref="routingOperate"
|
||||
@ -65,15 +74,6 @@
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="路径单元" name="path">
|
||||
<path-operate
|
||||
ref="pathOperate"
|
||||
:card-height="cardHeight+25"
|
||||
:map-info="mapInfo"
|
||||
:selected="selected"
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</div>
|
||||
|
@ -58,7 +58,7 @@
|
||||
style="width: 95%; margin: 0 auto"
|
||||
>
|
||||
<el-table-column type="index" />
|
||||
<el-table-column prop="routeCode" label="进路ID" />
|
||||
<el-table-column prop="routeCode" label="进路code" />
|
||||
<el-table-column prop="routeName" label="进路名称" />
|
||||
<el-table-column fixed="right" :label="$t('map.operation')" width="50">
|
||||
<template slot-scope="scope">
|
||||
@ -235,10 +235,8 @@ export default {
|
||||
data.forEach((element, index) => {
|
||||
this.addModel.mapRouteUnitRelList.push({
|
||||
routeCode: element.code,
|
||||
routeName: element.name,
|
||||
mapId: this.mapInfo.id,
|
||||
id: element.id,
|
||||
routeUnitCode: this.addModel.code
|
||||
routeName: element.name
|
||||
// routeUnitCode: this.addModel.code
|
||||
});
|
||||
});
|
||||
},
|
||||
@ -274,15 +272,13 @@ export default {
|
||||
this.loading = false;
|
||||
});
|
||||
} else {
|
||||
[
|
||||
addRouteUnit(this.buildModel()).then(response => {
|
||||
this.$message.success(this.$t('tip.createSuccess'));
|
||||
this.clear();
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.operationAbnormal'));
|
||||
this.loading = false;
|
||||
})
|
||||
];
|
||||
addRouteUnit(this.buildModel()).then(response => {
|
||||
this.$message.success(this.$t('tip.createSuccess'));
|
||||
this.clear();
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.operationAbnormal'));
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
clear() {
|
||||
|
@ -515,8 +515,10 @@ export default {
|
||||
const model = Object.assign({}, this.addModel);
|
||||
model['mapId'] = this.mapInfo.id;
|
||||
model['routeSectionList'] = this.addModel.routeSectionList.map(elem => { return { sectionCode: elem }; });
|
||||
model['routeTriggerSectionList'] = this.addModel.routeTriggerSectionList.map(elem => { return { mapId: this.mapInfo.id, routeCode: model.code, sectionCode: elem }; });
|
||||
model['routeOverlapSectionList'] = this.addModel.routeOverlapSectionList.map(elem => { return { mapId: this.mapInfo.id, routeCode: model.code, sectionCode: elem }; });
|
||||
// mapId: this.mapInfo.id, routeCode: model.code,
|
||||
model['routeTriggerSectionList'] = this.addModel.routeTriggerSectionList.map(elem => { return { sectionCode: elem }; });
|
||||
// mapId: this.mapInfo.id, routeCode: model.code,
|
||||
model['routeOverlapSectionList'] = this.addModel.routeOverlapSectionList.map(elem => { return { sectionCode: elem }; });
|
||||
model['routeStandList'] = this.addModel.routeStandList.map(elem => { return { stationStandCode: elem }; });
|
||||
if (code) { model['code'] = code; }
|
||||
|
||||
|
@ -120,8 +120,8 @@ export default {
|
||||
draw: {
|
||||
name: this.$t('map.drawData'),
|
||||
item: [
|
||||
{ prop: 'code', label: `${this.$t('map.image')}${this.$t('map.code')}`, type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.resourceList, change: true, deviceChange: this.deviceChange },
|
||||
{ prop: 'name', label: this.$t('map.imageName'), type: 'input' },
|
||||
{ prop: 'code', label: `${this.$t('map.image')}${this.$t('map.code')}`, type: 'select', optionLabel: 'code', optionValue: 'code', options: this.resourceList, change: true, deviceChange: this.deviceChange },
|
||||
// { prop: 'name', label: this.$t('map.imageName'), type: 'input' },
|
||||
{ prop: 'width', label: this.$t('map.imageWidth'), type: 'number', min: 0 },
|
||||
{ prop: 'height', label: this.$t('map.imageHeight'), type: 'number', min: 0 },
|
||||
{ prop: 'zIndex', label: this.$t('map.imageZindex'), type: 'number', min: 0 },
|
||||
|
308
src/views/map/mapdraft/mapedit/mapoperate/buttonDraft.vue
Normal file
@ -0,0 +1,308 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-tabs v-model="activeName" class="card">
|
||||
<el-tab-pane class="view-control" :label="$t('map.property')" name="first">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
|
||||
<config-list ref="form" :form="form" :form-model="editModel" :rules="rules" />
|
||||
</el-scrollbar>
|
||||
<div class="button_box">
|
||||
<el-button-group class="map-draft-group">
|
||||
<el-button type="primary" size="small" @click="edit">{{ $t('map.updateObj') }}</el-button>
|
||||
<el-button type="danger" size="small" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
|
||||
<el-form ref="make" label-width="120px" :rules="createRules" :model="addModel" size="mini">
|
||||
<!-- <el-form-item :label="$t('map.buttonText')+':'" prop="text">
|
||||
<el-input v-model="addModel.text" />
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="$t('map.buttonType')+ ':'" prop="type">
|
||||
<el-select v-model="addModel.type" filterable>
|
||||
<el-option
|
||||
v-for="item in buttonTypeList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.belongsStation')" prop="stationCode">
|
||||
<el-select v-model="addModel.stationCode" filterable>
|
||||
<el-option
|
||||
v-for="item in stationList"
|
||||
:key="item.code"
|
||||
:label="item.name + ' (' + item.code+ ')'"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<div class="coordinate">
|
||||
<span class="title" style="width: 120px">{{ $t('map.textPoints') }}</span>
|
||||
<el-form-item
|
||||
label="x:"
|
||||
prop="position.x"
|
||||
style="display: table; float: left; margin-right: 20px;"
|
||||
label-width="25px"
|
||||
>
|
||||
<el-input-number v-model="addModel.position.x" label="x:" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="y:"
|
||||
prop="position.y"
|
||||
style="display: table; float: left;"
|
||||
label-width="25px"
|
||||
>
|
||||
<el-input-number v-model="addModel.position.y" label="y:" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
<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-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { getUID } from '@/jmap/utils/Uid';
|
||||
import ConfigList from './config/list';
|
||||
|
||||
export default {
|
||||
name: 'LcControlDraft',
|
||||
components: {
|
||||
ConfigList
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default: function () {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
cardHeight: {
|
||||
type: [String, Number],
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'first',
|
||||
buttonTypeList: [
|
||||
{ code: '01', name: '按图折返' }
|
||||
],
|
||||
mapData: null,
|
||||
editModel: {
|
||||
code: '',
|
||||
text: '',
|
||||
type: '',
|
||||
stationCode: '',
|
||||
position: {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
},
|
||||
addModel: {
|
||||
type: '',
|
||||
stationCode: '',
|
||||
text: '',
|
||||
position: {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: this.$t('rules.pleaseSelectEncoding'), trigger: 'change' }
|
||||
],
|
||||
tsxt: [
|
||||
{ required: true, message: this.$t('rules.pleaseEnterStatusSignal'), trigger: 'blur' }
|
||||
],
|
||||
'position.x': [
|
||||
{ required: true, message: this.$t('map.pleaseEnterXCoordinate'), trigger: 'blur' }
|
||||
],
|
||||
'position.y': [
|
||||
{ required: true, message: this.$t('map.pleaseEnterYCoordinate'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList',
|
||||
'buttonList'
|
||||
]),
|
||||
createRules: function () {
|
||||
return {
|
||||
text: [
|
||||
{ required: true, message: this.$t('rules.pleaseSelectButtonContent'), trigger: 'blur' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: this.$t('rules.pleaseSelectButtonType'), trigger: 'blur' }
|
||||
],
|
||||
stationCode: [
|
||||
{ required: true, message: this.$t('rules.stationControlStationCode'), trigger: 'change' }
|
||||
],
|
||||
'position.x': [
|
||||
{ required: true, message: this.$t('map.pleaseEnterXCoordinate'), trigger: 'blur' }
|
||||
],
|
||||
'position.y': [
|
||||
{ required: true, message: this.$t('map.pleaseEnterYCoordinate'), trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
},
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '140px',
|
||||
items: {
|
||||
code: {
|
||||
name: '',
|
||||
item: []
|
||||
},
|
||||
draw: {
|
||||
name: this.$t('map.drawData'),
|
||||
item: [
|
||||
{ prop: 'code', label: `${this.$t('map.buttonControl')}${this.$t('map.code')}`, type: 'select', optionLabel: 'code', optionValue: 'code', options: this.buttonList, change: true, deviceChange: this.deviceChange },
|
||||
// { prop: 'text', label: `${this.$t('map.buttonText')}:`, type: 'input' },
|
||||
{ prop: 'type', label: `${this.$t('map.buttonType')}:`, type: 'select', optionLabel: 'name', optionValue: 'code', options: this.buttonTypeList },
|
||||
{ prop: 'position', label: this.$t('map.stateSignalsPlotCoordinates'), type: 'coordinate', width: '140px', 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: [
|
||||
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList }
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
return form;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
selected: function (val, oldVal) {
|
||||
this.deviceSelect(val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
deviceChange(code) {
|
||||
this.$emit('setCenter', code);
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
if (selected && selected._type.toUpperCase() == 'ButtonControl'.toUpperCase()) {
|
||||
this.editModel.code = selected.code;
|
||||
this.editModel.text = selected.text;
|
||||
this.editModel.type = selected.type;
|
||||
this.editModel.stationCode = selected.stationCode;
|
||||
this.editModel.position = {
|
||||
x: selected.position.x,
|
||||
y: selected.position.y
|
||||
};
|
||||
this.activeName = 'first';
|
||||
}
|
||||
},
|
||||
create() {
|
||||
this.$refs.make.validate((valid) => {
|
||||
if (valid) {
|
||||
const uid = getUID('ButtonControl');
|
||||
const model = {
|
||||
_type: 'ButtonControl',
|
||||
code: uid,
|
||||
type: this.addModel.type,
|
||||
stationCode: this.addModel.stationCode,
|
||||
text: this.addModel.text,
|
||||
position: {
|
||||
x: this.addModel.position.x,
|
||||
y: this.addModel.position.y
|
||||
}
|
||||
};
|
||||
this.$emit('addOrUpdateMapModel', model);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 修改对象
|
||||
edit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$emit('addOrUpdateMapModel', this.buildEditModel());
|
||||
}
|
||||
});
|
||||
},
|
||||
buildEditModel() {
|
||||
const model = {
|
||||
_type: 'ButtonControl',
|
||||
code: this.editModel.code,
|
||||
text: this.editModel.text,
|
||||
type: this.editModel.type,
|
||||
stationCode: this.editModel.stationCode,
|
||||
position: {
|
||||
x: this.editModel.position.x,
|
||||
y: this.editModel.position.y
|
||||
}
|
||||
};
|
||||
return model;
|
||||
},
|
||||
// 删除对象
|
||||
deleteObj() {
|
||||
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
|
||||
if (selected && selected._type.toUpperCase() === 'LcControl'.toUpperCase()) {
|
||||
const _that = this;
|
||||
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
_that.$emit('delMapModel', selected);
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
_that.$message.info(this.$t('tip.cancelledDelete'));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.button_box{
|
||||
width: 100%;
|
||||
background: #f0f0f0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.coordinate {
|
||||
overflow: hidden;
|
||||
|
||||
.title {
|
||||
text-align: right;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
line-height: 40px;
|
||||
padding: 0 12px 0 0;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
line-height: 28px;
|
||||
width: 160px;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
|
||||
.map-draft-group {
|
||||
color: #3E44BE;
|
||||
}
|
||||
</style>
|
@ -204,6 +204,16 @@
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('map.button')" name="ButtonControl">
|
||||
<button-draft
|
||||
ref="ImageControl"
|
||||
:card-height="cardHeights"
|
||||
:selected="selected"
|
||||
@addOrUpdateMapModel="addOrUpdateMapModel"
|
||||
@delMapModel="delMapModel"
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</div>
|
||||
@ -228,6 +238,7 @@ import ZcControlDraft from './zcControl';
|
||||
import LimitControlDraft from './limitControl';
|
||||
import LcControlDraft from './lcControl';
|
||||
import ImageControlDraft from './ImageControl';
|
||||
import ButtonDraft from './buttonDraft';
|
||||
|
||||
import { ViewMode } from '@/scripts/ConstDic';
|
||||
|
||||
@ -250,7 +261,8 @@ export default {
|
||||
ZcControlDraft,
|
||||
LimitControlDraft,
|
||||
LcControlDraft,
|
||||
ImageControlDraft
|
||||
ImageControlDraft,
|
||||
ButtonDraft
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
|
@ -27,7 +27,7 @@
|
||||
<el-input-number v-model="addModel.width" :min="1" />px
|
||||
</el-form-item>
|
||||
<div class="coordinate">
|
||||
<span class="title">{{ $t('map.segmentCoordinates') }}</span>
|
||||
<span class="title">{{ $t('map.linePoint') }}</span>
|
||||
<div class="point-section">
|
||||
<template v-for="(point, index) in addModel.points">
|
||||
<div :key="index" style="overflow: hidden;">
|
||||
|
@ -74,7 +74,8 @@ export default {
|
||||
zakContent: '',
|
||||
jjzkContent: '',
|
||||
zbjkContent: '',
|
||||
zzkContent: ''
|
||||
zzkContent: '',
|
||||
lskContent: ''
|
||||
},
|
||||
addModel: {
|
||||
stationCode: ''
|
||||
@ -104,11 +105,12 @@ export default {
|
||||
name: this.$t('map.drawData'),
|
||||
item: [
|
||||
{ prop: 'code', label: this.$t('map.stationControlCode'), type: 'select', optionLabel: 'code', optionValue: 'code', options: this.stationControlList, change: true, deviceChange: this.deviceChange },
|
||||
{ prop: 'name', label: this.$t('map.stationControlName'), type: 'input' },
|
||||
// { prop: 'name', label: this.$t('map.stationControlName'), type: 'input' },
|
||||
{ prop: 'zokContent', label: this.$t('map.zokContent'), type: 'input' },
|
||||
{ prop: 'zakContent', label: this.$t('map.zakContent'), type: 'input' },
|
||||
{ prop: 'jjzkContent', label: this.$t('map.jjzkContent'), type: 'input' },
|
||||
{ prop: 'zzkContent', label: this.$t('map.zzkContent'), type: 'input' },
|
||||
{ prop: 'lskContent', label: `${this.$t('map.interconnected')}:`, type: 'input' },
|
||||
{ prop: 'position', label: this.$t('map.stationControlPosition'), type: 'coordinate', width: '150px', 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' }
|
||||
@ -184,6 +186,7 @@ export default {
|
||||
this.editModel.zakContent = selected.zakContent;
|
||||
this.editModel.jjzkContent = selected.jjzkContent;
|
||||
this.editModel.zzkContent = selected.zzkContent;
|
||||
this.editModel.lskContent = selected.lskContent;
|
||||
this.editModel.stationCode = selected.stationCode;
|
||||
this.editModel.zbjkContent = selected.zbjkContent;
|
||||
if (selected.hasOwnProperty('position')) {
|
||||
@ -208,7 +211,8 @@ export default {
|
||||
zbjkContent: '总报警',
|
||||
zakContent: '站控',
|
||||
jjzkContent: '紧急站控',
|
||||
zzkContent: '站中控按钮'
|
||||
zzkContent: '站中控按钮',
|
||||
lskContent: '连锁控'
|
||||
};
|
||||
this.stationList.forEach(elem => {
|
||||
if (elem.code === this.addModel.stationCode) {
|
||||
@ -241,6 +245,7 @@ export default {
|
||||
zbjkContent: this.editModel.zbjkContent,
|
||||
zakContent: this.editModel.zakContent,
|
||||
jjzkContent: this.editModel.jjzkContent,
|
||||
lskContent: this.editModel.lskContent,
|
||||
zzkContent: this.editModel.zzkContent,
|
||||
stationCode: this.editModel.stationCode,
|
||||
position: {
|
||||
|
@ -86,12 +86,16 @@ export default {
|
||||
const list = [];
|
||||
if (this.sectionList && this.sectionList.length) {
|
||||
this.sectionList.forEach(elem => {
|
||||
if (elem.type === '01') {
|
||||
list.push({
|
||||
label: elem.name,
|
||||
key: elem.code,
|
||||
pinyin: elem.name
|
||||
});
|
||||
if (elem.type === '01' && elem.isSwitchSection) {
|
||||
const link = this.findLinkData(elem.linkCode);
|
||||
if ((link.leftFdCode && link.leftSdCode) || (link.rightFdCode && link.rightSdCode)) {
|
||||
list.push({
|
||||
label: elem.name,
|
||||
key: elem.code,
|
||||
pinyin: elem.name
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|