调整哈尔滨道岔现地操作

This commit is contained in:
zyy 2020-03-19 17:18:46 +08:00
parent 1df8f5cac4
commit f78d9e80fe
7 changed files with 74 additions and 35 deletions

View File

@ -132,6 +132,9 @@ class Status {
handleGuideLock(device) {
this.statusObj = { };
}
handleResource(device) {
this.statusObj = { };
}
getStatus() {
return this.statusObj;
}

View File

@ -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
}
}));
}

View File

@ -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({

View File

@ -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);
}

View File

@ -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) {

View File

@ -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;
}

View File

@ -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'; // 杜康