diff --git a/src/jmapNew/constant/stateTransition.js b/src/jmapNew/constant/stateTransition.js index 665961fec..d88b91330 100644 --- a/src/jmapNew/constant/stateTransition.js +++ b/src/jmapNew/constant/stateTransition.js @@ -132,6 +132,9 @@ class Status { handleGuideLock(device) { this.statusObj = { }; } + handleResource(device) { + this.statusObj = { }; + } getStatus() { return this.statusObj; } diff --git a/src/jmapNew/shape/Section/ELines.js b/src/jmapNew/shape/Section/ELines.js index bda374f86..6aba140f0 100644 --- a/src/jmapNew/shape/Section/ELines.js +++ b/src/jmapNew/shape/Section/ELines.js @@ -15,6 +15,12 @@ export default class ELines extends Group { create(model) { /** 创建区段*/ if (model && model.points.length > 1) { + let stroke; + stroke = model.style.Section.line.spareColor; + if (model.style.Section.line.isActiveShow) { + stroke = '#2EBFBF'; + } + if (model.isCurve) { const shape = {}; for (let i = 1; i < (model.points.length - 1); i++) { @@ -35,7 +41,7 @@ export default class ELines extends Group { shape: shape, style: { lineWidth: model.style.Section.line.width, - stroke: model.style.Section.line.spareColor, + stroke: stroke, fillOpacity: 0 } }); @@ -55,7 +61,7 @@ export default class ELines extends Group { }, style: { lineWidth: model.style.Section.line.width, - stroke: model.style.Section.line.spareColor + stroke: stroke } })); } diff --git a/src/jmapNew/shape/Section/EMouse.js b/src/jmapNew/shape/Section/EMouse.js index 850274745..77ae6aa67 100644 --- a/src/jmapNew/shape/Section/EMouse.js +++ b/src/jmapNew/shape/Section/EMouse.js @@ -1,7 +1,6 @@ import Group from 'zrender/src/container/Group'; import Text from 'zrender/src/graphic/Text'; import Rect from 'zrender/src/graphic/shape/Rect'; -// import Vue from 'vue'; import store from '@/store'; class EMouse extends Group { constructor(device, code) { @@ -11,6 +10,7 @@ class EMouse extends Group { this.create(); } create() { + // 名称的包围框 if (this.device.name) { const rect = this.device.name.getBoundingRect(); if (!this.device.isSwitchSection) { @@ -66,6 +66,7 @@ class EMouse extends Group { this.add(this.sectionTextShadow); this.sectionTextShadow.hide(); } + // 区段包围框 if (this.device.section) { const rect = this.device.section.getBoundingRect(); this.lineBorder = new Rect({ diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index 7688a2c53..b0c66f4a1 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -30,7 +30,6 @@ export default class Section extends Group { this.create(); this.createMouseEvent(); this.setState(model); - this.checkIsDrawMap(); } create() { @@ -52,16 +51,6 @@ export default class Section extends Group { // } } - createMouseEvent() { - // 鼠标事件 - if (this.style.Section.mouseOverStyle) { // 只有北京线路才会有鼠标事件 - this.mouseEvent = new EMouse(this, this.model.relSwitchCode); - this.add(this.mouseEvent); - this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); }); - this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); }); - } - } - /** 创建区段*/ createSection() { const model = this.model; @@ -88,6 +77,19 @@ export default class Section extends Group { this.add(this.section); this.add(this.sectionBlock); + + if (this.style.Section.line.isActiveShow) { // 哈尔滨线路点击背景色 + this.lineBorder = new ELines({ + zlevel: this.zlevel, + z: this.z - 1, // 逻辑区段层级降低一层 + isSwitchSection: model.switchSection, + isCurve: model.curve, + points: model.type == '04' ? [model.namePosition, model.namePosition] : model.points, + style: style + }); + this.add(this.lineBorder); + this.lineBorder.setStyle({ lineWidth: 0 }); + } } // 折返箭头 @@ -851,16 +853,32 @@ export default class Section extends Group { } } + createMouseEvent() { // 鼠标事件 + if (this.style.Section.mouseOverStyle) { // 只有北京线路才会有鼠标事件 + this.mouseEvent = new EMouse(this, this.model.relSwitchCode); + this.add(this.mouseEvent); + this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); }); + this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); }); + } + const path = window.location.href; + if (path.includes('/map/draw')) { + this.on('mouseout', () => { !this.selectedType && !this.selected && this.section && this.section.setStyle({ stroke: this.style.Section.line.spareColor }); }); + this.on('mouseover', () => { !this.selectedType && this.section && this.section.setStyle({ stroke: '#fbfbfb' }); }); + } + } + drawSelected(selected) { this.selected = selected; if (selected) { if (this.style.Section.line.isActiveShow) { - console.log(111); + this.lineBorder && this.lineBorder.setStyle({ lineWidth: this.style.Section.line.width + 3 }); } else { !this.selectedType && this.section && this.section.setStyle({ stroke: '#fbfbfb' }); } } else { - !this.selectedType && this.section && this.section.setStyle({ stroke: this.style.Section.line.spareColor }); + this.lineBorder && this.lineBorder.setStyle({ lineWidth: 0 }); + // !this.selectedType && this.section && this.section.setStyle({ stroke: this.style.Section.line.spareColor }); + !this.selectedType && this.setState(this.model); } } drawBatchSelected(selected, type) { @@ -875,14 +893,6 @@ export default class Section extends Group { this.selectedType = type; } - checkIsDrawMap() { - const path = window.location.href; - if (path.includes('/map/draw')) { - this.on('mouseout', () => { !this.selectedType && !this.selected && this.section && this.section.setStyle({ stroke: this.style.Section.line.spareColor }); }); - this.on('mouseover', () => { !this.selectedType && this.section && this.section.setStyle({ stroke: '#fbfbfb' }); }); - } - } - mouseout() { this.drawSelected(false); } diff --git a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue index cae23e9bd..83be15396 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue @@ -76,6 +76,7 @@ export default { canCommand: true, operate: '', cmdType: '', + switchRelevanceSectionList: [], // 道岔关联的区段列表 param: {}, tableStyle: { 'border-bottom': 'none', @@ -91,7 +92,12 @@ export default { { name: '取消锁定', cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK, operate: OperationEvent.Switch.unlock.menu.operation, show: false }, { name: '单锁道岔', cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK, operate: OperationEvent.Switch.lock.menu.operation, show: false }, { name: '转换定位', cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION, operate: OperationEvent.Switch.locate.menu.operation, show: false }, - { name: '转换反位', cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION, operate: OperationEvent.Switch.reverse.menu.operation, show: false } + { name: '转换反位', cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION, operate: OperationEvent.Switch.reverse.menu.operation, show: false }, + { name: '封锁区段', cmdType: CMD.Section.CMD_SECTION_BLOCK, operate: OperationEvent.Section.lock.menu.operation, show: false }, + { name: '解封区段', cmdType: CMD.Section.CMD_SECTION_UNBLOCK, operate: OperationEvent.Section.unlock.menu.operation, show: false }, + { name: '轨区消限', cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED, operate: OperationEvent.Section.cancelSpeed.menu.operation, show: false }, + { name: '轨区设限', cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED, operate: OperationEvent.Section.setSpeed.menu.operation, show: false }, + { name: '强解区段', cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK, operate: OperationEvent.Section.fault.menu.operation, show: false } ], signalParamList: [ { name: '追踪单开', cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO, operate: OperationEvent.Signal.setAutoInterlock.menu.operation, show: false }, @@ -136,9 +142,6 @@ export default { switch (this.selected._type) { case 'Switch': this.handleSwicthMenu(); - this.deviceHighLight(this.oldDevice, false); - this.deviceHighLight(this.selected, true); - this.oldDevice = this.selected; break; case 'Signal': if (this.oldClickObj && this.oldClickObj.code != this.selected.code) { @@ -149,9 +152,6 @@ export default { break; case 'Section': this.handleSectionMenu(); - this.deviceHighLight(this.oldDevice, false); - this.deviceHighLight(this.selected, true); - this.oldDevice = this.selected; break; // case 'Station': // this.handleStationMenu(); @@ -204,6 +204,18 @@ export default { }); }, handleSwicthMenu() { // 转换底部道岔菜单栏 + // 获取道岔相关区段显示高亮 + const section = this.$store.getters['map/getDeviceByCode'](this.selected.sectionParentCode); + const sectionA = this.$store.getters['map/getDeviceByCode'](this.selected.sectionACode); // 获取道岔相关的道岔计轴区段 + const sectionB = this.$store.getters['map/getDeviceByCode'](this.selected.sectionBCode); + const sectionC = this.$store.getters['map/getDeviceByCode'](this.selected.sectionCCode); + this.switchRelevanceSectionList = [sectionA, sectionB, sectionC]; + this.deviceHighLight(this.oldDevice, false); + this.switchRelevanceSectionList.forEach(model => { + this.deviceHighLight(model, true); + }); + this.oldDevice = section; + this.centralizedStationList = new Array(15).fill({}); this.swicthParamList.forEach((swicth, index) => { this.centralizedStationList[index] = swicth; @@ -211,7 +223,9 @@ export default { this.tempData = []; this.tempData.push(this.selected); this.param = { - switchCode: this.selected.code + switchCode: this.selected.code, + sectionCode: section.code, + speedLimitValue: 5 }; }, handleSingalMenu() { @@ -261,6 +275,10 @@ export default { } }, handleSectionMenu() { + this.deviceHighLight(this.oldDevice, false); + this.deviceHighLight(this.selected, true); + this.oldDevice = this.selected; + this.centralizedStationList = new Array(15).fill({}); this.sectionParamList.forEach((swicth, index) => { this.centralizedStationList[index] = swicth; @@ -308,7 +326,7 @@ export default { }); }, doClose() { - this.deviceHighLight(this.selected, false); // 当前选中 + this.deviceHighLight(this.oldDevice, false); // 当前选中 this.operate = ''; // 清空指令 this.cmdType = ''; if (this.oldClickObj) { diff --git a/src/jmapNew/utils/parser.js b/src/jmapNew/utils/parser.js index ee8769297..9f7db98c6 100644 --- a/src/jmapNew/utils/parser.js +++ b/src/jmapNew/utils/parser.js @@ -176,6 +176,7 @@ export function parser(data, skinCode, showConfig) { const section = mapDevice[cnodeSection.parentCode]; if (section) { mapDevice[elem.code].sectionName = section.name; + mapDevice[elem.code].sectionParentCode = section.code; section['relSwitchCode'] = elem.code; } diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index d8b10d887..ae880e5e3 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,10 +3,10 @@ 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 = '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.41:9000'; // 张赛 + // BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康