From b4ea83eabc7fbfdc72bcc8e60fd9887e0c1bbbbd Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 17 Dec 2019 19:03:38 +0800 Subject: [PATCH] =?UTF-8?q?zc=20=E9=9B=86=E4=B8=AD=E7=AB=99=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= 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/en/rules.js | 3 +- src/i18n/langs/zh/map.js | 3 +- src/i18n/langs/zh/rules.js | 3 +- src/jmapNew/config/skinCode/bejing_01.js | 2 + src/jmapNew/shape/ZcControl/index.js | 136 +++++++++--------- src/jmapNew/utils/parser.js | 2 +- .../newMapdraft/mapoperate/config/data.vue | 20 +++ .../newMap/newMapdraft/mapoperate/station.vue | 15 +- .../newMapdraft/mapoperate/stationstand.vue | 10 -- .../newMapdraft/mapoperate/zcControl.vue | 98 +++++++++++-- 11 files changed, 190 insertions(+), 105 deletions(-) diff --git a/src/i18n/langs/en/map.js b/src/i18n/langs/en/map.js index d2ba76f2b..3a8a983be 100644 --- a/src/i18n/langs/en/map.js +++ b/src/i18n/langs/en/map.js @@ -70,7 +70,7 @@ export default { section: 'section', switch: 'switch', signal: 'signal', - zcZoneControl: 'zc zone control', + zcZoneControl: 'zone control', temporaryLimit: 'temporary speed restriction', lcControl: 'Lc control', image: 'image', @@ -85,6 +85,7 @@ export default { text: 'text', button: 'button', signalApprochSection:'Signal approch section', + concentrateStationList:'Concentrate station list', mapName: 'Name:', skinName: 'Skin style:', diff --git a/src/i18n/langs/en/rules.js b/src/i18n/langs/en/rules.js index 39454342b..3d1167e94 100644 --- a/src/i18n/langs/en/rules.js +++ b/src/i18n/langs/en/rules.js @@ -318,5 +318,6 @@ export default { enterTheNewsContent: 'Please enter news content', chooseNewsCanBeClosed: 'Please select the news can be closed', theLeftEndOfTheSelectedAssociatedSectionIsNotAdjacent: 'The left end of the selected associated section is not adjacent!', - theRightEndOfTheSelectedAssociatedSectionIsNotAdjacent: 'The right end of the selected associated section is not adjacent!' + theRightEndOfTheSelectedAssociatedSectionIsNotAdjacent: 'The right end of the selected associated section is not adjacent!', + selectConcentrateStation:'Please select Concentrate Station' }; diff --git a/src/i18n/langs/zh/map.js b/src/i18n/langs/zh/map.js index 51aee2a8f..68a12a762 100644 --- a/src/i18n/langs/zh/map.js +++ b/src/i18n/langs/zh/map.js @@ -46,7 +46,7 @@ export default { section: '区段', switch: '道岔', signal: '信号机', - zcZoneControl: 'zc区域控制', + zcZoneControl: 'ZC', temporaryLimit: '全线临时限速', lcControl: 'Lc控制', buttonControl: '按钮', @@ -62,6 +62,7 @@ export default { text: '文字', button: '按钮', signalApprochSection:' 信号机接近区段', + concentrateStationList:'集中站列表', mapName: '地图名称:', skinName: '皮肤:', diff --git a/src/i18n/langs/zh/rules.js b/src/i18n/langs/zh/rules.js index 9bd4b2d04..556d5dc37 100644 --- a/src/i18n/langs/zh/rules.js +++ b/src/i18n/langs/zh/rules.js @@ -320,5 +320,6 @@ export default { enterTheNewsContent: '请输入消息内容', chooseNewsCanBeClosed: '请选择消息是否可关闭', theLeftEndOfTheSelectedAssociatedSectionIsNotAdjacent: '所选择关联区段与该区段左侧不相邻!', - theRightEndOfTheSelectedAssociatedSectionIsNotAdjacent: '所选择关联区段与该区段右侧不相邻!' + theRightEndOfTheSelectedAssociatedSectionIsNotAdjacent: '所选择关联区段与该区段右侧不相邻!', + selectConcentrateStation:'请选择设备集中站' }; diff --git a/src/jmapNew/config/skinCode/bejing_01.js b/src/jmapNew/config/skinCode/bejing_01.js index 39d3a80c8..4723f37a5 100644 --- a/src/jmapNew/config/skinCode/bejing_01.js +++ b/src/jmapNew/config/skinCode/bejing_01.js @@ -390,6 +390,8 @@ class SkinCode extends defaultStyle { }; this[deviceType.ZcControl] = { + // 是否显示 + visible:true, text: { fontSize: 10, // 字体大小 fontWeight: 'normal', // 字体粗细 diff --git a/src/jmapNew/shape/ZcControl/index.js b/src/jmapNew/shape/ZcControl/index.js index 425016973..7c2dc23e2 100644 --- a/src/jmapNew/shape/ZcControl/index.js +++ b/src/jmapNew/shape/ZcControl/index.js @@ -6,75 +6,77 @@ import EControl from '../element/EControl'; import EMouse from './EMouse'; export default class ZcControl extends Group { - constructor(model, style) { - super(); - this.z = 20; - this._code = model.code; - this._type = model._type; - this.zlevel = model.zlevel; - this.model = model; - this.style = style; - this.create(model); - this.createMouseEvent(); - this.setState(model); + constructor(model, style) { + super(); + this.z = 20; + this._code = model.code; + this._type = model._type; + this.zlevel = model.zlevel; + this.model = model; + this.style = style; + this.create(model); + this.createMouseEvent(); + this.setState(model); - } + } - create(model) { - this.control = new EControl({ - zlevel: this.zlevel, - z: this.z, - arc: { - shape: { - cx: model.position.x, - cy: model.position.y, - r: this.style.ZcControl.lamp.radiusR - }, - lineWidth: 0, - fill: this.style.ZcControl.lamp.controlColor, - mouseover: this.mouseoverArc, - mouseout: this.mouseoutArc - }, - text: { - position: [0, 0], - x: model.position.x, - y: model.position.y + this.style.ZcControl.lamp.radiusR + this.style.ZcControl.text.distance, - fontWeight: this.style.ZcControl.text.fontWeight, - fontSize: this.style.ZcControl.text.fontSize, - fontFamily: this.style.fontFamily, - text: model.name, - textFill: '#fff', - textAlign: 'middle', - textVerticalAlign: 'top', - mouseover: this.mouseoverText, - mouseout: this.mouseoutText - }, - style: this.style - }); + create(model) { + if (this.style.ZcControl.visible) { + this.control = new EControl({ + zlevel: this.zlevel, + z: this.z, + arc: { + shape: { + cx: model.position.x, + cy: model.position.y, + r: this.style.ZcControl.lamp.radiusR + }, + lineWidth: 0, + fill: this.style.ZcControl.lamp.controlColor, + mouseover: this.mouseoverArc, + mouseout: this.mouseoutArc + }, + text: { + position: [0, 0], + x: model.position.x, + y: model.position.y + this.style.ZcControl.lamp.radiusR + this.style.ZcControl.text.distance, + fontWeight: this.style.ZcControl.text.fontWeight, + fontSize: this.style.ZcControl.text.fontSize, + fontFamily: this.style.fontFamily, + text: model.name, + textFill: '#fff', + textAlign: 'middle', + textVerticalAlign: 'top', + mouseover: this.mouseoverText, + mouseout: this.mouseoutText + }, + style: this.style + }); + this.add(this.control); + } - this.add(this.control); - } + } - // 设置状态 - setState(model) { - } - createMouseEvent() { - if (this.style.ZcControl.mouseOverStyle) { - this.mouseEvent = new EMouse(this); - this.add(this.mouseEvent); - this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); }); - this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); }); - } - } - 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; - } + // 设置状态 + setState(model) { + } + createMouseEvent() { + if (this.style.ZcControl.mouseOverStyle) { + this.mouseEvent = new EMouse(this); + this.add(this.mouseEvent); + this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); }); + this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); }); + } + } + 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/jmapNew/utils/parser.js b/src/jmapNew/utils/parser.js index 4b69be2d3..3cbb66406 100644 --- a/src/jmapNew/utils/parser.js +++ b/src/jmapNew/utils/parser.js @@ -194,7 +194,7 @@ export function updateMapData(state, model) { case deviceType.StationStand: updateForList(model, state, 'stationStandList'); break; case deviceType.StationControl: updateForList(model, state, 'stationControlList'); break; case deviceType.StationCounter: updateForList(model, state, 'stationCounterList'); break; - case deviceType.ZcControl: updateForList(model, state, 'zcControlList'); break; + case deviceType.ZcControl: updateForList(model, state, 'zcList'); break; case deviceType.StationDelayUnlock:updateForList(model, state, 'stationDelayUnlockList'); break; case deviceType.LcControl: updateForList(model, state, 'lcControlList'); break; case deviceType.LimitControl: updateForList(model, state, 'tempSpeedLimitList'); break; diff --git a/src/views/newMap/newMapdraft/mapoperate/config/data.vue b/src/views/newMap/newMapdraft/mapoperate/config/data.vue index 3e6493ad4..f65ab489f 100644 --- a/src/views/newMap/newMapdraft/mapoperate/config/data.vue +++ b/src/views/newMap/newMapdraft/mapoperate/config/data.vue @@ -36,6 +36,26 @@ +