diff --git a/src/jmapNew/config/skinCode/bejing_01.js b/src/jmapNew/config/skinCode/bejing_01.js index 7907c9965..ed8284558 100644 --- a/src/jmapNew/config/skinCode/bejing_01.js +++ b/src/jmapNew/config/skinCode/bejing_01.js @@ -250,6 +250,13 @@ class SkinCode extends defaultStyle { } }; + // 供电线路 + this[deviceType.Power] = { + lineColor: '#FFFFFF', // 线条颜色 + strokeColor: '#ccc', // 线条颜色 + extendLength: 10 // 延伸长度 + }; + this[deviceType.StationStand] = { common: { // 通用属性 textFontSize: 8, // 站台默认字体大小 diff --git a/src/jmapNew/config/skinCode/chengdu_01.js b/src/jmapNew/config/skinCode/chengdu_01.js index f95bfdceb..405c3e819 100644 --- a/src/jmapNew/config/skinCode/chengdu_01.js +++ b/src/jmapNew/config/skinCode/chengdu_01.js @@ -363,6 +363,13 @@ class SkinCode extends defaultStyle { } }; + // 供电线路 + this[deviceType.Power] = { + lineColor: '#FFFFFF', // 线条颜色 + strokeColor: '#ccc', // 线条颜色 + extendLength: 10 // 延伸长度 + }; + this[deviceType.Switch] = { text: { show: true, // 道岔名称显示 diff --git a/src/jmapNew/config/skinCode/chengdu_03.js b/src/jmapNew/config/skinCode/chengdu_03.js index e9c64c29a..a03765d1e 100644 --- a/src/jmapNew/config/skinCode/chengdu_03.js +++ b/src/jmapNew/config/skinCode/chengdu_03.js @@ -200,6 +200,13 @@ class SkinCode extends defaultStyle { } }; + // 供电线路 + this[deviceType.Power] = { + lineColor: '#FFFFFF', // 线条颜色 + strokeColor: '#ccc', // 线条颜色 + extendLength: 10 // 延伸长度 + }; + this[deviceType.StationStand] = { common: { // 通用属性 textFontSize: 10, // 站台默认字体大小 diff --git a/src/jmapNew/config/skinCode/foshan_01.js b/src/jmapNew/config/skinCode/foshan_01.js index 2c5e629be..1986cadc2 100644 --- a/src/jmapNew/config/skinCode/foshan_01.js +++ b/src/jmapNew/config/skinCode/foshan_01.js @@ -383,6 +383,13 @@ class SkinCode extends defaultStyle { } }; + // 供电线路 + this[deviceType.Power] = { + lineColor: '#FFFFFF', // 线条颜色 + strokeColor: '#ccc', // 线条颜色 + extendLength: 10 // 延伸长度 + }; + this[deviceType.Switch] = { text: { show: true, // 道岔名称显示 diff --git a/src/jmapNew/config/skinCode/fuzhou_01.js b/src/jmapNew/config/skinCode/fuzhou_01.js index 721c93775..323487877 100644 --- a/src/jmapNew/config/skinCode/fuzhou_01.js +++ b/src/jmapNew/config/skinCode/fuzhou_01.js @@ -329,8 +329,8 @@ class SkinCode extends defaultStyle { }, StationControl:{ text: { - distance: 2, // 灯和文字之间的距离 - fontSize: 11, // 字体大小 + distance: 10, // 灯和文字之间的距离 + fontSize: 14, // 字体大小 fontFormat: 'consolas', // 字体格式 fontColor: '#ffffff', // 字体颜色 fontWeight: 'normal', // 字体粗细 @@ -345,9 +345,9 @@ class SkinCode extends defaultStyle { }, lamp: { count: 2, // 控制模式灯个数 - offset: {x: 0, y: 0}, // 控制模式灯偏移量 - radiusR: 4, // 控制模式灯的半径 - distance: 36, // 控制模式之间灯之间的距离 + offset: {x: 0, y: 3}, // 控制模式灯偏移量 + radiusR: 7, // 控制模式灯的半径 + distance: 42, // 控制模式之间灯之间的距离 grayColor: '#7F7F7F', // 控制模式灰色 greenColor: '#00FF00', // 控制模式绿色 redColor: '#FF0000', // 控制模式红色 @@ -418,6 +418,12 @@ class SkinCode extends defaultStyle { this[deviceType.Line] = { lineColor: '#FFFFFF' // 线条颜色 }; + // 供电线路 + this[deviceType.Power] = { + lineColor: '#FFFFFF', // 线条颜色 + strokeColor: '#ccc', // 线条颜色 + extendLength: 8 // 延伸长度 + }; this[deviceType.LcControl] = { text: { diff --git a/src/jmapNew/config/skinCode/haerbin_01.js b/src/jmapNew/config/skinCode/haerbin_01.js index 4ddba9dab..eabbb5a93 100644 --- a/src/jmapNew/config/skinCode/haerbin_01.js +++ b/src/jmapNew/config/skinCode/haerbin_01.js @@ -392,6 +392,13 @@ class SkinCode extends defaultStyle { } }; + // 供电线路 + this[deviceType.Power] = { + lineColor: '#FFFFFF', // 线条颜色 + strokeColor: '#ccc', // 线条颜色 + extendLength: 10 // 延伸长度 + }; + this[deviceType.Switch] = { text: { show: true, // 道岔名称显示 diff --git a/src/jmapNew/config/skinCode/ningbo_01.js b/src/jmapNew/config/skinCode/ningbo_01.js index 521b51b5f..83e597622 100644 --- a/src/jmapNew/config/skinCode/ningbo_01.js +++ b/src/jmapNew/config/skinCode/ningbo_01.js @@ -411,6 +411,13 @@ class SkinCode extends defaultStyle { } }; + // 供电线路 + this[deviceType.Power] = { + lineColor: '#FFFFFF', // 线条颜色 + strokeColor: '#ccc', // 线条颜色 + extendLength: 10 // 延伸长度 + }; + this[deviceType.StationDelayUnlock] = { text: { distance: 3, // 延迟解锁和设备之间的距离 diff --git a/src/jmapNew/config/skinCode/xian_01.js b/src/jmapNew/config/skinCode/xian_01.js index 8953afb6d..549f88141 100644 --- a/src/jmapNew/config/skinCode/xian_01.js +++ b/src/jmapNew/config/skinCode/xian_01.js @@ -387,6 +387,13 @@ class SkinCode extends defaultStyle { } }; + // 供电线路 + this[deviceType.Power] = { + lineColor: '#FFFFFF', // 线条颜色 + strokeColor: '#ccc', // 线条颜色 + extendLength: 10 // 延伸长度 + }; + this[deviceType.Switch] = { text: { show: true, // 道岔名称显示 diff --git a/src/jmapNew/config/skinCode/xian_02.js b/src/jmapNew/config/skinCode/xian_02.js index 504339c51..526937ad6 100644 --- a/src/jmapNew/config/skinCode/xian_02.js +++ b/src/jmapNew/config/skinCode/xian_02.js @@ -509,6 +509,14 @@ class SkinCode extends defaultStyle { lineColor: '#FFFFFF', // 线条颜色 lineDash: [8, 4] }; + + // 供电线路 + this[deviceType.Power] = { + lineColor: '#FFFFFF', // 线条颜色 + strokeColor: '#ccc', // 线条颜色 + extendLength: 10 // 延伸长度 + }; + this[deviceType.AutomaticRoute] = { // 是否显示 displayCondition: '03', // 显示条件 prdType diff --git a/src/jmapNew/constant/deviceRender.js b/src/jmapNew/constant/deviceRender.js index e277dece8..29d99baaa 100644 --- a/src/jmapNew/constant/deviceRender.js +++ b/src/jmapNew/constant/deviceRender.js @@ -245,4 +245,9 @@ deviceRender[deviceType.Arrow] = { _type: deviceType.Arrow, zlevel: 1 }; +/** 供电线路 */ +deviceRender[deviceType.Power] = { + _type: deviceType.Power, + zlevel: 1 +}; export default deviceRender; diff --git a/src/jmapNew/constant/deviceType.js b/src/jmapNew/constant/deviceType.js index ec7d703d5..a39d6567b 100644 --- a/src/jmapNew/constant/deviceType.js +++ b/src/jmapNew/constant/deviceType.js @@ -42,7 +42,8 @@ const deviceType = { Axle: 'Axle', SplitStation:'SplitStation', SwitchFault: 'SwitchFault', - Arrow: 'Arrow' + Arrow: 'Arrow', + Power: 'Power' }; export default deviceType; diff --git a/src/jmapNew/shape/Power/ESeparator.js b/src/jmapNew/shape/Power/ESeparator.js new file mode 100644 index 000000000..dca0071f9 --- /dev/null +++ b/src/jmapNew/shape/Power/ESeparator.js @@ -0,0 +1,47 @@ +import Group from 'zrender/src/container/Group'; +import Polyline from 'zrender/src/graphic/shape/Polyline'; + +/** 分隔符*/ +export default class ESeparator extends Group { + constructor(model) { + super(); + this.model = model; + this.zlevel = model.zlevel; + this.z = model.z || 6; + this.style = model.style; + this.setType(); + } + + createModel(points) { + const model = this.model; + this.partition = new Polyline({ + zlevel: this.zlevel, + progressive: model.progressive, + z: this.z, + shape: { + points: points + }, + style: { + lineWidth: model.width, + stroke: model.stroke + } + }); + this.add(this.partition); + } + + setType() { + const model = this.model; + if (model && model.traingle) { + const points = [ + [model.point.x, model.point.y - (this.style.Power.extendLength)], + [model.point.x, model.point.y + (this.style.Power.extendLength)] + ]; + this.createModel(points); + } + if (model.traingle) { + this.origin = [model.point.x, model.point.y]; + this.rotation = Math.PI * 2 - Math.atan2(model.traingle.absy, model.traingle.absx) * model.traingle.drictx * model.traingle.dricty; + this.dirty(); // 可以无需调用 + } + } +} diff --git a/src/jmapNew/shape/Power/index.js b/src/jmapNew/shape/Power/index.js new file mode 100644 index 000000000..fbdb5c81f --- /dev/null +++ b/src/jmapNew/shape/Power/index.js @@ -0,0 +1,131 @@ +import Polyline from 'zrender/src/graphic/shape/Polyline'; +import Group from 'zrender/src/container/Group'; +import JTriangle from '../../utils/JTriangle'; +import ESeparator from './ESeparator'; +import {isShowThePrdType} from '../../utils/handlePath'; + +export default class Line2 extends Group { + constructor(model, style) { + super(); + this._code = model.code; + this._type = model._type; + this.zlevel = model.zlevel; + this.z = 0; + this.model = model; + this.style = style; + this.isShowShape = true; + if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) { + this.create(); + this.createTerminal(); + this.setState(model); + } + if (model.previewOrMapDraw) { + this.setShowMode(); + } + } + + create() { + const model = this.model; + const style = this.style; + if (model && model.points.length > 1) { + const points = []; + for (let i = 0; i < model.points.length; i++) { + points.push([model.points[i].x, model.points[i].y]); + } + this.line = new Polyline({ + zlevel: this.zlevel, + progressive: model.progressive, + z: this.z, + shape: { + points: points + }, + style: { + lineWidth: model.width, + stroke: style.Power.strokeColor + } + }); + this.add(this.line); + } + } + + createTerminal() { // 创建左右端点 + const model = this.model; + const style = this.style; + if (model && model.leftTerminal) { // 左端点 + const traingle = new JTriangle(model.points[0], model.points[1]); + this.leftTerminal = new ESeparator({ + style: style, + zlevel: this.zlevel, + z: this.z + 3, + traingle: traingle, + width: model.width, + stroke: style.Power.strokeColor, + point: { + x: model.points[0].x, + y: model.points[0].y + } + }); + this.add(this.leftTerminal); + } + if (model && model.rightTerminal) { // 右端点 + const traingle = new JTriangle(model.points[model.points.length - 2], model.points[model.points.length - 1]); + this.rightTerminal = new ESeparator({ + style: style, + zlevel: this.zlevel, + z: this.z + 3, + traingle: traingle, + width: model.width, + stroke: style.Power.strokeColor, + point: { + x: model.points[model.points.length - 1].x, + y: model.points[model.points.length - 1].y + } + }); + this.add(this.rightTerminal); + } + } + + setLineType(type) { + switch (type) { + case '01': break; + case '02': + this.eachChild((child) => { + child.setStyle('lineDash', this.style.Line.lineDash || [4]); + }); + break; + } + } + + setState(model) { + if (!this.isShowShape) return; + this.setLineType(model.type); + } + // 设置显示模式 + setShowMode() { + const showMode = this.model.showMode; + const showConditions = this.model.showConditions; + if (!showConditions || showConditions === '01' || showMode === showConditions) { + this.eachChild((child) => { + child.show(); + }); + } else { + this.eachChild((child) => { + child.hide(); + }); + } + } + setShowStation(stationCode) { + if (!stationCode || this.model.stationCode === stationCode) { + this.eachChild((child) => { + child.show(); + }); + this.isShowShape = true; + this.setState(this.model); + } else { + this.eachChild((child) => { + child.hide(); + }); + this.isShowShape = false; + } + } +} diff --git a/src/jmapNew/shape/Station/ESingleControl.js b/src/jmapNew/shape/Station/ESingleControl.js index ad2956851..3d87a0ec7 100644 --- a/src/jmapNew/shape/Station/ESingleControl.js +++ b/src/jmapNew/shape/Station/ESingleControl.js @@ -70,6 +70,12 @@ export default class ESingleControl extends Group { this.control.setStyle('fill', color); } } + + setTextColor(color) { + if (color) { + this.text.setStyle('textFill', color); + } + } getArcBoundingRect() { const rect = this.control.getBoundingRect().clone(); const scale = this.control.scale[0]; diff --git a/src/jmapNew/shape/Station/index.js b/src/jmapNew/shape/Station/index.js index ca5433e33..d508a395a 100644 --- a/src/jmapNew/shape/Station/index.js +++ b/src/jmapNew/shape/Station/index.js @@ -291,12 +291,15 @@ export default class Station extends Group { this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.greenColor); + this.centerControl && this.centerControl.setTextColor(this.style.Station.StationControl.lamp.greenColor); // 文字颜色 } handleLocal() { // 站控 this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor); + this.substationControl && this.substationControl.setTextColor(this.style.Station.StationControl.lamp.yellowColor); // 文字颜色 this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor); + this.arrowsControl && this.arrowsControl.setColor(this.style.Station.StationControl.lamp.greenColor); } handleEmergency() { // 紧急站控 @@ -315,7 +318,8 @@ export default class Station extends Group { setState(model) { if (!this.isShowShape) return; this.recover(); - model.controlMode && this['handle' + model.controlMode](); + // model.controlMode && this['handle' + model.controlMode](); + this.handleLocal(); } getShapeTipPoint(opts) { diff --git a/src/jmapNew/shape/factory.js b/src/jmapNew/shape/factory.js index 4741ab55a..02ed5d3c7 100644 --- a/src/jmapNew/shape/factory.js +++ b/src/jmapNew/shape/factory.js @@ -24,6 +24,7 @@ import AutomaticRoute from './AutomacticRoute/index.js'; import SaidLamp from './SaidLamp/index.js'; import SplitStation from './SplitStation/index'; import Arrow from './Arrow/index'; +import Power from './Power/index'; /** 图库*/ const mapShape = {}; @@ -69,6 +70,7 @@ mapShape[deviceType.Axle] = SaidLamp; mapShape[deviceType.SwitchFault] = SaidLamp; mapShape[deviceType.SplitStation] = SplitStation; mapShape[deviceType.Arrow] = Arrow; +mapShape[deviceType.Power] = Power; function shapefactory(device, jmap) { const type = device._type; diff --git a/src/jmapNew/utils/parser.js b/src/jmapNew/utils/parser.js index e75dc26ed..c7c3f6186 100644 --- a/src/jmapNew/utils/parser.js +++ b/src/jmapNew/utils/parser.js @@ -144,9 +144,12 @@ export function parser(data, skinCode, showConfig) { zrUtil.each(data.splitStationList || [], elem => { mapDevice[elem.code] = createDevice(deviceType.SplitStation, elem, propConvert, showConfig); }, this); - zrUtil.each( data.arrowList || [], elem => { + zrUtil.each(data.arrowList || [], elem => { mapDevice[elem.code] = createDevice(deviceType.Arrow, elem, propConvert, showConfig); }, this); + zrUtil.each(data.powerList || [], elem => { + mapDevice[elem.code] = createDevice(deviceType.Power, elem, propConvert, showConfig); + }, this); zrUtil.each(data.indicatorLightList || [], elem => { switch (elem.type) { case 'AtsControl': @@ -326,6 +329,7 @@ export function updateMapData(state, model) { case deviceType.SplitStation: updateForList(model, state, 'splitStationList'); break; case deviceType.SwitchFault: updateForList(model, state, 'indicatorLightList'); break; case deviceType.Arrow: updateForList(model, state, 'arrowList'); break; + case deviceType.Power: updateForList(model, state, 'powerList'); break; } } } diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 3205a7be4..96f3d7bd4 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -342,6 +342,13 @@ const map = { return []; } }, + powerList: (state) => { + if (state.map) { + return state.map.powerList || []; + } else { + return []; + } + }, tempSpeedLimitList: (state) => { if (state.map) { return state.map.tempSpeedLimitList; diff --git a/src/views/jsxt/competition/examDetail.vue b/src/views/jsxt/competition/examDetail.vue index 48ecc8904..46375740c 100644 --- a/src/views/jsxt/competition/examDetail.vue +++ b/src/views/jsxt/competition/examDetail.vue @@ -182,7 +182,7 @@ export default { } else { getPracticalQuestion(this.$route.query.raceId).then((responese)=>{ if (responese.data) { - participantCreatTrainingRoom(this.$route.query.raceId, {mapId: 41, prdType: '02'}).then(resp => { + participantCreatTrainingRoom(this.$route.query.raceId, {mapId: 41, prdType: '03'}).then(resp => { const query = { lineCode: '11', mapId: '41', group: resp.data, raceId: this.$route.query.raceId}; this.$router.replace({ path: `/jointTrainingNew`, query: query}); }); diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index 88352b0da..618cd1663 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -133,6 +133,14 @@ @setCenter="setCenter" /> + + + + + +
+ + + +
+ + {{ $t('map.updateObj') }} + {{ $t('map.deleteObj') }} + +
+ +
+ + + + px + + + + {{ $t('map.localCenter') }} + {{ $t('map.center') }} + {{ $t('map.local') }} + + +
+ {{ $t('map.linePoint') }} +
+ +
+
+
+
+
+ + {{ $t('map.create') }} + +
+
+ + + +