Merge branch 'dev' of https://git.code.tencent.com/lian-cbtc/jl-client into dev
# Conflicts: # src/jmapNew/shape/Automactic/index.js
This commit is contained in:
commit
8c71459ac1
@ -6,6 +6,7 @@ import Arc from 'zrender/src/graphic/shape/Arc';
|
|||||||
import Text from 'zrender/src/graphic/Text';
|
import Text from 'zrender/src/graphic/Text';
|
||||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||||
import EMouse from './EMouse';
|
import EMouse from './EMouse';
|
||||||
|
import {getPrdType} from '../utils/handlePath';
|
||||||
|
|
||||||
export default class Automactic extends Group {
|
export default class Automactic extends Group {
|
||||||
constructor(model, style) {
|
constructor(model, style) {
|
||||||
@ -16,17 +17,8 @@ export default class Automactic extends Group {
|
|||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.prdType = '';
|
this.prdType = getPrdType();
|
||||||
const path = window.location.href;
|
if (!this.prdType || this.style.MapCycleButtonVO.visibleConditions.indexOf(this.prdType) !== -1) {
|
||||||
if (path.includes('?')) {
|
|
||||||
const arr = window.location.href.split('?')[1].split('&');
|
|
||||||
arr.forEach(elem => {
|
|
||||||
if (elem.split('=')[0] === 'prdType') {
|
|
||||||
this.prdType = elem.split('=')[1];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (!this.prdType || this.style.AutomaticRoute.displayCondition.indexOf(this.prdType) !== -1) {
|
|
||||||
this.create();
|
this.create();
|
||||||
this.createMouseEvent();
|
this.createMouseEvent();
|
||||||
this.setState(model);
|
this.setState(model);
|
||||||
|
@ -5,6 +5,7 @@ import Group from 'zrender/src/container/Group';
|
|||||||
import Arc from 'zrender/src/graphic/shape/Arc';
|
import Arc from 'zrender/src/graphic/shape/Arc';
|
||||||
import Text from 'zrender/src/graphic/Text';
|
import Text from 'zrender/src/graphic/Text';
|
||||||
import EMouse from './EMouse';
|
import EMouse from './EMouse';
|
||||||
|
import {getPrdType} from '../utils/handlePath';
|
||||||
|
|
||||||
export default class LcControl extends Group {
|
export default class LcControl extends Group {
|
||||||
constructor(model, style) {
|
constructor(model, style) {
|
||||||
@ -15,13 +16,7 @@ export default class LcControl extends Group {
|
|||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
const arr = window.location.href.split('?')[1].split('&');
|
this.prdType = getPrdType();
|
||||||
this.prdType = '';
|
|
||||||
arr.forEach(elem => {
|
|
||||||
if (elem.split('=')[0] === 'prdType') {
|
|
||||||
this.prdType = elem.split('=')[1];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (!this.prdType || this.style.AutomaticRoute.displayCondition.indexOf(this.prdType) !== -1) {
|
if (!this.prdType || this.style.AutomaticRoute.displayCondition.indexOf(this.prdType) !== -1) {
|
||||||
this.create();
|
this.create();
|
||||||
this.createMouseEvent();
|
this.createMouseEvent();
|
||||||
|
@ -30,6 +30,7 @@ export default class LcControl extends Group {
|
|||||||
cy: model.position.y,
|
cy: model.position.y,
|
||||||
r: this.style.LcControl.lamp.radiusR
|
r: this.style.LcControl.lamp.radiusR
|
||||||
},
|
},
|
||||||
|
subType: 'Control',
|
||||||
lineWidth: 0,
|
lineWidth: 0,
|
||||||
fill: this.style.LcControl.lamp.controlColor
|
fill: this.style.LcControl.lamp.controlColor
|
||||||
},
|
},
|
||||||
|
@ -6,77 +6,78 @@ import EControl from '../element/EControl';
|
|||||||
import EMouse from './EMouse';
|
import EMouse from './EMouse';
|
||||||
|
|
||||||
export default class LimitControl extends Group {
|
export default class LimitControl extends Group {
|
||||||
constructor(model, style) {
|
constructor(model, style) {
|
||||||
super();
|
super();
|
||||||
this.selected = false;
|
this.selected = false;
|
||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.z = 20;
|
this.z = 20;
|
||||||
this.create(model);
|
this.create(model);
|
||||||
this.createMouseEvent();
|
this.createMouseEvent();
|
||||||
this.setState(model);
|
this.setState(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
create(model) {
|
create(model) {
|
||||||
this.control = new EControl({
|
this.control = new EControl({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
arc: {
|
arc: {
|
||||||
shape: {
|
shape: {
|
||||||
cx: model.position.x,
|
cx: model.position.x,
|
||||||
cy: model.position.y,
|
cy: model.position.y,
|
||||||
r: this.style.LimitControl.lamp.radiusR
|
r: this.style.LimitControl.lamp.radiusR
|
||||||
},
|
},
|
||||||
lineWidth: 0,
|
subType: 'Control',
|
||||||
fill: this.style.LimitControl.lamp.controlColor,
|
lineWidth: 0,
|
||||||
mouseover: this.mouseoverArc,
|
fill: this.style.LimitControl.lamp.controlColor,
|
||||||
mouseout: this.mouseoutArc
|
mouseover: this.mouseoverArc,
|
||||||
},
|
mouseout: this.mouseoutArc
|
||||||
text: {
|
},
|
||||||
position: [0, 0],
|
text: {
|
||||||
x: model.position.x,
|
position: [0, 0],
|
||||||
y: model.position.y + this.style.LimitControl.lamp.radiusR + this.style.LimitControl.text.distance,
|
x: model.position.x,
|
||||||
fontWeight: this.style.LimitControl.text.fontWeight,
|
y: model.position.y + this.style.LimitControl.lamp.radiusR + this.style.LimitControl.text.distance,
|
||||||
fontSize: this.style.LimitControl.text.fontSize,
|
fontWeight: this.style.LimitControl.text.fontWeight,
|
||||||
fontFamily: this.style.fontFamily,
|
fontSize: this.style.LimitControl.text.fontSize,
|
||||||
text: model.name,
|
fontFamily: this.style.fontFamily,
|
||||||
textFill: '#fff',
|
text: model.name,
|
||||||
textAlign: 'middle',
|
textFill: '#fff',
|
||||||
textVerticalAlign: 'top',
|
textAlign: 'middle',
|
||||||
mouseover: this.mouseoverText,
|
textVerticalAlign: 'top',
|
||||||
mouseout: this.mouseoutText
|
mouseover: this.mouseoverText,
|
||||||
},
|
mouseout: this.mouseoutText
|
||||||
style: this.style
|
},
|
||||||
});
|
style: this.style
|
||||||
|
});
|
||||||
|
|
||||||
this.add(this.control);
|
this.add(this.control);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置状态
|
// 设置状态
|
||||||
setState(model) {
|
setState(model) {
|
||||||
}
|
}
|
||||||
|
|
||||||
createMouseEvent() {
|
createMouseEvent() {
|
||||||
if (this.style.LimitControl.mouseOverStyle) {
|
if (this.style.LimitControl.mouseOverStyle) {
|
||||||
this.mouseEvent = new EMouse(this);
|
this.mouseEvent = new EMouse(this);
|
||||||
this.add(this.mouseEvent);
|
this.add(this.mouseEvent);
|
||||||
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
|
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
|
||||||
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getShapeTipPoint() {
|
getShapeTipPoint() {
|
||||||
if (this.control) {
|
if (this.control) {
|
||||||
var distance = 2;
|
var distance = 2;
|
||||||
var rect = this.control.getBoundingRect();
|
var rect = this.control.getBoundingRect();
|
||||||
return {
|
return {
|
||||||
x: rect.x + rect.width / 2,
|
x: rect.x + rect.width / 2,
|
||||||
y: rect.y - distance
|
y: rect.y - distance
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import Line from 'zrender/src/graphic/shape/Line';
|
import Line from 'zrender/src/graphic/shape/Line';
|
||||||
import Group from 'zrender/src/container/Group';
|
import Group from 'zrender/src/container/Group';
|
||||||
|
import {getPrdType, isShowThePrdType} from '../utils/handlePath';
|
||||||
|
|
||||||
export default class Line2 extends Group {
|
export default class Line2 extends Group {
|
||||||
constructor(model, style) {
|
constructor(model, style) {
|
||||||
@ -10,8 +11,11 @@ export default class Line2 extends Group {
|
|||||||
this.z = 0;
|
this.z = 0;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.create();
|
this.prdType = getPrdType();
|
||||||
this.setState(model);
|
if (isShowThePrdType(this.prdType, model.showConditions)) {
|
||||||
|
this.create();
|
||||||
|
this.setState(model);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import Group from 'zrender/src/container/Group';
|
import Group from 'zrender/src/container/Group';
|
||||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||||
|
import {getPrdType, isShowThePrdType} from '../utils/handlePath';
|
||||||
|
|
||||||
export default class OutFrame extends Group {
|
export default class OutFrame extends Group {
|
||||||
constructor(model, style) {
|
constructor(model, style) {
|
||||||
@ -10,8 +11,11 @@ export default class OutFrame extends Group {
|
|||||||
this.style = style;
|
this.style = style;
|
||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.z = 0;
|
this.z = 0;
|
||||||
this.create();
|
this.prdType = getPrdType();
|
||||||
this.setState(model);
|
if (isShowThePrdType(this.prdType, model.showConditions)) {
|
||||||
|
this.create();
|
||||||
|
this.setState(model);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
|
46
src/jmapNew/shape/Section/ETriangle.js
Normal file
46
src/jmapNew/shape/Section/ETriangle.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import Group from 'zrender/src/container/Group';
|
||||||
|
import Polygon from 'zrender/src/graphic/shape/Polygon';
|
||||||
|
|
||||||
|
/** 创建三角形*/
|
||||||
|
export default class ETriangle extends Group {
|
||||||
|
constructor(model) {
|
||||||
|
super();
|
||||||
|
this.model = model;
|
||||||
|
this.zlevel = model.zlevel;
|
||||||
|
this.z = model.z;
|
||||||
|
this.create(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
create(model) {
|
||||||
|
if (model && model.point) {
|
||||||
|
const right = model.right == 1 ? 1 : -1;
|
||||||
|
this.angle = new Polygon({
|
||||||
|
zlevel: model.zlevel,
|
||||||
|
z: model.z,
|
||||||
|
shape: {
|
||||||
|
points:[[model.point.x + 10 * right, model.point.y], [model.point.x + (1 - right) * 10 / 4, model.point.y - 6], [model.point.x + (1 - right) * 10 / 4, model.point.y + 6]]
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
stroke:'#FFFF00',
|
||||||
|
lineWidth: 0.5,
|
||||||
|
fill: '#FFFF00'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.add(this.angle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 隐藏
|
||||||
|
hide() {
|
||||||
|
this.angle.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示
|
||||||
|
show() {
|
||||||
|
this.angle.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
// setModel(model) {
|
||||||
|
// this.shape
|
||||||
|
// }
|
||||||
|
}
|
@ -3,13 +3,14 @@ import ETextName from '../element/ETextName'; // 名称文字 (共有)
|
|||||||
import ERelease from './ERelease'; // 线段 (共有)
|
import ERelease from './ERelease'; // 线段 (共有)
|
||||||
import ELimitLines from './ELimitLines'; // 区段限速 (私有)
|
import ELimitLines from './ELimitLines'; // 区段限速 (私有)
|
||||||
import ELines from './ELines'; // 创建多线条 曲线 (私有)
|
import ELines from './ELines'; // 创建多线条 曲线 (私有)
|
||||||
import EblockLines from './EblockLines'; // 区段封锁特有
|
import EblockLines from './EblockLines'; // 区段封锁特有
|
||||||
import ESeparator from './ESeparator'; // 分隔符 (私有)
|
import ESeparator from './ESeparator'; // 分隔符 (私有)
|
||||||
import EMouse from './EMouse';
|
import EMouse from './EMouse';
|
||||||
import { EAxle } from './EAxle'; // 创建计轴 (私有)
|
import { EAxle } from './EAxle'; // 创建计轴 (私有)
|
||||||
import { EBackArrow, EBackArrowTriangle } from './EBackArrow'; // 折返进路箭头
|
import { EBackArrow, EBackArrowTriangle } from './EBackArrow'; // 折返进路箭头
|
||||||
import ELimitName from './ELimitName'; // 成都三号线 限速名称
|
import ELimitName from './ELimitName'; // 成都三号线 限速名称
|
||||||
import JTriangle from '../../utils/JTriangle';
|
import JTriangle from '../../utils/JTriangle';
|
||||||
|
import ETriangle from './ETriangle';
|
||||||
import router from '@/router';
|
import router from '@/router';
|
||||||
import { drawSectionStyle } from '../../config/defaultStyle';
|
import { drawSectionStyle } from '../../config/defaultStyle';
|
||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
@ -45,6 +46,9 @@ export default class Section extends Group {
|
|||||||
this.creatRelease(); // 创建延时释放
|
this.creatRelease(); // 创建延时释放
|
||||||
this.createSeparator(); // 创建分隔符
|
this.createSeparator(); // 创建分隔符
|
||||||
this.createTurnBack(); // 创建成都三号线 折返箭头
|
this.createTurnBack(); // 创建成都三号线 折返箭头
|
||||||
|
if (this.style.Section.trainPosition.display) {
|
||||||
|
this.createTriangle(); // 创建成都一号线 列车精确位置
|
||||||
|
}
|
||||||
if (model.type === '01' && model.type === '03') {
|
if (model.type === '01' && model.type === '03') {
|
||||||
this.createAxles(); // 创建计轴
|
this.createAxles(); // 创建计轴
|
||||||
}
|
}
|
||||||
@ -577,7 +581,7 @@ export default class Section extends Group {
|
|||||||
recover() {
|
recover() {
|
||||||
if (this.section) {
|
if (this.section) {
|
||||||
this.section.stopAnimation(true);
|
this.section.stopAnimation(true);
|
||||||
this.sectionBlock && this.sectionBlock.hide(); // 因此特殊区段
|
this.sectionBlock && this.sectionBlock.hide(); // 因此特殊区段
|
||||||
this.section.setStyle({
|
this.section.setStyle({
|
||||||
fill: this.style.backgroundColor,
|
fill: this.style.backgroundColor,
|
||||||
stroke: this.style.Section.line.spareColor,
|
stroke: this.style.Section.line.spareColor,
|
||||||
@ -591,6 +595,11 @@ export default class Section extends Group {
|
|||||||
this.remove(this.speedLimitLeft);
|
this.remove(this.speedLimitLeft);
|
||||||
this.remove(this.speedLimitRight);
|
this.remove(this.speedLimitRight);
|
||||||
}
|
}
|
||||||
|
if (this.style.Section.trainPosition.display) {
|
||||||
|
this.triangleL.hide();
|
||||||
|
this.triangleR.hide();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -644,6 +653,121 @@ export default class Section extends Group {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// updateTriangle(model) {
|
||||||
|
// if(model.offsetp)
|
||||||
|
// // if (model.right && model.points.length > 1) {
|
||||||
|
// // this.triangle.setModel([model.points[0].x + (model.points[1].x - model.points[0].x) * model.offsetp, model.points[0].y]);
|
||||||
|
// // }
|
||||||
|
// this.triangle.show();
|
||||||
|
// }
|
||||||
|
|
||||||
|
createTriangle() {
|
||||||
|
const model = this.model;
|
||||||
|
this.triangleL = new ETriangle({
|
||||||
|
style: this.style,
|
||||||
|
zlevel: this.zlevel,
|
||||||
|
z:10,
|
||||||
|
right: 0,
|
||||||
|
point:{x:model.points[model.points.length - 1].x, y:model.points[model.points.length - 1].y}
|
||||||
|
});
|
||||||
|
this.triangleR = new ETriangle({
|
||||||
|
style: this.style,
|
||||||
|
zlevel: this.zlevel,
|
||||||
|
z:10,
|
||||||
|
right: 1,
|
||||||
|
point:{x:model.points[0].x, y:model.points[0].y}
|
||||||
|
});
|
||||||
|
this.add(this.triangleL);
|
||||||
|
this.add(this.triangleR);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 成都一号线列车的精确位置
|
||||||
|
updateTriangle() {
|
||||||
|
const model = this.model;
|
||||||
|
// debugger;
|
||||||
|
// if (model.hideOld) {
|
||||||
|
// // debugger;
|
||||||
|
// if (model.right == 1) {
|
||||||
|
// this.triangleR.hide();
|
||||||
|
// } else {
|
||||||
|
// this.triangleL.hide();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
if (model.right != undefined && model.offsetp != undefined && model.points.length > 1) {
|
||||||
|
const newX = model.points[0].x + (model.points[1].x - model.points[0].x) * model.offsetp;
|
||||||
|
const newY = model.points[0].y + (model.points[1].y - model.points[0].y) * model.offsetp;
|
||||||
|
if (!model.oldX && !model.oldY) {
|
||||||
|
model.oldX = this.triangleL.model.point.x;
|
||||||
|
model.oldY = this.triangleL.model.point.y;
|
||||||
|
}
|
||||||
|
if (model.right == 1) {
|
||||||
|
if (model.hideOld) {
|
||||||
|
// debugger;
|
||||||
|
this.triangleR.hide();
|
||||||
|
}
|
||||||
|
this.triangleL.hide();
|
||||||
|
this.triangleR.show();
|
||||||
|
this.triangleR.position = [newX - model.oldX, newY - model.oldY];
|
||||||
|
// const runner = this.triangleR.animate('position', false).when(100, [newX - model.oldX, newY - model.oldY]);
|
||||||
|
// runner.done(function() {
|
||||||
|
// runner.stop();
|
||||||
|
// data.hide();
|
||||||
|
// model.oldX = newX;
|
||||||
|
// model.oldY = newY;
|
||||||
|
// }).start();
|
||||||
|
} else {
|
||||||
|
if (model.hideOld) {
|
||||||
|
this.triangleL.hide();
|
||||||
|
}
|
||||||
|
this.triangleR.hide();
|
||||||
|
this.triangleL.show();
|
||||||
|
this.triangleL.position = [newX - model.oldX, newY - model.oldY];
|
||||||
|
// const runner = this.triangleL.animate('position', false).when(100, [newX - model.oldX, newY - model.oldY]);
|
||||||
|
// runner.done(function() {
|
||||||
|
// // debugger;
|
||||||
|
// runner.stop();
|
||||||
|
// data.hide();
|
||||||
|
// model.oldX = newX;
|
||||||
|
// model.oldY = newY;
|
||||||
|
// }).start();
|
||||||
|
// stopAnimation(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (!model.hasTriangle) {
|
||||||
|
// this.triangle = new ETriangle({
|
||||||
|
// style: this.style,
|
||||||
|
// zlevel: this.zlevel,
|
||||||
|
// z:1000,
|
||||||
|
// right: model.right,
|
||||||
|
// point:{x:model.points[0].x + (model.points[1].x - model.points[0].x) * model.offsetp, y:model.points[0].y}
|
||||||
|
// });
|
||||||
|
// /** 添加视图*/
|
||||||
|
// this.add(this.triangle);
|
||||||
|
// model.hasTriangle = true;
|
||||||
|
// } else {
|
||||||
|
// // debugger;
|
||||||
|
// console.log(2222222);
|
||||||
|
// const newX = model.points[0].x + (model.points[1].x - model.points[0].x) * model.offsetp;
|
||||||
|
// const newY = model.points[0].y;
|
||||||
|
// // debugger;
|
||||||
|
// if (this.triangle) {
|
||||||
|
// if (model.offsetp >= 1) {
|
||||||
|
// this.remove(this.triangle);
|
||||||
|
// model.hasTriangle = false;
|
||||||
|
// } else {
|
||||||
|
// // this.remove(this.triangle);
|
||||||
|
// // model.hasTriangle = false;
|
||||||
|
// const runner = this.triangle.animate('position', true).when(100, [newX - this.triangle.model.point.x, newY - this.triangle.model.point.y]);
|
||||||
|
// runner.start();
|
||||||
|
// }
|
||||||
|
// // this.triangle.position = [newX - this.triangle.model.point.x, newY - this.triangle.model.point.y];
|
||||||
|
// // this.triangle.dirty();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 封锁 06*/
|
/** 封锁 06*/
|
||||||
block() {
|
block() {
|
||||||
if (this.style.Section.block.special) {
|
if (this.style.Section.block.special) {
|
||||||
@ -803,6 +927,8 @@ export default class Section extends Group {
|
|||||||
}
|
}
|
||||||
/** 道岔保护区段锁闭 */
|
/** 道岔保护区段锁闭 */
|
||||||
model.overlapLock && this.protectiveLock();
|
model.overlapLock && this.protectiveLock();
|
||||||
|
/** 成都一号线列车精确位置 */
|
||||||
|
model.offsetp && this.updateTriangle();
|
||||||
/** 空闲锁闭或者叫进路锁闭 */
|
/** 空闲锁闭或者叫进路锁闭 */
|
||||||
model.routeLock && this.routeLock();
|
model.routeLock && this.routeLock();
|
||||||
/** 轨道封锁 */
|
/** 轨道封锁 */
|
||||||
|
@ -10,6 +10,7 @@ import EArrow from './EArrow';
|
|||||||
import { arrow } from '../utils/ShapePoints';
|
import { arrow } from '../utils/ShapePoints';
|
||||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||||
import BoundingRect from 'zrender/src/core/BoundingRect';
|
import BoundingRect from 'zrender/src/core/BoundingRect';
|
||||||
|
import {getPrdType} from '../utils/handlePath';
|
||||||
|
|
||||||
export default class Station extends Group {
|
export default class Station extends Group {
|
||||||
constructor(model, style) {
|
constructor(model, style) {
|
||||||
@ -23,15 +24,7 @@ export default class Station extends Group {
|
|||||||
|
|
||||||
this.create();
|
this.create();
|
||||||
this.createTurnBack(); // 创建按图折返
|
this.createTurnBack(); // 创建按图折返
|
||||||
const path = window.location.href;
|
this.prdType = getPrdType();
|
||||||
if (path.includes('?')) {
|
|
||||||
const arr = window.location.href.split('?')[1].split('&');
|
|
||||||
arr.forEach(elem => {
|
|
||||||
if (elem.split('=')[0] === 'prdType') {
|
|
||||||
this.prdType = elem.split('=')[1];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if ((!this.prdType || this.style.StationStand.common.functionButtonShow.indexOf(this.prdType) !== -1) && model.guideTotalLockPoint) {
|
if ((!this.prdType || this.style.StationStand.common.functionButtonShow.indexOf(this.prdType) !== -1) && model.guideTotalLockPoint) {
|
||||||
this.createGuideTotalLock(); // 创建引导总锁
|
this.createGuideTotalLock(); // 创建引导总锁
|
||||||
}
|
}
|
||||||
@ -123,15 +116,18 @@ export default class Station extends Group {
|
|||||||
if (model.guideTotalLock) {
|
if (model.guideTotalLock) {
|
||||||
this.guideLamp = new EControl({
|
this.guideLamp = new EControl({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: 1000,
|
||||||
arc: {
|
arc: {
|
||||||
shape: {
|
shape: {
|
||||||
cx: model.guideTotalLockPoint.x,
|
cx: model.guideTotalLockPoint.x,
|
||||||
cy: model.guideTotalLockPoint.y,
|
cy: model.guideTotalLockPoint.y,
|
||||||
r: style.Station.lamp.radiusR
|
r: style.Station.lamp.radiusR
|
||||||
},
|
},
|
||||||
|
subType: 'GuideLamp',
|
||||||
lineWidth: 0,
|
lineWidth: 0,
|
||||||
fill: style.Station.lamp.guideColor
|
fill: style.Station.lamp.guideColor,
|
||||||
|
onmouseover: this.guideMouseOver,
|
||||||
|
onmouseout: this.guideMouseOut
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
|
@ -12,6 +12,7 @@ import EHighlight from '../element/EHighlight';
|
|||||||
import ETrainStop from './ETrainStop';
|
import ETrainStop from './ETrainStop';
|
||||||
import ETrainDepart from './ETrainDepart';
|
import ETrainDepart from './ETrainDepart';
|
||||||
import EControl from '../element/EControl';
|
import EControl from '../element/EControl';
|
||||||
|
import {getPrdType} from '../utils/handlePath';
|
||||||
|
|
||||||
class StationStand extends Group {
|
class StationStand extends Group {
|
||||||
constructor(model, style) {
|
constructor(model, style) {
|
||||||
@ -23,16 +24,7 @@ class StationStand extends Group {
|
|||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.z = 1;
|
this.z = 1;
|
||||||
this.doors = new Group();
|
this.doors = new Group();
|
||||||
this.prdType = '';
|
this.prdType = getPrdType();
|
||||||
const path = window.location.href;
|
|
||||||
if (path.includes('?')) {
|
|
||||||
const arr = window.location.href.split('?')[1].split('&');
|
|
||||||
arr.forEach(elem => {
|
|
||||||
if (elem.split('=')[0] === 'prdType') {
|
|
||||||
this.prdType = elem.split('=')[1];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.create();
|
this.create();
|
||||||
this.createMouseEvent();
|
this.createMouseEvent();
|
||||||
if (!this.prdType || this.style.StationStand.common.functionButtonShow.indexOf(this.prdType) !== -1) {
|
if (!this.prdType || this.style.StationStand.common.functionButtonShow.indexOf(this.prdType) !== -1) {
|
||||||
@ -239,6 +231,7 @@ class StationStand extends Group {
|
|||||||
cy: model.stopJumpLampPoint.y,
|
cy: model.stopJumpLampPoint.y,
|
||||||
r: style.Station.lamp.radiusR
|
r: style.Station.lamp.radiusR
|
||||||
},
|
},
|
||||||
|
subType: 'StopJumpLamp',
|
||||||
lineWidth: 0,
|
lineWidth: 0,
|
||||||
fill: style.StationStand.lamp.lampColor
|
fill: style.StationStand.lamp.lampColor
|
||||||
},
|
},
|
||||||
@ -268,6 +261,7 @@ class StationStand extends Group {
|
|||||||
cy: model.cancelStopJumpLampPoint.y,
|
cy: model.cancelStopJumpLampPoint.y,
|
||||||
r: style.Station.lamp.radiusR
|
r: style.Station.lamp.radiusR
|
||||||
},
|
},
|
||||||
|
subType: 'CancelStopJumpLamp',
|
||||||
lineWidth: 0,
|
lineWidth: 0,
|
||||||
fill: style.StationStand.lamp.lampColor
|
fill: style.StationStand.lamp.lampColor
|
||||||
},
|
},
|
||||||
@ -297,6 +291,7 @@ class StationStand extends Group {
|
|||||||
cy: model.upDetainLampPoint.y,
|
cy: model.upDetainLampPoint.y,
|
||||||
r: style.Station.lamp.radiusR
|
r: style.Station.lamp.radiusR
|
||||||
},
|
},
|
||||||
|
subType: 'UpDetainLamp',
|
||||||
lineWidth: 0,
|
lineWidth: 0,
|
||||||
fill: style.StationStand.lamp.lampColor
|
fill: style.StationStand.lamp.lampColor
|
||||||
},
|
},
|
||||||
@ -326,6 +321,7 @@ class StationStand extends Group {
|
|||||||
cy: model.downDetainLampPoint.y,
|
cy: model.downDetainLampPoint.y,
|
||||||
r: style.Station.lamp.radiusR
|
r: style.Station.lamp.radiusR
|
||||||
},
|
},
|
||||||
|
subType: 'DownDetainLamp',
|
||||||
lineWidth: 0,
|
lineWidth: 0,
|
||||||
fill: style.StationStand.lamp.lampColor
|
fill: style.StationStand.lamp.lampColor
|
||||||
},
|
},
|
||||||
@ -336,7 +332,7 @@ class StationStand extends Group {
|
|||||||
fontWeight: style.StationStand.text.fontWeight,
|
fontWeight: style.StationStand.text.fontWeight,
|
||||||
fontSize: style.StationStand.text.fontSize,
|
fontSize: style.StationStand.text.fontSize,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
text: '上行扣车',
|
text: '下行扣车',
|
||||||
textFill: '#fff',
|
textFill: '#fff',
|
||||||
textAlign: 'middle',
|
textAlign: 'middle',
|
||||||
textVerticalAlign: 'top'
|
textVerticalAlign: 'top'
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import Text from 'zrender/src/graphic/Text';
|
import Text from 'zrender/src/graphic/Text';
|
||||||
import Group from 'zrender/src/container/Group';
|
import Group from 'zrender/src/container/Group';
|
||||||
|
import {getPrdType, isShowThePrdType} from '../utils/handlePath';
|
||||||
|
|
||||||
export default class Text2 extends Group {
|
export default class Text2 extends Group {
|
||||||
constructor(model, style) {
|
constructor(model, style) {
|
||||||
@ -11,15 +12,11 @@ export default class Text2 extends Group {
|
|||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.z = 6;
|
this.z = 6;
|
||||||
const arr = window.location.href.split('?')[1].split('&');
|
this.prdType = getPrdType();
|
||||||
this.prdType = '';
|
if (isShowThePrdType(this.prdType, model.showConditions)) {
|
||||||
arr.forEach(elem => {
|
this.create();
|
||||||
if (elem.split('=')[0] === 'prdType') {
|
this.setState(model);
|
||||||
this.prdType = elem.split('=')[1];
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
this.create();
|
|
||||||
this.setState(model);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
|
@ -128,7 +128,17 @@ export default class Train extends Group {
|
|||||||
let models = [];
|
let models = [];
|
||||||
const model = deepAssign(oldmodel, {_type: 'Section'}); // 修改元素model
|
const model = deepAssign(oldmodel, {_type: 'Section'}); // 修改元素model
|
||||||
models = [model];
|
models = [model];
|
||||||
store.dispatch('map/updateMapDevices', models);
|
store.dispatch('map/updateMapDevices', models).then(()=>{
|
||||||
|
if (train.oldsection && train.oldsection != train.physicalCode) {
|
||||||
|
const oldmodels = store.getters['map/getDeviceByCode'](train.oldsection);
|
||||||
|
const models = deepAssign(oldmodels, {_type: 'Section'}); // 修改元素model
|
||||||
|
models.hideOld = true;
|
||||||
|
models.offsetp = undefined;
|
||||||
|
const trainOldSection = [models];
|
||||||
|
store.dispatch('map/updateMapDevices', trainOldSection);
|
||||||
|
}
|
||||||
|
train.oldsection = train.physicalCode;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ export default class ZcControl extends Group {
|
|||||||
cy: model.position.y,
|
cy: model.position.y,
|
||||||
r: this.style.ZcControl.lamp.radiusR
|
r: this.style.ZcControl.lamp.radiusR
|
||||||
},
|
},
|
||||||
|
subType: 'Control',
|
||||||
lineWidth: 0,
|
lineWidth: 0,
|
||||||
fill: this.style.ZcControl.lamp.controlColor,
|
fill: this.style.ZcControl.lamp.controlColor,
|
||||||
mouseover: this.mouseoverArc,
|
mouseover: this.mouseoverArc,
|
||||||
|
@ -19,7 +19,7 @@ export default class EControl extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
this.control = new Arc({
|
this.control = new Arc({
|
||||||
_subType: 'Control',
|
_subType: this.arcStyle.subType,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
shape: this.arcStyle.shape,
|
shape: this.arcStyle.shape,
|
||||||
@ -30,7 +30,6 @@ export default class EControl extends Group {
|
|||||||
onmouseover: this.arcStyle.mouseover,
|
onmouseover: this.arcStyle.mouseover,
|
||||||
onmouseout: this.arcStyle.mouseout
|
onmouseout: this.arcStyle.mouseout
|
||||||
});
|
});
|
||||||
|
|
||||||
this.text = new Text({
|
this.text = new Text({
|
||||||
_subType: 'Text',
|
_subType: 'Text',
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
|
25
src/jmapNew/shape/utils/handlePath.js
Normal file
25
src/jmapNew/shape/utils/handlePath.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
export function getPrdType() {
|
||||||
|
let prdType = '';
|
||||||
|
const path = window.location.href;
|
||||||
|
if (path.includes('?')) {
|
||||||
|
const arr = window.location.href.split('?')[1].split('&');
|
||||||
|
arr.forEach(elem => {
|
||||||
|
if (elem.split('=')[0] === 'prdType') {
|
||||||
|
prdType = elem.split('=')[1];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return prdType;
|
||||||
|
}
|
||||||
|
export function isShowThePrdType (prdType, showConditions) {
|
||||||
|
const path = window.location.href;
|
||||||
|
if (path.indexOf('map/draw') !== -1 ) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
if (showConditions === '01' || (showConditions === '02' && prdType === '02') || (showConditions === '03' && prdType === '01')) {
|
||||||
|
return true;
|
||||||
|
} else if (!showConditions) {
|
||||||
|
return true; // 兼容老数据没有showConditions
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -149,7 +149,7 @@ export default {
|
|||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate, [error.message]);
|
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 信号关灯
|
// 信号关灯
|
||||||
@ -169,7 +169,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.$refs.noticeInfo.doShow(operate, [error.message]);
|
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 信号重开
|
// 信号重开
|
||||||
@ -189,7 +189,7 @@ export default {
|
|||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate, [error.message]);
|
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消
|
// 取消
|
||||||
|
@ -137,7 +137,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
},
|
},
|
||||||
@ -306,7 +306,7 @@ export default {
|
|||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate, [error.message]);
|
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 进路交自动控
|
// 进路交自动控
|
||||||
@ -329,7 +329,7 @@ export default {
|
|||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate, [error.message]);
|
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -1,157 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-dialog class="beijing-01__systerm route-lock" :title="title" :visible.sync="show" width="340px"
|
|
||||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
|
||||||
<el-row class="header">
|
|
||||||
<el-col :span="10"><span>车站名称</span></el-col>
|
|
||||||
<el-col :span="10" :offset="2"><span>信号机名称</span></el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="10">
|
|
||||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="10" :offset="2">
|
|
||||||
<el-input v-model="signalName" size="small" disabled></el-input>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<div class="table">
|
|
||||||
<span>信号按钮列表</span>
|
|
||||||
<el-table ref="table" :data="tempData" border style="width: 100%" size="mini" highlight-current-row
|
|
||||||
:height="140">
|
|
||||||
<el-table-column prop="name" label="按钮名称">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="status" label="按钮状态">
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
<el-row justify="center" class="button-group">
|
|
||||||
<el-col :span="10" :offset="2">
|
|
||||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8" :offset="4">
|
|
||||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<notice-info ref="noticeInfo"></notice-info>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { mapGetters } from 'vuex';
|
|
||||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
|
||||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
|
||||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'RouteLock',
|
|
||||||
components: {
|
|
||||||
NoticeInfo
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dialogShow: false,
|
|
||||||
loading: false,
|
|
||||||
selected: null,
|
|
||||||
tempData: [],
|
|
||||||
operate: null,
|
|
||||||
stationName: '',
|
|
||||||
signalName: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapGetters('map', [
|
|
||||||
'signalList'
|
|
||||||
]),
|
|
||||||
show() {
|
|
||||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
|
||||||
},
|
|
||||||
domIdCancel() {
|
|
||||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
|
||||||
},
|
|
||||||
domIdConfirm() {
|
|
||||||
return this.dialogShow ? OperationEvent.Signal.lock.menu.domId : '';
|
|
||||||
},
|
|
||||||
title() {
|
|
||||||
return '封锁信号按钮'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$store.dispatch('training/tipReload');
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
doShow(operate, selected) {
|
|
||||||
this.selected = selected;
|
|
||||||
//入股不是断点激活,而是第一次显示需要初始化
|
|
||||||
if (!this.dialogShow) {
|
|
||||||
this.signalName = '';
|
|
||||||
this.stationName = '';
|
|
||||||
|
|
||||||
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
|
||||||
this.signalName = selected.name
|
|
||||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
|
||||||
if (station) {
|
|
||||||
this.stationName = station.name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** status 04:封锁*/
|
|
||||||
let signal = (selected || {}).state;
|
|
||||||
this.tempData = [{ code: selected.code, name: selected.name, status: signal.status != '04' ? '未封锁' : '封锁' }]
|
|
||||||
let timer = setInterval(() => {
|
|
||||||
if (this.$refs.table) {
|
|
||||||
this.$refs.table.setCurrentRow(this.tempData[0]);
|
|
||||||
clearInterval(timer);
|
|
||||||
}
|
|
||||||
}, 300);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.dialogShow = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$store.dispatch('training/emitTipFresh');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
doClose() {
|
|
||||||
this.loading = false;
|
|
||||||
this.dialogShow = false;
|
|
||||||
this.$store.dispatch('training/emitTipFresh');
|
|
||||||
// mouseCancelState(this.selected);
|
|
||||||
},
|
|
||||||
commit() {
|
|
||||||
let operate = {
|
|
||||||
send: true,
|
|
||||||
type: MapDeviceType.Signal.type,
|
|
||||||
operation: OperationEvent.Signal.lock.menu.operation
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loading = true;
|
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
|
||||||
this.loading = false;
|
|
||||||
if (valid) {
|
|
||||||
this.doClose();
|
|
||||||
}
|
|
||||||
}).catch(error => {
|
|
||||||
this.loading = false;
|
|
||||||
this.doClose();
|
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
cancel() {
|
|
||||||
let operate = {
|
|
||||||
type: MapDeviceType.Signal.type,
|
|
||||||
operation: OperationEvent.Command.cancel.menu.operation,
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
|
||||||
if (valid) {
|
|
||||||
this.doClose();
|
|
||||||
}
|
|
||||||
}).catch(error => {
|
|
||||||
this.doClose();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -195,7 +195,7 @@ export default {
|
|||||||
// 设置新选的进路区段为切除状态
|
// 设置新选的进路区段为切除状态
|
||||||
row.routeSectionList.forEach(elem => {
|
row.routeSectionList.forEach(elem => {
|
||||||
const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](elem));
|
const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](elem));
|
||||||
if (section.logicSectionCodeList && section.logicSectionCodeList.length){
|
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
|
||||||
section.logicSectionCodeList.forEach(item => {
|
section.logicSectionCodeList.forEach(item => {
|
||||||
const sec = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item));
|
const sec = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item));
|
||||||
sec.cutOff = true;
|
sec.cutOff = true;
|
||||||
@ -246,7 +246,7 @@ export default {
|
|||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate, [error.message]);
|
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -22,10 +22,9 @@ import AlxeEffective from './dialog/alxeEffective';
|
|||||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import { OperateMode } from '@/scripts/ConstDic';
|
import { OperateMode } from '@/scripts/ConstDic';
|
||||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
import { OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||||
import { mouseCancelState } from './utils/menuItemStatus';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SectionMenu',
|
name: 'SectionMenu',
|
||||||
@ -137,6 +136,11 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
'$store.state.menuOperation.selectedCount': function(val) {
|
||||||
|
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Section') {
|
||||||
|
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -176,6 +180,18 @@ export default {
|
|||||||
this.$refs.popMenu.close();
|
this.$refs.popMenu.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
operationHandler(buttonOperation, selectType) {
|
||||||
|
switch (buttonOperation) {
|
||||||
|
case OperationEvent.Signal.guide.button.operation: {
|
||||||
|
// 区故解
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case OperationEvent.Signal.guide.button.operation: {
|
||||||
|
// 计轴复位
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
// // 设置计轴失效
|
// // 设置计轴失效
|
||||||
// alxeFailure() {
|
// alxeFailure() {
|
||||||
// const operate = {
|
// const operate = {
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
<div>
|
<div>
|
||||||
<pop-menu ref="popMenu" :menu="menu" />
|
<pop-menu ref="popMenu" :menu="menu" />
|
||||||
<route-selection ref="routeSelection" />
|
<route-selection ref="routeSelection" />
|
||||||
<route-lock ref="routeLock" />
|
|
||||||
<route-control ref="routeControl" />
|
<route-control ref="routeControl" />
|
||||||
<route-cmd-control ref="routeCmdControl" />
|
<route-cmd-control ref="routeCmdControl" />
|
||||||
<route-hand-control ref="routeHandControl" />
|
<route-hand-control ref="routeHandControl" />
|
||||||
@ -15,7 +14,6 @@
|
|||||||
import PopMenu from '@/components/PopMenu';
|
import PopMenu from '@/components/PopMenu';
|
||||||
import RouteControl from './dialog/routeControl';
|
import RouteControl from './dialog/routeControl';
|
||||||
import RouteSelection from './dialog/routeSelection';
|
import RouteSelection from './dialog/routeSelection';
|
||||||
import RouteLock from './dialog/routeLock';
|
|
||||||
import RouteCmdControl from './dialog/routeCmdControl';
|
import RouteCmdControl from './dialog/routeCmdControl';
|
||||||
import RouteHandControl from './dialog/routeHandControl';
|
import RouteHandControl from './dialog/routeHandControl';
|
||||||
import RouteDetail from './dialog/routeDetail';
|
import RouteDetail from './dialog/routeDetail';
|
||||||
@ -24,7 +22,7 @@ import { mapGetters } from 'vuex';
|
|||||||
import { OperateMode } from '@/scripts/ConstDic';
|
import { OperateMode } from '@/scripts/ConstDic';
|
||||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
import {OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||||
import { mouseCancelState } from './utils/menuItemStatus';
|
import { mouseCancelState } from './utils/menuItemStatus';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -33,7 +31,6 @@ export default {
|
|||||||
PopMenu,
|
PopMenu,
|
||||||
RouteControl,
|
RouteControl,
|
||||||
RouteSelection,
|
RouteSelection,
|
||||||
RouteLock,
|
|
||||||
RouteCmdControl,
|
RouteCmdControl,
|
||||||
RouteHandControl,
|
RouteHandControl,
|
||||||
RouteDetail,
|
RouteDetail,
|
||||||
@ -160,9 +157,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
'$store.state.menuOperation.selectedCount': function(val) {
|
'$store.state.menuOperation.selectedCount': function(val) {
|
||||||
if (this.buttonOperation) {
|
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Signal') {
|
||||||
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected._type);
|
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -175,7 +172,7 @@ export default {
|
|||||||
]),
|
]),
|
||||||
...mapGetters('map', [
|
...mapGetters('map', [
|
||||||
'routeList'
|
'routeList'
|
||||||
]),
|
])
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
clickEvent() {
|
clickEvent() {
|
||||||
@ -235,16 +232,18 @@ export default {
|
|||||||
// 引导总锁
|
// 引导总锁
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case OperationEvent.Signal.guide.button.operation: {
|
case OperationEvent.Signal.setAutoInterlock.button.operation: {
|
||||||
// 自动进路
|
// 自动进路
|
||||||
break;
|
if (selectType.fleetMode != undefined) {
|
||||||
}
|
if (selectType.fleetMode) {
|
||||||
case OperationEvent.Signal.guide.button.operation: {
|
this.singalCancelPassModel(selectType);
|
||||||
// 区故解
|
} else {
|
||||||
break;
|
this.singalPassModel(selectType);
|
||||||
}
|
}
|
||||||
case OperationEvent.Signal.guide.button.operation: {
|
|
||||||
// 计轴复位
|
} else {
|
||||||
|
this.$refs.noticeInfo.doShow({}, `信号机[${selectType.name}(${selectType.code})]没有已锁闭进路,不能设置联锁自动进路`);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -340,42 +339,6 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// // 信号封锁
|
|
||||||
// lock() {
|
|
||||||
// const operate = {
|
|
||||||
// start: true,
|
|
||||||
// send: true,
|
|
||||||
// code: this.selected.code,
|
|
||||||
// type: MapDeviceType.Signal.type,
|
|
||||||
// label: MapDeviceType.Signal.label,
|
|
||||||
// operation: OperationEvent.Signal.lock.menu.operation
|
|
||||||
// };
|
|
||||||
|
|
||||||
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
|
||||||
// if (valid) {
|
|
||||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
|
||||||
// this.$refs.routeLock.doShow(operate.operation, this.selected);
|
|
||||||
// }
|
|
||||||
// }).catch(() => {
|
|
||||||
// this.$refs.noticeInfo.doShow(operate);
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// // 信号解封
|
|
||||||
// unlock() {
|
|
||||||
// const operate = {
|
|
||||||
// start: true,
|
|
||||||
// code: this.selected.code,
|
|
||||||
// type: MapDeviceType.Signal.type,
|
|
||||||
// label: MapDeviceType.Signal.label,
|
|
||||||
// operation: OperationEvent.Signal.unlock.menu.operation
|
|
||||||
// };
|
|
||||||
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
|
||||||
// if (valid) {
|
|
||||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
|
||||||
// this.$refs.routeCmdControl.doShow(operate, this.selected);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// 信号重开
|
// 信号重开
|
||||||
reopenSignal() {
|
reopenSignal() {
|
||||||
const operate = {
|
const operate = {
|
||||||
@ -456,6 +419,44 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 设置通过模式
|
||||||
|
singalPassModel(selectType) {
|
||||||
|
const operate = {
|
||||||
|
start: true,
|
||||||
|
over: true,
|
||||||
|
operation: OperationEvent.Signal.setAutoInterlock.menu.operation,
|
||||||
|
param: {
|
||||||
|
signalCode:selectType.code
|
||||||
|
},
|
||||||
|
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
|
||||||
|
};
|
||||||
|
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||||
|
if (valid) {
|
||||||
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消通过模式
|
||||||
|
singalCancelPassModel(selectType) {
|
||||||
|
const operate = {
|
||||||
|
start: true,
|
||||||
|
over: true,
|
||||||
|
operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation,
|
||||||
|
param: {
|
||||||
|
signalCode:selectType.code
|
||||||
|
},
|
||||||
|
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
|
||||||
|
};
|
||||||
|
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||||
|
if (valid) {
|
||||||
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||||
|
});
|
||||||
|
},
|
||||||
// 查询进路状态
|
// 查询进路状态
|
||||||
detail() {
|
detail() {
|
||||||
const step = {
|
const step = {
|
||||||
|
@ -52,16 +52,16 @@ export default {
|
|||||||
menu: [],
|
menu: [],
|
||||||
menuNormal: {
|
menuNormal: {
|
||||||
Local: [
|
Local: [
|
||||||
{
|
// {
|
||||||
label: '轨道切除',
|
// label: '轨道切除',
|
||||||
handler: this.split,
|
// handler: this.split,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
|
// cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
label: '轨道激活',
|
// label: '轨道激活',
|
||||||
handler: this.active,
|
// handler: this.active,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
|
// cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
|
||||||
}
|
// }
|
||||||
// {
|
// {
|
||||||
// label: '查看站场设备状态',
|
// label: '查看站场设备状态',
|
||||||
// handler: this.undeveloped
|
// handler: this.undeveloped
|
||||||
|
@ -19,20 +19,20 @@
|
|||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
<!-- 流程未做暂不显示 -->
|
<!-- 流程未做暂不显示 -->
|
||||||
<!-- <button :id="Switch.guideLock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.guideLock.button.operation)">
|
<button :id="Switch.guideLock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.guideLock.button.operation)">
|
||||||
<span style="color: red">
|
<span style="color: #800000">
|
||||||
<center><b>引</b><b>导</b></center>
|
<center><b>引</b><b>导</b></center>
|
||||||
<center><b>总</b><b>锁</b></center>
|
<center><b>总</b><b>锁</b></center>
|
||||||
</span>
|
</span>
|
||||||
</button> -->
|
</button>
|
||||||
<button :id="Signal.humanTrainRoute.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.humanTrainRoute.button.operation, 'Signal')">
|
<button :id="Signal.humanTrainRoute.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.humanTrainRoute.button.operation, 'Signal')">
|
||||||
<span style="color: red">
|
<span style="color: #800000">
|
||||||
<center><b>总</b></center>
|
<center><b>总</b></center>
|
||||||
<center><b>人</b><b>解</b></center>
|
<center><b>人</b><b>解</b></center>
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
<button :id="Section.fault.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Section.fault.button.operation, 'Section')">
|
<button :id="Section.fault.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Section.fault.button.operation, 'Section')">
|
||||||
<span style="color: black">
|
<span style="color: #800000">
|
||||||
<center><b>区</b></center>
|
<center><b>区</b></center>
|
||||||
<center><b>故</b><b>解</b></center>
|
<center><b>故</b><b>解</b></center>
|
||||||
</span>
|
</span>
|
||||||
@ -56,7 +56,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
<button :id="Switch.unlock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.unlock.button.operation, 'Switch')">
|
<button :id="Switch.unlock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.unlock.button.operation, 'Switch')">
|
||||||
<span style="color: red">
|
<span style="color: #800000">
|
||||||
<center><b>道</b><b>岔</b></center>
|
<center><b>道</b><b>岔</b></center>
|
||||||
<center><b>解</b><b>锁</b></center>
|
<center><b>解</b><b>锁</b></center>
|
||||||
</span>
|
</span>
|
||||||
@ -331,10 +331,10 @@ export default {
|
|||||||
}
|
}
|
||||||
} else if (deviceList.length === 2) {
|
} else if (deviceList.length === 2) {
|
||||||
this.routeList.forEach(item => {
|
this.routeList.forEach(item => {
|
||||||
if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code){
|
if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code) {
|
||||||
item.type
|
item.type;
|
||||||
const operate = this.handelOperate(item);
|
const operate = this.handelOperate(item);
|
||||||
console.log(operate,item);
|
console.log(operate, item);
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {});
|
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -207,27 +207,27 @@ export default {
|
|||||||
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
|
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
|
||||||
};
|
};
|
||||||
|
|
||||||
this.sendCommand(operate)
|
this.sendCommand(operate);
|
||||||
},
|
},
|
||||||
// 道岔定位
|
// 道岔定位
|
||||||
locate() {
|
locate() {
|
||||||
const operate = {
|
const operate = {
|
||||||
over: true,
|
over: true,
|
||||||
operation: OperationEvent.Switch.locate.menu.operation,
|
operation: OperationEvent.Switch.locate.menu.operation,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
|
cmdType: CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN
|
||||||
};
|
};
|
||||||
|
|
||||||
this.sendCommand(operate)
|
this.sendCommand(operate);
|
||||||
},
|
},
|
||||||
// 道岔反位
|
// 道岔反位
|
||||||
reverse() {
|
reverse() {
|
||||||
const operate = {
|
const operate = {
|
||||||
over: true,
|
over: true,
|
||||||
operation: OperationEvent.Switch.reverse.menu.operation,
|
operation: OperationEvent.Switch.reverse.menu.operation,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
|
cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN
|
||||||
};
|
};
|
||||||
|
|
||||||
this.sendCommand(operate)
|
this.sendCommand(operate);
|
||||||
},
|
},
|
||||||
// 区段切除
|
// 区段切除
|
||||||
split() {
|
split() {
|
||||||
@ -236,7 +236,7 @@ export default {
|
|||||||
operation: OperationEvent.Switch.split.menu.operation,
|
operation: OperationEvent.Switch.split.menu.operation,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
|
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
|
||||||
};
|
};
|
||||||
this.sendCommand(operate)
|
this.sendCommand(operate);
|
||||||
},
|
},
|
||||||
// 区段激活
|
// 区段激活
|
||||||
active() {
|
active() {
|
||||||
@ -245,7 +245,7 @@ export default {
|
|||||||
operation: OperationEvent.Switch.active.menu.operation,
|
operation: OperationEvent.Switch.active.menu.operation,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
|
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
|
||||||
};
|
};
|
||||||
this.sendCommand(operate)
|
this.sendCommand(operate);
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
const operate = {
|
const operate = {
|
||||||
|
@ -49,12 +49,12 @@ export default {
|
|||||||
{
|
{
|
||||||
label: '定操',
|
label: '定操',
|
||||||
handler: this.locate,
|
handler: this.locate,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
|
cmdType: CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '反操',
|
label: '反操',
|
||||||
handler: this.reverse,
|
handler: this.reverse,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
|
cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '道岔单锁',
|
label: '道岔单锁',
|
||||||
@ -81,12 +81,12 @@ export default {
|
|||||||
{
|
{
|
||||||
label: '定操',
|
label: '定操',
|
||||||
handler: this.locate,
|
handler: this.locate,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
|
cmdType: CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '反操',
|
label: '反操',
|
||||||
handler: this.reverse,
|
handler: this.reverse,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
|
cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
|
@ -33,7 +33,11 @@ export default {
|
|||||||
/** 定位(定操) */
|
/** 定位(定操) */
|
||||||
CMD_SWITCH_NORMAL_POSITION:{value:'Switch_Normal_Position', label:'单操到定位'},
|
CMD_SWITCH_NORMAL_POSITION:{value:'Switch_Normal_Position', label:'单操到定位'},
|
||||||
/** 反位(反操) */
|
/** 反位(反操) */
|
||||||
CMD_SWITCH_REVERSE_POSITION:{value:'Switch_Reverse_Position', label:'单操到反位'}
|
CMD_SWITCH_REVERSE_POSITION:{value:'Switch_Reverse_Position', label:'单操到反位'},
|
||||||
|
/** 道岔定操(联动) */
|
||||||
|
CMD_SWITCH_TURN_NP_CHAIN: {value: 'Switch_Turn_NP_Chain', label: '道岔定操(联动)'},
|
||||||
|
/** 道岔反操(联动)*/
|
||||||
|
CMD_SWITCH_TURN_RP_CHAIN: {value: 'Switch_Turn_RP_Chain', label: '道岔反操(联动)'}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 控制模式操作
|
// 控制模式操作
|
||||||
|
@ -11,6 +11,7 @@ const menuOperation = {
|
|||||||
mbmpCount: 0, // 地图按钮菜单位置变更标识
|
mbmpCount: 0, // 地图按钮菜单位置变更标识
|
||||||
buttonOperation: null, // 按钮菜单是否被按下
|
buttonOperation: null, // 按钮菜单是否被按下
|
||||||
selected: {}, // 选中的地图对象
|
selected: {}, // 选中的地图对象
|
||||||
|
subType: '', // 选中的设备子元素类型
|
||||||
selectedCount: 0, // 选中对象变更标识
|
selectedCount: 0, // 选中对象变更标识
|
||||||
menu: null, // 弹出菜单设备
|
menu: null, // 弹出菜单设备
|
||||||
menuPosition: {}, // 弹出菜单位置
|
menuPosition: {}, // 弹出菜单位置
|
||||||
@ -26,6 +27,9 @@ const menuOperation = {
|
|||||||
selected: (state) => {
|
selected: (state) => {
|
||||||
return state.selected;
|
return state.selected;
|
||||||
},
|
},
|
||||||
|
subType: (state) => {
|
||||||
|
return state.subType;
|
||||||
|
},
|
||||||
mbmpCount: (state) => {
|
mbmpCount: (state) => {
|
||||||
return state.mbmpCount;
|
return state.mbmpCount;
|
||||||
},
|
},
|
||||||
@ -71,7 +75,8 @@ const menuOperation = {
|
|||||||
state.buttonOperation = operation;
|
state.buttonOperation = operation;
|
||||||
},
|
},
|
||||||
setSelected: (state, selected) => {
|
setSelected: (state, selected) => {
|
||||||
state.selected = selected;
|
state.selected = selected.device;
|
||||||
|
state.subType = selected.subType;
|
||||||
state.selectedCount += 1;
|
state.selectedCount += 1;
|
||||||
},
|
},
|
||||||
mbmpCountIncrement: (state) => {
|
mbmpCountIncrement: (state) => {
|
||||||
|
@ -99,7 +99,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.selected = device;
|
this.selected = device;
|
||||||
this.$store.dispatch('menuOperation/setSelected', device);
|
this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType});
|
||||||
this.$store.dispatch('training/emitTipFresh');
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -119,7 +119,7 @@ export default {
|
|||||||
if (device) {
|
if (device) {
|
||||||
this.selected = device = this.getSelectedByLineCode(device);
|
this.selected = device = this.getSelectedByLineCode(device);
|
||||||
if (!this.buttonOperation) {
|
if (!this.buttonOperation) {
|
||||||
this.$store.dispatch('menuOperation/setSelected', device);
|
this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType});
|
||||||
if (!this.checkShouldPop(device)) {
|
if (!this.checkShouldPop(device)) {
|
||||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: null });
|
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: null });
|
||||||
} else {
|
} else {
|
||||||
|
@ -103,9 +103,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.selected = device;
|
this.selected = device;
|
||||||
this.$store.dispatch('menuOperation/setSelected', device);
|
this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType});
|
||||||
this.$store.dispatch('training/emitTipFresh');
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -120,7 +119,7 @@ export default {
|
|||||||
this.$store.dispatch('map/setTrainWindowShow', true);
|
this.$store.dispatch('map/setTrainWindowShow', true);
|
||||||
} else if (em.subType == 'button' && em.deviceType == 'Station') { // 宁波一号线右键显示控制模式
|
} else if (em.subType == 'button' && em.deviceType == 'Station') { // 宁波一号线右键显示控制模式
|
||||||
const equipment = this.getDeviceByEm(em);
|
const equipment = this.getDeviceByEm(em);
|
||||||
this.$store.dispatch('menuOperation/setSelected', equipment);
|
this.$store.dispatch('menuOperation/setSelected', {device:equipment, subType: em.subType});
|
||||||
menu = getDeviceMenuByDeviceType('StationControl');
|
menu = getDeviceMenuByDeviceType('StationControl');
|
||||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||||
this.$store.dispatch('training/emitTipFresh');
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
@ -133,7 +132,7 @@ export default {
|
|||||||
if (device) {
|
if (device) {
|
||||||
this.selected = device = this.getSelectedByLineCode(device);
|
this.selected = device = this.getSelectedByLineCode(device);
|
||||||
if (!this.buttonOperation) {
|
if (!this.buttonOperation) {
|
||||||
this.$store.dispatch('menuOperation/setSelected', device);
|
this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType});
|
||||||
if (!this.checkShouldPop(device)) {
|
if (!this.checkShouldPop(device)) {
|
||||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: null });
|
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: null });
|
||||||
} else {
|
} else {
|
||||||
|
@ -97,7 +97,7 @@ export default {
|
|||||||
content: '',
|
content: '',
|
||||||
font: '',
|
font: '',
|
||||||
fontColor: '',
|
fontColor: '',
|
||||||
showConditions: '',
|
showConditions: '01',
|
||||||
position: {
|
position: {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0
|
y: 0
|
||||||
@ -106,7 +106,7 @@ export default {
|
|||||||
addModel: {
|
addModel: {
|
||||||
prepend: 'H',
|
prepend: 'H',
|
||||||
content: '',
|
content: '',
|
||||||
showConditions: '',
|
showConditions: '01',
|
||||||
position: {
|
position: {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0
|
y: 0
|
||||||
|
Loading…
Reference in New Issue
Block a user