From 498f09386623b37c1109235a1fb410376eaecd6c Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Tue, 27 Aug 2019 18:32:26 +0800 Subject: [PATCH 1/8] =?UTF-8?q?desc:=20=E6=96=B0=E5=A2=9E=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/en/map.js | 3 + src/i18n/langs/zh/map.js | 6 + src/i18n/langs/zh/rules.js | 5 +- src/jmap/config/skinCode/bejing_01.js | 2 +- src/jmap/config/skinCode/chengdu_03.js | 14 +- src/jmap/config/skinCode/chengdu_04.js | 2 +- src/jmap/config/skinCode/fuzhou_01.js | 2 +- src/jmap/constant/deviceType.js | 1 + src/jmap/map.js | 1 + src/jmap/shape/ButtonControl/index.js | 67 ++++ src/jmap/shape/StationControl/index.js | 12 +- src/jmap/shape/factory.js | 2 + src/jmap/utils/parser.js | 4 + src/store/modules/map.js | 7 + src/utils/baseUrl.js | 4 +- .../mapdraft/mapedit/dataRelation/index.vue | 18 +- .../dataRelation/pathoperate/route.vue | 24 +- .../dataRelation/routeoperate/route.vue | 6 +- .../mapedit/mapoperate/ImageControl.vue | 4 +- .../mapedit/mapoperate/buttonDraft.vue | 308 ++++++++++++++++++ .../map/mapdraft/mapedit/mapoperate/index.vue | 14 +- .../map/mapdraft/mapedit/mapoperate/line.vue | 2 +- .../mapedit/mapoperate/stationcontrol.vue | 11 +- .../mapdraft/mapedit/mapoperate/switch.vue | 16 +- 24 files changed, 484 insertions(+), 51 deletions(-) create mode 100644 src/jmap/shape/ButtonControl/index.js create mode 100644 src/views/map/mapdraft/mapedit/mapoperate/buttonDraft.vue 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/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/map/mapdraft/mapedit/dataRelation/index.vue b/src/views/map/mapdraft/mapedit/dataRelation/index.vue index e3c56f266..3468150f5 100644 --- a/src/views/map/mapdraft/mapedit/dataRelation/index.vue +++ b/src/views/map/mapdraft/mapedit/dataRelation/index.vue @@ -38,6 +38,15 @@ @setCenter="setCenter" /> + + + - - - diff --git a/src/views/map/mapdraft/mapedit/dataRelation/pathoperate/route.vue b/src/views/map/mapdraft/mapedit/dataRelation/pathoperate/route.vue index 80b0373e2..32521c05a 100644 --- a/src/views/map/mapdraft/mapedit/dataRelation/pathoperate/route.vue +++ b/src/views/map/mapdraft/mapedit/dataRelation/pathoperate/route.vue @@ -58,7 +58,7 @@ style="width: 95%; margin: 0 auto" > - +