diff --git a/src/assets/ibp_images/alarm.png b/src/assets/ibp_images/alarm.png index 996d2e957..6319ecc4f 100644 Binary files a/src/assets/ibp_images/alarm.png and b/src/assets/ibp_images/alarm.png differ diff --git a/src/assets/ibp_images/elevatorArrow.png b/src/assets/ibp_images/elevatorArrow.png new file mode 100644 index 000000000..8120b68ce Binary files /dev/null and b/src/assets/ibp_images/elevatorArrow.png differ diff --git a/src/assets/ibp_images/elevatorArrow_on.png b/src/assets/ibp_images/elevatorArrow_on.png new file mode 100644 index 000000000..7b898b922 Binary files /dev/null and b/src/assets/ibp_images/elevatorArrow_on.png differ diff --git a/src/assets/ibp_images/rotate_black.png b/src/assets/ibp_images/rotate_black.png new file mode 100644 index 000000000..6f9ad48b6 Binary files /dev/null and b/src/assets/ibp_images/rotate_black.png differ diff --git a/src/assets/ibp_images/rotate_red.png b/src/assets/ibp_images/rotate_red.png new file mode 100644 index 000000000..2e06a141f Binary files /dev/null and b/src/assets/ibp_images/rotate_red.png differ diff --git a/src/assets/ibp_images/telephone_terminal.png b/src/assets/ibp_images/telephone_terminal.png new file mode 100644 index 000000000..0f9462ca8 Binary files /dev/null and b/src/assets/ibp_images/telephone_terminal.png differ diff --git a/src/i18n/langs/en/map.js b/src/i18n/langs/en/map.js index 3d239d6f4..477cfca52 100644 --- a/src/i18n/langs/en/map.js +++ b/src/i18n/langs/en/map.js @@ -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', diff --git a/src/i18n/langs/zh/map.js b/src/i18n/langs/zh/map.js index 7478e0c0e..a37d4868e 100644 --- a/src/i18n/langs/zh/map.js +++ b/src/i18n/langs/zh/map.js @@ -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: '文本内容:', diff --git a/src/i18n/langs/zh/rules.js b/src/i18n/langs/zh/rules.js index 488df975a..a72792f3f 100644 --- a/src/i18n/langs/zh/rules.js +++ b/src/i18n/langs/zh/rules.js @@ -252,6 +252,9 @@ export default { enterScale: '请输入缩放比例', enterXOffset: '请输入X偏移', - enterYOffset: '请输入Y偏移' + enterYOffset: '请输入Y偏移', + + pleaseSelectButtonType: '请选择按钮类型', + pleaseSelectButtonContent: '请输入内容' }; diff --git a/src/ibp/ibpPan.js b/src/ibp/ibpPan.js index f1c6f5a17..dd357bdc2 100644 --- a/src/ibp/ibpPan.js +++ b/src/ibp/ibpPan.js @@ -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() { diff --git a/src/ibp/painter.js b/src/ibp/painter.js index 126c11508..edcb09bf0 100644 --- a/src/ibp/painter.js +++ b/src/ibp/painter.js @@ -112,7 +112,7 @@ class Painter { * 更新transform变化 * @param {*} opt */ - updateTransform(opt,) { + updateTransform(opt) { this.$transformHandle.updateTransform(opt); } diff --git a/src/ibp/shape/alarm.js b/src/ibp/shape/alarm.js index cc09557d8..00a1a3cf2 100644 --- a/src/ibp/shape/alarm.js +++ b/src/ibp/shape/alarm.js @@ -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() { diff --git a/src/ibp/shape/button.js b/src/ibp/shape/button.js index 050fc0a28..58be97077 100644 --- a/src/ibp/shape/button.js +++ b/src/ibp/shape/button.js @@ -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() { diff --git a/src/ibp/shape/elevatorArrow.js b/src/ibp/shape/elevatorArrow.js new file mode 100644 index 000000000..5c9c9ad2b --- /dev/null +++ b/src/ibp/shape/elevatorArrow.js @@ -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; + } +} diff --git a/src/ibp/shape/elevatorBack.js b/src/ibp/shape/elevatorBack.js new file mode 100644 index 000000000..18c439881 --- /dev/null +++ b/src/ibp/shape/elevatorBack.js @@ -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); + } +} \ No newline at end of file diff --git a/src/ibp/shape/rotateTip.js b/src/ibp/shape/rotateTip.js new file mode 100644 index 000000000..5855fece6 --- /dev/null +++ b/src/ibp/shape/rotateTip.js @@ -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; + } +} diff --git a/src/ibp/shape/teleTerminal.js b/src/ibp/shape/teleTerminal.js new file mode 100644 index 000000000..c4626aa91 --- /dev/null +++ b/src/ibp/shape/teleTerminal.js @@ -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; + } +} diff --git a/src/ibp/transformHandle.js b/src/ibp/transformHandle.js index 055aed10c..7bac831b2 100644 --- a/src/ibp/transformHandle.js +++ b/src/ibp/transformHandle.js @@ -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(); } diff --git a/src/jmap/config/skinCode/bejing_01.js b/src/jmap/config/skinCode/bejing_01.js index d60250e8e..2777d73a8 100644 --- a/src/jmap/config/skinCode/bejing_01.js +++ b/src/jmap/config/skinCode/bejing_01.js @@ -272,7 +272,7 @@ class SkinCode extends defaultStyle { emergencyControlShow: true, // 紧急站控显示 centerControlShow: true, // 中控显示 substationControlShow: true, // 站控按钮显示 - turnedAroundControlShow: false // 按图折返显示 + interconnectedControlShow: false // 联锁控显示 }, arrow: { show: false // 控制模式箭头显隐 diff --git a/src/jmap/config/skinCode/chengdu_03.js b/src/jmap/config/skinCode/chengdu_03.js index d127f42bd..3c1474c90 100644 --- a/src/jmap/config/skinCode/chengdu_03.js +++ b/src/jmap/config/skinCode/chengdu_03.js @@ -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' // 线条颜色 }; diff --git a/src/jmap/config/skinCode/chengdu_04.js b/src/jmap/config/skinCode/chengdu_04.js index 418fefd30..4705e4417 100644 --- a/src/jmap/config/skinCode/chengdu_04.js +++ b/src/jmap/config/skinCode/chengdu_04.js @@ -273,7 +273,7 @@ class SkinCode extends defaultStyle { emergencyControlShow: true, // 紧急站控显示 centerControlShow: true, // 中控显示 substationControlShow: true, // 站控按钮显示 - turnedAroundControlShow: false // 按图折返显示 + interconnectedControlShow: false // 联锁控显示 }, arrow: { show: false // 控制模式箭头显隐 diff --git a/src/jmap/config/skinCode/fuzhou_01.js b/src/jmap/config/skinCode/fuzhou_01.js index 2cebd978b..acae1a23b 100644 --- a/src/jmap/config/skinCode/fuzhou_01.js +++ b/src/jmap/config/skinCode/fuzhou_01.js @@ -255,7 +255,7 @@ class SkinCode extends defaultStyle { emergencyControlShow: false, // 紧急站控显示 centerControlShow: true, // 中控显示 substationControlShow: true, // 站控按钮显示 - turnedAroundControlShow: false // 按图折返显示 + interconnectedControlShow: false // 联锁控显示 }, arrow: { show: true // 控制模式箭头显隐 diff --git a/src/jmap/constant/deviceType.js b/src/jmap/constant/deviceType.js index b9ec52ffc..3093556e3 100644 --- a/src/jmap/constant/deviceType.js +++ b/src/jmap/constant/deviceType.js @@ -11,6 +11,7 @@ const deviceType = { StationStand: 'StationStand', StationControl: 'StationControl', StationCounter: 'StationCounter', + ButtonControl: 'ButtonControl', StationDelayUnlock: 'StationDelayUnlock', Train: 'Train', TrainWindow: 'TrainWindow', diff --git a/src/jmap/map.js b/src/jmap/map.js index 7ae9e4a77..966b7771a 100644 --- a/src/jmap/map.js +++ b/src/jmap/map.js @@ -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; diff --git a/src/jmap/shape/ButtonControl/index.js b/src/jmap/shape/ButtonControl/index.js new file mode 100644 index 000000000..29e2887d4 --- /dev/null +++ b/src/jmap/shape/ButtonControl/index.js @@ -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; + } +} diff --git a/src/jmap/shape/StationControl/index.js b/src/jmap/shape/StationControl/index.js index aced10c05..953981194 100644 --- a/src/jmap/shape/StationControl/index.js +++ b/src/jmap/shape/StationControl/index.js @@ -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) { diff --git a/src/jmap/shape/factory.js b/src/jmap/shape/factory.js index d592ca368..80b9d1336 100644 --- a/src/jmap/shape/factory.js +++ b/src/jmap/shape/factory.js @@ -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; diff --git a/src/jmap/utils/parser.js b/src/jmap/utils/parser.js index 95ea5d265..4ecbb8788 100644 --- a/src/jmap/utils/parser.js +++ b/src/jmap/utils/parser.js @@ -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); diff --git a/src/store/modules/map.js b/src/store/modules/map.js index b6ec423ef..bcb7e8071 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -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; diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index b49dd28b5..72be3b2f1 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -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 { diff --git a/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/index.vue b/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/index.vue index 9a2e70cd1..1e06b7d61 100644 --- a/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/index.vue +++ b/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/index.vue @@ -1,104 +1,89 @@ diff --git a/src/views/ibp/ibpDraft/ibpEdit/index.vue b/src/views/ibp/ibpDraft/ibpEdit/index.vue index eb7f642bb..44a2ea3ef 100644 --- a/src/views/ibp/ibpDraft/ibpEdit/index.vue +++ b/src/views/ibp/ibpDraft/ibpEdit/index.vue @@ -1,67 +1,65 @@ diff --git a/src/views/map/mapdraft/mapedit/mapoperate/index.vue b/src/views/map/mapdraft/mapedit/mapoperate/index.vue index 754a1aafa..4eb3f0466 100644 --- a/src/views/map/mapdraft/mapedit/mapoperate/index.vue +++ b/src/views/map/mapdraft/mapedit/mapoperate/index.vue @@ -204,6 +204,16 @@ @setCenter="setCenter" /> + + + @@ -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: { diff --git a/src/views/map/mapdraft/mapedit/mapoperate/line.vue b/src/views/map/mapdraft/mapedit/mapoperate/line.vue index 1f98af3a7..460b86dc4 100644 --- a/src/views/map/mapdraft/mapedit/mapoperate/line.vue +++ b/src/views/map/mapdraft/mapedit/mapoperate/line.vue @@ -27,7 +27,7 @@ px
- {{ $t('map.segmentCoordinates') }} + {{ $t('map.linePoint') }}