Merge remote-tracking branch 'origin/dev' into test
This commit is contained in:
commit
11a36646ea
@ -54,6 +54,7 @@ export default {
|
||||
batchOperation: 'Batch operation',
|
||||
breakUpNumber: 'Split quantity',
|
||||
// physicalSegmentName: '物理区段:',
|
||||
autoSignalCode:'AutoSignal Name',
|
||||
|
||||
save: 'save',
|
||||
updata: 'update',
|
||||
|
@ -63,6 +63,7 @@ export default {
|
||||
button: '按钮',
|
||||
signalApprochSection:' 信号机接近区段',
|
||||
concentrateStationList:'集中站列表',
|
||||
autoSignalCode:'自动信号名称',
|
||||
|
||||
mapName: '地图名称:',
|
||||
skinName: '皮肤:',
|
||||
|
@ -165,5 +165,60 @@ deviceRender[deviceType.VolumeControlDamper] = {
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
};
|
||||
/** 文字 */
|
||||
deviceRender[deviceType.IscsText] = {
|
||||
_type: deviceType.IscsText,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
};
|
||||
/** 线段渲染配置 */
|
||||
deviceRender[deviceType.IscsLine] = {
|
||||
_type: deviceType.IscsLine,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
};
|
||||
/** 矩形渲染配置 */
|
||||
deviceRender[deviceType.IscsRect] = {
|
||||
_type: deviceType.IscsRect,
|
||||
zlevel:1,
|
||||
z: 3
|
||||
};
|
||||
/** 楼梯 */
|
||||
deviceRender[deviceType.Escalator] = {
|
||||
_type: deviceType.Escalator,
|
||||
zlevel:1,
|
||||
z: 4
|
||||
};
|
||||
/** 通道 */
|
||||
deviceRender[deviceType.StairControl] = {
|
||||
_type: deviceType.StairControl,
|
||||
zlevel:1,
|
||||
z: 4
|
||||
};
|
||||
/** fas 闸机 */
|
||||
deviceRender[deviceType.FasBrakeMachine] = {
|
||||
_type: deviceType.FasBrakeMachine,
|
||||
zlevel:1,
|
||||
z: 4
|
||||
};
|
||||
|
||||
/** 扶梯 */
|
||||
deviceRender[deviceType.Staircase] = {
|
||||
_type: deviceType.Staircase,
|
||||
zlevel:1,
|
||||
z: 4
|
||||
};
|
||||
/** 单向楼梯 */
|
||||
deviceRender[deviceType.SingleStaircase] = {
|
||||
_type: deviceType.SingleStaircase,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
};
|
||||
|
||||
deviceRender[deviceType.ArcStatus] = {
|
||||
_type: deviceType.ArcStatus,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
}
|
||||
|
||||
export default deviceRender;
|
||||
|
@ -24,7 +24,16 @@ const deviceType = {
|
||||
EntranceGuard: 'EntranceGuard',
|
||||
SemiAutomaticTicketMachine: 'SemiAutomaticTicketMachine',
|
||||
TicketMachine: 'TicketMachine',
|
||||
VolumeControlDamper: 'VolumeControlDamper'
|
||||
VolumeControlDamper: 'VolumeControlDamper',
|
||||
IscsText: 'IscsText',
|
||||
IscsLine: 'IscsLine',
|
||||
IscsRect: 'IscsRect',
|
||||
Escalator:'Escalator',
|
||||
StairControl:'StairControl',
|
||||
FasBrakeMachine:'FasBrakeMachine',
|
||||
Staircase:'Staircase',
|
||||
SingleStaircase: 'SingleStaircase',
|
||||
ArcStatus: 'ArcStatus'
|
||||
};
|
||||
|
||||
export default deviceType;
|
||||
|
18
src/iscs/constant/iscsData.js
Normal file
18
src/iscs/constant/iscsData.js
Normal file
File diff suppressed because one or more lines are too long
@ -237,7 +237,6 @@ class Iscs {
|
||||
}
|
||||
dispose() {
|
||||
this.off(this.events.Pan, this.optionsHandler);
|
||||
this.off(this.events.Zoom, this.optionsHandler);
|
||||
|
||||
this.clear();
|
||||
|
||||
|
@ -137,9 +137,6 @@ class MouseController extends Eventful {
|
||||
this.eventTarget.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
|
||||
this.eventTarget.dirty();
|
||||
}
|
||||
if (this.eventTarget._type === deviceType.Background) {
|
||||
this.eventTarget.setCursor('default');
|
||||
}
|
||||
this.eventTarget = '';
|
||||
this._dragging = false;
|
||||
this.deviceList = [];
|
||||
@ -203,10 +200,7 @@ class MouseController extends Eventful {
|
||||
}
|
||||
/** 处理鼠标左键按下事件 */
|
||||
handleMouseDownLeft(e) {
|
||||
if (this.eventTarget && this.eventTarget._type === deviceType.Background) {
|
||||
this.eventTarget.setCursor('pointer');
|
||||
this.$iscs.deleteCheckBox('check_box');
|
||||
} else if (this.eventTarget && this.eventTarget._type === deviceType.CheckBox) {
|
||||
if (this.eventTarget && this.eventTarget._type === deviceType.CheckBox) {
|
||||
this.handleBoundingRect(this.eventTarget);
|
||||
} else {
|
||||
this.$iscs.deleteCheckBox('check_box');
|
||||
@ -216,9 +210,7 @@ class MouseController extends Eventful {
|
||||
handleMouseDownWheel(e) {
|
||||
this.deviceList = [];
|
||||
Object.values(this.$iscs.iscsDevice).forEach(item => {
|
||||
if (item.instance._type !== deviceType.Background) {
|
||||
this.deviceList.push(item.instance);
|
||||
}
|
||||
this.deviceList.push(item.instance);
|
||||
});
|
||||
}
|
||||
/** 处理右键拖动事件--- 改变选中区域大小 */
|
||||
@ -241,12 +233,15 @@ class MouseController extends Eventful {
|
||||
item.grouper.drift(dx, dy, e);
|
||||
});
|
||||
} else if (this._dragging && this.eventTarget) { // 选中元素图形移动
|
||||
if (( this.eventTarget._type === deviceType.Background) || !this.isAllowDragging) {
|
||||
if (!this.isAllowDragging) {
|
||||
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
||||
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
||||
} else if (this.isAllowDragging) {
|
||||
this.eventTarget.grouper.drift(dx, dy, e);
|
||||
}
|
||||
} else if (this._dragging) {
|
||||
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
||||
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
||||
}
|
||||
}
|
||||
/** 通过包围盒筛选选中区域的元素 */
|
||||
@ -257,13 +252,11 @@ class MouseController extends Eventful {
|
||||
const deviceList = Object.values(this.$iscs.iscsDevice);
|
||||
const includeDeviceList = [];
|
||||
deviceList.forEach( item =>{
|
||||
if (item.instance._type !== deviceType.Background) {
|
||||
let deviceBoundingRect = item.instance.grouper.getBoundingRect();
|
||||
deviceBoundingRect = this.createFakeBoundingRect(item.instance, deviceBoundingRect);
|
||||
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
|
||||
includeDeviceList.push(item.instance);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.deviceList = includeDeviceList;
|
||||
}
|
||||
|
39
src/iscs/shape/ArcStatus.js
Normal file
39
src/iscs/shape/ArcStatus.js
Normal file
@ -0,0 +1,39 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Circle from 'zrender/src/graphic/shape/Circle';
|
||||
|
||||
export default class ArcStatus extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this._type = device.model._type;
|
||||
this._code = device.model.code;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.grouper = new Group({
|
||||
id: model.code,
|
||||
position: [model.point.x, model.point.y]
|
||||
});
|
||||
this.iscsCircle = new Circle({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
cx: 0,
|
||||
cy: 0,
|
||||
r: this.model.r
|
||||
},
|
||||
style: {
|
||||
fill: this.model.fillColor
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.iscsCircle);
|
||||
this.add(this.grouper);
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point.x += dx;
|
||||
this.model.point.y += dy;
|
||||
}
|
||||
}
|
@ -22,8 +22,8 @@ export default class Vidicon extends Group {
|
||||
zlevel: this.model.zlevel,
|
||||
z: this.model.z,
|
||||
shape: {
|
||||
x: this.model.point.x,
|
||||
y: this.model.point.y,
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: this.model.width,
|
||||
height: vidiconHeight,
|
||||
r: [1, 1, 1, 1]
|
||||
@ -40,15 +40,16 @@ export default class Vidicon extends Group {
|
||||
z: this.model.z + 1,
|
||||
shape: {
|
||||
points: [
|
||||
[this.model.point.x + this.model.width, this.model.point.y + 3],
|
||||
[this.model.point.x + this.model.width + shotWidth, this.model.point.y],
|
||||
[this.model.point.x + this.model.width + shotWidth, this.model.point.y + 6 + shotHeight],
|
||||
[this.model.point.x + this.model.width, this.model.point.y + 3 + shotHeight]
|
||||
[this.model.width, 3],
|
||||
[this.model.width + shotWidth, 0],
|
||||
[this.model.width + shotWidth, 6 + shotHeight],
|
||||
[this.model.width, 3 + shotHeight]
|
||||
],
|
||||
smooth: 0.2
|
||||
},
|
||||
style: {
|
||||
fill: '#00FF00'
|
||||
fill: '#00FF00',
|
||||
stroke: 'rgba(255, 0, 0, 0)'
|
||||
}
|
||||
});
|
||||
} else { // 镜头在左
|
||||
@ -57,20 +58,22 @@ export default class Vidicon extends Group {
|
||||
z: this.model.z + 1,
|
||||
shape: {
|
||||
points: [
|
||||
[this.model.point.x, this.model.point.y + vidiconHeight - 3],
|
||||
[this.model.point.x - shotWidth, this.model.point.y + vidiconHeight],
|
||||
[this.model.point.x - shotWidth, this.model.point.y + vidiconHeight - 6 - shotHeight],
|
||||
[this.model.point.x, this.model.point.y + vidiconHeight - 3 - shotHeight]
|
||||
[0, vidiconHeight - 3],
|
||||
[-shotWidth, vidiconHeight],
|
||||
[-shotWidth, vidiconHeight - 6 - shotHeight],
|
||||
[0, vidiconHeight - 3 - shotHeight]
|
||||
],
|
||||
smooth: 0.2
|
||||
},
|
||||
style: {
|
||||
fill: '#00FF00'
|
||||
fill: '#00FF00',
|
||||
stroke: 'rgba(255, 0, 0, 0)'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.grouper.add(this.rect);
|
||||
this.grouper.rotation = Math.PI / 180 * (this.model.rotationAngle || 0);
|
||||
if (this.model.right) {
|
||||
this.grouper.add(this.PolylineRight);
|
||||
} else {
|
||||
|
@ -22,8 +22,8 @@ export default class VidiconCloud extends Group {
|
||||
zlevel: this.model.zlevel,
|
||||
z: this.model.z,
|
||||
shape: {
|
||||
cx: this.model.point.x,
|
||||
cy: this.model.point.y,
|
||||
cx: 0,
|
||||
cy: 0,
|
||||
r: this.model.r || 30,
|
||||
startAngle: 0,
|
||||
endAngle: Math.PI,
|
||||
@ -42,10 +42,10 @@ export default class VidiconCloud extends Group {
|
||||
z: this.model.z + 1,
|
||||
shape: {
|
||||
points: [
|
||||
[this.model.point.x + this.model.r / 2, this.model.point.y],
|
||||
[this.model.point.x - Math.cos(45 * (Math.PI / 180)) * this.model.r, this.model.point.y + Math.sin(45 * (Math.PI / 180)) * this.model.r],
|
||||
[this.model.point.x - Math.cos(55 * (Math.PI / 180)) * this.model.r, this.model.point.y + Math.sin(55 * (Math.PI / 180)) * this.model.r],
|
||||
[this.model.point.x + this.model.r / 1.2, this.model.point.y]
|
||||
[this.model.r / 2, 0],
|
||||
[-Math.cos(45 * (Math.PI / 180)) * this.model.r, Math.sin(45 * (Math.PI / 180)) * this.model.r],
|
||||
[-Math.cos(55 * (Math.PI / 180)) * this.model.r, Math.sin(55 * (Math.PI / 180)) * this.model.r],
|
||||
[this.model.r / 1.2, 0]
|
||||
]
|
||||
},
|
||||
style: {
|
||||
|
@ -29,7 +29,7 @@ export default class BorderRadius extends Group {
|
||||
endAngle: Math.PI * 3 / 2
|
||||
},
|
||||
style: {
|
||||
fill: 'rgba(0, 0, 0, 0.1)',
|
||||
fill: 'rgba(0, 0, 0, 0)',
|
||||
stroke: '#EBEE0C'
|
||||
}
|
||||
});
|
||||
@ -44,7 +44,7 @@ export default class BorderRadius extends Group {
|
||||
endAngle: Math.PI / 2
|
||||
},
|
||||
style: {
|
||||
fill: 'rgba(0, 0, 0, 0.1)',
|
||||
fill: 'rgba(0, 0, 0, 0)',
|
||||
stroke: '#EBEE0C'
|
||||
}
|
||||
});
|
||||
@ -58,7 +58,7 @@ export default class BorderRadius extends Group {
|
||||
height: this.model.height
|
||||
},
|
||||
style: {
|
||||
fill: '#000',
|
||||
fill: 'rgba(0,0,0,0)',
|
||||
stroke: '#EBEE0C'
|
||||
}
|
||||
});
|
||||
@ -73,7 +73,7 @@ export default class BorderRadius extends Group {
|
||||
},
|
||||
style: {
|
||||
lineWidth: 3,
|
||||
stroke: '#000'
|
||||
stroke: '#45607B'
|
||||
}
|
||||
});
|
||||
this.rightLine = new Line({
|
||||
@ -87,7 +87,7 @@ export default class BorderRadius extends Group {
|
||||
},
|
||||
style: {
|
||||
lineWidth: 3,
|
||||
stroke: '#000'
|
||||
stroke: '#45607B'
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.leftSector);
|
||||
|
@ -17,6 +17,10 @@ export default class BrakeMachine extends Group {
|
||||
position: [this.model.point.x, this.model.point.y]
|
||||
});
|
||||
this.path = createPathSvg(this.model);
|
||||
if (this.model.isRight) {
|
||||
this.grouper.origin = [this.model.width / 2, this.model.width * 0.61 / 2 ];
|
||||
this.grouper.rotation = Math.PI;
|
||||
}
|
||||
this.add(this.grouper);
|
||||
this.grouper.add(this.path);
|
||||
}
|
||||
|
@ -39,6 +39,26 @@ const map = {
|
||||
TunnelFan:{
|
||||
width:68,
|
||||
path:'M40,112L5,94V91H73v3ZM6,26H73V89H6V26Zm4,59H69V30H10V85Zm29.5-1A26.5,26.5,0,1,1,66,57.5,26.5,26.5,0,0,1,39.5,84ZM52,77l7-7-2-2-7,7ZM36,66l-5-4-2,2,5,4ZM27,77l2-2-8-7-2,2Zm0-38-9,8,3,2,8-7Zm7,10-5,5,3,2,5-5Zm9,6H37v6h6V55Zm2,13,5-5-2-2-5,5ZM44,49l5,5,2-3-5-5Zm9-12-3,2,8,8,2-2ZM5,22L40,4,73,22v3H5V22Z'
|
||||
},
|
||||
Escalator:{
|
||||
width:335,
|
||||
path:'M338,202H3V171H3.135v0l47,0V142H21v-6H50.135V108l-47,.161V108H3V4H338V202ZM332,10H9.826v92H232.135V89l-210,0v0H22V27h0.135V26.838L308,27V177H9.826v19H332V10ZM89.135,136V108H56.826v28h32.31Zm-32.31,6v29h32.31V142H56.826Zm57.309-6V108H95.826v28h18.309Zm-18.309,6v29h18.309V142H95.826Zm41.309-6V108H120.826v28h16.309Zm-16.309,6v29h16.309V142H120.826Zm41.309-6V108H143.826v28h18.309Zm-18.309,6v29h18.309V142H143.826Zm42.309-6V108H168.826v28h17.309Zm-17.309,6v29h17.309V142H168.826Zm36.309-6V108H192.826v28h12.309Zm-12.309,6v29h12.309V142H192.826Zm33.309-6V108H211.826v28h14.309Zm-14.309,6v29h14.309V142H211.826Zm0-86V83h14.309V56H211.826Zm14.309-6V33H211.826V50h14.309Zm-33.309,6V83h12.309V56H192.826Zm12.309-6V33H192.826V50h12.309Zm-36.309,6V83h17.309V56H168.826Zm17.309-6V33H168.826V50h17.309Zm-42.309,6V83h18.309V56H143.826Zm18.309-6V33H143.826V50h18.309Zm-41.309,6V83h16.309V56H120.826Zm16.309-6V33H120.826V50h16.309Zm-26.219,6,0.039,10.487L95.826,61.619V83h18.309V56h-3.219Zm3.219-6V33H95.826V43.627l14.953-4.539L110.916,50h3.219Zm-25-4.342V33H56.826V83h32.31V59.466L67.055,52.361ZM50.135,83V33H28.826V83H50.135Zm182.691,25v28H265.25V56H232.826V83h6v25h-6ZM271.25,49.868V50h0.008l0,92H271.25v0l-38.424,0v29H302V33H232.826V50Z'
|
||||
},
|
||||
StairControl:{
|
||||
width:103,
|
||||
path:'M48,86V85h53V81H45V80h56V55H31V54h70V52H29V51h72V49H27V48h74V46H24V45h6V27H25V44H24V27H19v6H18V6H13V23H12V6H7v6H6V6H3V5h98V2H0V0H103V86H48ZM24,6H19V26h5V6Zm6,0H25V26h5V6Zm6,0H31V26h5V6Zm0,21H31V45h5V27ZM42,6H37V26h5V6Zm0,21H37V45h5V27ZM48,6H43V26h5V6Zm0,21H43V45h5V27ZM54,6H49V26h5V6Zm0,21H49V45h5V27ZM60,6H55V26h5V6Zm0,21H55V45h5V27ZM66,6H61V26h5V6Zm0,21H61V45h5V27ZM72,6H67V26h5V6Zm0,21H67V45h5V27ZM78,6H73V26h5V6Zm0,21H73V45h5V27ZM84,6H79V26h2V23l3,1.333V6Zm0,23-3,1V27H79V45h5V29ZM90,6H85V24.778L90,27l-5,1.667V45h5V6Zm6,0H91V45h5V6Zm5,0H97V45h4V6Z'
|
||||
},
|
||||
FasBrakeMachine:{
|
||||
width:65,
|
||||
path:'M0,29V21H1.474L9,14.732v-0.7L1.474,7.869H0V0H65V7.869H31.669L22,14.339v0.083L31.669,21H65v8H0ZM62,5.9V1.967H3V5.9H62ZM28.113,7.869H4.53l6,4.918H20.764ZM20.764,16H10.533l-6,5H28.113ZM62,23H3v4H62V23Z'
|
||||
},
|
||||
Staircase:{
|
||||
width:133,
|
||||
path:'M12,131l25-11v8H97v6H37v8ZM3,186V155H132V108H3V77H17V47H10V41h7V24H3V4H136V186H3ZM132,8H7V20H132V8ZM28,41V24H21V41h7Zm-7,6V77h7V47H21Zm19-6V24H32V41h8Zm-8,6V77h8V47H32Zm19-6V24H44V41h7Zm-7,6V77h7V47H44Zm19-6V24H55V41h8Zm-8,6V77h8V47H55Zm15-6V33l4,1.76V24H67V41h3Zm-3,6V77h7V53.24L70,55V47H67Zm19-6.96V24H78V36.52ZM78,51.48V77h8V47.96ZM90,46.2V77h7V24H90V41.8L95,44ZM101,24V77h7V24h-7Zm11,0V77h8V24h-8Zm20,0h-8V77h8V24Zm0,57H7v6H132V81Zm0,10H7v4H132V91Zm0,8H7v5H132V99Zm0,60H7v6H132v-6Zm0,10H7v4H132v-4Zm0,8H7v5H132v-5Z'
|
||||
},
|
||||
SingleStaircase: {
|
||||
width: 58,
|
||||
path: 'M0,32V24H5V8H0V0H58V8H51V24h7v8H0Zm8-8h3V8H8V24ZM55,5V3H3V5H55ZM14,8V24h2V8H14Zm5,0V24h3V8H19Zm6,0V24h2V8H25Zm5,0V24h2V8H30Zm5,0V24h2V8H35Zm5,0V24h3V8H40Zm6,0V24h2V8H46Zm9,19H3v2H55V27Z'
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -41,7 +41,7 @@ export default class EndDoor extends Group {
|
||||
height: this.model.width * 4 / 17
|
||||
},
|
||||
style: {
|
||||
fill: '#000'
|
||||
fill: '#45607B'
|
||||
}
|
||||
});
|
||||
this.doorknob = new Circle({
|
||||
@ -53,7 +53,7 @@ export default class EndDoor extends Group {
|
||||
r: this.model.width / 17
|
||||
},
|
||||
style: {
|
||||
fill: '#000'
|
||||
fill: '#45607B'
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.door);
|
||||
|
27
src/iscs/shape/escalator.js
Normal file
27
src/iscs/shape/escalator.js
Normal file
@ -0,0 +1,27 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import createPathSvg from './components/pathsvg';
|
||||
|
||||
export default class Escalator extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this._type = device.model._type;
|
||||
this.code = device.model.code;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
this.grouper = new Group({
|
||||
id: this.model.code,
|
||||
position: [this.model.point.x, this.model.point.y]
|
||||
});
|
||||
this.path = createPathSvg(this.model);
|
||||
this.add(this.grouper);
|
||||
this.grouper.add(this.path);
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point.x += dx;
|
||||
this.model.point.y += dy;
|
||||
}
|
||||
}
|
@ -25,6 +25,15 @@ import SemiAutomaticTicketMachine from './semiAutomaticTicketMachine';
|
||||
import TicketMachine from './ticketMachine';
|
||||
import AirConditioner from './bas/airConditioner';
|
||||
import VolumeControlDamper from './bas/volumeControlDamper';
|
||||
import IscsText from './text';
|
||||
import IscsLine from './line';
|
||||
import IscsRect from './rect';
|
||||
import Escalator from './escalator';
|
||||
import StairControl from './stairControl';
|
||||
import FasBrakeMachine from './fasBrakeMachine';
|
||||
import Staircase from './staircase';
|
||||
import SingleStaircase from './singleStaircase';
|
||||
import ArcStatus from './ArcStatus';
|
||||
|
||||
const iscsShape = {};
|
||||
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
|
||||
@ -54,6 +63,15 @@ iscsShape[deviceType.SemiAutomaticTicketMachine] = SemiAutomaticTicketMachine;
|
||||
iscsShape[deviceType.TicketMachine] = TicketMachine;
|
||||
iscsShape[deviceType.AirConditioner] = AirConditioner;
|
||||
iscsShape[deviceType.VolumeControlDamper] = VolumeControlDamper;
|
||||
iscsShape[deviceType.IscsText] = IscsText;
|
||||
iscsShape[deviceType.IscsLine] = IscsLine;
|
||||
iscsShape[deviceType.IscsRect] = IscsRect;
|
||||
iscsShape[deviceType.Escalator] = Escalator;
|
||||
iscsShape[deviceType.StairControl] = StairControl;
|
||||
iscsShape[deviceType.FasBrakeMachine] = FasBrakeMachine;
|
||||
iscsShape[deviceType.Staircase] = Staircase;
|
||||
iscsShape[deviceType.SingleStaircase] = SingleStaircase;
|
||||
iscsShape[deviceType.ArcStatus] = ArcStatus;
|
||||
|
||||
function shapefactory(device, iscs) {
|
||||
const type = device.model._type;
|
||||
|
31
src/iscs/shape/fasBrakeMachine.js
Normal file
31
src/iscs/shape/fasBrakeMachine.js
Normal file
@ -0,0 +1,31 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import createPathSvg from './components/pathsvg';
|
||||
|
||||
export default class FasBrakeMachine extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this._type = device.model._type;
|
||||
this.code = device.model.code;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
this.grouper = new Group({
|
||||
id: this.model.code,
|
||||
position: [this.model.point.x, this.model.point.y]
|
||||
});
|
||||
this.path = createPathSvg(this.model);
|
||||
if (!this.model.isRight) {
|
||||
this.grouper.origin = [this.model.width / 2, this.model.width * 0.446 / 2];
|
||||
this.grouper.rotation = Math.PI;
|
||||
}
|
||||
this.add(this.grouper);
|
||||
this.grouper.add(this.path);
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point.x += dx;
|
||||
this.model.point.y += dy;
|
||||
}
|
||||
}
|
@ -40,7 +40,7 @@ export default class FireHydrantAlarmButton extends Group {
|
||||
points: [[width / 4, width * 3 / 40], [width * 3 / 4, width * 3 / 40], [width * 3 / 5, width * 5 / 20], [width * 2 / 5, width * 5 / 20]]
|
||||
},
|
||||
style: {
|
||||
color: '#000'
|
||||
fill: '#45607B'
|
||||
}
|
||||
});
|
||||
this.polygonBottom = new Polygon({
|
||||
@ -50,7 +50,7 @@ export default class FireHydrantAlarmButton extends Group {
|
||||
points: [[width * 2 / 5, width * 3 / 10], [width * 3 / 5, width * 3 / 10], [width * 13 / 20, width * 2 / 5], [width * 7 / 20, width * 2 / 5]]
|
||||
},
|
||||
style: {
|
||||
color: '#000'
|
||||
fill: '#45607B'
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.polygonTop);
|
||||
|
@ -8,7 +8,7 @@ export default class GasFireControl extends Group {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.z;
|
||||
this.z = device.model.z;
|
||||
this._type = device.model._type;
|
||||
this._code = device.model.code;
|
||||
this.create();
|
||||
@ -30,7 +30,8 @@ export default class GasFireControl extends Group {
|
||||
},
|
||||
style: {
|
||||
lineWidth: 1,
|
||||
stroke: '#0F0'
|
||||
stroke: '#0F0',
|
||||
fill: 'rgba(0,0,0,0)'
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.rect);
|
||||
|
45
src/iscs/shape/line.js
Normal file
45
src/iscs/shape/line.js
Normal file
@ -0,0 +1,45 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Line from 'zrender/src/graphic/shape/Line';
|
||||
|
||||
export default class line extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this._type = device.model._type;
|
||||
this._code = device.model.code;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.model.point = this.model.point1;
|
||||
this.z = device.model.z;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.grouper = new Group({
|
||||
id: model.code,
|
||||
position: [model.point1.x, model.point1.y]
|
||||
});
|
||||
this.iscsLine = new Line({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
shape: {
|
||||
x1: 0,
|
||||
y1: 0,
|
||||
x2: model.point2.x - model.point1.x,
|
||||
y2: model.point2.y - model.point1.y
|
||||
},
|
||||
style: {
|
||||
lineWidth: this.model.lineWidth,
|
||||
stroke: this.model.fillColor
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.iscsLine);
|
||||
this.add(this.grouper);
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point1.x += dx;
|
||||
this.model.point1.y += dy;
|
||||
this.model.point2.x += dx;
|
||||
this.model.point2.y += dy;
|
||||
}
|
||||
}
|
@ -30,7 +30,8 @@ export default class manualAlarmButton extends Group {
|
||||
},
|
||||
style: {
|
||||
lineWidth: 1,
|
||||
stroke: '#0F0'
|
||||
stroke: '#0F0',
|
||||
fill: 'rgba(0,0,0,0)'
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.rect);
|
||||
@ -75,7 +76,7 @@ export default class manualAlarmButton extends Group {
|
||||
r: this.model.width / 10
|
||||
},
|
||||
style: {
|
||||
fill: '#000'
|
||||
fill: '#45607B'
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.circleInside);
|
||||
|
@ -11,7 +11,7 @@ export default class PlatformScreenDoor extends Group {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.z;
|
||||
this.z = device.model.z;
|
||||
this._type = device.model._type;
|
||||
this._code = device.model.code;
|
||||
this.create();
|
||||
|
42
src/iscs/shape/rect.js
Normal file
42
src/iscs/shape/rect.js
Normal file
@ -0,0 +1,42 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
|
||||
export default class rect extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this._type = device.model._type;
|
||||
this._code = device.model.code;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.grouper = new Group({
|
||||
id: model.code,
|
||||
position: [model.point.x, model.point.y]
|
||||
});
|
||||
this.iscsRect = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: this.model.width,
|
||||
height: this.model.height
|
||||
},
|
||||
style: {
|
||||
fill: this.model.fillColor,
|
||||
stroke: this.model.strokeColor,
|
||||
lineWidth: this.model.borderWidth
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.iscsRect);
|
||||
this.add(this.grouper);
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point.x += dx;
|
||||
this.model.point.y += dy;
|
||||
}
|
||||
}
|
31
src/iscs/shape/singleStaircase.js
Normal file
31
src/iscs/shape/singleStaircase.js
Normal file
@ -0,0 +1,31 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import createPathSvg from './components/pathsvg';
|
||||
|
||||
export default class SingleStaircase extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this._type = device.model._type;
|
||||
this.code = device.model.code;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
this.grouper = new Group({
|
||||
id: this.model.code,
|
||||
position: [this.model.point.x, this.model.point.y]
|
||||
});
|
||||
this.path = createPathSvg(this.model);
|
||||
this.add(this.grouper);
|
||||
if (this.model.isRight) {
|
||||
this.grouper.origin = [this.model.width / 2, this.model.width * 1.368 / 2];
|
||||
this.grouper.scale = [-1, 1];
|
||||
}
|
||||
this.grouper.add(this.path);
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point.x += dx;
|
||||
this.model.point.y += dy;
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@ export default class SmokeDetector extends Group {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.z;
|
||||
this.z = device.model.z;
|
||||
this._type = device.model._type;
|
||||
this._code = device.model.code;
|
||||
this.create();
|
||||
@ -28,7 +28,8 @@ export default class SmokeDetector extends Group {
|
||||
},
|
||||
style: {
|
||||
lineWidth: 1,
|
||||
stroke: '#0F0'
|
||||
stroke: '#0F0',
|
||||
fill: 'rgba(0,0,0,0)'
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.circle);
|
||||
|
31
src/iscs/shape/stairControl.js
Normal file
31
src/iscs/shape/stairControl.js
Normal file
@ -0,0 +1,31 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import createPathSvg from './components/pathsvg';
|
||||
|
||||
export default class StairControl extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this._type = device.model._type;
|
||||
this.code = device.model.code;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
this.grouper = new Group({
|
||||
id: this.model.code,
|
||||
position: [this.model.point.x, this.model.point.y]
|
||||
});
|
||||
this.path = createPathSvg(this.model);
|
||||
this.add(this.grouper);
|
||||
if (this.model.isRight) {
|
||||
this.grouper.origin = [this.model.width / 2, this.model.width * 0.83 / 2 ];
|
||||
this.grouper.scale = [-1, 1];
|
||||
}
|
||||
this.grouper.add(this.path);
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point.x += dx;
|
||||
this.model.point.y += dy;
|
||||
}
|
||||
}
|
32
src/iscs/shape/staircase.js
Normal file
32
src/iscs/shape/staircase.js
Normal file
@ -0,0 +1,32 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import createPathSvg from './components/pathsvg';
|
||||
|
||||
export default class Staircase extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this._type = device.model._type;
|
||||
this.code = device.model.code;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
this.grouper = new Group({
|
||||
id: this.model.code,
|
||||
position: [this.model.point.x, this.model.point.y]
|
||||
});
|
||||
this.path = createPathSvg(this.model);
|
||||
this.add(this.grouper);
|
||||
if (this.model.isRight) {
|
||||
this.grouper.origin = [this.model.width / 2, this.model.width * 1.368 / 2];
|
||||
this.grouper.scale = [-1, 1];
|
||||
}
|
||||
this.grouper.rotation = Math.PI / 180 * (this.model.rotationAngle || 0);
|
||||
this.grouper.add(this.path);
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point.x += dx;
|
||||
this.model.point.y += dy;
|
||||
}
|
||||
}
|
@ -28,7 +28,8 @@ export default class TemperatureDetector extends Group {
|
||||
},
|
||||
style: {
|
||||
lineWidth: 1,
|
||||
stroke: '#0F0'
|
||||
stroke: '#0F0',
|
||||
fill: 'rgba(0,0,0,0)'
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.circle);
|
||||
|
51
src/iscs/shape/text.js
Normal file
51
src/iscs/shape/text.js
Normal file
@ -0,0 +1,51 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Text from 'zrender/src/graphic/Text';
|
||||
|
||||
export default class text extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this._type = device.model._type;
|
||||
this._code = device.model.code;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.grouper = new Group({
|
||||
id: model.code,
|
||||
position: [model.point.x, model.point.y]
|
||||
});
|
||||
this.textName = new Text({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
silent: model.silent || false,
|
||||
style: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
fontWeight: model.fontWeight,
|
||||
fontSize: model.fontSize,
|
||||
fontFamily: 'consolas',
|
||||
text: model.context,
|
||||
textStrokeWidth: model.textStrokeWidth,
|
||||
textFill: model.textFill,
|
||||
textAlign: model.textAlign,
|
||||
textPosition: model.textPosition || 'inside',
|
||||
textVerticalAlign: model.textVerticalAlign || null,
|
||||
textLineHeight: model.fontSize
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.textName);
|
||||
this.add(this.grouper);
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point.x += dx;
|
||||
this.model.point.y += dy;
|
||||
}
|
||||
setSize(width, height) {
|
||||
this.model.width = width;
|
||||
this.model.height = height;
|
||||
}
|
||||
}
|
@ -17,7 +17,7 @@ class TransformHandle {
|
||||
}
|
||||
|
||||
revisibleView(view) {
|
||||
if (this.checkVisible(view) || view._type === deviceType.Background) {
|
||||
if (this.checkVisible(view)) {
|
||||
view.show();
|
||||
} else {
|
||||
view.hide();
|
||||
|
@ -87,6 +87,9 @@ export function parser(data) {
|
||||
zrUtil.each(data.borderRadiusList || [], elem =>{
|
||||
iscsDevice[elem.code] = deviceFactory(deviceType.BorderRadius, elem);
|
||||
} );
|
||||
zrUtil.each(data.arcStatusList || [], elem=> {
|
||||
iscsDevice[elem.code] = deviceFactory(deviceType.ArcStatus, elem);
|
||||
});
|
||||
|
||||
zrUtil.each(data.airConditionerList || [], elem =>{
|
||||
iscsDevice[elem.code] = deviceFactory(deviceType.AirConditioner, elem);
|
||||
@ -121,6 +124,30 @@ export function parser(data) {
|
||||
zrUtil.each(data.volumeControlDamperList || [], elem => {
|
||||
iscsDevice[elem.code] = deviceFactory(deviceType.VolumeControlDamper, elem);
|
||||
});
|
||||
zrUtil.each(data.iscsTextList || [], elem=> {
|
||||
iscsDevice[elem.code] = deviceFactory(deviceType.IscsText, elem);
|
||||
});
|
||||
zrUtil.each(data.iscsLineList || [], elem=> {
|
||||
iscsDevice[elem.code] = deviceFactory(deviceType.IscsLine, elem);
|
||||
});
|
||||
zrUtil.each(data.iscsRectList || [], elem=> {
|
||||
iscsDevice[elem.code] = deviceFactory(deviceType.IscsRect, elem);
|
||||
});
|
||||
zrUtil.each(data.escalatorList || [], elem=> {
|
||||
iscsDevice[elem.code] = deviceFactory(deviceType.Escalator, elem);
|
||||
});
|
||||
zrUtil.each(data.stairControlList || [], elem=> {
|
||||
iscsDevice[elem.code] = deviceFactory(deviceType.StairControl, elem);
|
||||
});
|
||||
zrUtil.each(data.fasBrakeMachineList || [], elem=> {
|
||||
iscsDevice[elem.code] = deviceFactory(deviceType.FasBrakeMachine, elem);
|
||||
});
|
||||
zrUtil.each(data.staircaseList || [], elem=> {
|
||||
iscsDevice[elem.code] = deviceFactory(deviceType.Staircase, elem);
|
||||
});
|
||||
zrUtil.each(data.singleStaircaseList || [], elem=> {
|
||||
iscsDevice[elem.code] = deviceFactory(deviceType.SingleStaircase, elem);
|
||||
});
|
||||
}
|
||||
|
||||
return iscsDevice;
|
||||
@ -134,20 +161,13 @@ function updateIscsListByDevice(state, name, device) {
|
||||
if (device._dispose) {
|
||||
index >= 0 && list.splice(index, 1); // 删除
|
||||
} else if (!list[index]) {
|
||||
list.push(deepClone(device)); // 新增
|
||||
list.push(device); // 新增
|
||||
} else if (index >= 0) {
|
||||
list[index] = deepClone(device); // item map 数据 model 页面表单数据
|
||||
list[index] = device; // item map 数据 model 页面表单数据
|
||||
}
|
||||
// if (index >= 0) {
|
||||
// device._dispose ? list.splice(index, 1) : list[index] = deepClone(device);
|
||||
// } else {
|
||||
// list.push(deepClone(device));
|
||||
// }
|
||||
} else {
|
||||
// list[name] = [device];
|
||||
state.iscs[name] = [device];
|
||||
}
|
||||
// return list;
|
||||
}
|
||||
|
||||
export function updateIscsData(state, device) {
|
||||
@ -228,7 +248,33 @@ export function updateIscsData(state, device) {
|
||||
case deviceType.VolumeControlDamper:
|
||||
updateIscsListByDevice(state, 'volumeControlDamperList', device);
|
||||
break;
|
||||
case deviceType.IscsRect:
|
||||
updateIscsListByDevice(state, 'iscsRectList', device);
|
||||
break;
|
||||
case deviceType.IscsText:
|
||||
updateIscsListByDevice(state, 'iscsTextList', device);
|
||||
break;
|
||||
case deviceType.IscsLine:
|
||||
updateIscsListByDevice(state, 'iscsLineList', device);
|
||||
break;
|
||||
case deviceType.Escalator:
|
||||
updateIscsListByDevice(state, 'escalatorList', device);
|
||||
break;
|
||||
case deviceType.StairControl:
|
||||
updateIscsListByDevice(state, 'stairControlList', device);
|
||||
break;
|
||||
case deviceType.FasBrakeMachine:
|
||||
updateIscsListByDevice(state, 'fasBrakeMachineList', device);
|
||||
break;
|
||||
case deviceType.Staircase:
|
||||
updateIscsListByDevice(state, 'staircaseList', device);
|
||||
break;
|
||||
case deviceType.SingleStaircase:
|
||||
updateIscsListByDevice(state, 'singleStaircaseList', device);
|
||||
break;
|
||||
case deviceType.ArcStatus:
|
||||
updateIscsListByDevice(state, 'arcStatusList', device);
|
||||
break;
|
||||
}
|
||||
|
||||
// store.dispatch('iscs/setIscsData', state.iscs);
|
||||
}
|
||||
|
@ -3,7 +3,8 @@ const mapDeviceStyle = {
|
||||
'02': 'fuzhou_01',
|
||||
'03': 'bejing_01',
|
||||
'04': 'chengdu_03',
|
||||
'06': 'ningbo_01'
|
||||
'06': 'ningbo_01',
|
||||
'07': 'haerbin_01'
|
||||
};
|
||||
|
||||
export function selectLineCode(code) {
|
||||
|
@ -138,6 +138,8 @@ class SkinCode extends defaultStyle {
|
||||
this[deviceType.Signal] = {
|
||||
distance: 0, // 设备距离区段的距离
|
||||
post: {
|
||||
standardLength: 6, // 高柱长度
|
||||
standardHeight: 6, // 灯柱高度
|
||||
standardColor: '#5578B6', // 灯灯柱颜色
|
||||
standardWidth: 1.5 // 灯柱宽度
|
||||
},
|
||||
@ -173,7 +175,7 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
auto: {
|
||||
direction: true, // 自动通过方向
|
||||
offset: { x: 4, y: 0}, // 自动通过偏移量
|
||||
offset: { x: 4, y: 0 }, // 自动通过偏移量
|
||||
width: 5, // 自动宽度
|
||||
autoRoute: '#00FF00', // 自动进路
|
||||
autoTrigger: '#FFFF00', // 自动触发
|
||||
@ -182,7 +184,7 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
delay: {
|
||||
direction: false, // 延时解锁方向
|
||||
offset: { x: 0, y: -5}, // 延时解锁偏移量
|
||||
offset: { x: 0, y: -5 }, // 延时解锁偏移量
|
||||
fontSize: 9, // 延迟解锁字体大小
|
||||
fontColor: '#FF0000', // 延迟解锁颜色
|
||||
fontWeight: 'bold' // 字体粗细
|
||||
@ -220,19 +222,19 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
standEmergent: { // 紧急关闭
|
||||
mergentR: 4, // 站台紧急关闭半径
|
||||
offset: {x: 0, y: 0}, // 站台紧急关闭偏移量
|
||||
offset: { x: 0, y: 0 }, // 站台紧急关闭偏移量
|
||||
closeColor: '#F61107' // 站台紧急关闭颜色
|
||||
},
|
||||
reentry: { // 站台折返策略
|
||||
position: 0, // 折返方向
|
||||
offset: {x: -16, y: 18}, // 折返偏移量
|
||||
offset: { x: -16, y: 18 }, // 折返偏移量
|
||||
noHumanColor: '#0F16DA', // 站台无人折返
|
||||
autoChangeEndsColor: '#0BF400' // 站台自动换端
|
||||
},
|
||||
detainCar: { // 扣车
|
||||
text: 'H', // 扣车显示内容
|
||||
position: 1, // 扣车方向
|
||||
offset: {x: -8, y: 13}, // 扣车偏移量
|
||||
offset: { x: -8, y: 13 }, // 扣车偏移量
|
||||
trainColor: '#E4EF50', // 车站扣车颜色
|
||||
centerTrainColor: '#FFFFFF', // 中心扣车颜色
|
||||
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
|
||||
@ -240,12 +242,12 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
stopTime: { // 停站时间
|
||||
position: 1, // 运行时间方向
|
||||
offset: {x: -8, y: 3}, // 运行时间偏移量
|
||||
offset: { x: -8, y: 3 }, // 运行时间偏移量
|
||||
textColor: '#FFFFFF' // 停站时间字体颜色
|
||||
},
|
||||
level: { // 运行等级
|
||||
position: 1, // 运行等级方向
|
||||
offset: {x: -8, y: 22}, // 运行等级偏移量
|
||||
offset: { x: -8, y: 22 }, // 运行等级偏移量
|
||||
textColor: '#FFFFFF' // 停站等级字体颜色
|
||||
},
|
||||
mouseOverStyle: {
|
||||
@ -290,7 +292,7 @@ class SkinCode extends defaultStyle {
|
||||
lamp: 1, // 灯数量
|
||||
lampSpace: 60 // 灯间距
|
||||
},
|
||||
StationControl:{
|
||||
StationControl: {
|
||||
text: {
|
||||
distance: 2, // 灯和文字之间的距离
|
||||
fontSize: 10, // 控制模式字体大小
|
||||
@ -301,8 +303,8 @@ class SkinCode extends defaultStyle {
|
||||
textVerticalAlign: 'top', // 控制模式垂直对齐
|
||||
centerControlText: '中控', // 中控文字内容
|
||||
substationControlText: '站控', // 站控文字内容
|
||||
emergencyControlText:'紧急站控', // 紧急站控文字内容
|
||||
interconnectedControlText:'连锁控' // 连锁控文字内容
|
||||
emergencyControlText: '紧急站控', // 紧急站控文字内容
|
||||
interconnectedControlText: '连锁控' // 连锁控文字内容
|
||||
// stationCenterControlText: '站中控', // 站中控文字内容
|
||||
// generalAlarmControlText: '总报警' // 总报警文字内容
|
||||
},
|
||||
@ -339,7 +341,7 @@ class SkinCode extends defaultStyle {
|
||||
text: {
|
||||
show: true, // 道岔名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
offset: {x: -15, y: -10}, // 道岔名称与区段距离
|
||||
offset: { x: -15, y: -10 }, // 道岔名称与区段距离
|
||||
fontSize: 10, // 字体大小
|
||||
fontColor: '#C0C0C0', // 道岔名称颜色
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
@ -392,7 +394,7 @@ class SkinCode extends defaultStyle {
|
||||
|
||||
this[deviceType.ZcControl] = {
|
||||
// 是否显示
|
||||
visible:true,
|
||||
visible: true,
|
||||
text: {
|
||||
fontSize: 10, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
@ -477,27 +479,27 @@ class SkinCode extends defaultStyle {
|
||||
textAContent: 'A'// textA文本
|
||||
},
|
||||
trainNumber: {
|
||||
trainNumberOffset: { x: 0, y: 1}// 目的地码偏移量
|
||||
trainNumberOffset: { x: 0, y: 1 }// 目的地码偏移量
|
||||
},
|
||||
trainServer: {
|
||||
serviceNumberPrefix: '00', // 服务号(表号)前缀
|
||||
defaultServiceNumber: 'AA', // 默认服务号(表号)
|
||||
trainServerOffset: { x: 4, y: 4}// 列车服务号偏移
|
||||
trainServerOffset: { x: 4, y: 4 }// 列车服务号偏移
|
||||
},
|
||||
trainTarget: {
|
||||
tripNumberPrefix: '000', // 车次号前缀
|
||||
defaultTripNumber: 'DDD', // 默认车次号2
|
||||
trainTargetOffset: { x: 36, y: 4}, // 列车车次号偏移
|
||||
trainTargetOffset: { x: 36, y: 4 }, // 列车车次号偏移
|
||||
trainTargetTextAlign: 'left'// 车次号文字显示位置
|
||||
},
|
||||
trainTargetNumber: {
|
||||
trainTargetNumberOffset: {x: 0, y: 0}// 车组号偏移量
|
||||
trainTargetNumberOffset: { x: 0, y: 0 }// 车组号偏移量
|
||||
},
|
||||
trainHead: {
|
||||
trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
|
||||
trainHeadTriangleFirst: { x: 7, y: 1}, // 列车车头三角坐标1偏移量
|
||||
trainHeadTriangleSecond: { x: 13, y: 10}, // 列车车头三角坐标2偏移量
|
||||
trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量
|
||||
trainHeadTriangleFirst: { x: 7, y: 1 }, // 列车车头三角坐标1偏移量
|
||||
trainHeadTriangleSecond: { x: 13, y: 10 }, // 列车车头三角坐标2偏移量
|
||||
trainHeadTriangleThird: { x: 7, y: 19 }, // 列车车头三角坐标3偏移量
|
||||
trainHeadRectHeight: 20, // 列车车头矩形高度
|
||||
trainConntWidth: 3, // 列车竖杠的宽度
|
||||
trainHeadFillColor: '#000000'// 列车车头矩形填充颜色
|
||||
@ -518,10 +520,10 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
trainStatusStyle: {
|
||||
destinationStatus: [
|
||||
{status: '01', showColor: '#FFFFFF'},
|
||||
{status: '02', showColor: '#00FF00'},
|
||||
{status: '03', showColor: '#A0522D'},
|
||||
{status: '04', showColor: '#FFFF00'}
|
||||
{ status: '01', showColor: '#FFFFFF' },
|
||||
{ status: '02', showColor: '#00FF00' },
|
||||
{ status: '03', showColor: '#A0522D' },
|
||||
{ status: '04', showColor: '#FFFF00' }
|
||||
], // 目的地状态 01准点 02早点 03晚点 04头码车
|
||||
defaultDestinationColor: '#FFFFFF', // 默认目的地状态显示颜色
|
||||
destinationStatusSetText: 'trainTarget', // 目的地状态设置的对应哪个text的颜色
|
||||
@ -549,9 +551,9 @@ class SkinCode extends defaultStyle {
|
||||
}
|
||||
], // 列车运行方向状态类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
|
||||
directionStopType: [
|
||||
{type: '01', lineLShow: false, lineRShow: false},
|
||||
{type: '02', lineLShow: false, lineRShow: true},
|
||||
{type: '03', lineLShow: true, lineRShow: false}
|
||||
{ type: '01', lineLShow: false, lineRShow: false },
|
||||
{ type: '02', lineLShow: false, lineRShow: true },
|
||||
{ type: '03', lineLShow: true, lineRShow: false }
|
||||
], // 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
|
||||
runModeStatus: [
|
||||
{
|
||||
@ -567,7 +569,8 @@ class SkinCode extends defaultStyle {
|
||||
{
|
||||
status: '03',
|
||||
trainLColor: '#FFFF00',
|
||||
trainRColor: '#FFFF00'},
|
||||
trainRColor: '#FFFF00'
|
||||
},
|
||||
{
|
||||
status: '04',
|
||||
trainLColor: '#A0522D',
|
||||
@ -580,25 +583,25 @@ class SkinCode extends defaultStyle {
|
||||
}
|
||||
], // 列车运行模式对应车头颜色 01未知 02 ATO自动驾驶模式AM 03 ATP监控下的人工驾驶模式CM 04 限制人工驾驶模式RM 05 非限制人工驾驶模式RM
|
||||
runControlStatus: [
|
||||
{status: '01', hShow: false, sShow: false},
|
||||
{status: '02', hShow: true, sShow: false},
|
||||
{status: '03', hShow: false, sShow: true}
|
||||
{ status: '01', hShow: false, sShow: false },
|
||||
{ status: '02', hShow: true, sShow: false },
|
||||
{ status: '03', hShow: false, sShow: true }
|
||||
], // 设置运行控制状态类型 01正常 02扣车 03停跳
|
||||
doorStatus: [
|
||||
{status: '01', dShow: false},
|
||||
{status: '02', dShow: true}
|
||||
{ status: '01', dShow: false },
|
||||
{ status: '02', dShow: true }
|
||||
], // 设置车门状态类型 01关门 02开门
|
||||
communicationStatus: [
|
||||
{status: '01', trainColor: '#725A64'},
|
||||
{status: '02', trainColor: '#C0C0C0'}
|
||||
{ status: '01', trainColor: '#725A64' },
|
||||
{ status: '02', trainColor: '#C0C0C0' }
|
||||
], // 设置通信状态 01正常 02故障
|
||||
alarmStatus: [
|
||||
{status: '01', aShow: false},
|
||||
{status: '02', aShow: true}
|
||||
{ status: '01', aShow: false },
|
||||
{ status: '02', aShow: true }
|
||||
], // 设置报警状态 01不报警 02报警
|
||||
serverNoType: [
|
||||
{type: '01', showColor: '#FFFFFF'},
|
||||
{type: '02', showColor: '#FFF000'}
|
||||
{ type: '01', showColor: '#FFFFFF' },
|
||||
{ type: '02', showColor: '#FFF000' }
|
||||
], // 服务号状态类型 01显示服务号 计划车 02显示车组号: 头码车与人工车
|
||||
defaultServerNoColor: '#FFFFFF' // 默认服务号状态显示颜色
|
||||
}
|
||||
|
@ -138,6 +138,8 @@ class SkinCode extends defaultStyle {
|
||||
this[deviceType.Signal] = {
|
||||
distance: 3, // 设备距离区段的距离
|
||||
post: {
|
||||
standardLength: 6, // 高柱长度
|
||||
standardHeight: 6, // 灯柱高度
|
||||
standardColor: '#C0C0C0', // 灯柱颜色
|
||||
standardWidth: 2 // 灯柱宽度
|
||||
},
|
||||
|
@ -141,6 +141,8 @@ class SkinCode extends defaultStyle {
|
||||
this[deviceType.Signal] = {
|
||||
distance: 10, // 设备距离区段的距离
|
||||
post: {
|
||||
standardLength: 6, // 高柱长度
|
||||
standardHeight: 6, // 灯柱高度
|
||||
standardColor: '#FFFFFF', // 灯柱颜色
|
||||
standardWidth: 2 // 灯柱宽度
|
||||
},
|
||||
|
@ -131,6 +131,8 @@ class SkinCode extends defaultStyle {
|
||||
this[deviceType.Signal] = {
|
||||
distance: 10, // 设备距离区段的距离
|
||||
post: {
|
||||
standardLength: 6, // 高柱长度
|
||||
standardHeight: 6, // 灯柱高度
|
||||
standardColor: '#3149C3', // 灯珠颜色
|
||||
standardWidth: 2 // 灯珠宽度
|
||||
},
|
||||
|
579
src/jmapNew/config/skinCode/haerbin_01.js
Normal file
579
src/jmapNew/config/skinCode/haerbin_01.js
Normal file
@ -0,0 +1,579 @@
|
||||
import defaultStyle from '../defaultStyle';
|
||||
import deviceType from '../../constant/deviceType';
|
||||
|
||||
class SkinCode extends defaultStyle {
|
||||
constructor() {
|
||||
super();
|
||||
this[deviceType.Section] = {
|
||||
active: {
|
||||
routeColor: false // 进路触发颜色
|
||||
},
|
||||
text: {
|
||||
show: true, // 物理区段名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 18, // 文字离区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
logicText: {
|
||||
show: true, // 逻辑区段名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 6, // 文字离区段距离
|
||||
fontSize: 8, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
switchText: {
|
||||
show: false, // 道岔区段名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 18, // 文字离区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
standText: {
|
||||
show: true, // 站台轨名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 30, // 文字离区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
reentryText: {
|
||||
show: true, // 折返轨名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 30, // 文字离区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
transferText: {
|
||||
show: true, // 转换轨名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 28, // 文字离区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
destinationText: {
|
||||
show: true, // 目的码名称显示
|
||||
opposite: true, // 对称相反
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 10, // 文字离区段距离
|
||||
fontSize: 10, // 字体大小
|
||||
fontWeight: 'bold', // 字体粗细
|
||||
fontColor: 'yellow', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
line: {
|
||||
width: 5, // 区段宽度
|
||||
beyondWidth: 1, // 区段宽超出宽度
|
||||
invadeColor: '#EF0C08', // 区段侵入颜色
|
||||
spareColor: '#3F3F3F', // 区段空闲颜色
|
||||
communicationOccupiedColor: '#FF329A', // 区段通信车占用颜色
|
||||
unCommunicationOccupiedColor: '#FE0000', // 区段非通讯车占用颜色
|
||||
routeLockColor: '#FFFFFF', // 区段路由锁定颜色
|
||||
faultLockColor: '#9B4A0A', // 区段故障锁定颜色
|
||||
undefinedColor: '#0071C1', // 区段未定义颜色
|
||||
protectionLockedColor: '#FEFF00', // 保护区段锁闭(未用)
|
||||
blockColor: '#800080', // 区段封锁颜色
|
||||
atcExcisionColor: '#A0522D', // 区段atc切除颜色
|
||||
atsExcisionColor: '#A0522D', // 区段ats切除颜色
|
||||
timeReleaseColor: '#3F3F3F', // 区段延时释放颜色
|
||||
protectiveLockColor: '#FFFF00', // 区段保护锁闭
|
||||
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
|
||||
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
|
||||
logicalTextColor: '#FFFFFF' // 逻辑区段名称颜色 (未用)
|
||||
},
|
||||
axle: {
|
||||
radius: 3, // 计轴 半径
|
||||
distance: 5, // 计轴和区段之间的距离 (未用)
|
||||
color: '#FFFFFF', // 区段计轴颜色
|
||||
resetColor: '#00FFFF', // 区段计轴预复位颜色
|
||||
Failure: '#E6A23C' // #FFFF00 计轴失效
|
||||
},
|
||||
speedLimit: { // 限速元素
|
||||
width: 1, // 限速线的宽短
|
||||
distance: 5, // 限速线距离区段距离
|
||||
lineColor: '#FFFF00', // 限速线颜色
|
||||
nameShow: false // 名称显示
|
||||
},
|
||||
separator: {
|
||||
z: 6, // 分割符层级
|
||||
width: 1.2, // 分隔符宽度
|
||||
endWidth: 3.5, // 尽头分隔符宽度
|
||||
endColor: '#3F3F3F', // 尽头分隔符颜色
|
||||
color: '#3149C3' // 区段边界符颜色
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.Signal] = {
|
||||
distance: 10, // 设备距离区段的距离
|
||||
post: {
|
||||
standardShow: true, // 灯柱显示
|
||||
standardLength: 4, // 高柱长度
|
||||
standardHeight: 5, // 灯柱高度
|
||||
standardColor: '#3149C3', // 灯柱颜色
|
||||
standardWidth: 4 // 灯柱宽度
|
||||
},
|
||||
text: {
|
||||
show: true, // 信号机名称显示
|
||||
distance: 4, // 文字和灯杆的距离
|
||||
isAlignCenter: true, // 信号字体对其方式
|
||||
fontSize: 11, // 信号机名称字体大小
|
||||
fontWeight: 'bold', // 信号机名称字体粗细
|
||||
defaultColor: '#FFFFFF', // 信号灯字体默认色
|
||||
blockColor: '#EF0C08', // 信号灯字体锁定颜色
|
||||
checkColor: '#00FF00', // 信号字体
|
||||
nameBorderShow: true // 信号机名字边框显示
|
||||
},
|
||||
lamp: {
|
||||
logicDisplayNone: true, // 逻辑点灯斜线不显示
|
||||
guidName: 'defult', // 默认引导类型
|
||||
stopWidth: 2, // 禁止线宽度
|
||||
borderWidth: 1, // 信号灯边框线宽度
|
||||
borderColor: '#3149C3', // 信号灯边框线颜色
|
||||
radiusR: 4, // 信号灯半径
|
||||
blockColor: '#EF0C08', // 信号灯锁闭
|
||||
grayColor: '#7F7F7F', // 信号灯灰色
|
||||
redColor: '#FF0000', // 信号灯红色
|
||||
greenColor: '#00FF00', // 信号灯绿色
|
||||
yellowColor: '#FFFF00', // 信号灯黄色
|
||||
whiteColor: '#FFFFFF', // 信号灯白色
|
||||
blueColor: '#0070C0' // 信号灯蓝色
|
||||
},
|
||||
route: {
|
||||
direction: false, // 自动进路方向
|
||||
offset: { x: -4, y: 0 }, // 自动进路偏移量
|
||||
routeColor: '#00FF00' // 自动进路
|
||||
},
|
||||
auto: {
|
||||
direction: false, // 自动通过方向
|
||||
offset: { x: -4, y: 0 }, // 自动通过偏移量
|
||||
width: 5, // 自动宽度
|
||||
autoRoute: '#00FF00', // 自动进路
|
||||
autoTrigger: '#FFFF00', // 自动触发
|
||||
manualControl: '#FFFF00', // 人工控制
|
||||
outConflict: '#C00808' // 出车冲突
|
||||
},
|
||||
delay: {
|
||||
direction: true, // 延时解锁方向
|
||||
offset: { x: 15, y: -10 }, // 延时解锁偏移量
|
||||
fontSize: 11, // 延迟解锁字体大小
|
||||
fontColor: '#FF0000', // 延迟解锁颜色
|
||||
fontWeight: 'bold' // 字体粗细
|
||||
},
|
||||
button: {
|
||||
distance: 5, // 信号灯按钮距离区段的距离
|
||||
borderDashColor: '#FFFFFF', // 信号灯按钮边线
|
||||
buttonColor: 'darkgreen', // 信号灯按钮颜色
|
||||
buttonLightenColor: '#E4EF50' // 信号灯按钮闪烁颜色
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.StationStand] = {
|
||||
common: { // 通用属性
|
||||
textFontSize: 11, // 站台默认字体大小
|
||||
special: true // 特殊站台
|
||||
},
|
||||
safetyDoor: { // 屏蔽门
|
||||
height: 3, // 站台屏蔽门高度
|
||||
width: 60,
|
||||
distance: 8, // 站台和屏蔽门之间的距离
|
||||
defaultColor: '#fff', // 屏蔽门默认颜色
|
||||
splitDoorColor: '#F61107' // 屏蔽门切除颜色
|
||||
},
|
||||
stand: { // 站台
|
||||
headFontSize: 11, // 站台首端字体大小
|
||||
textFill: '#fff', // 站台字体颜色
|
||||
spareColor: '#00ffff', // 站台空闲颜色
|
||||
stopColor: '#FEFE00', // 站台列车停站颜色
|
||||
jumpStopColor: '#9A99FF', // 站台跳停颜色
|
||||
designatedJumpStopColor: 'lightSkyBlue' // 站台指定列车跳停颜色
|
||||
},
|
||||
standEmergent: { // 紧急关闭
|
||||
mergentR: 4, // 站台紧急关闭半径
|
||||
offset: { x: 0, y: 40 }, // 站台紧急关闭偏移量
|
||||
closeColor: '#F61107' // 站台紧急关闭颜色
|
||||
},
|
||||
reentry: { // 站台折返策略
|
||||
position: 0, // 折返方向
|
||||
offset: { x: -16, y: 20 }, // 折返偏移量
|
||||
noHumanColor: '#0F16DA', // 站台无人折返
|
||||
autoChangeEndsColor: '#0BF400' // 站台自动换端
|
||||
},
|
||||
detainCar: { // 扣车
|
||||
text: 'H', // 扣车显示内容
|
||||
fontSize: 18, // 扣车字体大小
|
||||
position: -1, // 扣车方向
|
||||
offset: { x: -8, y: -6 }, // 扣车偏移量
|
||||
trainColor: '#E4EF50', // 车站扣车颜色
|
||||
centerTrainColor: '#FFFFFF', // 中心扣车颜色
|
||||
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
|
||||
detainTrainTextColor: '#E4EF50' // 车站扣除文字颜色
|
||||
},
|
||||
stopTime: { // 停站时间
|
||||
position: 1, // 运行时间方向
|
||||
offset: { x: -8, y: 26 }, // 运行时间偏移量
|
||||
textColor: '#FFFFFF' // 停站时间字体颜色
|
||||
},
|
||||
level: { // 运行等级
|
||||
position: 1, // 运行等级方向
|
||||
offset: { x: -8, y: 6 }, // 运行等级偏移量
|
||||
textColor: '#FFFFFF' // 停站等级字体颜色
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.StationCounter] = {
|
||||
text: {
|
||||
distance: 2, // 计数器名称和文字的距离
|
||||
fontColor: '#FFFFFF', // 计数器字体颜色
|
||||
borderColor: '#E4EF50' // 计数器边框颜色
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.StationDelayUnlock] = {
|
||||
text: {
|
||||
distance: 3, // 延迟解锁和设备之间的距离
|
||||
fontColor: '#FFFFFF', // 延时解锁字体颜色
|
||||
borderColor: '#FFFFFF' // 延迟解锁边框颜色
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.Station] = {
|
||||
// text: {
|
||||
// show: true // 公里标名称显示
|
||||
// },
|
||||
kmPostShow: true, // 公里标显示
|
||||
kilometerPosition: 'up', // 公里标朝向
|
||||
text: {
|
||||
borderShow: true, // 车站包围框显示
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 5 // 灯跟文字距离
|
||||
},
|
||||
lamp: {
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#FFFF00' // 控制灯颜色
|
||||
},
|
||||
turnBack: { // 按图折返
|
||||
lamp: 1, // 灯数量
|
||||
lampSpace: 60 // 灯间距
|
||||
},
|
||||
StationControl: {
|
||||
text: {
|
||||
distance: 2, // 灯和文字之间的距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontFormat: 'consolas', // 字体格式
|
||||
fontColor: '#ffffff', // 字体颜色
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
textAlign: 'middle', // 字体水平对齐
|
||||
textVerticalAlign: 'top', // 字体垂直对齐
|
||||
centerControlText: '中控', // 中控文字内容
|
||||
substationControlText: '站控', // 站控文字内容
|
||||
emergencyControlText: '紧急站控', // 紧急站控文字内容
|
||||
interconnectedControlText: '连锁控' // 连锁控文字内容
|
||||
// stationCenterControlText: '站中控', // 站中控文字内容
|
||||
// generalAlarmControlText: '总报警' // 总报警文字内容
|
||||
},
|
||||
lamp: {
|
||||
count: 2, // 控制模式灯个数
|
||||
offset: { x: 0, y: 0 }, // 控制模式灯偏移量
|
||||
radiusR: 4, // 控制模式灯的半径
|
||||
distance: 36, // 控制模式之间灯之间的距离
|
||||
grayColor: '#7F7F7F', // 控制模式灰色
|
||||
greenColor: '#00FF00', // 控制模式绿色
|
||||
redColor: '#FF0000', // 控制模式红色
|
||||
yellowColor: '#FFFF00', // 控制模式黄色
|
||||
emergencyControlShow: false, // 紧急站控显示
|
||||
centerControlShow: true, // 中控显示
|
||||
substationControlShow: true, // 站控按钮显示
|
||||
interconnectedControlShow: false, // 联锁控显示
|
||||
centerControlButtonShow: false // 中控显示
|
||||
},
|
||||
arrow: {
|
||||
show: true // 控制模式箭头显隐
|
||||
},
|
||||
mouseOverStyle: { // 鼠标悬浮样式
|
||||
fontSize: null,
|
||||
fontFormat: 'consolas',
|
||||
fontColor: '#000',
|
||||
fontWeight: 'normal',
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.Switch] = {
|
||||
text: {
|
||||
show: true, // 道岔名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
offset: { x: 0, y: 8 }, // 道岔名称与区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontColor: '#C0C0C0', // 道岔名称颜色
|
||||
fontWeight: 'bold', // 字体粗细
|
||||
borderColor: '#FE0000', // 道岔边框颜色
|
||||
lossColor: '#FFFFFF', // 道岔失去颜色
|
||||
locateColor: '#00FF00', // 道岔定位颜色
|
||||
inversionColor: '#9C9D09', // 道岔反位颜色
|
||||
monolockColor: '#870E10' // 道岔单锁颜色
|
||||
},
|
||||
core: {
|
||||
splice: true, // 哈尔滨特殊显示
|
||||
length: 6 // 道岔单边长度
|
||||
},
|
||||
block: { // 道岔封锁配置
|
||||
nameBorderShow: true, // 道岔名称是否有包围框 显示
|
||||
contentRectShow: false // 道岔封锁显示
|
||||
},
|
||||
monolock: { // 道岔单锁配置
|
||||
locationColor: '#ea282c', // 道岔单锁定位颜色 (红色)
|
||||
inversionColor: '#ea282c', // 道岔单锁反位颜色 (红色)
|
||||
rectShow: false // 道岔单锁 矩形框是否显示
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.Line] = {
|
||||
lineColor: '#FFFFFF' // 线条颜色
|
||||
};
|
||||
|
||||
this[deviceType.LcControl] = {
|
||||
text: {
|
||||
fontSize: 10, // 灯字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 5 // 灯跟文字距离
|
||||
},
|
||||
lamp: {
|
||||
radiusR: 6, // 灯大小
|
||||
controlColor: '#FFFF00' // 灯颜色
|
||||
},
|
||||
mouseOverStyle: {
|
||||
fontSize: 10,
|
||||
fontFormat: 'consolas',
|
||||
fontColor: '#FFF000',
|
||||
fontWeight: 'normal',
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top',
|
||||
arcColor: '#00FFFF',
|
||||
textColor: '#000000'
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.ZcControl] = {
|
||||
text: {
|
||||
fontSize: 10, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 5 // 灯跟文字距离
|
||||
},
|
||||
lamp: {
|
||||
radiusR: 6, // 灯大小
|
||||
controlColor: '#00FF00' // 灯颜色
|
||||
},
|
||||
mouseOverStyle: {
|
||||
fontSize: 10,
|
||||
fontFormat: 'consolas',
|
||||
fontColor: '#FFF000',
|
||||
fontWeight: 'normal',
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top',
|
||||
arcColor: '#00FFFF',
|
||||
textColor: '#000000'
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.LimitControl] = {
|
||||
text: {
|
||||
fontSize: 10, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 5 // 灯跟文字距离
|
||||
},
|
||||
lamp: {
|
||||
radiusR: 6, // 灯大小
|
||||
controlColor: '#ECE9D8' // 灯颜色
|
||||
},
|
||||
mouseOverStyle: {
|
||||
fontSize: 10,
|
||||
fontFormat: 'consolas',
|
||||
fontColor: '#FFF000',
|
||||
fontWeight: 'normal',
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top',
|
||||
textColor: '#000000',
|
||||
arcColor: '#00FFFF'
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.TrainWindow] = {
|
||||
lineColor: '#4DD43F', // 车次窗颜色
|
||||
lineDash: null, // 车次窗虚线间隔
|
||||
lineWidth: 1, // 车次窗线宽
|
||||
trainWindowSmooth: 0 // 车次窗矩形圆滑程度
|
||||
};
|
||||
|
||||
this[deviceType.Train] = {
|
||||
trainBody: {
|
||||
trainBodyLineWidth: 0, // 车身line宽
|
||||
changeTrainWidth: true, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
||||
specialTrainType: [
|
||||
{
|
||||
type: '03',
|
||||
serviceNumber: 'MM',
|
||||
nameFormat: 'serviceNumber:groupNumber'
|
||||
},
|
||||
{
|
||||
type: '02',
|
||||
nameFormat: 'targetCode:groupNumber'
|
||||
}
|
||||
], // 特殊列车类型需设置显示格式
|
||||
lrPadding: 1, // 两边间隔
|
||||
upPadding: 1, // 上边距离
|
||||
trainBodyFillColor: '#000000', // 列车车身填充颜色
|
||||
trainNameFormat: 'targetCode:serviceNumber:tripNumber'// 列车显示格式
|
||||
},
|
||||
hsda: {
|
||||
trainHSDATextFontSize: 8// 列车HDSA字号
|
||||
},
|
||||
trainNumber: {
|
||||
targetCodePrefix: '000', // 目的地码前缀
|
||||
defaultTargetCode: 'AAA', // 默认目的地码
|
||||
trainTargetTextAlign: 'left', // 车次号文字显示位置
|
||||
trainNumberOffset: { x: 1, y: 1 }// 目的地码偏移量
|
||||
},
|
||||
trainServer: {
|
||||
serviceNumberPrefix: '00', // 服务号(表号)前缀
|
||||
defaultServiceNumber: 'BB', // 默认服务号(表号)
|
||||
trainServerOffset: { x: 26, y: 1 }// 列车服务号偏移
|
||||
},
|
||||
trainTarget: {
|
||||
tripNumberPrefix: '0000', // 车次号前缀
|
||||
defaultDirectionCode: 'D', // 默认车次号1
|
||||
defaultTripNumber: 'CCC', // 默认车次号2
|
||||
trainTargetOffset: { x: 42, y: 1 }// 列车车次号偏移
|
||||
},
|
||||
trainTargetNumber: {
|
||||
groupNumberPrefix: '000', // 车组号前缀
|
||||
defaultGroupNumber: 'EEE', // 默认车组号
|
||||
trainTargetNumberOffset: { x: 0, y: 1 }// 车组号偏移量
|
||||
},
|
||||
trainHead: {
|
||||
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
|
||||
trainHeadTriangleFirst: { x: 0, y: 0 }, // 列车车头三角坐标1偏移量
|
||||
trainHeadTriangleSecond: { x: 4, y: 7.5 }, // 列车车头三角坐标2偏移量
|
||||
trainHeadTriangleThird: { x: 0, y: 15 }, // 列车车头三角坐标3偏移量
|
||||
trainHeadRectHeight: 15, // 列车车头矩形高度
|
||||
trainConntWidth: 4, // 列车竖杠的宽度
|
||||
trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色
|
||||
},
|
||||
common: {
|
||||
trainHeight: 17, // 列车高度
|
||||
trainHeadDistance: 2, // 列车和车头之间的间距
|
||||
trainWidth: 76, // 列车长度
|
||||
trainTextFontSize: 15, // 列车字号
|
||||
fontFamily: 'consolas', // 默认字体 族类
|
||||
nameFontSize: 15, // 字体大小
|
||||
haveTextHSDA: false, // 是否需创建textHSDA对象
|
||||
haveArrowText: true, // 是否需创建arrowText对象
|
||||
haveTrainBorder: false, // 是否需创建trainBorder对象
|
||||
aspectRatio: 8 / 15, // 字体宽高比例(用以拼接text是计算位置)
|
||||
textOffset: 1, // 字体偏移(用以控制字体据车头的距离)
|
||||
trainWidthMoreText: 2 // 计算列车长度时--列车长比text多出尺寸
|
||||
},
|
||||
trainStatusStyle: {
|
||||
destinationStatus: [
|
||||
{ status: '01', showColor: '#FFFFFF' },
|
||||
{ status: '02', showColor: '#00FF00' },
|
||||
{ status: '03', showColor: '#3265FF' },
|
||||
{ status: '04', showColor: '#9B4A09' },
|
||||
{ status: '05', showColor: '#EF0C08' },
|
||||
{ status: '06', showColor: '#FFFFFF' },
|
||||
{ status: '07', showColor: '#FFFF00' }
|
||||
], // 目的地状态 01准点 02早点 03严重早点 04晚点 05严重晚点 06头码车 07ATP切除
|
||||
destinationStatusSetText: 'trainServer', // 目的地状态设置的对应哪个text的颜色
|
||||
directionType: [
|
||||
{
|
||||
type: '01',
|
||||
lineLShow: false,
|
||||
lineRShow: false,
|
||||
arrowLShow: false,
|
||||
arrowRShow: false
|
||||
},
|
||||
{
|
||||
type: '02',
|
||||
lineLShow: false,
|
||||
lineRShow: false,
|
||||
arrowLShow: false,
|
||||
arrowRShow: true
|
||||
},
|
||||
{
|
||||
type: '03',
|
||||
lineLShow: false,
|
||||
lineRShow: false,
|
||||
arrowLShow: true,
|
||||
arrowRShow: false
|
||||
}
|
||||
], // 运行方向状态类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
|
||||
directionStopType: [
|
||||
{ type: '01', lineLShow: false, lineRShow: false },
|
||||
{ type: '02', lineLShow: false, lineRShow: true },
|
||||
{ type: '03', lineLShow: true, lineRShow: false }
|
||||
], // 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
|
||||
runModeStatus: [
|
||||
{
|
||||
status: '01',
|
||||
trainLColor: '#EF0C08',
|
||||
trainRColor: '#EF0C08'
|
||||
},
|
||||
{
|
||||
status: '02',
|
||||
trainLColor: '#00FF00',
|
||||
trainRColor: '#00FF00'
|
||||
},
|
||||
{
|
||||
status: '03',
|
||||
trainLColor: '#FFFF00',
|
||||
trainRColor: '#FFFF00'
|
||||
},
|
||||
{
|
||||
status: '04',
|
||||
trainLColor: '#EA700D',
|
||||
trainRColor: '#EA700D'
|
||||
},
|
||||
{
|
||||
status: '05',
|
||||
trainLColor: '#A0522D',
|
||||
trainRColor: '#A0522D'
|
||||
}
|
||||
], // 列车运行模式对应车头颜色 01信号中断 02 ATO自动驾驶模式AM 03 ATP监控下的人工驾驶模式CM 04 限制人工驾驶模式RM 05 非限制人工驾驶模式RM
|
||||
runControlStatus: [], // 设置运行控制状态类型 eg:{status: '01', hShow: false, sShow: false}
|
||||
doorStatus: [], // 设置车门状态类型 eg:{status: '01', dShow: false}
|
||||
communicationStatus: [], // 设置通信状态 eg:{status: '01', trainColor:'#725A64'}
|
||||
alarmStatus: [], // 设置报警状态 eg:{status: '01', aShow: false}
|
||||
serverNoType: []// 服务号状态类型 eg:{type: '01', showColor: '#FFFFFF'}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export default new SkinCode();
|
@ -138,6 +138,8 @@ class SkinCode extends defaultStyle {
|
||||
this[deviceType.Signal] = {
|
||||
distance: 3, // 设备距离区段的距离
|
||||
post: {
|
||||
standardLength: 6, // 高柱长度
|
||||
standardHeight: 6, // 灯柱高度
|
||||
standardColor: '#C0C0C0', // 灯柱颜色
|
||||
standardWidth: 2 // 灯柱宽度
|
||||
},
|
||||
|
@ -12,58 +12,92 @@ class ESafeDoor extends Group {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
const padding = 0.1;
|
||||
if (style.StationStand.common.special) {
|
||||
this.stand1 = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: model.x - model.width / 4,
|
||||
y: model.y,
|
||||
width: model.width / 4 - 2,
|
||||
height: model.height
|
||||
},
|
||||
style: {
|
||||
lineWidth: 0,
|
||||
stroke: style.sidelineColor,
|
||||
fill: style.StationStand.safetyDoor.defaultColor
|
||||
}
|
||||
});
|
||||
this.stand2 = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: model.x,
|
||||
y: model.y,
|
||||
width: model.width / 4 - 2,
|
||||
height: model.height
|
||||
},
|
||||
style: {
|
||||
lineWidth: 0,
|
||||
stroke: style.sidelineColor,
|
||||
fill: style.StationStand.safetyDoor.defaultColor
|
||||
}
|
||||
});
|
||||
this.add(this.stand1);
|
||||
this.add(this.stand2);
|
||||
} else {
|
||||
this.safeL = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: model.x - model.width / 2 - padding,
|
||||
y: model.y,
|
||||
width: model.width / 4 + padding,
|
||||
height: model.height
|
||||
},
|
||||
style: {
|
||||
lineWidth: 0,
|
||||
stroke: style.StationStand.safetyDoor.defaultColor,
|
||||
fill: style.StationStand.safetyDoor.defaultColor
|
||||
}
|
||||
});
|
||||
|
||||
this.safeL = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: model.x - model.width / 2 - padding,
|
||||
y: model.y,
|
||||
width: model.width / 4 + padding,
|
||||
height: model.height
|
||||
},
|
||||
style: {
|
||||
lineWidth: 0,
|
||||
stroke: style.StationStand.safetyDoor.defaultColor,
|
||||
fill: style.StationStand.safetyDoor.defaultColor
|
||||
}
|
||||
});
|
||||
this.safeC = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: model.x - model.width / 4 - padding,
|
||||
y: model.y,
|
||||
width: model.width / 2 + padding * 2,
|
||||
height: model.height
|
||||
},
|
||||
style: {
|
||||
lineWidth: 0,
|
||||
stroke: style.StationStand.safetyDoor.defaultColor,
|
||||
fill: style.StationStand.safetyDoor.defaultColor
|
||||
}
|
||||
});
|
||||
|
||||
this.safeC = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: model.x - model.width / 4 - padding,
|
||||
y: model.y,
|
||||
width: model.width / 2 + padding * 2,
|
||||
height: model.height
|
||||
},
|
||||
style: {
|
||||
lineWidth: 0,
|
||||
stroke: style.StationStand.safetyDoor.defaultColor,
|
||||
fill: style.StationStand.safetyDoor.defaultColor
|
||||
}
|
||||
});
|
||||
this.safeR = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: model.x + model.width / 4,
|
||||
y: model.y,
|
||||
width: model.width / 4 + padding,
|
||||
height: model.height
|
||||
},
|
||||
style: {
|
||||
lineWidth: 0,
|
||||
stroke: style.StationStand.safetyDoor.defaultColor,
|
||||
fill: style.StationStand.safetyDoor.defaultColor
|
||||
}
|
||||
});
|
||||
|
||||
this.safeR = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: model.x + model.width / 4,
|
||||
y: model.y,
|
||||
width: model.width / 4 + padding,
|
||||
height: model.height
|
||||
},
|
||||
style: {
|
||||
lineWidth: 0,
|
||||
stroke: style.StationStand.safetyDoor.defaultColor,
|
||||
fill: style.StationStand.safetyDoor.defaultColor
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.safeL);
|
||||
this.add(this.safeC);
|
||||
this.add(this.safeR);
|
||||
this.add(this.safeL);
|
||||
this.add(this.safeC);
|
||||
this.add(this.safeR);
|
||||
}
|
||||
}
|
||||
|
||||
hasDoor(show) {
|
||||
@ -71,9 +105,9 @@ class ESafeDoor extends Group {
|
||||
}
|
||||
|
||||
setColor(color) {
|
||||
this.safeL.setStyle('fill', color);
|
||||
this.safeC.setStyle('fill', color);
|
||||
this.safeR.setStyle('fill', color);
|
||||
this.safeL && this.safeL.setStyle('fill', color);
|
||||
this.safeC && this.safeC.setStyle('fill', color);
|
||||
this.safeR && this.safeR.setStyle('fill', color);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,8 +73,10 @@ class ESigLamp extends Group {
|
||||
}
|
||||
});
|
||||
this.add(this.lamp);
|
||||
this.add(this.lstop);
|
||||
this.add(this.rstop);
|
||||
if (!style.Signal.lamp.logicDisplayNone) {
|
||||
this.add(this.lstop);
|
||||
this.add(this.rstop);
|
||||
}
|
||||
}
|
||||
|
||||
setColor(color) {
|
||||
@ -86,7 +88,7 @@ class ESigLamp extends Group {
|
||||
}
|
||||
|
||||
setBorderColor(color) {
|
||||
this.lamp.setStyle({stroke: color});
|
||||
this.lamp.setStyle({ stroke: color });
|
||||
}
|
||||
|
||||
setStyle(data) {
|
||||
|
@ -19,8 +19,8 @@ class ESigPost extends Group {
|
||||
z: model.z,
|
||||
shape: {
|
||||
points: [
|
||||
[model.x, model.y + style.Signal.lamp.radiusR * 1.2],
|
||||
[model.x, model.y - style.Signal.lamp.radiusR * 1.2]
|
||||
[model.x, model.y + style.Signal.post.standardHeight * 1.2],
|
||||
[model.x, model.y - style.Signal.post.standardHeight * 1.2]
|
||||
]
|
||||
},
|
||||
style: {
|
||||
@ -35,7 +35,7 @@ class ESigPost extends Group {
|
||||
shape: {
|
||||
points: [
|
||||
[model.x, model.y],
|
||||
[model.x + model.drict * style.Signal.lamp.radiusR * 1.2, model.y]
|
||||
[model.x + model.drict * style.Signal.post.standardLength * 1.2, model.y]
|
||||
]
|
||||
},
|
||||
style: {
|
||||
@ -48,19 +48,26 @@ class ESigPost extends Group {
|
||||
this.add(this.hor);
|
||||
|
||||
model.type === '01' ? this.hor.hide() : this.hor.show();
|
||||
if (style.Signal.post.standardShow) {
|
||||
this.hor.show();
|
||||
}
|
||||
}
|
||||
|
||||
getLampPosition(type) {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
if (style.Signal.post.standardShow) {
|
||||
type = '01'
|
||||
}
|
||||
const length = style.Signal.post.standardShow ? 4 : 0;
|
||||
if (type === '01') {
|
||||
return {
|
||||
x: model.x + model.drict * style.Signal.lamp.radiusR * 3 / 2,
|
||||
x: model.x + model.drict * style.Signal.lamp.radiusR * 3 / 2 + model.drict * length,
|
||||
y: model.y
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
x: this.hor.shape.points[1][0] + model.drict * style.Signal.lamp.radiusR,
|
||||
x: this.hor.shape.points[1][0] + model.drict * style.Signal.lamp.radiusR + model.drict * length,
|
||||
y: this.hor.shape.points[1][1]
|
||||
};
|
||||
}
|
||||
|
60
src/jmapNew/shape/Signal/EVirtualSignal.js
Normal file
60
src/jmapNew/shape/Signal/EVirtualSignal.js
Normal file
@ -0,0 +1,60 @@
|
||||
import Line from 'zrender/src/graphic/shape/Line';
|
||||
import Isogon from 'zrender/src/graphic/shape/Isogon';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
|
||||
class EVirtualSignal extends Group {
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
const rotation = model.drict != 1? -Math.PI / 180 * Number(30) : Math.PI / 180 * Number(30);;
|
||||
|
||||
this.lamp = new Isogon({
|
||||
name: model.index,
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
origin: [model.x, model.y],
|
||||
rotation: rotation,
|
||||
shape: {
|
||||
x: model.x,
|
||||
y: model.y,
|
||||
r: 6,
|
||||
n: 3
|
||||
},
|
||||
style: {
|
||||
lineWidth: style.Signal.lamp.borderWidth,
|
||||
fill: style.backgroundColor,
|
||||
stroke: style.Signal.lamp.borderColor
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.lamp);
|
||||
}
|
||||
|
||||
setColor(color) {
|
||||
if (this.model.style.Signal.lamp.borderVariable) {
|
||||
this.lamp.setStyle({ fill: color, stroke: color });
|
||||
} else {
|
||||
this.lamp.setStyle({ fill: color });
|
||||
}
|
||||
}
|
||||
|
||||
setBorderColor(color) {
|
||||
this.lamp.setStyle({ stroke: color });
|
||||
}
|
||||
|
||||
setStyle(data) {
|
||||
this.lamp.setStyle(data);
|
||||
}
|
||||
|
||||
getBoundingRect() {
|
||||
return this.lamp.getBoundingRect();
|
||||
}
|
||||
}
|
||||
|
||||
export default EVirtualSignal;
|
@ -13,6 +13,7 @@ import EMouse from './EMouse';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import BoundingRect from 'zrender/src/core/BoundingRect';
|
||||
import EHighlight from '../element/EHighlight';
|
||||
import EVirtualSignal from './EVirtualSignal';
|
||||
|
||||
class Signal extends Group {
|
||||
constructor(model, style) {
|
||||
@ -67,6 +68,18 @@ class Signal extends Group {
|
||||
this.lamps.push(lamp);
|
||||
}
|
||||
|
||||
// 虚拟信号机显示
|
||||
this.virtualSignal = new EVirtualSignal({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: style,
|
||||
drict: drict,
|
||||
x: endPoint.x,
|
||||
y: endPoint.y,
|
||||
originX: model.position.x,
|
||||
originY: model.position.y
|
||||
});
|
||||
|
||||
// 信号机名称
|
||||
const sigNameX = model.position.x - drict * (style.Signal.post.standardWidth) + model.namePosition.x;
|
||||
const sigNameY = model.position.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance);
|
||||
@ -155,6 +168,7 @@ class Signal extends Group {
|
||||
this.add(this.sigAuto);
|
||||
this.add(this.sigRoute);
|
||||
this.add(this.sigDelay);
|
||||
// this.add(this.virtualSignal); // 虚拟信号机 (哈尔滨线路)
|
||||
// this.add(this.sigButton);
|
||||
}
|
||||
|
||||
@ -344,7 +358,7 @@ class Signal extends Group {
|
||||
}
|
||||
this.sigName.setColor(this.style.Signal.text.blockColor);
|
||||
if (this.style.Signal.text.nameBorderShow) {
|
||||
this.sigName.setStyle({textBorderWidth: 1});
|
||||
this.sigName.setStyle({ textBorderWidth: 1 });
|
||||
this.sigName.setColor('#fff');
|
||||
}
|
||||
}
|
||||
@ -433,7 +447,7 @@ class Signal extends Group {
|
||||
|
||||
// 恢复状态
|
||||
recover() {
|
||||
this.sigName.setStyle({textBorderWidth: 0});
|
||||
this.sigName.setStyle({ textBorderWidth: 0 });
|
||||
this.sigAuto.hide();
|
||||
this.sigRoute.hide();
|
||||
this.sigDelay.hide();
|
||||
|
@ -46,6 +46,12 @@ export default class Station extends Group {
|
||||
textFill: model.nameFontColor
|
||||
});
|
||||
this.add(this.stationText);
|
||||
if (style.Station.text.borderShow) {
|
||||
this.stationText.setStyle('textPadding', [2, 6]);
|
||||
this.stationText.setStyle('textBorderColor', model.nameFontColor);
|
||||
this.stationText.setStyle('textBorderWidth', 1);
|
||||
}
|
||||
|
||||
const path = window.location.href;
|
||||
if (style.Station.kmPostShow || path.includes('/map/draw')) {
|
||||
// 公里标是否显示
|
||||
@ -74,7 +80,7 @@ export default class Station extends Group {
|
||||
});
|
||||
this.add(this.mileageText);
|
||||
}
|
||||
if (model.subheadDisplay) {
|
||||
if (model.subheadDisplay) { // 副标题
|
||||
this.subheadText = new ETextName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
@ -89,6 +95,11 @@ export default class Station extends Group {
|
||||
textFill: model.subheadFontColor
|
||||
});
|
||||
this.add(this.subheadText);
|
||||
if (style.Station.text.borderShow) {
|
||||
this.subheadText.setStyle('textPadding', [2, 6]);
|
||||
this.subheadText.setStyle('textBorderColor', model.nameFontColor);
|
||||
this.subheadText.setStyle('textBorderWidth', 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -198,7 +209,7 @@ export default class Station extends Group {
|
||||
y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y
|
||||
},
|
||||
// context: model.lskContent || '联锁控',
|
||||
context:this.style.Station.StationControl.text.interconnectedControlText || '联锁控',
|
||||
context: this.style.Station.StationControl.text.interconnectedControlText || '联锁控',
|
||||
pop: false
|
||||
});
|
||||
this.add(this.interconnectedControl);
|
||||
@ -245,26 +256,26 @@ export default class Station extends Group {
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
switch (model.controlMode) {
|
||||
case '': // 无状态
|
||||
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.grayColor);
|
||||
break;
|
||||
case 'Center': // 中控
|
||||
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);
|
||||
break;
|
||||
case 'Local': // 站控
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
break;
|
||||
case 'Emergency': // 紧急站控
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.redColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
break;
|
||||
case '': // 无状态
|
||||
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.grayColor);
|
||||
break;
|
||||
case 'Center': // 中控
|
||||
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);
|
||||
break;
|
||||
case 'Local': // 站控
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
break;
|
||||
case 'Emergency': // 紧急站控
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.redColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,31 +6,74 @@ class EDetain extends Group {
|
||||
super();
|
||||
this.model = model;
|
||||
this.isNew = false;
|
||||
this.detain = null;
|
||||
if (this.model.style.StationStand.common.special) {
|
||||
this.create('E');
|
||||
}
|
||||
}
|
||||
|
||||
create() {
|
||||
create(textName) {
|
||||
if (!this.isNew) {
|
||||
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
|
||||
this.isNew = true;
|
||||
this.detain = new Text({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
position: [0, 0],
|
||||
style: {
|
||||
x: model.x,
|
||||
y: model.y,
|
||||
text: style.StationStand.detainCar.text,
|
||||
textAlign: model.textAlign,
|
||||
textVerticalAlign: model.textVerticalAlign,
|
||||
fontSize: `${style.StationStand.stand.headFontSize} px ${style.fontFamily}`,
|
||||
textFill: style.StationStand.detainCar.centerTrainColor,
|
||||
textStroke: style.backgroundColor
|
||||
if (style.StationStand.common.special) {
|
||||
// inside true 内侧
|
||||
let height = '';
|
||||
let position = '';
|
||||
if (model.right) {
|
||||
if (model.inside) {
|
||||
height = -30;
|
||||
position = -model.width / 4;
|
||||
} else {
|
||||
height = 30;
|
||||
position = model.width / 4;
|
||||
}
|
||||
} else {
|
||||
if (model.inside) {
|
||||
height = 30;
|
||||
position = model.width / 4;
|
||||
} else {
|
||||
height = -30;
|
||||
position = -model.width / 4;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.detain);
|
||||
this.detain = new Text({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
position: [0, 0],
|
||||
style: {
|
||||
x: model.x + position,
|
||||
y: model.y + height,
|
||||
text: textName,
|
||||
textAlign: model.inside ? 'left' : 'right',
|
||||
fontWeight: 'blod',
|
||||
fontSize: `${style.StationStand.detainCar.fontSize} px ${style.fontFamily}`,
|
||||
textFill: textName == 'E' ? '#fff' : 'red',
|
||||
textVerticalAlign: 'middle'
|
||||
}
|
||||
});
|
||||
this.add(this.detain);
|
||||
} else {
|
||||
this.detain = new Text({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
position: [0, 0],
|
||||
style: {
|
||||
x: model.x,
|
||||
y: model.y,
|
||||
text: style.StationStand.detainCar.text,
|
||||
textAlign: model.textAlign,
|
||||
textVerticalAlign: model.textVerticalAlign,
|
||||
fontSize: `${style.StationStand.stand.headFontSize} px ${style.fontFamily}`,
|
||||
textFill: style.StationStand.detainCar.centerTrainColor,
|
||||
textStroke: style.backgroundColor
|
||||
}
|
||||
});
|
||||
this.add(this.detain);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,7 +88,7 @@ class EDetain extends Group {
|
||||
}
|
||||
|
||||
show() {
|
||||
this.create();
|
||||
this.create('H');
|
||||
this.detain.show();
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,15 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Isogon from 'zrender/src/graphic/shape/Isogon';
|
||||
import Polyline from 'zrender/src/graphic/shape/Polyline';
|
||||
|
||||
class ESafeEmergent extends Group {
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.isNew = false;
|
||||
if (this.model.style.StationStand.common.special) {
|
||||
this.create();
|
||||
}
|
||||
}
|
||||
|
||||
create() {
|
||||
@ -14,23 +18,50 @@ class ESafeEmergent extends Group {
|
||||
const style = this.model.style;
|
||||
|
||||
this.isNew = true;
|
||||
this.emergent = new Isogon({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: model.x,
|
||||
y: model.y,
|
||||
r: model.r,
|
||||
n: model.n
|
||||
},
|
||||
style: {
|
||||
lineWidth: 0,
|
||||
stroke: style.StationStand.standEmergent.closeColor,
|
||||
fill: style.StationStand.standEmergent.closeColor
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.emergent);
|
||||
if (style.StationStand.common.special) {
|
||||
const height = model.inside ? model.y + 26 : model.y - 33;
|
||||
const width = model.inside ? model.x + model.width / 8 : model.x - model.width / 8;
|
||||
this.emergent = new Polyline({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
points: [
|
||||
[width, height - 3],
|
||||
[width + 7, height],
|
||||
[width + 7, height + 3],
|
||||
[width + 3, height + 3],
|
||||
[width + 3, height + 10],
|
||||
[width - 3, height + 10],
|
||||
[width - 3, height + 3],
|
||||
[width - 7, height + 3],
|
||||
[width - 7, height],
|
||||
[width, height - 3],
|
||||
]
|
||||
},
|
||||
style: {
|
||||
stroke: 'red',
|
||||
fill: 'red'
|
||||
}
|
||||
});
|
||||
this.add(this.emergent);
|
||||
} else {
|
||||
this.emergent = new Isogon({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: model.x,
|
||||
y: model.y,
|
||||
r: model.r,
|
||||
n: model.n
|
||||
},
|
||||
style: {
|
||||
lineWidth: 0,
|
||||
stroke: style.StationStand.standEmergent.closeColor,
|
||||
fill: style.StationStand.standEmergent.closeColor
|
||||
}
|
||||
});
|
||||
this.add(this.emergent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
import Text from 'zrender/src/graphic/Text';
|
||||
|
||||
class ESafeStand extends Group {
|
||||
constructor(model) {
|
||||
@ -11,28 +12,90 @@ class ESafeStand extends Group {
|
||||
create() {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
|
||||
this.stand = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: model.x,
|
||||
y: model.y,
|
||||
width: model.width,
|
||||
height: model.height
|
||||
},
|
||||
style: {
|
||||
lineWidth: 0,
|
||||
stroke: style.sidelineColor,
|
||||
fill: style.StationStand.stand.spareColor
|
||||
// model.x /y 是整个坐标左上角起点
|
||||
if (style.StationStand.common.special) {
|
||||
this.stand1 = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: model.x,
|
||||
y: model.y,
|
||||
width: model.width / 4 - 2,
|
||||
height: model.height
|
||||
},
|
||||
style: {
|
||||
lineWidth: 0,
|
||||
stroke: style.sidelineColor,
|
||||
fill: style.StationStand.stand.spareColor
|
||||
}
|
||||
});
|
||||
this.stand2 = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: model.x + model.width * 3 / 4,
|
||||
y: model.y,
|
||||
width: model.width / 4 - 2,
|
||||
height: model.height
|
||||
},
|
||||
style: {
|
||||
lineWidth: 0,
|
||||
stroke: style.sidelineColor,
|
||||
fill: style.StationStand.stand.spareColor
|
||||
}
|
||||
});
|
||||
let height = model.inside ? 7 : -12;
|
||||
if (model.right) {
|
||||
if (model.inside) {
|
||||
height = -12;
|
||||
} else {
|
||||
height = 7;
|
||||
}
|
||||
} else {
|
||||
if (model.inside) {
|
||||
height = 7;
|
||||
} else {
|
||||
height = -12;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.stand);
|
||||
this.standText = new Text({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
style: {
|
||||
x: model.x + model.width / 2,
|
||||
y: model.y + height,
|
||||
fontSize: style.StationStand.stand.headFontSize,
|
||||
text: model.name,
|
||||
textFill: style.StationStand.stand.textFill,
|
||||
textPosition: 'inside',
|
||||
textAlign: 'center'
|
||||
}
|
||||
});
|
||||
this.add(this.stand1);
|
||||
this.add(this.stand2);
|
||||
this.add(this.standText);
|
||||
} else {
|
||||
this.stand = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: model.x,
|
||||
y: model.y,
|
||||
width: model.width,
|
||||
height: model.height
|
||||
},
|
||||
style: {
|
||||
lineWidth: 0,
|
||||
stroke: style.sidelineColor,
|
||||
fill: style.StationStand.stand.spareColor
|
||||
}
|
||||
});
|
||||
this.add(this.stand);
|
||||
}
|
||||
}
|
||||
|
||||
setColor(color) {
|
||||
this.stand.setStyle('fill', color);
|
||||
this.stand && this.stand.setStyle('fill', color);
|
||||
}
|
||||
}
|
||||
|
||||
|
95
src/jmapNew/shape/StationStand/ETrainDepart.js
Normal file
95
src/jmapNew/shape/StationStand/ETrainDepart.js
Normal file
@ -0,0 +1,95 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Text from 'zrender/src/graphic/Text';
|
||||
|
||||
class ETrainDepart extends Group {
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.isNew = false;
|
||||
this.timeStart = 30;
|
||||
this.time = null;
|
||||
}
|
||||
|
||||
create(text) {
|
||||
if (!this.isNew) {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
|
||||
this.isNew = true;
|
||||
let cy = model.inside ? model.y + 30 : model.y - 30;
|
||||
let cx = model.inside ? model.x - model.width / 4 - model.width / 8 : model.x + model.width / 4 + model.width / 8;
|
||||
if (model.right) {
|
||||
if (model.inside) {
|
||||
cy = model.y - 30;
|
||||
cx = model.x + model.width / 4 + model.width / 8;
|
||||
} else {
|
||||
cy = model.y + 30;
|
||||
cx = model.x - model.width / 4 - model.width / 8;
|
||||
}
|
||||
} else {
|
||||
if (model.inside) {
|
||||
cy = model.y + 30;
|
||||
cx = model.x - model.width / 4 - model.width / 8;
|
||||
} else {
|
||||
cy = model.y - 30;
|
||||
cx = model.x + model.width / 4 + model.width / 8;
|
||||
}
|
||||
}
|
||||
this.trainDepart = new Text({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
position: [0, 0],
|
||||
style: {
|
||||
x: cx,
|
||||
y: cy,
|
||||
text: text,
|
||||
textAlign: 'middle',
|
||||
fontSize: `${style.StationStand.detainCar.fontSize} px ${style.fontFamily}`,
|
||||
textFill: 'green',
|
||||
textVerticalAlign: 'middle',
|
||||
textBorderColor: 'green',
|
||||
textPadding: 2,
|
||||
textBorderWidth: 1
|
||||
}
|
||||
});
|
||||
this.add(this.trainDepart);
|
||||
}
|
||||
}
|
||||
|
||||
setColor(color) {
|
||||
this.create();
|
||||
this.trainDepart.setStyle('textFill', color);
|
||||
}
|
||||
|
||||
hide() {
|
||||
this.create();
|
||||
this.trainDepart.hide();
|
||||
this.time && clearInterval(this.time);
|
||||
}
|
||||
|
||||
show() {
|
||||
this.timeStart = 30;
|
||||
this.create(`0${this.timeStart}`);
|
||||
this.trainDepart.show();
|
||||
setTimeout(() => {
|
||||
this.animition();
|
||||
}, 1000);
|
||||
}
|
||||
animition() {
|
||||
this.time && clearInterval(this.time);
|
||||
this.time = setInterval(() => {
|
||||
this.timeStart--;
|
||||
if (this.timeStart >= 0) {
|
||||
if (this.timeStart < 10) {
|
||||
this.trainDepart.setStyle('text', `00${this.timeStart}`);
|
||||
} else {
|
||||
this.trainDepart.setStyle('text', `0${this.timeStart}`);
|
||||
}
|
||||
} else {
|
||||
clearInterval(this.time);
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
export default ETrainDepart;
|
68
src/jmapNew/shape/StationStand/ETrainStop.js
Normal file
68
src/jmapNew/shape/StationStand/ETrainStop.js
Normal file
@ -0,0 +1,68 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Arc from 'zrender/src/graphic/shape/Arc';
|
||||
|
||||
class ETrainStop extends Group {
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.isNew = false;
|
||||
}
|
||||
|
||||
create() {
|
||||
if (!this.isNew) {
|
||||
const model = this.model;
|
||||
|
||||
this.isNew = true;
|
||||
let cy = model.inside ? model.y + 30 : model.y - 30;
|
||||
let cx = model.inside ? model.x - model.width / 8 : model.x + model.width / 8;
|
||||
if (model.right) {
|
||||
if (model.inside) {
|
||||
cy = model.y - 30;
|
||||
cx = model.x + model.width / 8;
|
||||
} else {
|
||||
cy = model.y + 30;
|
||||
cx = model.x - model.width / 8;
|
||||
}
|
||||
} else {
|
||||
if (model.inside) {
|
||||
cy = model.y + 30;
|
||||
cx = model.x - model.width / 8;
|
||||
} else {
|
||||
cy = model.y - 30;
|
||||
cx = model.x + model.width / 8;
|
||||
}
|
||||
}
|
||||
this.trainStop = new Arc({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
cx: cx,
|
||||
cy: cy,
|
||||
r: model.r
|
||||
},
|
||||
style: {
|
||||
fill: 'red',
|
||||
stroke: 'red'
|
||||
}
|
||||
});
|
||||
this.add(this.trainStop);
|
||||
}
|
||||
}
|
||||
|
||||
setColor(color) {
|
||||
this.create();
|
||||
this.trainStop.setStyle('textFill', color);
|
||||
}
|
||||
|
||||
hide() {
|
||||
this.create();
|
||||
this.trainStop.hide();
|
||||
}
|
||||
|
||||
show() {
|
||||
this.create();
|
||||
this.trainStop.show();
|
||||
}
|
||||
}
|
||||
|
||||
export default ETrainStop;
|
@ -9,6 +9,8 @@ import ESafeEmergent from './ESafeEmergent';
|
||||
import EMouse from './EMouse';
|
||||
import EJump from './EJump';
|
||||
import EHighlight from '../element/EHighlight';
|
||||
import ETrainStop from './ETrainStop';
|
||||
import ETrainDepart from './ETrainDepart';
|
||||
|
||||
class StationStand extends Group {
|
||||
constructor(model, style) {
|
||||
@ -40,6 +42,9 @@ class StationStand extends Group {
|
||||
style: style,
|
||||
x: standX,
|
||||
y: standY,
|
||||
name: model.name,
|
||||
inside: model.inside,
|
||||
right: model.right,
|
||||
width: model.width,
|
||||
height: model.height
|
||||
});
|
||||
@ -47,18 +52,55 @@ class StationStand extends Group {
|
||||
|
||||
/** 站台紧急关闭*/
|
||||
const emergentH = model.right ? 1 : -1;
|
||||
const emergentX = model.position.x + drict * (style.StationStand.standEmergent.offset.x);
|
||||
const emergentY = model.position.y + emergentH * (model.height / 2 + style.StationStand.standEmergent.mergentR);
|
||||
let emergentX = model.position.x + drict * (style.StationStand.standEmergent.offset.x);
|
||||
let emergentY = model.position.y + emergentH * (model.height / 2 + style.StationStand.standEmergent.mergentR);
|
||||
if (style.StationStand.common.special) {
|
||||
emergentX = model.position.x;
|
||||
emergentY = model.position.y;
|
||||
}
|
||||
this.emergent = new ESafeEmergent({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 1,
|
||||
style: style,
|
||||
inside: model.inside,
|
||||
right: model.right,
|
||||
width: model.width,
|
||||
x: emergentX,
|
||||
y: emergentY,
|
||||
r: style.StationStand.standEmergent.mergentR,
|
||||
n: 4
|
||||
});
|
||||
|
||||
// 列车停站
|
||||
const stopX = model.position.x;
|
||||
const stopY = model.position.y;
|
||||
this.trainStop = new ETrainStop({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 1,
|
||||
style: style,
|
||||
inside: model.inside,
|
||||
right: model.right,
|
||||
width: model.width,
|
||||
x: stopX,
|
||||
y: stopY,
|
||||
r: style.StationStand.standEmergent.mergentR,
|
||||
n: 4
|
||||
});
|
||||
|
||||
// 列车出发
|
||||
const departX = model.position.x;
|
||||
const departY = model.position.y;
|
||||
this.trainDepart = new ETrainDepart({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 1,
|
||||
style: style,
|
||||
inside: model.inside,
|
||||
right: model.right,
|
||||
width: model.width,
|
||||
x: departX,
|
||||
y: departY
|
||||
});
|
||||
|
||||
/** 站台折返策略*/
|
||||
const reentryH = style.StationStand.standEmergent.mergentR;
|
||||
const reentryX = model.position.x - (style.StationStand.reentry.position || drict) * (style.StationStand.reentry.offset.x - model.width / 2);
|
||||
@ -78,14 +120,21 @@ class StationStand extends Group {
|
||||
|
||||
/** 站台扣车*/
|
||||
const detainD = model.right ? 1 : -1;
|
||||
const detainX = model.position.x - (style.StationStand.stopTime.position || detainD) * (style.StationStand.detainCar.offset.x - model.width / 2);
|
||||
const detainY = model.position.y + (style.StationStand.stopTime.position || detainD) * (style.StationStand.detainCar.offset.y - model.height / 2);
|
||||
let detainX = model.position.x - (style.StationStand.stopTime.position || detainD) * (style.StationStand.detainCar.offset.x - model.width / 2);
|
||||
let detainY = model.position.y + (style.StationStand.stopTime.position || detainD) * (style.StationStand.detainCar.offset.y - model.height / 2);
|
||||
if (style.StationStand.common.special) {
|
||||
detainX = model.position.x;
|
||||
detainY = model.position.y;
|
||||
}
|
||||
this.detain = new EDetain({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: style,
|
||||
x: detainX,
|
||||
y: detainY,
|
||||
width: model.width,
|
||||
inside: model.inside,
|
||||
right: model.right,
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top'
|
||||
});
|
||||
@ -144,6 +193,8 @@ class StationStand extends Group {
|
||||
this.add(this.reentry);
|
||||
this.add(this.time);
|
||||
this.add(this.level);
|
||||
this.add(this.trainStop);
|
||||
this.add(this.trainDepart);
|
||||
}
|
||||
|
||||
createMouseEvent() {
|
||||
@ -167,25 +218,38 @@ class StationStand extends Group {
|
||||
recover() {
|
||||
this.time && this.time.hide();
|
||||
this.level && this.level.hide();
|
||||
this.detain && this.detain.hide();
|
||||
this.reentry && this.reentry.hide();
|
||||
if (!this.style.StationStand.common.special) {
|
||||
this.detain && this.detain.hide();
|
||||
}
|
||||
this.emergent && this.emergent.hide();
|
||||
this.trainStop && this.trainStop.hide(); // 列车停站
|
||||
this.trainDepart && this.trainDepart.hide();
|
||||
this.reentry && this.reentry.hide();
|
||||
this.jump && this.jump.hide();
|
||||
this.jump && this.jump.setStatus(0, 0);
|
||||
}
|
||||
|
||||
/** 空闲*/
|
||||
spare() {
|
||||
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.spareColor);
|
||||
if (!this.style.StationStand.common.special) {
|
||||
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.spareColor);
|
||||
}
|
||||
}
|
||||
|
||||
/** 列车停站*/
|
||||
stop() {
|
||||
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.stopColor);
|
||||
if (!this.style.StationStand.common.special) {
|
||||
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.stopColor);
|
||||
}
|
||||
this.trainStop && this.trainStop.show();
|
||||
this.trainDepart && this.trainDepart.show();
|
||||
}
|
||||
|
||||
/** 站台紧急关闭*/
|
||||
emergentClose() {
|
||||
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.spareColor);
|
||||
if (!this.style.StationStand.common.special) {
|
||||
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.spareColor);
|
||||
}
|
||||
this.emergent && this.emergent.show();
|
||||
}
|
||||
|
||||
@ -209,11 +273,6 @@ class StationStand extends Group {
|
||||
this.jump && this.jump.setStatus(1, 0);
|
||||
}
|
||||
|
||||
/** 未设置扣车*/
|
||||
unDetainTrain() {
|
||||
this.detain && this.detain.hide();
|
||||
}
|
||||
|
||||
/** 车站扣车*/
|
||||
standDetainTrain() {
|
||||
this.detain && this.detain.show();
|
||||
@ -276,12 +335,11 @@ class StationStand extends Group {
|
||||
}
|
||||
|
||||
/** 设置跳停*/
|
||||
this.unJumpStop(); // 未设置跳停
|
||||
// this.unJumpStop(); // 未设置跳停
|
||||
model.assignSkip && this.designatedJumpStop(); // 指定站台跳停
|
||||
model.allSkip && this.jumpStop(); // 站台全部跳停
|
||||
|
||||
/** 设置扣车*/
|
||||
this.unDetainTrain(); // 默认状态
|
||||
if (model.stationHoldTrain && model.centerHoldTrain) {
|
||||
this.standAndCenterDetainTrain(); // 中心+车站扣车
|
||||
} else if (model.stationHoldTrain) {
|
||||
|
50
src/jmapNew/shape/Switch/ERhomboid.js
Normal file
50
src/jmapNew/shape/Switch/ERhomboid.js
Normal file
@ -0,0 +1,50 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Polygon from 'zrender/src/graphic/shape/Polygon';
|
||||
|
||||
class ERhomboid extends Group {
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
this.section = new Polygon({ // 平行四边形
|
||||
zlevel: model.zlevel,
|
||||
z: model.z + 1,
|
||||
shape: {
|
||||
points: model.sectionPoints
|
||||
},
|
||||
style: {
|
||||
fill: style.Section.line.spareColor
|
||||
},
|
||||
cursor: model.cursor,
|
||||
onmouseover: model.onmouseover,
|
||||
onmouseout: model.onmouseout
|
||||
});
|
||||
|
||||
this.hide();
|
||||
this.add(this.section);
|
||||
}
|
||||
|
||||
hide() {
|
||||
this.section.hide();
|
||||
}
|
||||
|
||||
show() {
|
||||
this.section.show();
|
||||
}
|
||||
|
||||
stopAnimation(flag) {
|
||||
this.section.stopAnimation(flag);
|
||||
}
|
||||
|
||||
getSection() {
|
||||
return this.section;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ERhomboid;
|
@ -11,7 +11,7 @@ class ESwLnversion extends Group {
|
||||
create() {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
this.relocShelter = new Polygon({
|
||||
this.relocShelter = new Polygon({ // 遮盖B区段范围
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
@ -27,37 +27,38 @@ class ESwLnversion extends Group {
|
||||
const rpx = Math.abs(model.triangle.getCos(model.halfWidth)) + 0.2;
|
||||
this.relocShelter.position = [-model.triangle.drictx * rpx, -model.triangle.dricty * 0.2];
|
||||
|
||||
this.section = new Polygon({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z + 1,
|
||||
shape: {
|
||||
points: model.sectionPoints
|
||||
},
|
||||
style: {
|
||||
fill: style.Section.line.spareColor
|
||||
},
|
||||
cursor: model.cursor,
|
||||
onmouseover: model.onmouseover,
|
||||
onmouseout: model.onmouseout
|
||||
});
|
||||
// this.section = new Polygon({ // 平行四边形
|
||||
// zlevel: model.zlevel,
|
||||
// z: model.z + 1,
|
||||
// shape: {
|
||||
// points: model.sectionPoints
|
||||
// },
|
||||
// style: {
|
||||
// // fill: style.Section.line.spareColor
|
||||
// fill: 'blue'
|
||||
// },
|
||||
// cursor: model.cursor,
|
||||
// onmouseover: model.onmouseover,
|
||||
// onmouseout: model.onmouseout
|
||||
// });
|
||||
|
||||
this.hide();
|
||||
this.add(this.relocShelter);
|
||||
this.add(this.section);
|
||||
// this.add(this.section);
|
||||
}
|
||||
|
||||
hide() {
|
||||
this.relocShelter.hide();
|
||||
this.section.hide();
|
||||
// this.section.hide();
|
||||
}
|
||||
|
||||
show() {
|
||||
this.relocShelter.show();
|
||||
this.section.show();
|
||||
// this.section.show();
|
||||
}
|
||||
|
||||
stopAnimation(flag) {
|
||||
this.section.stopAnimation(flag);
|
||||
// this.section.stopAnimation(flag);
|
||||
}
|
||||
|
||||
getSection() {
|
||||
|
@ -11,6 +11,7 @@ import ESwLnversion from './ESwLnversion';
|
||||
import ELockRect from './ELockRect';
|
||||
import EMouse from './EMouse';
|
||||
import EHighlight from '../element/EHighlight';
|
||||
import ERhomboid from './ERhomboid';
|
||||
|
||||
export default class Switch extends Group {
|
||||
constructor(model, style) {
|
||||
@ -51,7 +52,7 @@ export default class Switch extends Group {
|
||||
const direct = -this.triangle.drictx * this.triangle.dricty;
|
||||
const coverLength = switchWidth * 1.5;
|
||||
|
||||
this.swCore = new ESwCore({
|
||||
this.swCore = new ESwCore({ // 道岔两个斜线 盖住所有
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: style,
|
||||
@ -90,11 +91,13 @@ export default class Switch extends Group {
|
||||
const width2 = (height1 + switchWidth1) / this.triangle.getTanRate();
|
||||
const width3 = (style.Section.line.width / this.triangle.getSinRate()) - width2 - width1;
|
||||
const spoint1 = [model.intersection.x + directx * width3, model.intersection.y - directy * switchWidth1];
|
||||
const spoint2 = [spoint1[0] - directx * (width2 + width1) - directx * width3, spoint1[1]];
|
||||
const spoint3 = [model.intersection.x - directx * width3, model.intersection.y + directy * switchWidth1];
|
||||
// const spoint2 = [spoint1[0] - directx * (width2 + width1) - directx * width3, spoint1[1]];
|
||||
// const spoint3 = [model.intersection.x - directx * width3, model.intersection.y + directy * switchWidth1];
|
||||
const spoint2 = [model.intersection.x - directx * 13, spoint1[1]];
|
||||
const spoint3 = [model.intersection.x - directx * 13, model.intersection.y + directy * switchWidth1];
|
||||
const spoint4 = [spoint1[0] + directx * (width2 + width1) - directx * width3, spoint3[1]];
|
||||
|
||||
this.relocShelter = new ESwLnversion({ // 反位
|
||||
this.relocShelter = new ESwLnversion({ // 反位覆盖形状
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: style,
|
||||
@ -107,6 +110,19 @@ export default class Switch extends Group {
|
||||
onmouseout: () => { this.name.getArrowText().hide(); }
|
||||
});
|
||||
|
||||
this.rhomboid = new ERhomboid({ // 平行四边形覆盖范围
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: style,
|
||||
sectionPoints: [spoint1, spoint2, spoint3, spoint4],
|
||||
cursor: 'pointer',
|
||||
halfWidth: halfWidth,
|
||||
triangle: this.triangle,
|
||||
onmouseover: () => { this.name.getArrowText().show(); },
|
||||
onmouseout: () => { this.name.getArrowText().hide(); }
|
||||
});
|
||||
|
||||
|
||||
this.releaseBackground = new Line({ // 区段上遮盖段
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
@ -127,7 +143,7 @@ export default class Switch extends Group {
|
||||
const nameTextX = model.namePosition.x + model.intersection.x + directx * (style.Section.line.width * 3 + style.Switch.text.offset.x) * this.triangle.getCotRate();
|
||||
const nameTextY = model.namePosition.y + model.intersection.y + style.Switch.text.offset.y * (style.Switch.text.position || directy);
|
||||
|
||||
this.name = new ESwName({
|
||||
this.name = new ESwName({ // 道岔名称
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: style,
|
||||
@ -144,6 +160,7 @@ export default class Switch extends Group {
|
||||
this.add(this.swCore); // 岔芯link
|
||||
this.add(this.locShelter);
|
||||
this.add(this.relocShelter);
|
||||
this.add(this.rhomboid);
|
||||
this.add(this.releaseBackground);
|
||||
this.add(this.name);
|
||||
}
|
||||
@ -195,7 +212,7 @@ export default class Switch extends Group {
|
||||
|
||||
/** 设置道岔文字颜色*/
|
||||
setTextColor(color) {
|
||||
this.name.getNameText().setStyle({textFill: color});
|
||||
this.name.getNameText().setStyle({ textFill: color });
|
||||
}
|
||||
|
||||
/** 设置道岔背景颜色*/
|
||||
@ -205,17 +222,18 @@ export default class Switch extends Group {
|
||||
|
||||
/** 设置道岔文字边框颜色 (道岔封锁) */
|
||||
setHasTextBorder(width) {
|
||||
this.name.getTextRect().setStyle({lineWidth: width});
|
||||
this.name.getTextRect().setStyle({ lineWidth: width });
|
||||
}
|
||||
|
||||
/** 恢复状态*/
|
||||
recover() {
|
||||
this.lockRect.hide();
|
||||
this.lockRect.hide(); // 矩形包围框
|
||||
this.setSwitchCoreColor(this.style.backgroundColor);
|
||||
this.name.getNameText().stopAnimation(false);
|
||||
this.swCore.stopAnimation(false);
|
||||
this.relocShelter.stopAnimation(false);
|
||||
this.relocShelter.hide();
|
||||
// this.relocShelter.hide();
|
||||
// this.rhomboid.hide();
|
||||
this.rhomboid.stopAnimation(false);
|
||||
this.releaseBackground.hide();
|
||||
this.setHasTextBorder(0);
|
||||
}
|
||||
@ -224,8 +242,13 @@ export default class Switch extends Group {
|
||||
setLocationAction() {
|
||||
this.recover();
|
||||
this.setSwitchCoreInvisible(true);
|
||||
this.locShelter.show();
|
||||
if (this.style.Switch.core.splice) {
|
||||
this.locShelter.hide();
|
||||
} else {
|
||||
this.locShelter.show();
|
||||
}
|
||||
this.relocShelter.hide();
|
||||
this.rhomboid.hide();
|
||||
this.setTextColor(this.style.Switch.text.locateColor);
|
||||
}
|
||||
|
||||
@ -234,9 +257,15 @@ export default class Switch extends Group {
|
||||
this.recover();
|
||||
this.setSwitchCoreInvisible(true);
|
||||
this.setTextColor(this.style.Switch.text.inversionColor);
|
||||
this.locShelter.hide();
|
||||
this.relocShelter.show();
|
||||
if (this.style.Switch.core.splice) {
|
||||
this.relocShelter.hide();
|
||||
} else {
|
||||
this.relocShelter.show(); // 反位
|
||||
}
|
||||
this.locShelter.hide(); // 定位
|
||||
this.rhomboid.show();
|
||||
this.setSectionState(this.relocShelter.getSection(), 'fill', this.model);
|
||||
this.setSectionState(this.rhomboid.getSection(), 'fill', this.model);
|
||||
}
|
||||
|
||||
/** 失去*/
|
||||
@ -244,6 +273,7 @@ export default class Switch extends Group {
|
||||
this.recover();
|
||||
this.locShelter.hide();
|
||||
this.relocShelter.hide();
|
||||
this.rhomboid.hide();
|
||||
this.setSwitchCoreInvisible(false);
|
||||
this.setTextColor(this.style.Switch.text.lossColor);
|
||||
nameFlicker && this.nameTextAnimation();
|
||||
@ -271,12 +301,12 @@ export default class Switch extends Group {
|
||||
this.lockRect.show();
|
||||
}
|
||||
switch (this.model.locateType) {
|
||||
case '01': // 定位
|
||||
this.setTextColor(this.style.Switch.monolock.locationColor); // 设置道岔名称颜色
|
||||
break;
|
||||
case '02': // 反位
|
||||
this.setTextColor(this.style.Switch.monolock.inversionColor); // 设置道岔名称颜色
|
||||
break;
|
||||
case '01': // 定位
|
||||
this.setTextColor(this.style.Switch.monolock.locationColor); // 设置道岔名称颜色
|
||||
break;
|
||||
case '02': // 反位
|
||||
this.setTextColor(this.style.Switch.monolock.inversionColor); // 设置道岔名称颜色
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -286,7 +316,7 @@ export default class Switch extends Group {
|
||||
this.setHasTextBorder(1);
|
||||
} else if (this.style.Switch.block.contentRectShow) {
|
||||
this.lockRect.show();
|
||||
this.lockRect.setStyle({stroke: this.style.Switch.block.contentRectColor});
|
||||
this.lockRect.setStyle({ stroke: this.style.Switch.block.contentRectColor });
|
||||
}
|
||||
}
|
||||
|
||||
@ -300,14 +330,17 @@ export default class Switch extends Group {
|
||||
setSwitchCutOff() {
|
||||
this.setSwitchCoreInvisible(true);
|
||||
switch (this.model.locateType) {
|
||||
case '01':
|
||||
this.releaseBackground.hide();
|
||||
break;
|
||||
case '02':
|
||||
this.relocShelter.getSection().animateStyle(true)
|
||||
.when(1000, { fill: this.style.backgroundColor })
|
||||
.start();
|
||||
break;
|
||||
case '01':
|
||||
this.releaseBackground.hide();
|
||||
break;
|
||||
case '02':
|
||||
this.relocShelter.getSection().animateStyle(true)
|
||||
.when(1000, { fill: this.style.backgroundColor })
|
||||
.start();
|
||||
this.rhomboid.getSection().animateStyle(true)
|
||||
.when(1000, { fill: this.style.backgroundColor })
|
||||
.start();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -325,38 +358,38 @@ export default class Switch extends Group {
|
||||
setSectionState(section, style, state) {
|
||||
if (section && !section.animators.length) {
|
||||
switch (state.sectionAstatus) {
|
||||
case '00': break;
|
||||
case '01': /** 空闲*/
|
||||
section.setStyle(style, this.style.Section.line.spareColor);
|
||||
break;
|
||||
case '02': /** 通信车占用*/
|
||||
section.setStyle(style, this.style.Section.line.communicationOccupiedColor);
|
||||
break;
|
||||
case '03': /** 非通信车占用*/
|
||||
section.setStyle(style, this.style.Section.line.unCommunicationOccupiedColor);
|
||||
break;
|
||||
case '04': /** 进路锁闭*/
|
||||
section.setStyle(style, this.style.Section.line.routeLockColor);
|
||||
break;
|
||||
case '05': /** 故障锁闭*/
|
||||
section.setStyle(style, this.style.Section.line.faultLockColor);
|
||||
break;
|
||||
case '06': /** 封锁*/
|
||||
section.setStyle(style, this.style.Section.line.blockColor);
|
||||
break;
|
||||
case '07': /** ATC切除*/
|
||||
section.setStyle(style, this.style.Section.line.atcExcisionColor);
|
||||
break;
|
||||
case '08': /** ATS切除*/
|
||||
section.setStyle(style, this.style.Section.line.atsExcisionColor);
|
||||
section.animateStyle(true)
|
||||
.when(1000, { fill: this.style.backgroundColor })
|
||||
.when(2000, { fill: this.style.Section.line.atsExcisionColor })
|
||||
.start();
|
||||
break;
|
||||
case '09': /** 进路延续保护 */
|
||||
section.setStyle(style, this.style.Section.line.protectiveLockColor);
|
||||
break;
|
||||
case '00': break;
|
||||
case '01': /** 空闲*/
|
||||
section.setStyle(style, this.style.Section.line.spareColor);
|
||||
break;
|
||||
case '02': /** 通信车占用*/
|
||||
section.setStyle(style, this.style.Section.line.communicationOccupiedColor);
|
||||
break;
|
||||
case '03': /** 非通信车占用*/
|
||||
section.setStyle(style, this.style.Section.line.unCommunicationOccupiedColor);
|
||||
break;
|
||||
case '04': /** 进路锁闭*/
|
||||
section.setStyle(style, this.style.Section.line.routeLockColor);
|
||||
break;
|
||||
case '05': /** 故障锁闭*/
|
||||
section.setStyle(style, this.style.Section.line.faultLockColor);
|
||||
break;
|
||||
case '06': /** 封锁*/
|
||||
section.setStyle(style, this.style.Section.line.blockColor);
|
||||
break;
|
||||
case '07': /** ATC切除*/
|
||||
section.setStyle(style, this.style.Section.line.atcExcisionColor);
|
||||
break;
|
||||
case '08': /** ATS切除*/
|
||||
section.setStyle(style, this.style.Section.line.atsExcisionColor);
|
||||
section.animateStyle(true)
|
||||
.when(1000, { fill: this.style.backgroundColor })
|
||||
.when(2000, { fill: this.style.Section.line.atsExcisionColor })
|
||||
.start();
|
||||
break;
|
||||
case '09': /** 进路延续保护 */
|
||||
section.setStyle(style, this.style.Section.line.protectiveLockColor);
|
||||
break;
|
||||
}
|
||||
|
||||
if (state.cutOff) {
|
||||
@ -368,20 +401,20 @@ export default class Switch extends Group {
|
||||
|
||||
setLocateType(model) {
|
||||
switch (model.locateType) {
|
||||
case '01':
|
||||
this.setLocationAction(); /** 定位*/
|
||||
break;
|
||||
case '02':
|
||||
this.setInversionAction(); /** 反位*/
|
||||
break;
|
||||
case '03':
|
||||
this.setLossAction(true); /** 失去*/
|
||||
break;
|
||||
case '04':
|
||||
this.setForkAction(); /** 挤岔*/
|
||||
break;
|
||||
default:
|
||||
this.setLocationAction();
|
||||
case '01':
|
||||
this.setLocationAction(); /** 定位*/
|
||||
break;
|
||||
case '02':
|
||||
this.setInversionAction(); /** 反位*/
|
||||
break;
|
||||
case '03':
|
||||
this.setLossAction(true); /** 失去*/
|
||||
break;
|
||||
case '04':
|
||||
this.setForkAction(); /** 挤岔*/
|
||||
break;
|
||||
default:
|
||||
this.setLocationAction();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,8 @@ class Theme {
|
||||
'03': 'beijing_01',
|
||||
'04': 'chengdu_03',
|
||||
'05': 'fuzhou_01', // 国际版运行图皮肤 指向05 福州线路
|
||||
'06': 'ningbo_01'
|
||||
'06': 'ningbo_01',
|
||||
'07': 'haerbin_01' // 哈尔滨培训线路
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm notice-info"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="360px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div class="context">
|
||||
<template v-for="(message,index) in messages">
|
||||
<div :key="index">{{ message }}</div>
|
||||
</template>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="8">
|
||||
<el-button :id="domIdSure" type="primary" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
|
||||
export default {
|
||||
name: 'NoticeInfo',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
messages: [this.$t('tip.commandFailed')],
|
||||
operate: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
return this.$t('tip.hint');
|
||||
},
|
||||
domIdSure() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.notice.domId : '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, messages) {
|
||||
this.operate = operate || {};
|
||||
this.dialogShow = true;
|
||||
this.messages = [this.$t('tip.commandFailed')];
|
||||
if (messages) {
|
||||
this.messages = messages;
|
||||
}
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.doClose();
|
||||
},
|
||||
cancel() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.notice-info .context {
|
||||
padding-bottom: 40px !important;
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,361 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag class="fuzhou-01__systerm confirm-control" :title="title" :visible.sync="show" width="360px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false" append-to-body>
|
||||
<div class="context">
|
||||
<template v-for="(message,index) in messages">
|
||||
<span :key="index">{{ message }}</span>
|
||||
</template>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import NoticeInfo from './childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'ConfirmControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: {},
|
||||
messages: '',
|
||||
operation: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
|
||||
return this.$t('menu.accessSetting');
|
||||
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
|
||||
return this.$t('menu.menuSignal.signalOff');
|
||||
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
return this.$t('menu.menuSignal.signalReopen');
|
||||
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
return this.$t('menu.cancelTheWay');
|
||||
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
|
||||
return this.$t('menu.approachManualControl');
|
||||
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
return this.$t('menu.accessToATSAutomaticControl');
|
||||
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.setRunLevel');
|
||||
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
|
||||
return this.$t('menu.stopTime');
|
||||
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
|
||||
return this.$t('menu.setSwitchbackStrategy');
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
|
||||
/** 进路设置*/
|
||||
return OperationEvent.Signal.arrangementRoute.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
|
||||
/** 信号关灯*/
|
||||
return OperationEvent.Signal.signalClose.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
/** 信号重开*/
|
||||
return OperationEvent.Signal.reopenSignal.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
/** 取消进路*/
|
||||
return OperationEvent.Signal.cancelTrainRoute.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 进路交人工控*/
|
||||
return OperationEvent.Signal.humanControl.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 进路交ATS自动控*/
|
||||
return OperationEvent.Signal.atsAutoControl.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
|
||||
/** 设置运行等级*/
|
||||
return OperationEvent.StationStand.setRunLevel.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
|
||||
/** 设置停站时间*/
|
||||
return OperationEvent.StationStand.setStopTime.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
|
||||
/** 设置折返策略*/
|
||||
return OperationEvent.StationStand.setBackStrategy.confirm.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.messages = operate.messages;
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
|
||||
/** 进路设置*/
|
||||
this.routeSetting();
|
||||
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
|
||||
/** 信号关灯*/
|
||||
this.signalClose();
|
||||
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
/** 信号重开*/
|
||||
this.reopenSignal();
|
||||
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
/** 取消进路*/
|
||||
this.cancelTrainRoute();
|
||||
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 进路交人工控*/
|
||||
this.humanControl();
|
||||
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 进路交ATS自动控*/
|
||||
this.atsAutoControl();
|
||||
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
|
||||
/** 设置运行等级*/
|
||||
this.setRunLevel();
|
||||
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
|
||||
/** 停站时间*/
|
||||
this.setStopTime();
|
||||
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
|
||||
/** 设置折返策略*/
|
||||
this.setBackStrategy();
|
||||
}
|
||||
},
|
||||
// 进路设置
|
||||
routeSetting() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.arrangementRoute.confirm.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 信号关灯
|
||||
signalClose() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.signalClose.confirm.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 信号重开
|
||||
reopenSignal() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.reopenSignal.confirm.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消进路
|
||||
cancelTrainRoute() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.cancelTrainRoute.confirm.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 进路交人工控
|
||||
humanControl() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.humanControl.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 进路交ATS自动控
|
||||
atsAutoControl() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置运行等级
|
||||
setRunLevel() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.setRunLevel.confirm.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME,
|
||||
val: this.operate.val
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 停站时间
|
||||
setStopTime() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.setStopTime.confirm.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME,
|
||||
val: this.operate.val
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置折返策略
|
||||
setBackStrategy() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.confirm.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY,
|
||||
val: this.operate.val
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.confirm-control .context {
|
||||
padding-bottom: 40px !important;
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,144 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag class="fuzhou-01__systerm confirm-control-speed" :title="title" :visible.sync="show" width="540px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false" append-to-body>
|
||||
<div style="height: 60px; padding-left: 20px">
|
||||
<span style="font-size: 18px">{{ message }}</span>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="6" :offset="6">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
|
||||
export default {
|
||||
name: 'ConfirmControlSpeed',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operation: '',
|
||||
message: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
|
||||
return this.$t('menu.menuSection.sectionSetSpeedLimit');
|
||||
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
|
||||
return this.$t('menu.menuSection.sectionCancelSpeedLimit');
|
||||
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
|
||||
return this.$t('menu.switchSettingSpeedLimit');
|
||||
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
|
||||
return this.$t('menu.menuSection.sectionCancelSpeedLimit');
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
|
||||
return OperationEvent.Section.setSpeed.confirm.domId; // 区段设置限速
|
||||
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
|
||||
return OperationEvent.Section.cancelSpeed.confirm.domId; // 区段取消限速
|
||||
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
|
||||
return OperationEvent.Switch.setSpeed.confirm.domId; // 道岔设置限速
|
||||
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
|
||||
return OperationEvent.Switch.cancelSpeed.confirm.domId; // 道岔取消限速
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
this.message = operate.message;
|
||||
}
|
||||
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
const operate = {};
|
||||
|
||||
if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
|
||||
/** 区段设置限速*/
|
||||
operate.operation = OperationEvent.Section.setSpeed.confirm.operation;
|
||||
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
|
||||
/** 区段取消限速*/
|
||||
operate.operation = OperationEvent.Section.cancelSpeed.confirm.operation;
|
||||
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
|
||||
/** 道岔设置限速*/
|
||||
operate.operation = OperationEvent.Switch.setSpeed.confirm.operation;
|
||||
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
|
||||
/** 道岔取消限速*/
|
||||
operate.operation = OperationEvent.Switch.cancelSpeed.confirm.operation;
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.$emit('setOperate', { step: 1, success: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$emit('setOperate', { step: 0, success: false });
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.$emit('setOperate', { step: 0, success: false });
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.confirm-control-speed .context {
|
||||
padding-bottom: 40px !important;
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,126 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm route-unlock-confirm"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="500px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div style="height: 60px; padding-left: 20px">
|
||||
<span>{{ $t('menu.in') }}{{ stationName }}【{{ signalName }}】{{ $t('menu.signalConfirmed') }}</span>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="6" :offset="6">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
|
||||
export default {
|
||||
name: 'RouteUnlockConfirm',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
signalName: '',
|
||||
stationName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.signalDeblocking');
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Signal.unlock.confirm.domId : '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.stationName = '';
|
||||
this.signalName = '';
|
||||
if (selected) {
|
||||
this.signalName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Signal.unlock.confirm.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.$emit('setOperate', { step: 1, success: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$emit('setOperate', { step: 0, success: false });
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.$emit('setOperate', { step: 0, success: false });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.route-unlock-confirm .context {
|
||||
padding-bottom: 40px !important;
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,180 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm confirm-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="360px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div class="context">
|
||||
<template v-for="(message,index) in messages">
|
||||
<span :key="index">{{ message }}</span>
|
||||
</template>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from './childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'ConfirmTrain',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: {},
|
||||
messages: '',
|
||||
operation: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
if (this.operation === OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return this.$t('menu.menuTrain.addTrainId');
|
||||
} else if (this.operation === OperationEvent.Train.editTrainId.menu.operation) {
|
||||
return this.$t('menu.menuTrain.editTrainId');
|
||||
} else if (this.operation === OperationEvent.Train.delTrainId.menu.operation) {
|
||||
return this.$t('menu.menuTrain.deleteTrainId');
|
||||
} else if (this.operation === OperationEvent.Train.moveTrainId.menu.operation) {
|
||||
return this.$t('menu.menuTrain.moveTrainId');
|
||||
} else if (this.operation === OperationEvent.Train.switchTrainId.menu.operation) {
|
||||
return this.$t('menu.menuTrain.switchTrainId');
|
||||
} else if (this.operation === OperationEvent.Train.editTrainNo.menu.operation) {
|
||||
return this.$t('menu.menuTrain.editTrainNo');
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation === OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Train.delTrainId.menu.operation) {
|
||||
/** 删除列车识别号*/
|
||||
return OperationEvent.Train.delTrainId.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Train.moveTrainId.menu.operation) {
|
||||
/** 移动列车识别号*/
|
||||
return OperationEvent.Train.moveTrainId.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Train.switchTrainId.menu.operation) {
|
||||
/** 交换列车识别号*/
|
||||
return OperationEvent.Train.switchTrainId.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Train.editTrainNo.menu.operation) {
|
||||
/** 修改车组号*/
|
||||
return OperationEvent.Train.editTrainNo.confirm.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.messages = operate.messages;
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation === OperationEvent.Train.addTrainId.menu.operation) {
|
||||
this.routeSetting();
|
||||
} else if (this.operation === OperationEvent.Train.editTrainId.menu.operation) {
|
||||
this.routeSetting();
|
||||
} else if (this.operation === OperationEvent.Train.delTrainId.menu.operation) {
|
||||
this.routeSetting();
|
||||
} else if (this.operation === OperationEvent.Train.moveTrainId.menu.operation) {
|
||||
this.routeSetting();
|
||||
} else if (this.operation === OperationEvent.Train.switchTrainId.menu.operation) {
|
||||
this.routeSetting();
|
||||
} else if (this.operation === OperationEvent.Train.editTrainNo.menu.operation) {
|
||||
this.routeSetting();
|
||||
}
|
||||
},
|
||||
// 进路设置
|
||||
routeSetting() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Train.addTrainId.confirm.operation,
|
||||
cmdType: CMD.Train.CMD_ADD_TRAIN_ID
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.confirm-control .context {
|
||||
padding-bottom: 40px !important;
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
</style>
|
450
src/jmapNew/theme/haerbin_01/menus/dialog/routeCmdControl.vue
Normal file
450
src/jmapNew/theme/haerbin_01/menus/dialog/routeCmdControl.vue
Normal file
@ -0,0 +1,450 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm route-cmd-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="840px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">{{ $t('menu.commandInformation') }}</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.type')" label-width="40px">
|
||||
<el-select v-model="operation" size="small" disabled>
|
||||
<el-option
|
||||
v-for="option in typeList"
|
||||
:key="option.code"
|
||||
:label="option.name"
|
||||
:value="option.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.stationName')" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.signalName')" label-width="100px">
|
||||
<el-input v-model="signalName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table
|
||||
ref="tempData"
|
||||
class="table"
|
||||
:data="tempData"
|
||||
border
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
height="200"
|
||||
>
|
||||
<el-table-column prop="order" :width="110" :label="this.$t('menu.serialNumber2')" />
|
||||
<el-table-column prop="date" :width="160" :label="this.$t('menu.time')" />
|
||||
<el-table-column prop="context" :width="180" :label="this.$t('menu.implementationProcess')" />
|
||||
<el-table-column prop="result" :label="this.$t('menu.executionResult')" />
|
||||
</el-table>
|
||||
<span class="notice">{{ message }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="3">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">{{ $t('menu.release') }}<span
|
||||
v-show="timeCountCommand>0"
|
||||
>({{ timeCountCommand }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdConfirm1" style="width:120px;" type="primary" :disabled="cmdDisabled[1]" @click="confirm1">{{ $t('menu.firstConfirm') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">{{ $t('menu.secondConfirm') }}<span
|
||||
v-show="timeCountConfirm>0"
|
||||
>({{ timeCountConfirm }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">{{ $t('menu.suspend') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdClose" @click="close">{{ $t('global.close') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<confirm-signal-unlock ref="confirmSignalUnlock" @setOperate="getOperate" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { now } from '@/utils/date';
|
||||
import ConfirmSignalUnlock from './childDialog/confirmSignalUnlock';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'RouteCmdControl',
|
||||
components: {
|
||||
ConfirmSignalUnlock
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
backOperate: '',
|
||||
selected: '',
|
||||
order: 0,
|
||||
row: null,
|
||||
timer: null,
|
||||
operation: '',
|
||||
cmdDisabled: [true, true, true],
|
||||
stpDisabled: true,
|
||||
tempData: [],
|
||||
message: '',
|
||||
timeCountCommand: -1,
|
||||
timeCountConfirm: -1,
|
||||
stationName: '',
|
||||
signalName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Signal.unlock.menu.operation, name: this.$t('menu.menuSignal.signalDeblock') },
|
||||
{ code: OperationEvent.Signal.guide.menu.operation, name: this.$t('menu.menuSignal.guideRouteHandle') }
|
||||
];
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
return OperationEvent.Signal.unlock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
return OperationEvent.Signal.guide.order.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
return OperationEvent.Signal.unlock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
return OperationEvent.Signal.guide.confirm1.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
return OperationEvent.Signal.unlock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
return OperationEvent.Signal.guide.confirm2.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
return OperationEvent.Signal.unlock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
return OperationEvent.Signal.guide.stop.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
return '信号解封';
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
return '办理引导进路';
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
cmdDisabled: {
|
||||
handler(val, oldVal) {
|
||||
this.stpDisabled = true;
|
||||
val.forEach((elem, index) => {
|
||||
// 在确定1之前的操作才可以终止
|
||||
if (elem == false && index >= 1 && index <= 2) {
|
||||
this.stpDisabled = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
this.timer = setInterval(() => {
|
||||
if (!this.$store.state.menuOperation.break) {
|
||||
if (this.timeCountCommand > 0) {
|
||||
this.timeCountCommand--;
|
||||
} else if (this.timeCountCommand == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountCommand = -1;
|
||||
}
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.signalName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.signalName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
this.selected = selected;
|
||||
}
|
||||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation;
|
||||
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.stpDisabled = true;
|
||||
this.setMessage(this.$t('tip.releaseTip'));
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
command() {
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
const operate = {
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
operate.operation = OperationEvent.Signal.unlock.order.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
this.$refs.confirmSignalUnlock.doShow(operate, this.selected);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
commandNoPopUp() {
|
||||
const operate = {
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
operate.operation = OperationEvent.Signal.guide.order.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
confirm1() {
|
||||
const operate = {
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
operate.operation = OperationEvent.Signal.unlock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
operate.operation = OperationEvent.Signal.guide.confirm1.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.secondConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = 10;
|
||||
this.setButtonEnable({ step: 2 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
const operate = {
|
||||
over: true
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
operate.operation = OperationEvent.Signal.unlock.confirm2.operation;
|
||||
operate.cmdType = CMD.Signal.CMD_SIGNAL_UNBLOCK;
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
operate.operation = OperationEvent.Signal.guide.confirm2.operation;
|
||||
operate.cmdType = CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE;
|
||||
}
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
stop() {
|
||||
const operate = {
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
operate.operation = OperationEvent.Signal.unlock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
operate.operation = OperationEvent.Signal.guide.stop.operation;
|
||||
}
|
||||
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
close() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
/** 弹框返回值处理*/
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
this.backOperate = operate;
|
||||
this.setButtonEnable(operate);
|
||||
if (operate.success) {
|
||||
this.timeCountCommand = 30;
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.confirmedSuccess') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.cancelSuccess') });
|
||||
}
|
||||
}
|
||||
},
|
||||
setButtonEnable(param) {
|
||||
this.cmdDisabled = [true, true, true];
|
||||
if (param && param.step >= 0) {
|
||||
this.cmdDisabled[param.step] = false;
|
||||
}
|
||||
},
|
||||
setMessage(message) {
|
||||
this.message = message;
|
||||
},
|
||||
writeRecord(param) {
|
||||
this.tempData.push(param);
|
||||
},
|
||||
editRecord(param) {
|
||||
this.tempData.forEach(elem => {
|
||||
if (elem.order == param.order) {
|
||||
for (var prop in param) {
|
||||
elem[prop] = param[prop];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
332
src/jmapNew/theme/haerbin_01/menus/dialog/routeControl.vue
Normal file
332
src/jmapNew/theme/haerbin_01/menus/dialog/routeControl.vue
Normal file
@ -0,0 +1,332 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm signal-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="300px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="11" :offset="2"><span>{{ $t('menu.signal') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="signalName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'RouteControl',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
operation: null,
|
||||
stationName: '',
|
||||
signalName: ''
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
return this.$t('menu.menuSignal.cancelTheTrainApproach');
|
||||
} else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) {
|
||||
return this.$t('menu.menuSignal.signalOff');
|
||||
} else if (this.operation == OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
return this.$t('menu.menuSignal.reopenTrainSignal');
|
||||
} else if (this.operation == OperationEvent.Signal.setAutoInterlock.menu.operation) {
|
||||
return this.$t('menu.menuSignal.setInterlockAutoRoute');
|
||||
} else if (this.operation == OperationEvent.Signal.cancelAutoInterlock.menu.operation) {
|
||||
return this.$t('menu.menuSignal.cancelInterlockAutoRoute');
|
||||
} else if (this.operation == OperationEvent.Signal.setAutoTrigger.menu.operation) {
|
||||
return this.$t('menu.menuSignal.setInterlockAutoTrigger');
|
||||
} else if (this.operation == OperationEvent.Signal.cancelAutoTrigger.menu.operation) {
|
||||
return this.$t('menu.menuSignal.cancelInterlockAutoTrigger');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.signalName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.signalName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.selected = selected;
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
/** 取消列车进路*/
|
||||
this.cancelTrainRoute();
|
||||
} else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) {
|
||||
/** 信号关灯*/
|
||||
this.signalClose();
|
||||
} else if (this.operation == OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
/** 信号重开*/
|
||||
this.reopenSignal();
|
||||
} else if (this.operation == OperationEvent.Signal.setAutoInterlock.menu.operation) {
|
||||
/** 设置联锁自动进路*/
|
||||
this.setAutoInterlock();
|
||||
} else if (this.operation == OperationEvent.Signal.cancelAutoInterlock.menu.operation) {
|
||||
/** 取消联锁自动进路*/
|
||||
this.cancelAutoInterlock();
|
||||
} else if (this.operation == OperationEvent.Signal.setAutoTrigger.menu.operation) {
|
||||
/** 设置联锁自动触发*/
|
||||
this.setAutoTrigger();
|
||||
} else if (this.operation == OperationEvent.Signal.cancelAutoTrigger.menu.operation) {
|
||||
/** 取消联锁自动触发*/
|
||||
this.cancelAutoTrigger();
|
||||
}
|
||||
},
|
||||
// 取消列车进路
|
||||
cancelTrainRoute() {
|
||||
if (this.$store.state.training.prdType == '01') {
|
||||
/** 现地工作站*/
|
||||
this.cancelTrainRouteByLocal();
|
||||
} else if (this.$store.state.training.prdType == '02') {
|
||||
/** 行调工作站*/
|
||||
this.cancelTrainRouteByCentral();
|
||||
}
|
||||
},
|
||||
// 现地工作站取消进路
|
||||
cancelTrainRouteByLocal() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 行调工作站取消进路
|
||||
cancelTrainRouteByCentral() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE,
|
||||
messages: [this.$t('tip.signalModeToManualModeTipPrefix') + this.signalName + this.$t('tip.signalModeToManualModeTipSuffix')]
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmControl.doShow(operate, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 信号关灯
|
||||
signalClose() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Signal.signalClose.menu.operation,
|
||||
messages: [this.$t('menu.menuSignal.signalOff') + this.$t('global.colon') + this.signalName]
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmControl.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 信号重开
|
||||
reopenSignal() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Signal.reopenSignal.menu.operation,
|
||||
messages: [this.$t('menu.menuSignal.signalReopen') + this.$t('global.colon') + this.signalName]
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmControl.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 设置联锁自动进路
|
||||
setAutoInterlock() {
|
||||
const operate = {
|
||||
over: true,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO,
|
||||
operation: OperationEvent.Signal.setAutoInterlock.menu.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消联锁自动进路
|
||||
cancelAutoInterlock() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置联锁自动触发
|
||||
setAutoTrigger() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.setAutoTrigger.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消联锁自动触发
|
||||
cancelAutoTrigger() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.cancelAutoTrigger.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER
|
||||
};
|
||||
|
||||
this.doClose();
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
166
src/jmapNew/theme/haerbin_01/menus/dialog/routeDetail.vue
Normal file
166
src/jmapNew/theme/haerbin_01/menus/dialog/routeDetail.vue
Normal file
@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm route-detail"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="340px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{ $t('menu.startSignal') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-input v-model="signalName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{ $t('menu.routeList') }}</span>
|
||||
<el-table
|
||||
ref="tempTable"
|
||||
:data="tempData"
|
||||
border
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
:height="140"
|
||||
>
|
||||
<el-table-column :label="this.$t('menu.route')">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" :label="this.$t('menu.controlState')" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.controlType == '01'">{{ $t('menu.automatic') }}</span>
|
||||
<span v-else>{{ $t('menu.artificial') }}</span>
|
||||
</template>
|
||||
</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">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'RouteDetail',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
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.detail.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.queryAccessControlMode');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected, tempData) {
|
||||
// 如果不是因为断点激活则需要,初始化菜单初始值
|
||||
if (!this.dialogShow) {
|
||||
this.signalName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.signalName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.tempData = tempData || [];
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.detail.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_STAND_VIEW_STATUS
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
316
src/jmapNew/theme/haerbin_01/menus/dialog/routeHandControl.vue
Normal file
316
src/jmapNew/theme/haerbin_01/menus/dialog/routeHandControl.vue
Normal file
@ -0,0 +1,316 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm route-hand-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="360px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{ $t('menu.startSignal') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-input v-model="signalName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{ $t('menu.routeList') }}</span>
|
||||
<el-table
|
||||
ref="tempTable"
|
||||
:data="tempData"
|
||||
border
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
:height="140"
|
||||
>
|
||||
<el-table-column :id="domIdChoose" prop="name" :label="this.$t('menu.route')" style="margin-left:30px">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="scope.row.check" :disabled="scope.row.disabled" />
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="controlType" :label="this.$t('menu.controlState')" :width="80">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">
|
||||
<span v-if="scope.row.controlType == '01'">{{ $t('menu.automatic2') }}</span>
|
||||
<span v-else>{{ $t('menu.artificial') }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="conflictCheck" :label="this.$t('menu.conflictCheck')" :width="80">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
:style="{color: scope.row.disabled ? '#CBCBCB':'unset'}"
|
||||
>{{ scope.row.conflictCheck }}</span>
|
||||
</template>
|
||||
</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"
|
||||
:disabled="commitDisabled"
|
||||
:loading="loading"
|
||||
@click="commit"
|
||||
>{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'RouteHandControl',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
operation: null,
|
||||
selection: [],
|
||||
stationName: '',
|
||||
signalName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'signalList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
return OperationEvent.Signal.humanControl.choose.domId;
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
return OperationEvent.Signal.atsAutoControl.choose.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
return this.$t('menu.menuSignal.humanControl');
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
return this.$t('menu.menuSignal.atsAutoControl');
|
||||
}
|
||||
return '';
|
||||
},
|
||||
commitDisabled() {
|
||||
let disabled = true;
|
||||
if (this.selection && this.selection.length) {
|
||||
disabled = false;
|
||||
}
|
||||
|
||||
return disabled;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 深度数据状态
|
||||
tempData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected, tempData) {
|
||||
// 如果不是断点激活,而是第一次显示则初始化
|
||||
if (!this.dialogShow) {
|
||||
this.signalName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.signalName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
if (tempData && tempData.length > 0) {
|
||||
tempData.forEach(elem => {
|
||||
elem.check = false;
|
||||
elem.disabled = false;
|
||||
// 设置禁用状态
|
||||
if (operate.operation === OperationEvent.Signal.humanControl.menu.operation &&
|
||||
elem.controlType != '01') {
|
||||
elem.disabled = true;
|
||||
} if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation &&
|
||||
elem.controlType == '01') {
|
||||
elem.disabled = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.tempData = tempData || [];
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$refs.tempTable.setCurrentRow();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.check && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.handleChooseChange(selection);
|
||||
this.selection = selection;
|
||||
}
|
||||
},
|
||||
handleChooseChange(selection) {
|
||||
this.selection = selection;
|
||||
const codeList = selection.map(elem => { return elem.code; });
|
||||
if (codeList && codeList.length) {
|
||||
const operate = {
|
||||
repeat: true,
|
||||
operation: '',
|
||||
val: codeList.join('::')
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 自排关*/
|
||||
operate.operation = OperationEvent.Signal.humanControl.choose.operation;
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 自排开*/
|
||||
operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
} else if (!selection) {
|
||||
this.$messageBox(this.$t('tip.selectAPieceOfData'));
|
||||
}
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 自排关*/
|
||||
this.humanControl();
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 自排开*/
|
||||
this.atsAutoControl();
|
||||
}
|
||||
},
|
||||
// 自排关
|
||||
humanControl() {
|
||||
const codeList = this.selection.map(elem => { return elem.code; });
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.humanControl.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING,
|
||||
param: {
|
||||
Route_Code_List: codeList
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 自排开
|
||||
atsAutoControl() {
|
||||
const codeList = this.selection.map(elem => { return elem.code; });
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING,
|
||||
param: {
|
||||
Route_Code_List: codeList
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
167
src/jmapNew/theme/haerbin_01/menus/dialog/routeLock.vue
Normal file
167
src/jmapNew/theme/haerbin_01/menus/dialog/routeLock.vue
Normal file
@ -0,0 +1,167 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm route-lock"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="340px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{ $t('menu.signalName') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-input v-model="signalName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{ $t('menu.listOfSignalButtons') }}</span>
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tempData"
|
||||
border
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
:height="140"
|
||||
>
|
||||
<el-table-column prop="name" :label="this.$t('menu.buttonName')" />
|
||||
<el-table-column prop="status" :label="this.$t('menu.buttonStatus')" />
|
||||
</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">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'RouteLock',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
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 this.$t('menu.blockSignalButton');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
// 入股不是断点激活,而是第一次显示需要初始化
|
||||
if (!this.dialogShow) {
|
||||
this.signalName = '';
|
||||
this.stationName = '';
|
||||
|
||||
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.signalName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
/** status 04:封锁*/
|
||||
const signal = (selected || {}).status;
|
||||
this.tempData = [{ code: selected.code, name: selected.name, status: signal.status != '04' ? this.$t('menu.unblocked') : this.$t('menu.blocked') }];
|
||||
const 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');
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.lock.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
239
src/jmapNew/theme/haerbin_01/menus/dialog/routeSelection.vue
Normal file
239
src/jmapNew/theme/haerbin_01/menus/dialog/routeSelection.vue
Normal file
@ -0,0 +1,239 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag class="fuzhou-01__systerm route-setting" :title="title" :visible.sync="show" width="500px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<el-row class="header">
|
||||
<el-col :span="8"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="8" :offset="2"><span>{{ $t('menu.startSignal') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="2">
|
||||
<el-input v-model="signalName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table ref="table" :data="tempData" border style="width: 100%; margin-top:10px" size="mini" height="120" highlight-current-row @row-click="clickEvent">
|
||||
<el-table-column :id="domIdChoose" prop="name" :label="this.$t('menu.route')" style="margin-left:30px" />
|
||||
<el-table-column prop="protectedSection" :label="this.$t('menu.protectionSection')" :width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getProtectedSectionName(scope.row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="canSetting" :label="this.$t('global.status')" :width="100">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.canSetting">{{ $t('menu.allowSelection') }}</span>
|
||||
<span v-else>{{ $t('menu.notAllowSelection') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button
|
||||
:id="domIdConfirm"
|
||||
type="primary"
|
||||
:loading="loading"
|
||||
:disabled="commitDisabled"
|
||||
@click="commit"
|
||||
>{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'RouteSelection',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tempData: [],
|
||||
beforeSectionList: [],
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
row: null,
|
||||
operation: '',
|
||||
display: true,
|
||||
stationName: '',
|
||||
signalName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuSignal.routeSelect');
|
||||
},
|
||||
commitDisabled() {
|
||||
let disabled = true;
|
||||
if (this.row) {
|
||||
disabled = !this.row.canSetting;
|
||||
}
|
||||
return disabled;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getProtectedSectionName(row) {
|
||||
let name = '';
|
||||
if (row &&
|
||||
row.overlapSectionList &&
|
||||
row.overlapSectionList &&
|
||||
row.overlapSectionList.length > 0) {
|
||||
|
||||
const protect = row.overlapSectionList[0];
|
||||
name = `${protect.name}`;
|
||||
if (protect.parentName) {
|
||||
name = `${protect.parentName}${protect.name}`;
|
||||
}
|
||||
const station = this.$store.getters['map/getDeviceByCode'](protect.stationCode);
|
||||
if (station) {
|
||||
name = `${name}(${station.name})`;
|
||||
}
|
||||
}
|
||||
return name;
|
||||
},
|
||||
doShow(operate, selected, tempData) {
|
||||
// 如果不是断点激活,而是第一次显示,则需要设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.signalName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.signalName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.tempData = tempData || [];
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.restoreBeforeDevices();
|
||||
this.$refs.table.setCurrentRow();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
restoreBeforeDevices() {
|
||||
// 恢复之前选中设备
|
||||
if (this.beforeSectionList && this.beforeSectionList.length) {
|
||||
this.beforeSectionList.forEach(elem => {
|
||||
elem.cutOff = false;
|
||||
});
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/updateMapState', [... this.beforeSectionList]);
|
||||
this.beforeSectionList = [];
|
||||
},
|
||||
clickEvent(row, event, column) {
|
||||
this.row = row;
|
||||
if (row) {
|
||||
// 恢复进路区段的切除状态
|
||||
this.restoreBeforeDevices();
|
||||
|
||||
if (row.canSetting) {
|
||||
// 设置选中区段为切除状态
|
||||
if (row.containSectionList && row.containSectionList.length) {
|
||||
// 设置新选的进路区段为切除状态
|
||||
row.containSectionList.forEach(elem => {
|
||||
elem.cutOff = true;
|
||||
});
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/updateMapState', [...row.containSectionList]);
|
||||
this.beforeSectionList = row.containSectionList || [];
|
||||
|
||||
// 设置选中指令
|
||||
const operate = {
|
||||
operation: OperationEvent.Signal.arrangementRoute.choose.operation,
|
||||
val: row.code,
|
||||
param: {
|
||||
Route_Code: row.code
|
||||
}
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
commit() {
|
||||
if (this.row && this.row.canSetting) {
|
||||
let names = '';
|
||||
if (this.row.overlapSectionList && this.row.overlapSectionList.length > 0) {
|
||||
names = names + this.row.overlapSectionList.map(elem => { return elem.name; }).join('');
|
||||
}
|
||||
if (this.row.overlapSwitchList && this.row.overlapSwitchList.length > 0) {
|
||||
names = names + this.row.overlapSwitchList.map(elem => { return elem.name; }).join('');
|
||||
}
|
||||
const operate = {
|
||||
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
|
||||
messages: [this.$t('menu.accessSetting') + this.$t('global.colon') + `${this.row.name}${names}(${this.row.stationName})`]
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmControl.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
419
src/jmapNew/theme/haerbin_01/menus/dialog/sectionCmdControl.vue
Normal file
419
src/jmapNew/theme/haerbin_01/menus/dialog/sectionCmdControl.vue
Normal file
@ -0,0 +1,419 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-dialogDrag class="fuzhou-01__systerm section-cmd-control" :title="title" :visible.sync="show" width="840px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">{{ $t('menu.commandInformation') }}</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('global.status')" label-width="40px">
|
||||
<el-select v-model="operation" size="small" disabled>
|
||||
<el-option v-for="option in typeList" :key="option.code" :label="option.name" :value="option.code" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.stationName')" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.sectionName')" label-width="100px">
|
||||
<el-input v-model="sectionName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table :data="tempData" border style="width: 100%" size="mini" highlight-current-row height="200">
|
||||
<el-table-column prop="order" :width="110" :label="this.$t('menu.serialNumber2')" />
|
||||
<el-table-column prop="date" :width="160" :label="this.$t('menu.time')" />
|
||||
<el-table-column prop="context" :width="180" :label="this.$t('menu.implementationProcess')" />
|
||||
<el-table-column prop="result" :label="this.$t('menu.executionResult')" />
|
||||
</el-table>
|
||||
<span class="notice">{{ message }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="3">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">
|
||||
{{ $t('menu.release') }}
|
||||
<span v-show="timeCountCommand>0">({{ timeCountCommand }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdConfirm1" type="primary" style="width:120px;" :disabled="cmdDisabled[1]" @click="confirm1">{{ $t('menu.firstConfirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">
|
||||
{{ $t('menu.secondConfirm') }}
|
||||
<span v-show="timeCountConfirm>0">({{ timeCountConfirm }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">{{ $t('menu.suspend') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdClose" @click="close">{{ $t('global.close') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { now } from '@/utils/date';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'SectionCmdControl',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
backOperate: '',
|
||||
selected: '',
|
||||
order: 0,
|
||||
row: null,
|
||||
timer: null,
|
||||
operation: '',
|
||||
cmdDisabled: [true, true, true],
|
||||
stpDisabled: true,
|
||||
tempData: [],
|
||||
message: '',
|
||||
timeCountCommand: -1,
|
||||
timeCountConfirm: -1,
|
||||
stationName: '',
|
||||
sectionName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Section.unlock.menu.operation, name: this.$t('menu.menuSection.sectionUnblock') },
|
||||
{ code: OperationEvent.Section.fault.menu.operation, name: this.$t('menu.menuSection.sectionFaultUnlock') },
|
||||
{ code: OperationEvent.Section.axlePreReset.menu.operation, name: this.$t('menu.menuSection.sectionAxisPreReset') }
|
||||
];
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
return OperationEvent.Section.unlock.order.domId; // 区段解封
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return OperationEvent.Section.fault.order.domId; // 区段故障解锁
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
return OperationEvent.Section.axlePreReset.order.domId; // 区段计轴预复位
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
return OperationEvent.Section.unlock.confirm1.domId; // 区段解封
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return OperationEvent.Section.fault.confirm1.domId; // 区段故障解锁
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
return OperationEvent.Section.axlePreReset.confirm1.domId; // 区段计轴预复位
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.confirm2.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.stop.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
return this.$t('menu.menuSection.sectionUnblock');
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return this.$t('menu.menuSection.sectionFaultUnlock');
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
return this.$t('menu.menuSection.sectionAxisPreReset');
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
cmdDisabled: {
|
||||
handler(val, oldVal) {
|
||||
this.stpDisabled = true;
|
||||
val.forEach((elem, index) => {
|
||||
// 在确定1之前的操作才可以终止
|
||||
if (elem == false && index >= 1 && index <= 2) {
|
||||
this.stpDisabled = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
this.timer = setInterval(() => {
|
||||
if (!this.$store.state.menuOperation.break) {
|
||||
if (this.timeCountCommand > 0) {
|
||||
this.timeCountCommand--;
|
||||
} else if (this.timeCountCommand == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountCommand = -1;
|
||||
}
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.sectionName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
if (selected.type === '02') {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.sectionName += section.name;
|
||||
}
|
||||
}
|
||||
this.sectionName += selected.name;
|
||||
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
this.selected = selected;
|
||||
}
|
||||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation || '';
|
||||
this.dialogShow = true;
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
this.stpDisabled = true;
|
||||
this.setMessage(this.$t('tip.releaseTip'));
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
command() {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation ||
|
||||
this.operation == OperationEvent.Section.unlock.menu.operation ||
|
||||
this.operation == OperationEvent.Section.cancelSpeed.menu.operation ||
|
||||
this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
} else {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
},
|
||||
commandNoPopUp() {
|
||||
const operate = {};
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.order.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.order.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.order.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
confirm1() {
|
||||
const operate = {
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.confirm1.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.secondConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = 10;
|
||||
this.setButtonEnable({ step: 2 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
const operate = {};
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.confirm2.operation;
|
||||
operate.cmdType = CMD.Section.CMD_SECTION_UNBLOCK;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.confirm2.operation;
|
||||
operate.cmdType = CMD.Section.CMD_SECTION_FAULT_UNLOCK;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.confirm2.operation;
|
||||
operate.cmdType = CMD.Section.CMD_SECTION_AXIS_PRE_RESET;
|
||||
}
|
||||
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
stop() {
|
||||
const operate = {};
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.stop.operation;
|
||||
}
|
||||
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
close() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
setButtonEnable(param) {
|
||||
this.cmdDisabled = [true, true, true];
|
||||
if (param && param.step >= 0) {
|
||||
this.cmdDisabled[param.step] = false;
|
||||
}
|
||||
},
|
||||
setMessage(message) {
|
||||
this.message = message;
|
||||
},
|
||||
writeRecord(param) {
|
||||
this.tempData.push(param);
|
||||
},
|
||||
editRecord(param) {
|
||||
this.tempData.forEach(elem => {
|
||||
if (elem.order == param.order) {
|
||||
for (var prop in param) {
|
||||
elem[prop] = param[prop];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
167
src/jmapNew/theme/haerbin_01/menus/dialog/sectionControl.vue
Normal file
167
src/jmapNew/theme/haerbin_01/menus/dialog/sectionControl.vue
Normal file
@ -0,0 +1,167 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag class="fuzhou-01__systerm section-control" :title="title" :visible.sync="show" width="300px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="11" :offset="2"><span>{{ $t('menu.section') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="sectionName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'SectionControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operation: '',
|
||||
stationName: '',
|
||||
sectionName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Section.lock.menu.operation) {
|
||||
return this.$t('menu.menuSection.sectionBlockade');
|
||||
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
|
||||
return this.$t('menu.menuSection.orbitalSectionResection');
|
||||
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
|
||||
return this.$t('menu.menuSection.orbitalSectionActive');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.sectionName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
if (selected.type === '02') {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.sectionName += section.name;
|
||||
}
|
||||
}
|
||||
this.sectionName += selected.name;
|
||||
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.operation = operate.operation || '';
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Section.lock.menu.operation) {
|
||||
this.lock(); // 区段封锁
|
||||
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
|
||||
this.split(); // 轨道区段切除
|
||||
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
|
||||
this.active(); // 轨道区段激活
|
||||
}
|
||||
},
|
||||
// 区段单锁
|
||||
lock() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Section.lock.menu.operation,
|
||||
cmdType: CMD.Section.CMD_SECTION_BLOCK
|
||||
};
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 轨道区段切除
|
||||
split() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Section.split.menu.operation,
|
||||
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
|
||||
};
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 轨道区段激活
|
||||
active() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Section.active.menu.operation,
|
||||
cmdType: CMD.Section.CMD_SECTION_ACTIVE
|
||||
};
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
sendCommand(operate) {
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
547
src/jmapNew/theme/haerbin_01/menus/dialog/speedCmdControl.vue
Normal file
547
src/jmapNew/theme/haerbin_01/menus/dialog/speedCmdControl.vue
Normal file
@ -0,0 +1,547 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-dialogDrag class="fuzhou-01__systerm section-cmd-speed" :title="title" :visible.sync="show" width="840px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">{{ $t('menu.commandInformation') }}</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="this.$t('menu.type')" label-width="40px">
|
||||
<el-select v-model="operation" size="small" disabled>
|
||||
<el-option v-for="option in typeList" :key="option.code" :label="option.name" :value="option.code" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="this.$t('menu.stationName')" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="nameLabel" label-width="80px">
|
||||
<el-input v-model="name" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="this.$t('menu.speedLimitValue')" label-width="80px">
|
||||
<el-select :id="domIdChoose" v-model="formData.SpeedLimit_Value" size="small" :disabled="spdDisabled" @change="speedSelectChange">
|
||||
<el-option v-for="item in speedList" :key="item" :label="item" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table :data="tableData" border style="width: 100%" size="mini" highlight-current-row height="200">
|
||||
<el-table-column prop="order" :width="110" :label="this.$t('menu.serialNumber2')" />
|
||||
<el-table-column prop="date" :width="160" :label="this.$t('menu.time')" />
|
||||
<el-table-column prop="context" :width="180" :label="this.$t('menu.implementationProcess')" />
|
||||
<el-table-column prop="result" :label="this.$t('menu.executionResult')" />
|
||||
</el-table>
|
||||
<span class="notice">{{ message }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="3">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">
|
||||
{{ $t('menu.release') }}
|
||||
<span v-show="timeCountCommand>0">({{ timeCountCommand }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdConfirm1" type="primary" style="width:120px;" :disabled="cmdDisabled[1]" @click="confirm1">{{ $t('menu.firstConfirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">
|
||||
{{ $t('menu.secondConfirm') }}
|
||||
<span v-show="timeCountConfirm>0">({{ timeCountConfirm }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">{{ $t('menu.suspend') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdClose" @click="close">{{ $t('global.close') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<confirm-control-speed ref="confirmControlSpeed" @setOperate="getOperate" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import ConfirmControlSpeed from './childDialog/confirmControlSpeed';
|
||||
import { now } from '@/utils/date';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'SectionCmdSpeed',
|
||||
components: {
|
||||
ConfirmControlSpeed
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
backOperate: '',
|
||||
selected: '',
|
||||
order: 0,
|
||||
row: null,
|
||||
timer: null,
|
||||
operation: '',
|
||||
cmdDisabled: [true, true, true],
|
||||
spdDisabled: false,
|
||||
stpDisabled: true,
|
||||
tableData: [],
|
||||
message: '',
|
||||
timeCountCommand: -1,
|
||||
timeCountConfirm: -1,
|
||||
maxSpeed: 80,
|
||||
speedSpace: 5,
|
||||
stationName: '',
|
||||
name: '',
|
||||
formData: {
|
||||
SpeedLimit_Value: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
nameLabel() {
|
||||
if (this.operation == OperationEvent.Section.setSpeed.menu.operation ||
|
||||
this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
|
||||
return this.$t('menu.sectionName');
|
||||
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
|
||||
return this.$t('menu.switchName');
|
||||
}
|
||||
return null;
|
||||
},
|
||||
speedList() {
|
||||
const list = [];
|
||||
for (var i = 0; i * this.speedSpace <= this.maxSpeed; i++) {
|
||||
list.push(i * this.speedSpace);
|
||||
}
|
||||
return list;
|
||||
},
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Section.setSpeed.menu.operation, name: this.$t('menu.menuSection.sectionSetSpeedLimit') },
|
||||
{ code: OperationEvent.Section.cancelSpeed.menu.operation, name: this.$t('menu.menuSection.sectionCancelSpeedLimit') },
|
||||
{ code: OperationEvent.Switch.setSpeed.menu.operation, name: this.$t('menu.turnoutSettingSpeedLimit') },
|
||||
{ code: OperationEvent.Switch.cancelSpeed.menu.operation, name: this.$t('menu.turnoutCancelsSpeedLimit') }
|
||||
];
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
|
||||
return this.$t('menu.menuSection.sectionSetSpeedLimit');
|
||||
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
|
||||
return this.$t('menu.menuSection.sectionCancelSpeedLimit');
|
||||
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
|
||||
return this.$t('menu.turnoutSettingSpeedLimit');
|
||||
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
|
||||
return this.$t('menu.turnoutCancelsSpeedLimit');
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdChoose() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
|
||||
/** 区段设置限速*/
|
||||
return OperationEvent.Section.setSpeed.choose.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
|
||||
/** 道岔设置限速*/
|
||||
return OperationEvent.Switch.setSpeed.choose.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
|
||||
/** 区段设置限速*/
|
||||
return OperationEvent.Section.setSpeed.order.domId;
|
||||
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
|
||||
/** 区段取消限速*/
|
||||
return OperationEvent.Section.cancelSpeed.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
|
||||
/** 道岔设置限速*/
|
||||
return OperationEvent.Switch.setSpeed.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
|
||||
/** 道岔取消限速*/
|
||||
return OperationEvent.Switch.cancelSpeed.order.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
|
||||
/** 区段设置限速*/
|
||||
return OperationEvent.Section.setSpeed.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
|
||||
/** 区段取消限速*/
|
||||
return OperationEvent.Section.cancelSpeed.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
|
||||
/** 道岔设置限速*/
|
||||
return OperationEvent.Switch.setSpeed.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
|
||||
/** 道岔取消限速*/
|
||||
return OperationEvent.Switch.cancelSpeed.confirm1.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
|
||||
/** 区段设置限速*/
|
||||
return OperationEvent.Section.setSpeed.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
|
||||
/** 区段取消限速*/
|
||||
return OperationEvent.Section.cancelSpeed.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
|
||||
/** 道岔设置限速*/
|
||||
return OperationEvent.Switch.setSpeed.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
|
||||
/** 道岔设置限速*/
|
||||
return OperationEvent.Switch.cancelSpeed.confirm2.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
|
||||
/** 区段设置限速*/
|
||||
return OperationEvent.Section.setSpeed.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
|
||||
/** 区段取消限速*/
|
||||
return OperationEvent.Section.cancelSpeed.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
|
||||
/** 道岔设置限速*/
|
||||
return OperationEvent.Switch.setSpeed.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
|
||||
/** 道岔取消限速*/
|
||||
return OperationEvent.Switch.cancelSpeed.stop.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
isCancelSpeed() {
|
||||
return this.operation == OperationEvent.Section.cancelSpeed.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.cancelSpeed.menu.operation;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
cmdDisabled: {
|
||||
handler(val, oldVal) {
|
||||
this.spdDisabled = false;
|
||||
val.forEach((elem, index) => {
|
||||
// 取消操作禁止选择限速,并跳过该步骤
|
||||
if (elem == false && index >= 1 || this.isCancelSpeed) {
|
||||
this.spdDisabled = true;
|
||||
}
|
||||
|
||||
// 在确定1之前的操作才可终止
|
||||
if (elem == false && index >= 1) {
|
||||
this.stpDisabled = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
'formData.SpeedLimit_Value': function (val) {
|
||||
if (val) this.cmdDisabled[0] = false;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
this.timer = setInterval(() => {
|
||||
if (!this.$store.state.menuOperation.break) {
|
||||
if (this.timeCountCommand > 0) {
|
||||
this.timeCountCommand--;
|
||||
} else if (this.timeCountCommand == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountCommand = -1;
|
||||
}
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected, tempData) {
|
||||
if (!this.dialogShow) {
|
||||
this.name = '';
|
||||
this.stationName = '';
|
||||
if (selected) {
|
||||
if (operate.operation == OperationEvent.Section.setSpeed.menu.operation ||
|
||||
operate.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
if (selected.type === '02') {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.name += section.name;
|
||||
}
|
||||
}
|
||||
this.name += selected.name;
|
||||
}
|
||||
} else if (operate.operation == OperationEvent.Switch.setSpeed.menu.operation ||
|
||||
operate.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
|
||||
if (selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
this.name = selected.name;
|
||||
}
|
||||
}
|
||||
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
|
||||
this.formData.SpeedLimit_Value = '';
|
||||
this.tableData = [];
|
||||
this.selected = selected;
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [true, true, true];
|
||||
this.stpDisabled = true;
|
||||
this.order = 0;
|
||||
this.operation = operate.operation;
|
||||
this.setMessage(this.$t('tip.selectSpeedLimitValueTip'));
|
||||
if (this.isCancelSpeed) {
|
||||
this.formData.SpeedLimit_Value = `${tempData}`;
|
||||
this.spdDisabled = true;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
speedSelectChange(val) {
|
||||
const operate = {
|
||||
val: val
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
|
||||
/** 区段设置限速*/
|
||||
operate.operation = OperationEvent.Section.setSpeed.choose.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
|
||||
/** 道岔设置限速*/
|
||||
operate.operation = OperationEvent.Switch.setSpeed.choose.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.releaseTip'));
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
}
|
||||
});
|
||||
},
|
||||
command() {
|
||||
const operate = {};
|
||||
|
||||
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
|
||||
/** 区段设置限速*/
|
||||
operate.operation = OperationEvent.Section.setSpeed.order.operation;
|
||||
operate.message = this.$t('menu.in') + `【${this.name}】` + this.$t('menu.sectionSetLimitPrefix') + `${this.formData.SpeedLimit_Value}` + this.$t('menu.sectionLimitSuffix');
|
||||
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
|
||||
/** 区段取消限速*/
|
||||
operate.operation = OperationEvent.Section.cancelSpeed.order.operation;
|
||||
operate.message = this.$t('menu.in') + `【${this.name}】` + this.$t('menu.sectionCancelLimitPrefix') + `${this.formData.SpeedLimit_Value}` + this.$t('menu.sectionLimitSuffix');
|
||||
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
|
||||
/** 道岔设置限速*/
|
||||
operate.operation = OperationEvent.Switch.setSpeed.order.operation;
|
||||
operate.message = this.$t('menu.in') + `【${this.name}】` + this.$t('menu.switchSetLimitPrefix') + `${this.formData.SpeedLimit_Value}` + this.$t('menu.sectionLimitSuffix');
|
||||
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
|
||||
/** 道岔取消限速*/
|
||||
operate.operation = OperationEvent.Switch.cancelSpeed.order.operation;
|
||||
operate.message = this.$t('menu.in') + `【${this.name}】` + this.$t('menu.switchCancelLimitPrefix') + `${this.formData.SpeedLimit_Value}` + this.$t('menu.sectionLimitSuffix');
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') });
|
||||
this.$refs.confirmControlSpeed.doShow(operate, this.selected);
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
confirm1() {
|
||||
const operate = {};
|
||||
|
||||
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
|
||||
/** 区段设置限速*/
|
||||
operate.operation = OperationEvent.Section.setSpeed.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
|
||||
/** 区段取消限速*/
|
||||
operate.operation = OperationEvent.Section.cancelSpeed.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
|
||||
/** 道岔设置限速*/
|
||||
operate.operation = OperationEvent.Switch.setSpeed.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
|
||||
/** 道岔取消限速*/
|
||||
operate.operation = OperationEvent.Switch.cancelSpeed.confirm1.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.secondConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = 10;
|
||||
this.setButtonEnable({ step: 2 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
const operate = {
|
||||
val: this.formData.SpeedLimit_Value,
|
||||
param: this.formData
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
|
||||
/** 区段设置限速*/
|
||||
operate.operation = OperationEvent.Section.setSpeed.confirm2.operation;
|
||||
operate.cmdType = CMD.Section.CMD_SECTION_SET_LIMIT_SPEED;
|
||||
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
|
||||
/** 区段取消限速*/
|
||||
operate.operation = OperationEvent.Section.cancelSpeed.confirm2.operation;
|
||||
operate.cmdType = CMD.Section.CMD_SECTION_SET_LIMIT_SPEED;
|
||||
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
|
||||
/** 道岔设置限速*/
|
||||
operate.operation = OperationEvent.Switch.setSpeed.confirm2.operation;
|
||||
operate.cmdType = CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED;
|
||||
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
|
||||
/** 道岔取消限速*/
|
||||
operate.operation = OperationEvent.Switch.cancelSpeed.confirm2.operation;
|
||||
operate.cmdType = CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED;
|
||||
}
|
||||
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
stop() {
|
||||
const operate = {};
|
||||
|
||||
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
|
||||
/** 区段设置限速*/
|
||||
operate.operation = OperationEvent.Section.setSpeed.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
|
||||
/** 区段取消限速*/
|
||||
operate.operation = OperationEvent.Section.cancelSpeed.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
|
||||
/** 道岔设置限速*/
|
||||
operate.operation = OperationEvent.Switch.setSpeed.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
|
||||
/** 道岔取消限速*/
|
||||
operate.operation = OperationEvent.Switch.cancelSpeed.stop.operation;
|
||||
}
|
||||
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
close() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickToClose'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
if (operate.step) {
|
||||
this.setButtonEnable({ step: operate.step });
|
||||
}
|
||||
},
|
||||
setButtonEnable(param) {
|
||||
this.cmdDisabled = [true, true, true];
|
||||
if (param && param.step >= 0) {
|
||||
this.cmdDisabled[param.step] = false;
|
||||
}
|
||||
},
|
||||
setMessage(message) {
|
||||
this.message = message;
|
||||
},
|
||||
writeRecord(param) {
|
||||
this.tableData.push(param);
|
||||
},
|
||||
editRecord(param) {
|
||||
this.tableData.forEach(elem => {
|
||||
if (elem.order == param.order) {
|
||||
for (var prop in param) {
|
||||
elem[prop] = param[prop];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
253
src/jmapNew/theme/haerbin_01/menus/dialog/standBackStrategy.vue
Normal file
253
src/jmapNew/theme/haerbin_01/menus/dialog/standBackStrategy.vue
Normal file
@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-run-level"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="500px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{ $t('menu.stationStandStatus') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<div style="height: 32px;">
|
||||
<el-radio
|
||||
v-model="standStatus"
|
||||
label="02"
|
||||
style="line-height: 32px;"
|
||||
:style="{color: standStatus == '02' ? '' : 'red'}"
|
||||
disabled
|
||||
>{{ $t('menu.upDirection') }}</el-radio>
|
||||
<el-radio
|
||||
v-model="standStatus"
|
||||
label="01"
|
||||
style="line-height: 32px;"
|
||||
:style="{color: standStatus == '01' ? '' : 'red'}"
|
||||
disabled
|
||||
>{{ $t('menu.downDirection') }}</el-radio>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{ $t('menu.stationStandStatus') }}</span>
|
||||
<el-table ref="tempData" :data="tempData" border style="width: 100%; height: 170px;" size="mini">
|
||||
<el-table-column prop="name" :width="170" :label="this.$t('menu.switchbackStation')" />
|
||||
<el-table-column prop="station" :label="this.$t('menu.switchbackPlatform')" />
|
||||
<el-table-column prop="strategy" :label="this.$t('menu.switchbackStrategy')">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
:id="domIdChoose"
|
||||
v-model="scope.row.strategy"
|
||||
size="mini"
|
||||
@change="strategySelectChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in strategyList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<span v-if="isSelect && tempData.length">{{ $t('menu.switchbackStrategyTip') }}</span>
|
||||
<span v-if="isConfirm && tempData.length">{{ $t('menu.setSwitchbackStrategyTipPrefix') + tempData[0].name + $t('menu.setSwitchbackStrategyTipSuffix') }}</span>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit">
|
||||
{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'StandBackStrategy',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
strategyList: [
|
||||
{
|
||||
value: '01',
|
||||
label: this.$t('menu.noSwitchback')
|
||||
},
|
||||
{
|
||||
value: '02',
|
||||
label: this.$t('menu.noOneSwitchback')
|
||||
},
|
||||
{
|
||||
value: '03',
|
||||
label: this.$t('menu.automaticChange')
|
||||
},
|
||||
{
|
||||
value: '04',
|
||||
label: this.$t('menu.default')
|
||||
}
|
||||
],
|
||||
stationName: '',
|
||||
standStatus: '',
|
||||
selection: [],
|
||||
isSelect: true,
|
||||
isConfirm: false,
|
||||
strategy: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setBackStrategy.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setBackStrategy.choose.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.setSwitchbackStrategy');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(selected, opts) {
|
||||
this.tempData = [];
|
||||
const station = this.stationList.find(n => n.code == selected.stationCode);
|
||||
this.tempData.push({ name: station.name, station: selected.name, strategy: opts.reentryStrategy });
|
||||
},
|
||||
doShow(operate, selected, opts) {
|
||||
if (!this.dialogShow) {
|
||||
this.standStatus = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standStatus = selected.direction;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.loadInitData(selected, opts);
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.check && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.disabledSend = !selection.length;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.selection = selection;
|
||||
}
|
||||
},
|
||||
strategySelectChange(strategy) {
|
||||
const operate = {
|
||||
operation: OperationEvent.StationStand.setBackStrategy.choose.operation,
|
||||
val: `${strategy}`
|
||||
};
|
||||
|
||||
this.strategy = strategy;
|
||||
this.isSelect = false;
|
||||
this.isConfirm = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.isConfirm) {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.menu.operation,
|
||||
val: `${this.strategy}`,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY,
|
||||
param:{
|
||||
Stand_ReentryStrategy:this.strategy
|
||||
}
|
||||
};
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
271
src/jmapNew/theme/haerbin_01/menus/dialog/standControl.vue
Normal file
271
src/jmapNew/theme/haerbin_01/menus/dialog/standControl.vue
Normal file
@ -0,0 +1,271 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-detain-train"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="context">
|
||||
<span>{{ preContext }}{{ standName }}</span>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'StandDetainTrain',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
standName: '',
|
||||
selected: null,
|
||||
operation: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.detainTrain');
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.cancelDetainTrain');
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrainForce.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.cancelDetainTrainForce');
|
||||
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.earlyDeparture');
|
||||
} else if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.setJumpStop');
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.cancelJumpStop');
|
||||
}
|
||||
return '';
|
||||
},
|
||||
preContext() {
|
||||
return this.title + ':';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(step, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
if (selected) {
|
||||
this.standName = selected.name;
|
||||
}
|
||||
|
||||
this.selected = selected;
|
||||
this.operation = step.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
|
||||
/** 设置扣车*/
|
||||
this.setDetainTrain();
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
|
||||
/** 取消扣车*/
|
||||
this.cancelDetainTrain();
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrainForce.menu.operation) {
|
||||
/** 强制取消扣车*/
|
||||
this.cancelDetainTrainForce();
|
||||
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
|
||||
/** 提前发车*/
|
||||
this.earlyDeparture();
|
||||
} else if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) {
|
||||
/** 设置跳停*/
|
||||
this.setJumpStop();
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) {
|
||||
/** 取消跳停*/
|
||||
this.cancelJumpStop();
|
||||
}
|
||||
},
|
||||
// 设置扣车
|
||||
setDetainTrain() {
|
||||
const step = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.setDetainTrain.menu.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', step).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
if (!valid) {
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
});
|
||||
},
|
||||
// 取消扣车
|
||||
cancelDetainTrain() {
|
||||
const step = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', step).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
if (!valid) {
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
});
|
||||
},
|
||||
// 强制取消扣车
|
||||
cancelDetainTrainForce() {
|
||||
const step = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', step).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
if (!valid) {
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
});
|
||||
},
|
||||
// 提前发车
|
||||
earlyDeparture() {
|
||||
const step = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.earlyDeparture.menu.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', step).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
});
|
||||
},
|
||||
// 设置跳停
|
||||
setJumpStop() {
|
||||
const step = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.setJumpStop.menu.operation,
|
||||
val: this.selected.direction, // 站台的上下行方向, 01:下行 /02:上行
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', step).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
});
|
||||
},
|
||||
// 取消跳停
|
||||
cancelJumpStop() {
|
||||
const step = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
|
||||
val: this.selected.direction, // 站台的上下行方向, 01:下行 /02:上行
|
||||
cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', step).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const step = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.loading = false;
|
||||
this.$store.dispatch('training/next', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.stand-detain-train .context {
|
||||
height: 80px !important;
|
||||
}
|
||||
</style>
|
180
src/jmapNew/theme/haerbin_01/menus/dialog/standDetail.vue
Normal file
180
src/jmapNew/theme/haerbin_01/menus/dialog/standDetail.vue
Normal file
@ -0,0 +1,180 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-detail"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{ $t('menu.platform') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-input v-model="standName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{ $t('menu.stationStandStatus') }}</span>
|
||||
<el-table ref="tempData" :data="tempData" border style="width: 100%" size="mini" highlight-current-row>
|
||||
<el-table-column prop="item" :width="140" :label="this.$t('menu.item')" />
|
||||
<el-table-column prop="status" :label="this.$t('global.status')" />
|
||||
</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">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { mapGetters } from 'vuex';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'StandDetail',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
stationName: '',
|
||||
standName: '',
|
||||
strategyMap: {
|
||||
'01': this.$t('menu.noSwitchback'),
|
||||
'02': this.$t('menu.noOneSwitchback'),
|
||||
'03': this.$t('menu.automaticChange'),
|
||||
'04': this.$t('menu.default')
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuStationStand.getStationStandStatus');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(selected, opts) {
|
||||
this.tempData = [];
|
||||
|
||||
const index = this.stationList.findIndex(n => n.code == selected.stationCode);
|
||||
let stationStand, station;
|
||||
if (selected.direction == '01') { // 下行
|
||||
// 下行时,此站不是最后一站
|
||||
if (index != 0) {
|
||||
stationStand = this.$store.getters['map/getDeviceByCode'](this.stationList[index - 1].code);
|
||||
station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
}
|
||||
} else {
|
||||
// 上行时,此站不是最后一站
|
||||
if (index != this.stationList.length - 1) {
|
||||
stationStand = this.$store.getters['map/getDeviceByCode'](this.stationList[index + 1].code);
|
||||
station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
}
|
||||
}
|
||||
|
||||
/** 01: 未设置扣车 02: 车站扣车 03: 中心扣车 04: 中心+车站扣车*/
|
||||
this.tempData.push({ item: this.$t('menu.stationDetainTrain'), status: opts.holdStatus == '02' || opts.holdStatus == '04' ? this.$t('menu.hasBeenSet') : this.$t('menu.notSet') });
|
||||
this.tempData.push({ item: this.$t('menu.centerDetainTrain'), status: opts.holdStatus == '03' || opts.holdStatus == '04' ? this.$t('menu.hasBeenSet') : this.$t('menu.notSet') });
|
||||
this.tempData.push({ item: this.$t('menu.stopTime'), status: opts.parkingTime != -1 ? opts.parkingTime : this.$t('menu.automatic2') });
|
||||
if (!stationStand || !station) {
|
||||
this.tempData.push({ item: this.$t('menu.runLevel'), status: this.$t('menu.automatic2') });
|
||||
} else {
|
||||
this.tempData.push({ item: this.$t('menu.runLevel'), status: opts.intervalRunTime > 0 ? this.$t('menu.to') + station.name + stationStand.name + this.$t('global.colon') + this.$t('menu.artificial') : this.$t('menu.to') + station.name + stationStand.name + this.$t('menu.automatic2') });
|
||||
}
|
||||
this.tempData.push({ item: this.$t('menu.jumpStop'), status: opts.jumpStopStatus != '01' ? this.$t('menu.hasBeenSet') : this.$t('menu.notSet') });
|
||||
this.tempData.push({ item: this.$t('menu.downSwitchbackStrategy'), status: this.strategyMap[opts.reentryStrategy] ? this.strategyMap[opts.reentryStrategy] : this.$t('menu.default') });
|
||||
},
|
||||
doShow(operate, selected, opts) {
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.loadInitData(selected, opts);
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -0,0 +1,192 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-detain-train-all"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="390px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-radio-group style="padding: 10px 20px; border: 1px double lightgray;width:100%;">
|
||||
<span class="base-label" style="font-size:14px;">{{ $t('menu.range') }}</span>
|
||||
<el-row>
|
||||
<el-radio-group v-model="upDown" style="width:100%;" @change="choose">
|
||||
<el-col :span="11">
|
||||
<el-radio :id="upDown == '01' ? domIdChoose : ''" label="02">{{ $t('menu.uplinkBroadly') }}</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="1">
|
||||
<el-radio :id="upDown == '02' ? domIdChoose : ''" label="01">{{ $t('menu.downlinkBroadly') }}</el-radio>
|
||||
</el-col>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
</el-radio-group>
|
||||
|
||||
<div class="table">
|
||||
<span>{{ $t('menu.detainTrainStationList') }}</span>
|
||||
<el-table
|
||||
ref="tempData"
|
||||
:data="tempData"
|
||||
border
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
:empty-text="this.$t('menu.allStationsHaveNoDetainTrainStatus')"
|
||||
height="160"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column prop="stationName" :label="this.$t('menu.stationName')" />
|
||||
<el-table-column prop="standName" :width="140" :label="this.$t('menu.detainTrainStation')" />
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="disabled" @click="commit">{{ $t('global.confirm') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'StandDetainTrainAll',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
upDown: '01',
|
||||
tempData: [],
|
||||
disabled: true,
|
||||
operation: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.cancelDetainTrainAll.choose.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.cancelDetainTrainAll.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.cancelDetainTrainAll');
|
||||
} else {
|
||||
return this.$t('menu.menuStationStand.cancelJumpStopAll');
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadTableData() {
|
||||
this.tempData = [];
|
||||
this.stationStandList.forEach(elem => {
|
||||
/** status 01: 未扣车*/
|
||||
const stand = (this.$store.getters['map/getDeviceByCode'](elem.code) || {}).status;
|
||||
const station = (this.$store.getters['map/getDeviceByCode'](elem.stationCode) || {});
|
||||
if (station && station.visible && stand && stand.holdStatus != '01' && Number(elem.direction) == Number(this.upDown)) {
|
||||
this.tempData.push({ stationName: station.name, standName: elem.name });
|
||||
}
|
||||
});
|
||||
|
||||
// 如果存在未扣车的情况,才可以做此操作
|
||||
if (this.tempData.length > 0) {
|
||||
this.disabled = false;
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
// 不是断点激活的菜单应该将状态初始化
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.upDown = selected.direction;
|
||||
this.loadTableData();
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
choose(upDown) {
|
||||
this.loadTableData();
|
||||
const operate = {
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.choose.operation,
|
||||
val: `${upDown}`
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN,
|
||||
val: this.upDown,
|
||||
param: {
|
||||
Stand_AllLine: this.upDown
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
276
src/jmapNew/theme/haerbin_01/menus/dialog/standRunLevel.vue
Normal file
276
src/jmapNew/theme/haerbin_01/menus/dialog/standRunLevel.vue
Normal file
@ -0,0 +1,276 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-run-level"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="500px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{ $t('menu.platform') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-input v-model="standName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{ $t('menu.stationStandStatus') }}</span>
|
||||
<el-table ref="tempData" :data="tempData" border style="width: 100%; height: 170px;" size="mini">
|
||||
<el-table-column prop="name" :width="210" :label="this.$t('menu.nextPlatform')" />
|
||||
<el-table-column prop="time" :label="this.$t('menu.intervalRunningTime')">
|
||||
<template slot-scope="scope">
|
||||
<el-select :id="domIdChoose" v-model="scope.row.time" size="mini" @change="timeSelectChange">
|
||||
<el-option
|
||||
v-for="item in timeList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="check" :label="this.$t('menu.alwaysEffective')">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox :id="domIdCheck" ref="check" v-model="scope.row.check" @change="checkChange" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<span v-if="isSelect && tempData.length">{{ $t('menu.setRunLevelTip') }}</span>
|
||||
<span v-if="isConfirm && tempData.length">{{ $t('menu.setRunLevelStationTip') + tempData[0].name }}</span>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit">
|
||||
{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { mapGetters } from 'vuex';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'StandRunLevel',
|
||||
components: {
|
||||
ConfirmControl
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
maxRunLevel: 300,
|
||||
stationName: '',
|
||||
standName: '',
|
||||
selection: [],
|
||||
isSelect: true,
|
||||
isConfirm: false,
|
||||
time: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList',
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.choose.domId : '';
|
||||
},
|
||||
domIdCheck() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.check.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuStationStand.setRunLevel');
|
||||
},
|
||||
timeList() {
|
||||
const list = [
|
||||
{ value: 0, label: this.$t('menu.automatic2') },
|
||||
{ value: 1, label: '1' }
|
||||
];
|
||||
for (var i = 60; i <= this.maxRunLevel; i++) {
|
||||
list.push({ value: i, label: `${i}` });
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 深度数据状态
|
||||
tempData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(selected, opts) {
|
||||
this.tempData = [];
|
||||
const index = this.stationList.findIndex(n => n.code == selected.stationCode);
|
||||
if (selected.direction == '01') { // 下行
|
||||
// 下行时,此站不是最后一站
|
||||
if (index != 0) {
|
||||
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
|
||||
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
this.tempData.push({ name: `${stationStand.name}(${station.name})`, time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus });
|
||||
}
|
||||
} else {
|
||||
// 上行时,此站不是最后一站
|
||||
if (index != this.stationList.length) {
|
||||
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
|
||||
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
this.tempData.push({ name: `${stationStand.name}(${station.name})`, time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus });
|
||||
}
|
||||
}
|
||||
},
|
||||
doShow(operate, selected, opts) {
|
||||
// 如果不是断点激活窗口,而是第一次显示窗口时,需要初始化窗口数据
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.loadInitData(selected, opts);
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.check && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.disabledSend = !selection.length;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.selection = selection;
|
||||
}
|
||||
},
|
||||
timeSelectChange(time) {
|
||||
const operate = {
|
||||
operation: OperationEvent.StationStand.setRunLevel.choose.operation,
|
||||
val: time.toString(),
|
||||
param: {
|
||||
Stand_RunLevel: time
|
||||
}
|
||||
};
|
||||
|
||||
this.time = time;
|
||||
this.isSelect = false;
|
||||
this.isConfirm = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
checkChange(check) {
|
||||
const operate = {
|
||||
operation: OperationEvent.StationStand.setRunLevel.check.operation,
|
||||
val: check.toString(),
|
||||
param: {
|
||||
Stand_AlwaysValid: !!this.tempData[0].check
|
||||
}
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.isConfirm) {
|
||||
const forver = !!this.tempData[0].check;
|
||||
const operate = {
|
||||
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
|
||||
val: [this.time, forver].join('::'),
|
||||
param:{
|
||||
Stand_AlwaysValid:forver,
|
||||
Stand_RunLevel:this.time
|
||||
},
|
||||
messages: [`${this.$t('menu.menuStationStand.setRunLevel')}${this.$t('global.colon')}${this.tempData[0].name}-${this.standName},${this.tempData[0].time == 0 ? this.$t('menu.runTimeAutomatically') : `${this.$t('menu.runningTimeIs')}${this.tempData[0].time}s`},${this.$t('menu.effectiveFrequencyIs')}${this.tempData[0].check ? this.$t('menu.alwaysEffective') : this.$t('menu.onceEffective')}`]
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmControl.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
});
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
265
src/jmapNew/theme/haerbin_01/menus/dialog/standStopTime.vue
Normal file
265
src/jmapNew/theme/haerbin_01/menus/dialog/standStopTime.vue
Normal file
@ -0,0 +1,265 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="430px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="11" :offset="2"><span>{{ $t('menu.platformName') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="standName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 60px;">
|
||||
<span class="base-label">{{ $t('menu.controlMode') }}</span>
|
||||
<div style=" position: relative; top:-10px;">
|
||||
<el-radio-group v-model="control" @change="chooseControl">
|
||||
<el-radio :id="control === '01'? '': domIdChoose1" label="01">{{ $t('menu.automatic2') }}</el-radio>
|
||||
<el-radio :id="control === '02'? '': domIdChoose1" label="02">{{ $t('menu.artificial') }}</el-radio>
|
||||
</el-radio-group>
|
||||
<el-input-number
|
||||
:id="domIdInput"
|
||||
v-model="time"
|
||||
:disabled="disabledInput"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
size="mini"
|
||||
style="width: 125px; padding-left:25px"
|
||||
@change="inputTime"
|
||||
/><span> {{ $t('global.second') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 0px 15px; height: 30px;">
|
||||
<div style=" position: relative; top:-5px;">
|
||||
<el-radio-group v-model="direction">
|
||||
<el-radio label="02" :disabled="disabledUp">{{ $t('menu.upDirection') }}</el-radio>
|
||||
<el-radio label="01" :disabled="disabledDown">{{ $t('menu.downDirection') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 10px 15px; border: 1px double lightgray; height: 60px;">
|
||||
<span class="base-label">{{ $t('menu.effectiveNumber') }}</span>
|
||||
<div style=" position: relative; top:-10px;">
|
||||
<el-radio-group v-model="effective" :disabled="disabledTime" @change="chooseEffective">
|
||||
<el-radio :id="effective === false? '': domIdChoose2" :label="false">{{ $t('menu.onceEffective') }}</el-radio>
|
||||
<el-radio :id="effective === true? '': domIdChoose2" :label="true">{{ $t('menu.alwaysEffective') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'StandStopTime',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
time: 0,
|
||||
control: '01',
|
||||
direction: '01',
|
||||
effective: false,
|
||||
selected: null,
|
||||
standName: '',
|
||||
stationName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.menu.domId : '';
|
||||
},
|
||||
domIdChoose1() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.choose1.domId : '';
|
||||
},
|
||||
domIdChoose2() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.choose2.domId : '';
|
||||
},
|
||||
domIdInput() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.input.domId : '';
|
||||
},
|
||||
disabledUp() {
|
||||
if (this.selected) {
|
||||
return this.selected.direction !== '02';
|
||||
}
|
||||
return true;
|
||||
},
|
||||
disabledDown() {
|
||||
if (this.selected) {
|
||||
return this.selected.direction !== '01';
|
||||
}
|
||||
return true;
|
||||
},
|
||||
disabledInput() {
|
||||
return this.control === '01'; // 如果是自动则不可以设置
|
||||
},
|
||||
disabledTime() {
|
||||
return this.control === '01'; // 如果是自动则不可以设置
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.stopTime');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected, tempDate) {
|
||||
// 如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.control = Number(tempDate.parkingTime) === -1 ? '01' : '02';
|
||||
this.time = Number(tempDate.parkingTime) === -1 ? 15 : Number(tempDate.parkingTime);
|
||||
this.effective = !!tempDate.parkingValidStatus;
|
||||
this.direction = selected.direction;
|
||||
this.selected = selected || {};
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
chooseControl(control) {
|
||||
/** 自动时的默认时间*/
|
||||
if (control == '01') {
|
||||
this.inputTime = 15;
|
||||
this.effective = true;
|
||||
}
|
||||
|
||||
const operate = {
|
||||
operation: OperationEvent.StationStand.setStopTime.choose1.operation,
|
||||
val: `${control}`,
|
||||
param: {
|
||||
Stand_StopControl: `${control}`
|
||||
}
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseEffective(effective) {
|
||||
const operate = {
|
||||
operation: OperationEvent.StationStand.setStopTime.choose2.operation,
|
||||
val: `${effective}`,
|
||||
param: {
|
||||
Stand_AlwaysValid: `${effective}`
|
||||
}
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
inputTime(time) {
|
||||
const operate = {
|
||||
repeat: true,
|
||||
operation: OperationEvent.StationStand.setStopTime.input.operation,
|
||||
val: `${time}`,
|
||||
param: {
|
||||
Stand_StopTime: `${time}`
|
||||
}
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
operation: OperationEvent.StationStand.setStopTime.menu.operation,
|
||||
val: [`${this.control}`, this.time, this.effective].join('::'),
|
||||
param:{
|
||||
Stand_StopControl:this.control,
|
||||
Stand_AlwaysValid:this.effective,
|
||||
Stand_StopTime:this.time
|
||||
},
|
||||
messages: [`${this.$t('menu.stopTime') + this.$t('global.colon') + this.stationName} - ${this.standName}, ${this.$t('menu.stopTimeIs')}${this.control == '01' ? this.$t('menu.automatic2') : this.time + this.$t('global.second')}, ${this.$t('menu.effectiveFrequencyIs')}${this.effective == false ? this.$t('menu.alwaysEffective') : this.$t('menu.onceEffective')}`]
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmControl.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
406
src/jmapNew/theme/haerbin_01/menus/dialog/stationCmdControl.vue
Normal file
406
src/jmapNew/theme/haerbin_01/menus/dialog/stationCmdControl.vue
Normal file
@ -0,0 +1,406 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm station-cmd-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="840px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">{{ $t('menu.commandInformation') }}</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-form-item :label="this.$t('menu.type')" label-width="40px">
|
||||
<el-select v-model="operation" size="small" disabled style="width:230px">
|
||||
<el-option
|
||||
v-for="option in typeList"
|
||||
:key="option.code"
|
||||
:label="option.name"
|
||||
:value="option.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="11">
|
||||
<el-form-item :label="this.$t('menu.stationName')" label-width="100px">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table
|
||||
ref="tempData"
|
||||
class="table"
|
||||
:data="tempData"
|
||||
border
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
height="200"
|
||||
>
|
||||
<el-table-column prop="order" :width="110" :label="this.$t('menu.serialNumber2')" />
|
||||
<el-table-column prop="date" :width="160" :label="this.$t('menu.time')" />
|
||||
<el-table-column prop="context" :width="180" :label="this.$t('menu.implementationProcess')" />
|
||||
<el-table-column prop="result" :label="this.$t('menu.executionResult')" />
|
||||
</el-table>
|
||||
<span class="notice">{{ message }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="3">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">{{ $t('menu.release') }}<span
|
||||
v-show="timeCountCommand>0"
|
||||
>({{ timeCountCommand }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdConfirm1" type="primary" style="width:120px;" :disabled="cmdDisabled[1]" @click="confirm1">{{ $t('menu.firstConfirm') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">{{ $t('menu.secondConfirm') }}<span
|
||||
v-show="timeCountConfirm>0"
|
||||
>({{ timeCountConfirm }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">{{ $t('menu.suspend') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdClose" @click="close">{{ $t('global.close') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { now } from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'StationCmdControl',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
backOperate: '',
|
||||
order: 0,
|
||||
row: null,
|
||||
timer: null,
|
||||
operation: '',
|
||||
cmdDisabled: [true, true, true],
|
||||
stpDisabled: true,
|
||||
tempData: [],
|
||||
message: '',
|
||||
timeCountCommand: -1,
|
||||
timeCountConfirm: -1,
|
||||
stationName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Station.powerUnLock.menu.operation, name: this.$t('menu.menuStation.powerUnLock') },
|
||||
{ code: OperationEvent.Station.execKeyOperationTest.menu.operation, name: this.$t('menu.menuStation.execKeyOperationTest') }
|
||||
];
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
return OperationEvent.Station.powerUnLock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
return OperationEvent.Station.execKeyOperationTest.order.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
return OperationEvent.Station.powerUnLock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
return OperationEvent.Station.execKeyOperationTest.confirm1.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
return OperationEvent.Station.powerUnLock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
return OperationEvent.Station.execKeyOperationTest.confirm2.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
return OperationEvent.Station.powerUnLock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
return OperationEvent.Station.execKeyOperationTest.stop.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
return this.$t('menu.signalDeblocking');
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
return this.$t('menu.menuStation.execKeyOperationTest');
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
cmdDisabled: {
|
||||
handler(val, oldVal) {
|
||||
this.stpDisabled = true;
|
||||
val.forEach((elem, index) => {
|
||||
// 在确定1之前的操作才可以终止
|
||||
if (elem == false && index >= 1 && index <= 2) {
|
||||
this.stpDisabled = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
this.timer = setInterval(() => {
|
||||
if (!this.$store.state.menuOperation.break) {
|
||||
if (this.timeCountCommand > 0) {
|
||||
this.timeCountCommand--;
|
||||
} else if (this.timeCountCommand == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountCommand = -1;
|
||||
}
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
|
||||
this.stationName = selected.name;
|
||||
}
|
||||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation;
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
this.stpDisabled = true;
|
||||
this.dialogShow = true;
|
||||
this.setMessage(this.$t('tip.releaseTip'));
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
command() {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation ||
|
||||
this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
} else {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
},
|
||||
commandNoPopUp() {
|
||||
const operate = {
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
operate.operation = OperationEvent.Station.powerUnLock.order.operation;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
operate.operation = OperationEvent.Station.execKeyOperationTest.order.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
confirm1() {
|
||||
const operate = {
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
operate.operation = OperationEvent.Station.powerUnLock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
operate.operation = OperationEvent.Station.execKeyOperationTest.confirm1.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.secondConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = 10;
|
||||
this.setButtonEnable({ step: 2 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
const operate = {
|
||||
over: true
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
operate.operation = OperationEvent.Station.powerUnLock.confirm2.operation;
|
||||
// operate.cmdType = CMD.Station.powerUnLock;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
operate.operation = OperationEvent.Station.execKeyOperationTest.confirm2.operation;
|
||||
// operate.cmdType = CMD.Station.execKeyOperationTest;
|
||||
}
|
||||
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
stop() {
|
||||
const operate = {
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
operate.operation = OperationEvent.Station.powerUnLock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
operate.operation = OperationEvent.Station.execKeyOperationTest.stop.operation;
|
||||
}
|
||||
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
close() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
/** 弹框返回值处理*/
|
||||
},
|
||||
setButtonEnable(param) {
|
||||
this.cmdDisabled = [true, true, true];
|
||||
if (param && param.step >= 0) {
|
||||
this.cmdDisabled[param.step] = false;
|
||||
}
|
||||
},
|
||||
setMessage(message) {
|
||||
this.message = message;
|
||||
},
|
||||
writeRecord(param) {
|
||||
this.tempData.push(param);
|
||||
},
|
||||
editRecord(param) {
|
||||
this.tempData.forEach(elem => {
|
||||
if (elem.order == param.order) {
|
||||
for (var prop in param) {
|
||||
elem[prop] = param[prop];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm station-human-control-all"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="430px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div class="context">
|
||||
<span>{{ title }}</span>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'StationHumanControlAll',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operation: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.fullConcentrationStationAccessManualControl');
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Station.humanControlALL.menu.domId : '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Station.humanControlALL.menu.operation,
|
||||
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.station-human-control-all .context {
|
||||
padding-bottom: 40px !important;
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm station-set-route-control-all"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="450px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div style="padding: 0px 10px">
|
||||
<el-form ref="form" size="small" label-width="110px" label-position="left">
|
||||
<el-form-item :label="this.$t('menu.concentratedStationName')" prop="stationName">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-radio-group v-model="mode">
|
||||
<el-row>
|
||||
<el-radio :label="true">{{ $t('menu.checkConflict') }}</el-radio>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-radio :label="false">{{ $t('menu.notCheckConflict') }}</el-radio>
|
||||
</el-row>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'StationSetRouteControlAll',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operation: null,
|
||||
stationName: '',
|
||||
mode: true
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.fullConcentrationStationSettingAccessControlMode');
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Station.atsAutoControlALL.menu.domId : '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operation = operate.operation;
|
||||
this.stationName = '';
|
||||
if (selected) {
|
||||
this.stationName = selected.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Station.atsAutoControlALL.menu.operation,
|
||||
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING,
|
||||
val: this.mode,
|
||||
param: {
|
||||
CheckConflict: this.mode
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.station-set-route-control-all .context {
|
||||
padding-bottom: 40px !important;
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
</style>
|
482
src/jmapNew/theme/haerbin_01/menus/dialog/switchCmdControl.vue
Normal file
482
src/jmapNew/theme/haerbin_01/menus/dialog/switchCmdControl.vue
Normal file
@ -0,0 +1,482 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm switch-cmd-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="840px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">{{ $t('menu.commandInformation') }}</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.type')" label-width="40px">
|
||||
<el-select v-model="operation" size="small" disabled>
|
||||
<el-option
|
||||
v-for="option in typeList"
|
||||
:key="option.code"
|
||||
:label="option.name"
|
||||
:value="option.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.stationName')" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.switchName')" label-width="80px">
|
||||
<el-input v-model="switchName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table
|
||||
ref="tempData"
|
||||
class="table"
|
||||
:data="tempData"
|
||||
border
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
height="200"
|
||||
>
|
||||
<el-table-column prop="order" :width="110" :label="this.$t('menu.serialNumber2')" />
|
||||
<el-table-column prop="date" :width="160" :label="this.$t('menu.time')" />
|
||||
<el-table-column prop="context" :width="180" :label="this.$t('menu.implementationProcess')" />
|
||||
<el-table-column prop="result" :label="this.$t('menu.executionResult')" />
|
||||
</el-table>
|
||||
<span class="notice">{{ message }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="3">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">{{ $t('menu.release') }}<span
|
||||
v-show="timeCountCommand>0"
|
||||
>({{ timeCountCommand }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdConfirm1" type="primary" style="width:120px;" :disabled="cmdDisabled[1]" @click="confirm1">{{ $t('menu.firstConfirm') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">{{ $t('menu.secondConfirm') }}<span
|
||||
v-show="timeCountConfirm>0"
|
||||
>({{ timeCountConfirm }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">{{ $t('menu.suspend') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdClose" @click="close">{{ $t('global.close') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { now } from '@/utils/date';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'SwitchCmdControl',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
backOperate: '',
|
||||
selected: '',
|
||||
order: 0,
|
||||
row: null,
|
||||
timer: null,
|
||||
operation: '',
|
||||
cmdDisabled: [true, true, true],
|
||||
stpDisabled: true,
|
||||
tempData: [],
|
||||
message: '',
|
||||
timeCountCommand: -1,
|
||||
timeCountConfirm: -1,
|
||||
stationName: '',
|
||||
switchName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Switch.unlock.menu.operation, name: this.$t('menu.menuSwitch.switchUnlock') },
|
||||
{ code: OperationEvent.Switch.unblock.menu.operation, name: this.$t('menu.menuSwitch.switchSectionUnblock') },
|
||||
{ code: OperationEvent.Switch.fault.menu.operation, name: this.$t('menu.menuSwitch.switchMalfunctionUnlock') },
|
||||
{ code: OperationEvent.Switch.axlePreReset.menu.operation, name: this.$t('menu.menuSwitch.switchSectionAxisPreReset') }
|
||||
];
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
return OperationEvent.Switch.unblock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.order.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
return OperationEvent.Switch.unblock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.confirm1.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
return OperationEvent.Switch.unblock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.confirm2.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
return OperationEvent.Switch.unblock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.stop.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
return '道岔单解';
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
return '道岔解封';
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
return '道岔故障解锁';
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
return '道岔计轴复位';
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
cmdDisabled: {
|
||||
handler(val, oldVal) {
|
||||
this.stpDisabled = true;
|
||||
val.forEach((elem, index) => {
|
||||
// 在确定1之前的操作才可以终止
|
||||
if (elem == false && index >= 1 && index <= 2) {
|
||||
this.stpDisabled = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
this.timer = setInterval(() => {
|
||||
if (!this.$store.state.menuOperation.break) {
|
||||
if (this.timeCountCommand > 0) {
|
||||
this.timeCountCommand--;
|
||||
} else if (this.timeCountCommand == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountCommand = -1;
|
||||
}
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
this.switchName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
this.selected = selected;
|
||||
}
|
||||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation;
|
||||
this.dialogShow = true;
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
this.stpDisabled = true;
|
||||
this.setMessage(this.$t('tip.releaseTip'));
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
command() {
|
||||
/** 道岔单解/道岔解封/道岔故障解锁/道岔计轴复位*/
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.unblock.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.fault.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.axlePreReset.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
} else {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
|
||||
},
|
||||
commandNoPopUp() {
|
||||
const operate = {
|
||||
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.order.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.order.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.order.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.order.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
confirm1() {
|
||||
const operate = {
|
||||
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.confirm1.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.secondConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = 10;
|
||||
this.setButtonEnable({ step: 2 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
const operate = {
|
||||
over: true
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm2.operation;
|
||||
operate.cmdType = CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.confirm2.operation;
|
||||
operate.cmdType = CMD.Switch.CMD_SWITCH_UNBLOCK;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.confirm2.operation;
|
||||
operate.cmdType = CMD.Switch.CMD_SWITCH_FAULT_UNLOCK;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.confirm2.operation;
|
||||
operate.cmdType = CMD.Switch.CMD_SWITCH_AXIS_PRE_RESET;
|
||||
}
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
stop() {
|
||||
const operate = {
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.stop.operation;
|
||||
}
|
||||
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
close() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
/** 弹框返回值处理*/
|
||||
},
|
||||
setButtonEnable(param) {
|
||||
this.cmdDisabled = [true, true, true];
|
||||
if (param && param.step >= 0) {
|
||||
this.cmdDisabled[param.step] = false;
|
||||
}
|
||||
},
|
||||
setMessage(message) {
|
||||
this.message = message;
|
||||
},
|
||||
writeRecord(param) {
|
||||
this.tempData.push(param);
|
||||
},
|
||||
editRecord(param) {
|
||||
this.tempData.forEach(elem => {
|
||||
if (elem.order == param.order) {
|
||||
for (var prop in param) {
|
||||
elem[prop] = param[prop];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
286
src/jmapNew/theme/haerbin_01/menus/dialog/switchControl.vue
Normal file
286
src/jmapNew/theme/haerbin_01/menus/dialog/switchControl.vue
Normal file
@ -0,0 +1,286 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm switch-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="300px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="11" :offset="2"><span>{{ $t('menu.switch') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="switchName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="activeShow" style="margin-top: 10px;">
|
||||
<el-col :span="11">
|
||||
<el-radio v-model="radio" label="1" :disabled="radio == 2" style="display: block; text-align: center;">
|
||||
{{ $t('menu.activation') }}</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-radio v-model="radio" label="2" :disabled="radio == 1" style="display: block; text-align: center;">
|
||||
{{ $t('menu.resection') }}</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'SwitchControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operation: '',
|
||||
stationName: '',
|
||||
switchName: '',
|
||||
radio: 1,
|
||||
activeShow: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
return this.$t('menu.menuSwitch.switchLock');
|
||||
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
|
||||
return this.$t('menu.menuSwitch.switchBlockade');
|
||||
} else if (this.operation == OperationEvent.Switch.turnout.menu.operation) {
|
||||
return this.$t('menu.menuSwitch.switchTurnout');
|
||||
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
|
||||
return this.$t('menu.menuSwitch.switchForcedPull');
|
||||
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
|
||||
return this.$t('menu.menuSwitch.sectionResection');
|
||||
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
|
||||
return this.$t('menu.menuSwitch.sectionActive');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
this.switchName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.operation = operate.operation;
|
||||
if (this.operation == OperationEvent.Switch.split.menu.operation) {
|
||||
this.activeShow = true;
|
||||
this.radio = '2';
|
||||
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
|
||||
this.activeShow = true;
|
||||
this.radio = '1';
|
||||
}
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
/** 道岔单锁*/
|
||||
this.lock();
|
||||
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
|
||||
/** 道岔封锁*/
|
||||
this.block();
|
||||
} else if (this.operation == OperationEvent.Switch.turnout.menu.operation) {
|
||||
/** 道岔转动*/
|
||||
this.turnout(this.operation);
|
||||
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
|
||||
/** 道岔强扳*/
|
||||
this.turnoutForce();
|
||||
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
|
||||
/** 区段激活*/
|
||||
this.split();
|
||||
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
|
||||
/** 区段激活*/
|
||||
this.active();
|
||||
}
|
||||
},
|
||||
// 道岔单锁
|
||||
lock() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Switch.lock.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 道岔封锁
|
||||
block() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Switch.block.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 道岔转动
|
||||
turnout(operation) {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Switch.turnout.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_TURN
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 道岔强扮
|
||||
turnoutForce() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Switch.turnoutForce.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_FORCE_TURN
|
||||
};
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 区段切除
|
||||
split() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Switch.split.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
|
||||
};
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 区段激活
|
||||
active() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Switch.active.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
|
||||
};
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
472
src/jmapNew/theme/haerbin_01/menus/dialog/trainControl.vue
Normal file
472
src/jmapNew/theme/haerbin_01/menus/dialog/trainControl.vue
Normal file
@ -0,0 +1,472 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag class="fuzhou-01__systerm train-control" :title="title" :visible.sync="show" width="370px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<el-form ref="form" size="small" label-width="120px" :model="formModel" :rules="rules">
|
||||
<el-form-item :label="this.$t('menu.groupNumber')+this.$t('global.colon')" prop="groupNumber">
|
||||
<el-select
|
||||
:id="domIdTrainNumber"
|
||||
v-model="formModel.groupNumber"
|
||||
filterable
|
||||
:disabled="trainNumberIsDisabled"
|
||||
@change="trainNumberChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="train in trainList"
|
||||
:key="train.groupNumber"
|
||||
:label="train.groupNumber"
|
||||
:value="train.groupNumber"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="trainType" label-width="0px">
|
||||
<el-radio-group
|
||||
:id="domIdTrainType"
|
||||
v-model="formModel.trainType"
|
||||
style="margin-left: 15px;"
|
||||
@change="trainTypeChange"
|
||||
>
|
||||
<el-radio :label="'01'">{{ $t('menu.planTrain') }}</el-radio>
|
||||
<el-radio :label="'02'">{{ $t('menu.headCodeTrain') }}</el-radio>
|
||||
<el-radio :label="'03'" style="margin-top:5px;">{{ $t('menu.artificialTrain') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formModel.trainType == '01'" prop="serviceNumber">
|
||||
<span slot="label">{{ $t('menu.serviceNumber') }}</span>
|
||||
<el-input
|
||||
:id="domIdServerNo"
|
||||
v-model="formModel.serviceNumber"
|
||||
:disabled="serverNoIsDisabled"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formModel.trainType == '01'" :label="this.$t('menu.tripNumber')+this.$t('global.colon')" prop="tripNumber">
|
||||
<el-input
|
||||
:id="domIdTrainNo"
|
||||
v-model="formModel.tripNumber"
|
||||
:disabled="trainNoIsDisabled"
|
||||
maxlength="4"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formModel.trainType == '01'" :label="this.$t('menu.targetCode')+this.$t('global.colon')" prop="targetCode">
|
||||
<el-input
|
||||
:id="domIdTargetCode"
|
||||
v-model="formModel.targetCode"
|
||||
:disabled="targetCodeIsDisabled"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formModel.trainType == '03'" :label="this.$t('menu.category')+this.$t('global.colon')" prop="category">
|
||||
<el-select
|
||||
:id="domIdTrainNumber"
|
||||
v-model="formModel.category"
|
||||
filterable
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in categoryList"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="istargetCode" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-train ref="confirmTrain" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import ConfirmTrain from './childDialog/confirmTrain';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import Handler from '@/scripts/cmdPlugin/Handler';
|
||||
|
||||
export default {
|
||||
name: 'TrainControl',
|
||||
components: {
|
||||
ConfirmTrain,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainList: [],
|
||||
categoryList: [
|
||||
{ name: 'MM', value: '01' }
|
||||
],
|
||||
formModel: {
|
||||
tripNumber: '',
|
||||
groupNumber: '',
|
||||
trainType: '01',
|
||||
serviceNumber: '',
|
||||
targetCode: '',
|
||||
category: 'MM'
|
||||
},
|
||||
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'change' }
|
||||
],
|
||||
trainType: [
|
||||
{ required: true, message: this.$t('rules.selectATrainType'), trigger: 'change' }
|
||||
],
|
||||
serviceNumber: [
|
||||
{ required: true, message: this.$t('rules.enterTheServiceNumber'), trigger: 'blur' }
|
||||
],
|
||||
tripNumber: [
|
||||
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
|
||||
],
|
||||
targetCode: [
|
||||
{ required: true, message: this.$t('rules.enterTheTargetCode'), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
direction: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
trainNoIsDisabled() {
|
||||
return false;
|
||||
},
|
||||
serverNoIsDisabled() {
|
||||
return true;
|
||||
},
|
||||
targetCodeIsDisabled() {
|
||||
return true;
|
||||
},
|
||||
trainNumberIsDisabled() {
|
||||
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return true;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
// trainTypeIsDisabled() {
|
||||
// if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
// return true;
|
||||
// }
|
||||
// return '';
|
||||
// },
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdTrainNumber() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.trainNumberChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.trainNumberChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdTrainNo() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.trainNoChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.trainNoChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdTrainType() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.trainTypeChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.trainTypeChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdServerNo() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.serverNoChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.serverNoChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdTargetCode() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.targetCodeChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.targetCodeChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.menu.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.menu.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return this.$t('menu.menuTrain.addTrainId');
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
return this.$t('menu.menuTrain.editTrainId');
|
||||
}
|
||||
return '';
|
||||
},
|
||||
istargetCode() {
|
||||
if (this.formModel.serviceNumber && this.formModel.targetCode) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'formModel.tripNumber': function(val) {
|
||||
if (val.length == 4) {
|
||||
this.trainNoChange(val);
|
||||
} else {
|
||||
this.formModel = {
|
||||
groupNumber: this.formModel.groupNumber,
|
||||
tripNumber: val,
|
||||
trainType: this.formModel.trainType,
|
||||
serviceNumber: '',
|
||||
targetCode: '',
|
||||
category: 'MM'
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {},
|
||||
doShow(operate, selected) {
|
||||
// 如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
const model = this.$store.getters['map/getDeviceByCode'](selected.code);
|
||||
this.formModel = {
|
||||
groupNumber: model.groupNumber,
|
||||
tripNumber: `${model.directionCode}${model.tripNumber}`,
|
||||
trainType: model.type,
|
||||
serviceNumber: model.serviceNumber,
|
||||
targetCode: model.targetCode,
|
||||
category: 'MM'
|
||||
};
|
||||
|
||||
/** 加载列车数据*/
|
||||
this.loadInitData(this.map);
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
trainNumberChange(groupNumber) {
|
||||
const operate = {
|
||||
|
||||
val: `${groupNumber}`,
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
trainTypeChange(trainType) {
|
||||
const operate = {
|
||||
|
||||
val: `${trainType}`,
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
trainNoChange(tripNumber) {
|
||||
const operate = {
|
||||
send: true,
|
||||
|
||||
val: tripNumber,
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
|
||||
operate.cmdType = CMD.Train.addTrainId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation;
|
||||
operate.cmdType = CMD.Train.editTrainId;
|
||||
}
|
||||
Handler.undo(1);
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
if (response.data) {
|
||||
this.formModel = {
|
||||
groupNumber: this.formModel.groupNumber,
|
||||
tripNumber: tripNumber,
|
||||
trainType: this.formModel.trainType,
|
||||
serviceNumber: response.data.serviceNumber,
|
||||
targetCode: response.data.targetCode,
|
||||
category: 'MM'
|
||||
};
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.formModel = {
|
||||
groupNumber: this.formModel.groupNumber,
|
||||
tripNumber: tripNumber,
|
||||
trainType: this.formModel.trainType,
|
||||
serviceNumber: '',
|
||||
targetCode: '',
|
||||
category: 'MM'
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 增加列车识别号*/
|
||||
this.addTrainId();
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
this.editTrainId();
|
||||
}
|
||||
},
|
||||
// 增加列车识别号
|
||||
addTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const model = this.formModel;
|
||||
const operate = {
|
||||
send: true,
|
||||
|
||||
operation: OperationEvent.Train.addTrainId.menu.operation,
|
||||
cmdType: CMD.Train.CMD_ADD_TRAIN_ID,
|
||||
messages: [this.$t('tip.addTrainIdTip')],
|
||||
val: `${model.groupNumber}::${model.trainType}::${model.serviceNumber}::${model.tripNumber}::${model.targetCode}`
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmTrain.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 修改列车识别号
|
||||
editTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
|
||||
operation: OperationEvent.Train.editTrainId.menu.operation,
|
||||
cmdType: CMD.Train.CMD_EDIT_TRAIN_ID,
|
||||
messages: [this.$t('tip.editTrainIdTip')],
|
||||
val: `${this.formModel.trainType}::${this.formModel.tripNumber}`
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmTrain.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
155
src/jmapNew/theme/haerbin_01/menus/dialog/trainCreate.vue
Normal file
155
src/jmapNew/theme/haerbin_01/menus/dialog/trainCreate.vue
Normal file
@ -0,0 +1,155 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag class="fuzhou-01__systerm route-create" :title="title" :visible.sync="show" width="380px" label-position="top" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<el-form size="small" label-width="100px">
|
||||
<el-form-item :label="this.$t('menu.train')+this.$t('global.colon')" prop="trainCode">
|
||||
<el-select v-model="trainCode" filterable :placeholder="this.$t('menu.train')">
|
||||
<el-option
|
||||
v-for="item in trainList"
|
||||
:key="item.code"
|
||||
:label="item.groupNumber"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="列车车次:" prop="tripNumber">
|
||||
<el-select v-model="tripNumber" filterable placeholder="列车车次">
|
||||
<el-option v-for="no in trainNoList" :key="no" :label="no" :value="no"></el-option>
|
||||
</el-select>
|
||||
<div style="font-size: 12px;">(上行路线车次号选择偶数,下行路线车次号选择基数)</div>
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="this.$t('menu.trainDirection')+this.$t('global.colon')" prop="direction">
|
||||
<el-select v-model="direction" filterable :placeholder="this.$t('menu.trainDirection')">
|
||||
<el-option v-for="no in directionList" :key="no.value" :label="no.label" :value="no.value" />
|
||||
</el-select>
|
||||
<!-- <div style="font-size: 12px;">(上行路线车次号选择偶数,下行路线车次号选择基数)</div> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col style="text-align: right;">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ this.$t('global.confirm') }}</el-button>
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ this.$t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'RouteCreate',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
trainList: [],
|
||||
trainNoList: [],
|
||||
directionList: [
|
||||
{
|
||||
value: '2',
|
||||
label: this.$t('menu.up')
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
label: this.$t('menu.down')
|
||||
}
|
||||
],
|
||||
trainCode: '',
|
||||
tripNumber: '',
|
||||
direction: '',
|
||||
selected: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return OperationEvent.Section.newtrain.menu.domId;
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.settingTrain');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map.trainList.length) {
|
||||
this.trainList = map.trainList;
|
||||
} else {
|
||||
this.$messageBox(this.$t('error.getTrainListFailed'));
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.selected = selected;
|
||||
/** 加载列车数据*/
|
||||
this.loadInitData(this.map);
|
||||
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.trainCode = '';
|
||||
this.direction = '';
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
send: true,
|
||||
|
||||
operation: OperationEvent.Section.newtrain.menu.operation,
|
||||
cmdType: CMD.Section.CMD_NEW_TRAIN,
|
||||
val: '' + this.direction + '::' + this.trainCode
|
||||
};
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
167
src/jmapNew/theme/haerbin_01/menus/dialog/trainDelete.vue
Normal file
167
src/jmapNew/theme/haerbin_01/menus/dialog/trainDelete.vue
Normal file
@ -0,0 +1,167 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
|
||||
<el-form-item :label="this.$t('menu.groupNumber')+this.$t('global.colon')" prop="groupNumber">
|
||||
<el-input :id="domIdTrainNumber" v-model="formModel.groupNumber" @change="trainNumberChange" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
// import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'TrainDelete',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
formModel: {
|
||||
groupNumber: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
|
||||
},
|
||||
domIdTrainNumber() {
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuTrain.deleteTrainId');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map) {
|
||||
// getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
// this.trainNoList = response.data;
|
||||
// }).catch(() => {
|
||||
// this.$messageBox(`获取列车车组号失败`);
|
||||
// });
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
// 如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
trainNumberChange() {
|
||||
const operate = {
|
||||
|
||||
val: `${this.formModel.groupNumber}`,
|
||||
operation: OperationEvent.Train.delTrainId.trainNumberChange.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation,
|
||||
cmdType: CMD.Train.CMD_DEL_TRAIN_ID,
|
||||
val: this.formModel.groupNumber
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
138
src/jmapNew/theme/haerbin_01/menus/dialog/trainEditNumber.vue
Normal file
138
src/jmapNew/theme/haerbin_01/menus/dialog/trainEditNumber.vue
Normal file
@ -0,0 +1,138 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="120px" :model="addModel" :rules="rules">
|
||||
<el-form-item :label="this.$t('menu.groupNumber')+this.$t('global.colon')" label-width="120px" prop="tripNumber">
|
||||
<el-input v-model="addModel.tripNumber" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'TrainMove',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
tripNumber: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
tripNumber: [
|
||||
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuTrain.editTrainNo');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
|
||||
operation: OperationEvent.Train.editTrainNo.menu.operation,
|
||||
cmdType: CMD.Train.CMD_EDIT_TRAIN_NO
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
background: rgba(0, 0, 0, x);
|
||||
position: relative;
|
||||
left: -5px;
|
||||
top: -18px;
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
201
src/jmapNew/theme/haerbin_01/menus/dialog/trainMove.vue
Normal file
201
src/jmapNew/theme/haerbin_01/menus/dialog/trainMove.vue
Normal file
@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="640px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
|
||||
<div style="width: 46%;">
|
||||
<el-form-item :label="this.$t('menu.groupNumber')+this.$t('global.colon')" label-width="95px" prop="tripNumber">
|
||||
<el-input v-model="addModel.tripNumber" disabled />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div style="overflow: hidden;">
|
||||
<div
|
||||
style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px; margin-right: 4%;"
|
||||
>
|
||||
<span class="base-label">{{ $t('menu.sourceTrainWindow') }}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item prop="stationStandSource">
|
||||
<span slot="label">{{ $t('menu.station') + $t('global.colon') }}</span>
|
||||
<el-select v-model="addModel.stationStandSource" filterable :placeholder="this.$t('global.choose')">
|
||||
<el-option
|
||||
v-for="item in stationStandList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('menu.trainWindow')+this.$t('global.colon')" prop="trainSource">
|
||||
<el-input v-model="addModel.trainSource" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;"
|
||||
>
|
||||
<span class="base-label">{{ $t('menu.targetTrainWindow') }}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item prop="stationStandGoal">
|
||||
<span slot="label">{{ $t('menu.station') + $t('global.colon') }}</span>
|
||||
<el-select v-model="addModel.stationStandGoal" filterable :placeholder="this.$t('global.choose')">
|
||||
<el-option
|
||||
v-for="item in stationStandList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('menu.trainWindow')+this.$t('global.colon')" prop="trainGoal">
|
||||
<el-input v-model="addModel.trainGoal" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'TrainMove',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
tripNumber: '',
|
||||
trainSource: '',
|
||||
stationStandSource: '',
|
||||
trainGoal: '',
|
||||
stationStandGoal: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
tripNumber: [
|
||||
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
|
||||
],
|
||||
trainSource: [
|
||||
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandSource: [
|
||||
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
|
||||
],
|
||||
trainGoal: [
|
||||
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandGoal: [
|
||||
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuTrain.moveTrainId');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
|
||||
operation: OperationEvent.Train.moveTrainId.menu.operation,
|
||||
cmdType: CMD.Train.CMD_MOVE_TRAIN_ID
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
background: rgba(0, 0, 0, x);
|
||||
position: relative;
|
||||
left: -5px;
|
||||
top: -18px;
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
206
src/jmapNew/theme/haerbin_01/menus/dialog/trainSwitch.vue
Normal file
206
src/jmapNew/theme/haerbin_01/menus/dialog/trainSwitch.vue
Normal file
@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="640px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
|
||||
<div style="overflow: hidden;">
|
||||
<div
|
||||
style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 177px; margin-right: 4%;"
|
||||
>
|
||||
<span class="base-label">{{ $t('menu.sourceTrainWindow') }}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item :label="this.$t('menu.groupNumber')+this.$t('global.colon')" prop="trainNumberSource">
|
||||
<el-input v-model="addModel.trainNumberSource" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="stationStandSource">
|
||||
<span slot="label">{{ $t('menu.station') + $t('global.colon') }}</span>
|
||||
<el-select v-model="addModel.stationStandSource" filterable :placeholder="this.$t('global.choose')">
|
||||
<el-option
|
||||
v-for="item in stationStandList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('menu.trainWindow')+this.$t('global.colon')" prop="trainSource">
|
||||
<el-input v-model="addModel.trainSource" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 177px;"
|
||||
>
|
||||
<span class="base-label">{{ $t('menu.targetTrainWindow') }}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item :label="this.$t('menu.groupNumber')+this.$t('global.colon')" prop="trainNumberGoal">
|
||||
<el-input v-model="addModel.trainNumberGoal" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="stationStandGoal">
|
||||
<span slot="label">{{ $t('menu.station') + $t('global.colon') }}</span>
|
||||
<el-select v-model="addModel.stationStandGoal" filterable :placeholder="this.$t('global.choose')">
|
||||
<el-option
|
||||
v-for="item in stationStandList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('menu.trainWindow')+this.$t('global.colon')" prop="trainGoal">
|
||||
<el-input v-model="addModel.trainGoal" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'TrainSwitch',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
trainNumberSource: '',
|
||||
trainSource: '',
|
||||
stationStandSource: '',
|
||||
trainGoal: '',
|
||||
stationStandGoal: '',
|
||||
trainNumberGoal: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
trainNumberSource: [
|
||||
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
|
||||
],
|
||||
trainSource: [
|
||||
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandSource: [
|
||||
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
|
||||
],
|
||||
trainNumberGoal: [
|
||||
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
|
||||
],
|
||||
trainGoal: [
|
||||
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandGoal: [
|
||||
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuTrain.switchTrainId');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
|
||||
operation: OperationEvent.Train.moveTrainId.menu.operation,
|
||||
cmdType: CMD.Train.CMD_MOVE_TRAIN_ID
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
background: rgba(0, 0, 0, x);
|
||||
position: relative;
|
||||
left: -5px;
|
||||
top: -18px;
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
356
src/jmapNew/theme/haerbin_01/menus/index.vue
Normal file
356
src/jmapNew/theme/haerbin_01/menus/index.vue
Normal file
@ -0,0 +1,356 @@
|
||||
<template>
|
||||
<div class="menus" :style="{width: width + 'px'}">
|
||||
<menu-cancel ref="menuCancel" />
|
||||
<template v-show="isShowAll">
|
||||
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
|
||||
<menu-station-stand ref="menuStationStand" :selected="selected" />
|
||||
<menu-switch ref="menuSwitch" :selected="selected" />
|
||||
<menu-signal ref="menuSignal" :selected="selected" />
|
||||
<menu-section ref="menuSection" :selected="selected" />
|
||||
<menu-train ref="menuTrain" :selected="selected" />
|
||||
<menu-station ref="menuStation" :selected="selected" />
|
||||
<passive-alarm ref="passiveAlarm" />
|
||||
<passive-contorl ref="passiveControl" />
|
||||
<passive-Timeout ref="passiveTimeout" />
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import MenuCancel from './menuCancel';
|
||||
import MenuSignal from './menuSignal';
|
||||
import MenuStationStand from './menuStationStand';
|
||||
import MenuSwitch from './menuSwitch';
|
||||
import MenuSection from './menuSection';
|
||||
import MenuTrain from './menuTrain';
|
||||
import MenuStation from './menuStation';
|
||||
import MenuBar from './menuBar';
|
||||
import PassiveAlarm from './passiveDialog/alarm';
|
||||
import PassiveContorl from './passiveDialog/control';
|
||||
import PassiveTimeout from './passiveDialog/timeout';
|
||||
|
||||
export default {
|
||||
name: 'Menus',
|
||||
components: {
|
||||
MenuBar,
|
||||
MenuCancel,
|
||||
MenuSignal,
|
||||
MenuSwitch,
|
||||
MenuSection,
|
||||
MenuStationStand,
|
||||
MenuStation,
|
||||
MenuTrain,
|
||||
PassiveAlarm,
|
||||
PassiveContorl,
|
||||
PassiveTimeout
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('config', [
|
||||
'width'
|
||||
]),
|
||||
isShowAll() {
|
||||
return this.$route.params.mode != 'dp' &&
|
||||
this.$route.params.mode != 'plan' &&
|
||||
this.$store.state.training.roles != 'BigScreen';
|
||||
},
|
||||
isShowBar() {
|
||||
return this.$store.state.training.prdType;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isShowBar(val) {
|
||||
val && this.$store.dispatch('config/updateMenuBar');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('config/updateMenuBar');
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.menus .pop-menu {
|
||||
background: #F0F0F0;
|
||||
}
|
||||
|
||||
.menus .pop-menu span {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.menus .pop-menu .is-disabled span {
|
||||
color: #B4B3B8;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog {
|
||||
background: rgba(100, 100, 100, 0.3);
|
||||
border: 2px solid rgb(144, 144, 144, 0.8);
|
||||
border-radius: 6px;
|
||||
color: #000;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-dialog__header {
|
||||
padding: 5px;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-dialog__footer {
|
||||
background: #F0F0F0;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
margin: 0px 5px 5px;
|
||||
border: 2px solid rgba(120, 121, 123, 0.5);
|
||||
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
|
||||
background: #F0F0F0;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-dialog__title {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
color: #000;
|
||||
border-radius: 4px;
|
||||
padding: 0px 2px;
|
||||
height: 20px;
|
||||
line-height: 20px
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-dialog__title::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
-webkit-filter: blur(10px);
|
||||
filter: blur(10px);
|
||||
height: 20px;
|
||||
width: -webkit-fill-available;
|
||||
background: rgba(128, 128, 128, 0.8);
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-dialog__headerbtn {
|
||||
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
border: 1px solid #fff;
|
||||
border-radius: 4px;
|
||||
top: 4px;
|
||||
right: 5px;
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-dialog__headerbtn .el-icon-close:before {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-dialog__headerbtn .el-dialog__close {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-button {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
padding: 0px;
|
||||
width: 80px;
|
||||
border: 2px outset #E2E2E2;
|
||||
border-radius: 0px !important;
|
||||
color: #000;
|
||||
background: #F0F0F0;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-button:focus span {
|
||||
border: 1px dashed gray;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-button:active {
|
||||
border: 2px inset #E2E2E2;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-button:disabled {
|
||||
border: 2px inset #E2E2E2;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-button:disabled span {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-input {
|
||||
border: 2px inset #E9E9E9;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-input .el-input__inner {
|
||||
color: #000;
|
||||
background: #fff !important;
|
||||
border: 0px;
|
||||
border-radius: 0px !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-input.is-disabled .el-input__inner {
|
||||
background: #F0F0F0 !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-textarea {
|
||||
border: 2px inset #E9E9E9;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-textarea .el-textarea__inner {
|
||||
color: #000;
|
||||
background: #fff !important;
|
||||
border: 0px;
|
||||
border-radius: 0px !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-textarea.is-disabled .el-textarea__inner {
|
||||
background: #F0F0F0 !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-table {
|
||||
border: 2px inset #E9E9E9;
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-table .cell {
|
||||
line-height: unset !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-table th.is-leaf {
|
||||
background: #F0F0F0 !important;
|
||||
border-right: 1px solid #BDBDBD !important;
|
||||
border-bottom: 1px solid #BDBDBD !important;
|
||||
color: #000 !important;
|
||||
height: 20px !important;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-table tr td {
|
||||
height: 20px !important;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-table .el-table__empty-text {
|
||||
top: 15px !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .current-row>td {
|
||||
background: #3399FF !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-checkbox__inner {
|
||||
border: 1px inset #dcdfe6 !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-checkbox__label {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-checkbox.is-disabled .el-checkbox__inner {
|
||||
background: #E6E6E6 !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-checkbox.is-disabled .el-checkbox__label {
|
||||
color: #C5C9CC !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner {
|
||||
background: #fff !important;
|
||||
border: 1px inset #dcdfe6 !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner::after {
|
||||
position: absolute;
|
||||
-webkit-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
content: "";
|
||||
border: 1px solid #000;
|
||||
border-left: 0;
|
||||
border-top: 0;
|
||||
height: 7px;
|
||||
left: 4px;
|
||||
top: 1px;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-radio__inner {
|
||||
border: 1px inset #dcdfe6 !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-radio__label {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-radio__input.is-checked .el-radio__inner {
|
||||
background: #fff !important;
|
||||
border: 1px inset #dcdfe6 !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-radio__input.is-checked .el-radio__inner::after {
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
border-radius: 100%;
|
||||
background-color: #000 !important;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-radio.is-disabled .el-radio__inner {
|
||||
background: #E6E6E6 !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-radio.is-disabled .el-radio__label {
|
||||
color: #C5C9CC !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
background: rgba(0, 0, 0, x);
|
||||
position: relative;
|
||||
left: -15px;
|
||||
top: -18px;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .el-form-item label {
|
||||
font-weight: normal !important;
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .context {
|
||||
height: 100px;
|
||||
border: 2px inset #E2E2E2;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .table {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .notice {
|
||||
margin-left: 62px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.fuzhou-01__systerm .el-dialog .button-group {
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
813
src/jmapNew/theme/haerbin_01/menus/menuBar.vue
Normal file
813
src/jmapNew/theme/haerbin_01/menus/menuBar.vue
Normal file
@ -0,0 +1,813 @@
|
||||
<template>
|
||||
<div id="menuBar">
|
||||
<div class="nav">
|
||||
<template v-for="(item,i) in menu">
|
||||
<template v-if="noShowingChildren(item.children)">
|
||||
<li :id="item.operate.domId" :key="i" class="nav-li" @click="hookClick(item)">
|
||||
<span class="nav-li-text">{{ item.title }}</span>
|
||||
</li>
|
||||
</template>
|
||||
<template v-else>
|
||||
<li :id="item.operate.domId" :key="i" class="nav-li" @click.stop="selectedClassA(item, i)">
|
||||
<span class="nav-li-text">{{ item.title }}</span>
|
||||
<ul class="nav-ul" :class="{'active' :i==classA}">
|
||||
<template v-for="(child,j) in item.children">
|
||||
<template v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)">
|
||||
<li
|
||||
:id="child.operate.domId"
|
||||
:key="j"
|
||||
class="menu-li"
|
||||
@click.stop="selectedClassB(child, j)"
|
||||
>
|
||||
<div class="menu-li-block">
|
||||
<span class="menu-li-text">
|
||||
<span class="status"> </span>
|
||||
<span class="label">{{ child.title }}</span>
|
||||
</span>
|
||||
</div>
|
||||
<ul class="menu-ul" :class="{'active' :j==classB}">
|
||||
<template v-for="(grandchild,k) in child.children">
|
||||
<li
|
||||
v-if="grandchild.show"
|
||||
:id="grandchild.operate.domId"
|
||||
:key="k"
|
||||
class="menu-li"
|
||||
@click.stop="hookClick(grandchild)"
|
||||
>
|
||||
<div class="menu-li-block">
|
||||
<span class="menu-li-text">
|
||||
<span class="status"> </span>
|
||||
<span class="label">{{ grandchild.title }}</span>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
</ul>
|
||||
</li>
|
||||
</template>
|
||||
<template v-else>
|
||||
<li
|
||||
v-if="child.show"
|
||||
:id="child.operate.domId"
|
||||
:key="j"
|
||||
class="menu-li"
|
||||
@click.stop="hookClick(child)"
|
||||
>
|
||||
<div class="menu-li-block">
|
||||
<span class="menu-li-text">
|
||||
<span class="status"> </span>
|
||||
<span class="label">{{ child.title }}</span>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
</template>
|
||||
</ul>
|
||||
</li>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
<station-control-convert ref="stationControlConvert" />
|
||||
<password-box ref="passwordBox" @setLoginResult="getLoginResult" />
|
||||
<view-train-id ref="viewTrainId" />
|
||||
<view-name ref="viewName" />
|
||||
<view-device ref="viewDevice" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
<train-add ref="trainAdd" />
|
||||
<train-transtalet ref="trainTranstalet" />
|
||||
<train-delete ref="trainDelete" />
|
||||
<manage-user ref="manageUser" />
|
||||
<help-about ref="helpAbout" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { TrainingMode } from '@/scripts/ConstDic';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler.js';
|
||||
import { State2SimulationMap } from '@/scripts/cmdPlugin/Config.js';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import StationControlConvert from './menuDialog/stationControlConvert';
|
||||
import TrainAdd from './menuDialog/trainAdd';
|
||||
import TrainTranstalet from './menuDialog/trainTranstalet';
|
||||
import TrainDelete from './menuDialog/trainDelete';
|
||||
import PasswordBox from './menuDialog/passwordBox';
|
||||
import ViewTrainId from './menuDialog/viewTrainId';
|
||||
import ViewName from './menuDialog/viewName';
|
||||
import ViewDevice from './menuDialog/viewDevice';
|
||||
import ManageUser from './menuDialog/manageUser';
|
||||
import HelpAbout from './menuDialog/helpAbout';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
export default {
|
||||
name: 'MenuBar',
|
||||
components: {
|
||||
NoticeInfo,
|
||||
StationControlConvert,
|
||||
PasswordBox,
|
||||
ViewTrainId,
|
||||
ViewName,
|
||||
ViewDevice,
|
||||
TrainAdd,
|
||||
TrainTranstalet,
|
||||
TrainDelete,
|
||||
ManageUser,
|
||||
HelpAbout
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
classA: -1,
|
||||
classB: -1,
|
||||
tempClassA: -1,
|
||||
tempClassB: -1,
|
||||
valid: true,
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
Local: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.system'),
|
||||
operate: OperationEvent.Command.mBar.system,
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.view'),
|
||||
operate: OperationEvent.Command.mBar.check,
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.refresh'),
|
||||
operate: OperationEvent.Command.mBar.fresh,
|
||||
click: this.refresh,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.display'),
|
||||
operate: OperationEvent.Command.mBar.view,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.setTrainIdDisplay'),
|
||||
click: this.setTrainIdDisplay,
|
||||
operate: OperationEvent.Command.view.setTrainIdDisplay
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.setNameDisplay'),
|
||||
click: this.setNameDisplay,
|
||||
operate: OperationEvent.Command.view.setNameDisplay
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.setDeviceDisplay'),
|
||||
click: this.setDeviceDisplay,
|
||||
operate: OperationEvent.Command.view.setDeviceDisplay
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.stationMapSwitch'),
|
||||
operate: '',
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.controlModeSwitch'),
|
||||
operate: OperationEvent.Command.mBar.remoteControl,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.toStationControl'),
|
||||
click: this.turnToStationControl,
|
||||
operate: OperationEvent.StationControl.requestStationControl.mbar
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.forcedStationControl'),
|
||||
click: this.mandatoryStationControl,
|
||||
operate: OperationEvent.StationControl.forcedStationControl.password
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.toCentralControl'),
|
||||
click: this.conterStationControl,
|
||||
operate: OperationEvent.StationControl.requestCentralControl.mbar,
|
||||
froce: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.requestOperationArea'),
|
||||
operate: OperationEvent.Command.mBar.requestZone,
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.historyQuery'),
|
||||
operate: OperationEvent.Command.mBar.historyQuery,
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.userManage'),
|
||||
operate: OperationEvent.Command.mBar.userManage,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.userManage'),
|
||||
click: this.userManage,
|
||||
operate: OperationEvent.Command.manage.userManage
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.help'),
|
||||
operate: OperationEvent.Command.mBar.help,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.about'),
|
||||
click: this.about,
|
||||
operate: OperationEvent.Command.help.about
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
Center: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.system'),
|
||||
operate: OperationEvent.Command.mBar.system,
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.view'),
|
||||
operate: OperationEvent.Command.mBar.check,
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.refresh'),
|
||||
operate: OperationEvent.Command.mBar.fresh,
|
||||
click: this.refresh,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.display'),
|
||||
operate: OperationEvent.Command.mBar.view,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.setTrainIdDisplay'),
|
||||
click: this.setTrainIdDisplay,
|
||||
operate: OperationEvent.Command.view.setTrainIdDisplay
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.setNameDisplay'),
|
||||
click: this.setNameDisplay,
|
||||
operate: OperationEvent.Command.view.setNameDisplay
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.setDeviceDisplay'),
|
||||
click: this.setDeviceDisplay,
|
||||
operate: OperationEvent.Command.view.setDeviceDisplay
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.stationMapSwitch'),
|
||||
operate: '',
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.planCarOperation'),
|
||||
operate: OperationEvent.Command.mBar.planTrain,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.addPlanCar'),
|
||||
click: this.addPlanTrain,
|
||||
operate: OperationEvent.Command.planTrain.addPlanTrain
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.panPlanCar'),
|
||||
click: this.translatPlanTrain,
|
||||
operate: OperationEvent.Command.planTrain.translatPlanTrain
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.deletePlanCar'),
|
||||
click: this.delPlanTrain,
|
||||
operate: OperationEvent.Command.planTrain.delPlanTrain
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.trainNumberMaintenance'),
|
||||
operate: '',
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.controlModeSwitch'),
|
||||
operate: OperationEvent.Command.mBar.remoteControl,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.toStationControl'),
|
||||
click: this.turnToStationControl,
|
||||
operate: OperationEvent.StationControl.requestStationControl.mbar,
|
||||
froce: true
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.forcedStationControl'),
|
||||
click: this.mandatoryStationControl,
|
||||
operate: OperationEvent.StationControl.forcedStationControl.password,
|
||||
froce: true
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.toCentralControl'),
|
||||
click: this.conterStationControl,
|
||||
operate: OperationEvent.StationControl.requestCentralControl.mbar
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.requestOperationArea'),
|
||||
operate: OperationEvent.Command.mBar.requestZone,
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.schedulingLog'),
|
||||
operate: '',
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.systemAnalysis'),
|
||||
operate: '',
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.userManage'),
|
||||
operate: OperationEvent.Command.mBar.userManage,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.userManage'),
|
||||
click: this.userManage,
|
||||
operate: OperationEvent.Command.manage.userManage
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.historyQuery'),
|
||||
operate: OperationEvent.Command.mBar.historyQuery,
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.help'),
|
||||
operate: OperationEvent.Command.mBar.help,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.about'),
|
||||
click: this.about,
|
||||
operate: OperationEvent.Command.help.about
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'started',
|
||||
'steps',
|
||||
'order',
|
||||
'mode'
|
||||
]),
|
||||
...mapGetters('map', [
|
||||
'stationList'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
tempClassA() {
|
||||
this.classA = this.$store.state.menuOperation.break ? -1 : this.tempClassA;
|
||||
},
|
||||
tempClassB() {
|
||||
this.classB = this.$store.state.menuOperation.break ? -1 : this.tempClassB;
|
||||
},
|
||||
'$store.state.menuOperation.break': function (val) {
|
||||
if (val) {
|
||||
this.classA = this.classB = -1;
|
||||
} else {
|
||||
this.classA = this.tempClassA;
|
||||
this.classB = this.tempClassB;
|
||||
}
|
||||
},
|
||||
'$store.state.training.operatemode': function (mode) {
|
||||
this.initMenu();
|
||||
},
|
||||
'$store.state.training.started': function (val) {
|
||||
this.closeMenu(true);
|
||||
},
|
||||
'$store.state.training.prdType': function () {
|
||||
this.initMenu();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initMenu();
|
||||
},
|
||||
methods: {
|
||||
initMenu(menu) {
|
||||
this.menu = MenuContextHandler.menuBarConvert(this.menuNormal[State2SimulationMap[this.$store.state.training.prdType]], this.$store.state.training.operatemode);
|
||||
this.clickEvent();
|
||||
this.closeMenu(true);
|
||||
},
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
if (document.getElementById('menuBar')) {
|
||||
self.closeMenu(false);
|
||||
}
|
||||
};
|
||||
},
|
||||
noShowingChildren(children) {
|
||||
if (!children || children.length <= 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
hasShowingChildren(children) {
|
||||
if (children && children.length > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
closeMenu(flag) {
|
||||
if (flag || (this.mode !== TrainingMode.EDIT && this.mode !== TrainingMode.TEACH)) {
|
||||
this.classA = this.tempClassA = -1;
|
||||
this.classB = this.tempClassB = -1;
|
||||
}
|
||||
},
|
||||
hookClick(item, event) {
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
|
||||
if (item && typeof item.click == 'function') {
|
||||
item.click(item.operate);
|
||||
}
|
||||
},
|
||||
selectedClassA(item, index) {
|
||||
const order = this.order || 0;
|
||||
if (this.mode !== TrainingMode.TEACH) { // 编辑模式下可显示
|
||||
this.popupMenuA(item, index);
|
||||
} else if (this.steps[order] && this.steps[order].type == 'bar') { // 操作步骤没有顶部操作顶部菜单都不可显示
|
||||
this.popupMenuA(item, index);
|
||||
}
|
||||
},
|
||||
// 弹出顶部菜单操作
|
||||
popupMenuA(item, index) {
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
|
||||
this.clickEvent();
|
||||
const operate = {
|
||||
operation: item.operate.operation
|
||||
};
|
||||
this.tempClassA = index;
|
||||
this.tempClassB = -1;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
selectedClassB(item, index) {
|
||||
const order = this.order || 0;
|
||||
if (this.mode !== TrainingMode.TEACH) { // 编辑模式下可显示
|
||||
this.popupMenuB(item, index);
|
||||
} else if (this.steps[order] && this.steps[order].type == 'bar') { // 操作步骤没有顶部操作顶部菜单都不可显示
|
||||
this.popupMenuB(item, index);
|
||||
}
|
||||
},
|
||||
popupMenuB(item, index) {
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
|
||||
const operate = {
|
||||
operation: item.operate.operation
|
||||
};
|
||||
this.tempClassB = index;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
// 转为站控
|
||||
turnToStationControl(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.stationControlConvert.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 强制转为站控
|
||||
mandatoryStationControl(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.passwordBox.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 请求中控
|
||||
conterStationControl(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.stationControlConvert.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置列车识别号显示
|
||||
setTrainIdDisplay(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.viewTrainId.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置设备显示
|
||||
setNameDisplay(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.viewName.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置名称显示
|
||||
setDeviceDisplay(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.viewDevice.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 添加计划车
|
||||
addPlanTrain(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainAdd.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 平移计划车
|
||||
translatPlanTrain(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainTranstalet.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 删除计划车
|
||||
delPlanTrain(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainDelete.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 用户管理
|
||||
userManage(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.manageUser.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 关于
|
||||
about(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.helpAbout.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 刷新
|
||||
refresh() {
|
||||
this.closeMenu(true);
|
||||
EventBus.$emit('refresh');
|
||||
},
|
||||
getLoginResult(operate) {
|
||||
/** 密码校验*/
|
||||
if (operate.operation == OperationEvent.StationControl.forcedStationControl.passwordConfirm.operation) {
|
||||
if (operate.success) {
|
||||
/** 校验成功*/
|
||||
this.$refs.stationControlConvert.doShow({ operation: OperationEvent.StationControl.forcedStationControl.mbar.operation });
|
||||
}
|
||||
}
|
||||
},
|
||||
undeveloped() {
|
||||
this.doClose();
|
||||
|
||||
this.$alert(this.$t('menu.menuBar.implemented'), this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
callback: action => {
|
||||
}
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.$nextTick(() => {
|
||||
EventBus.$emit('closeMenu');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped rel="stylesheet/scss" lang="scss">
|
||||
@import "src/styles/mixin.scss";
|
||||
$width: 30px;
|
||||
$height: 30px;
|
||||
$menuPadding: 10px;
|
||||
$menuItemHeight: 30px;
|
||||
$menuItemWidth: 190px;
|
||||
$menuItemPadding: 5px;
|
||||
|
||||
#menuBar {
|
||||
z-index: 10;
|
||||
position: absolute;
|
||||
width: inherit;
|
||||
height: $height;
|
||||
line-height: $height;
|
||||
}
|
||||
|
||||
.nav {
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
color: #0000;
|
||||
background: -webkit-linear-gradient(#FDFDFE, #DEE3F3);
|
||||
background: -o-linear-gradient(#FDFDFE, #DEE3F3);
|
||||
background: -moz-linear-gradient(#FDFDFE, #DEE3F3);
|
||||
background: linear-gradient(#FDFDFE, #DEE3F3);
|
||||
border: 1px solid #B6BCCC !important;
|
||||
border-bottom: 2px solid #B6BCCC !important;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.nav-li {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
padding-left: $menuPadding;
|
||||
padding-right: $menuPadding;
|
||||
}
|
||||
|
||||
.nav-li:active {
|
||||
background: #C9D0E1;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.nav-li-text {
|
||||
font-size: 13px;
|
||||
color: #000;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.nav-ul {
|
||||
display: none;
|
||||
position: absolute;
|
||||
list-style: none;
|
||||
border: 1px solid gray !important;
|
||||
line-height: $menuItemHeight;
|
||||
width: $menuItemWidth;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.menu-ul {
|
||||
display: none;
|
||||
list-style: none;
|
||||
background: #F0F0F0;
|
||||
line-height: $menuItemHeight;
|
||||
width: $menuItemWidth;
|
||||
bottom: $menuItemHeight;
|
||||
}
|
||||
|
||||
.active {
|
||||
position: absolute;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.menu-ul-text {
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
letter-spacing: 0;
|
||||
height: $menuItemHeight;
|
||||
line-height: $menuItemHeight;
|
||||
}
|
||||
|
||||
.menu-li {
|
||||
text-align: left;
|
||||
background: #F0F0F0;
|
||||
height: $menuItemHeight;
|
||||
line-height: $menuItemHeight;
|
||||
}
|
||||
|
||||
.menu-li-block {
|
||||
display: flex;
|
||||
letter-spacing: 0;
|
||||
height: $menuItemHeight;
|
||||
line-height: $menuItemHeight;
|
||||
}
|
||||
|
||||
.menu-li-text {
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.menu-li-text .status {
|
||||
display: block;
|
||||
float: left;
|
||||
border-right: 1px inset #CACACA;
|
||||
width: $width;
|
||||
}
|
||||
|
||||
.menu-li-text .label {
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.menu-li-block:hover {
|
||||
background: #C9DEF7;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
}
|
||||
</style>
|
130
src/jmapNew/theme/haerbin_01/menus/menuCancel.vue
Normal file
130
src/jmapNew/theme/haerbin_01/menus/menuCancel.vue
Normal file
@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import { Notification } from 'element-ui';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { exitFullscreen } from '@/utils/screen';
|
||||
|
||||
export default {
|
||||
name: 'CancelMenu',
|
||||
components: {
|
||||
PopMenu
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: [],
|
||||
menuScreen: [
|
||||
{
|
||||
label: this.$t('menu.menuCancle.zoomIn'),
|
||||
handler: this.magnifyMap,
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuCancle.zoomOut'),
|
||||
handler: this.shrinkMap,
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuCancle.back'),
|
||||
handler: this.back,
|
||||
disabled: false
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
this.menuNormal = [];
|
||||
this.stationList.forEach(station => {
|
||||
if (station.code === station.concentrateStationCode) {
|
||||
const node = {
|
||||
label: station.name,
|
||||
children: []
|
||||
};
|
||||
|
||||
this.stationList.forEach(elem => {
|
||||
if (elem.visible) {
|
||||
let next = elem;
|
||||
while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
|
||||
next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
|
||||
}
|
||||
|
||||
if (station.code == next.code) {
|
||||
node.children.push({
|
||||
code: elem.code,
|
||||
label: elem.name,
|
||||
handler: this.mapLocation
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.menuNormal.push(node);
|
||||
}
|
||||
});
|
||||
|
||||
this.menu = [...this.menuNormal];
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
// 设置地图定位
|
||||
mapLocation(item) {
|
||||
if (item) {
|
||||
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
// 放大地图
|
||||
magnifyMap() {
|
||||
this.$store.dispatch('menuOperation/handleMagnifyCount');
|
||||
},
|
||||
// 缩小地图
|
||||
shrinkMap() {
|
||||
this.$store.dispatch('menuOperation/handleShrinkCount');
|
||||
},
|
||||
// 返回
|
||||
async back() {
|
||||
history.go(-1);
|
||||
Notification.closeAll();
|
||||
exitFullscreen();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm two-confirmation"
|
||||
:title="$t('menu.menuChildDialog.secondaryConfirmation')"
|
||||
:visible.sync="show"
|
||||
width="360px"
|
||||
:before-close="doClose"
|
||||
:show-close="false"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div class="context">
|
||||
<template v-for="(message,index) in messages">
|
||||
<span :key="index">{{ message }}</span>
|
||||
</template>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="3">
|
||||
<el-button :id="show? domIdConfirm: ''" :loading="loading" @click="commit">{{ $t('menu.menuChildDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuChildDialog.close') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from '../../dialog/childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'TwoConfirmation',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: '',
|
||||
timer: null,
|
||||
domIdConfirm: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
messages() {
|
||||
if (this.operate) {
|
||||
return this.operate.messages;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.domIdConfirm = '';
|
||||
if (OperationHandler.checkOperationIsCurrentOperate(operate.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
this.domIdConfirm = OperationEvent.StationControl.forcedStationControl.confirm.domId;
|
||||
} else if (OperationHandler.checkOperationIsCurrentOperate(operate.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
this.domIdConfirm = OperationEvent.StationControl.requestStationControl.confirm.domId;
|
||||
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
this.domIdConfirm = OperationEvent.StationControl.requestCentralControl.confirm.domId;
|
||||
}
|
||||
|
||||
this.operate = operate || {};
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.close.confirm.operation
|
||||
};
|
||||
|
||||
this.$emit('setOperate', { selection: this.operate.selection, cancel: true });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
if (this.operate) {
|
||||
this.loading = true;
|
||||
(this.operate.selection || []).forEach(elem => {
|
||||
const operate = {
|
||||
val: elem.code,
|
||||
param: {
|
||||
ControlMode_Code: elem.code
|
||||
}
|
||||
};
|
||||
|
||||
if (OperationHandler.checkOperationIsCurrentOperate(this.operate.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
operate.operation = OperationEvent.StationControl.forcedStationControl.confirm.operation;
|
||||
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_FORCE_STATION_CONTROL;
|
||||
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operate.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
operate.operation = OperationEvent.StationControl.requestStationControl.confirm.operation;
|
||||
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL;
|
||||
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operate.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
operate.operation = OperationEvent.StationControl.requestCentralControl.confirm.operation;
|
||||
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL;
|
||||
}
|
||||
|
||||
this.doClose();
|
||||
this.$emit('setOperate', { selection: this.operate.selection, commit: true });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
});
|
||||
this.loading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -0,0 +1,172 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm user-add"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="420px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div style="padding: 15px 40px; border: 1px double lightgray; margin: 20px 10px; ">
|
||||
<el-form ref="form" size="small" label-width="90px" :model="model" label-position="left" :rules="rules">
|
||||
<el-form-item :label="$t('menu.menuChildDialog.jobNumber')" prop="jobNumber">
|
||||
<el-input v-model="model.jobNumber" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.userName')" prop="userName">
|
||||
<el-input v-model="model.userName" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.password')" prop="password">
|
||||
<el-input v-model="model.password" type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.confirmPassword')" prop="confirm">
|
||||
<el-input v-model="model.confirm" type="password" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="8" :offset="6">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuChildDialog.determine') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuChildDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
|
||||
export default {
|
||||
name: 'UserAdd',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operate: {},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
type: 'ADD',
|
||||
jobNumber: '',
|
||||
userName: '',
|
||||
password: '',
|
||||
confirm: ''
|
||||
},
|
||||
rules: {
|
||||
jobNumber: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputJobNumber'), trigger: 'blur' }
|
||||
],
|
||||
userName: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputUserName'), trigger: 'blur' }
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputPassword'), trigger: 'change' }
|
||||
],
|
||||
confirm: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputPasswordAgain'), trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuChildDialog.addUser');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.resetFields();
|
||||
});
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
if (this.model.password === this.model.confirm) {
|
||||
this.doClose();
|
||||
this.$emit('operateUser', this.model);
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuChildDialog.passwordInconsistent'));
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); this.model; });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
background: rgba(0, 0, 0, x);
|
||||
position: relative;
|
||||
left: -5px;
|
||||
top: -10px;
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm user-delete"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="260px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div style="padding-left: 10px; padding-bottom: 10px">
|
||||
<i class="el-icon-info" />
|
||||
<template v-for="(message,index) in messages">
|
||||
<span :key="index">{{ message }}</span>
|
||||
</template>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="8" :offset="3">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuChildDialog.determine') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="2">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuChildDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
|
||||
export default {
|
||||
name: 'UserDelete',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operate: {},
|
||||
messages: [],
|
||||
model: {
|
||||
type: 'DELETE',
|
||||
jobNumber: '',
|
||||
userName: ''
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuChildDialog.deleteUser');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.messages = operate.messages;
|
||||
this.model.userName = '';
|
||||
this.model.jobNumber = '';
|
||||
if (selected) {
|
||||
this.model.userName = selected.userName;
|
||||
this.model.jobNumber = selected.jobNumber;
|
||||
}
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.model.userName && this.model.jobNumber) {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$emit('operateUser', this.model);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuChildDialog.selectTips'));
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
background: rgba(0, 0, 0, x);
|
||||
position: relative;
|
||||
left: -5px;
|
||||
top: -10px;
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm user-edit"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="420px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div style="padding: 15px 40px; border: 1px double lightgray; margin: 20px 10px; ">
|
||||
<el-form ref="form" size="small" label-width="90px" :model="model" label-position="left" :rules="rules">
|
||||
<el-form-item :label="$t('menu.menuChildDialog.jobNumber')" prop="jobNumber">
|
||||
<el-input v-model="model.jobNumber" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.userName')" prop="userName">
|
||||
<el-input v-model="model.userName" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.originalPassword')" prop="oldPassword">
|
||||
<el-input v-model="model.oldPassword" type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.password')" prop="password">
|
||||
<el-input v-model="model.password" type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.confirmPassword')" prop="confirm">
|
||||
<el-input v-model="model.confirm" type="password" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="8" :offset="6">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuChildDialog.determine') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuChildDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
|
||||
export default {
|
||||
name: 'UserEdit',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operate: {},
|
||||
selected: {},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
type: 'EDIT',
|
||||
jobNumber: '',
|
||||
userName: '',
|
||||
oldPassword: '',
|
||||
password: '',
|
||||
confirm: ''
|
||||
},
|
||||
rules: {
|
||||
jobNumber: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputJobNumber'), trigger: 'blur' }
|
||||
],
|
||||
userName: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputUserName'), trigger: 'blur' }
|
||||
],
|
||||
oldPassword: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputOriginal'), trigger: 'change' }
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputNewPassword'), trigger: 'change' }
|
||||
],
|
||||
confirm: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputNewAgain'), trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuChildDialog.userEditPage');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.resetFields();
|
||||
this.selected = selected;
|
||||
if (selected) {
|
||||
this.model.jobNumber = selected.jobNumber;
|
||||
this.model.userName = selected.userName;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
if (this.selected.password !== this.model.oldPassword) {
|
||||
this.$messageBox(this.$t('menu.menuChildDialog.originalPasswordError'));
|
||||
} else if (this.model.password !== this.model.confirm) {
|
||||
this.$messageBox(this.$t('menu.menuChildDialog.passwordError'));
|
||||
} else if (this.model.oldPassword === this.model.password) {
|
||||
this.$messageBox(this.$t('menu.menuChildDialog.passwordSame'));
|
||||
} else {
|
||||
this.doClose();
|
||||
this.$emit('operateUser', this.model);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
background: rgba(0, 0, 0, x);
|
||||
position: relative;
|
||||
left: -5px;
|
||||
top: -10px;
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
140
src/jmapNew/theme/haerbin_01/menus/menuDialog/helpAbout.vue
Normal file
140
src/jmapNew/theme/haerbin_01/menus/menuDialog/helpAbout.vue
Normal file
@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm manage-user"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="600px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="height: 70px;">
|
||||
<div style="position: relative; left: 10px;" />
|
||||
<div style="position: relative; left: 80px;">
|
||||
<div style="width:100%">
|
||||
<span style="padding-left: 60px">{{ $t('menu.menuDialog.versionName') }}</span>
|
||||
<el-button
|
||||
:id="domIdConfirm"
|
||||
style="position: absolute; right: 95px;"
|
||||
type="primary"
|
||||
:loading="loading"
|
||||
@click="commit"
|
||||
>{{ $t('menu.menuDialog.confirm') }}</el-button>
|
||||
</div>
|
||||
<div style="width:100%; padding-top: 20px">
|
||||
<span> {{ $t('menu.menuDialog.copyright') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 10px; margin: 5px; ">
|
||||
<el-table :data="tableData" style="width: 100%;" height="400">
|
||||
<el-table-column prop="moduleName" :label="$t('menu.menuDialog.moduleName')" width="180" />
|
||||
<el-table-column prop="version" :label="$t('menu.menuDialog.version')" width="180" />
|
||||
<el-table-column prop="updateDate" :label="$t('menu.menuDialog.modifyDate')" />
|
||||
</el-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
|
||||
export default {
|
||||
name: 'ManageUser',
|
||||
data() {
|
||||
return {
|
||||
tableData: [
|
||||
{
|
||||
moduleName: this.$t('menu.menuDialog.mainProgramVersion'),
|
||||
version: '123',
|
||||
updateDate: '123'
|
||||
}
|
||||
],
|
||||
operate: {},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuDialog.about');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
background: rgba(0, 0, 0, x);
|
||||
position: relative;
|
||||
left: -5px;
|
||||
top: -10px;
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
309
src/jmapNew/theme/haerbin_01/menus/menuDialog/manageUser.vue
Normal file
309
src/jmapNew/theme/haerbin_01/menus/menuDialog/manageUser.vue
Normal file
@ -0,0 +1,309 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm manage-user"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="420px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="padding: 5px 5px; border: 1px double lightgray; margin: 20px 0px; ">
|
||||
<span class="base-label">{{ $t('menu.menuDialog.userList') }}</span>
|
||||
<el-row>
|
||||
<el-col :span="18">
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
border
|
||||
row-key="code"
|
||||
style="width: 100%"
|
||||
height="450"
|
||||
center
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
@row-click="chooseUser"
|
||||
>
|
||||
<el-table-column prop="jobNumber" :label="$t('menu.menuDialog.jobNumber')" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.jobNumber }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userName" :label="$t('menu.menuDialog.userName')">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.userName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button :id="domIdFreshUser" style="margin-top: 140px; margin-left: 10px;" @click="freshUser">{{ $t('menu.menuDialog.refresh') }}
|
||||
</el-button>
|
||||
<el-button :id="domIdAddUser" style="margin-top: 30px; margin-left: 10px;" @click="addUser">{{ $t('menu.menuDialog.add') }}
|
||||
</el-button>
|
||||
<el-button :id="domIdEditUser" style="margin-top: 30px; margin-left: 10px;" @click="editUser">{{ $t('menu.menuDialog.modify') }}
|
||||
</el-button>
|
||||
<el-button :id="domIdDelUser" style="margin-top: 30px; margin-left: 10px;" @click="delUser">{{ $t('menu.menuDialog.delete') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="8" :offset="6">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<user-add ref="userAdd" @operateUser="operateUser" />
|
||||
<user-edit ref="userEdit" @operateUser="operateUser" />
|
||||
<user-delete ref="userDelete" @operateUser="operateUser" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import UserAdd from './childDialog/userAdd';
|
||||
import UserEdit from './childDialog/userEdit';
|
||||
import UserDelete from './childDialog/userDelete';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
|
||||
export default {
|
||||
name: 'ManageUser',
|
||||
components: {
|
||||
UserAdd,
|
||||
UserEdit,
|
||||
UserDelete
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
operate: {},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdAddUser() {
|
||||
return this.dialogShow ? OperationEvent.Command.manage.addUser.domId : '';
|
||||
},
|
||||
domIdEditUser() {
|
||||
return this.dialogShow ? OperationEvent.Command.manage.editUser.domId : '';
|
||||
},
|
||||
domIdDelUser() {
|
||||
return this.dialogShow ? OperationEvent.Command.manage.delUser.domId : '';
|
||||
},
|
||||
domIdFreshUser() {
|
||||
return this.dialogShow ? OperationEvent.Command.manage.freshUser.domId : '';
|
||||
},
|
||||
domIdChooseUser() {
|
||||
return this.dialogShow ? OperationEvent.Command.manage.chooseUser.domId : '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuDialog.userManage');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
// 添加用户
|
||||
addUser() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.manage.addUser.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.$refs.userAdd.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 编辑用户
|
||||
editUser() {
|
||||
if (this.selected) {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.manage.editUser.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.$refs.userEdit.doShow(operate, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuDialog.selectUser'));
|
||||
}
|
||||
},
|
||||
// 删除用户
|
||||
delUser() {
|
||||
if (this.selected) {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.manage.delUser.operation,
|
||||
messages: [`${this.$t('menu.menuDialog.deleteMessageOne')} ${this.selected.userName} ${this.$t('menu.menuDialog.deleteMessageTwo')}`]
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.$refs.userDelete.doShow(operate, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuDialog.selectUser'));
|
||||
}
|
||||
},
|
||||
// 刷新用户
|
||||
freshUser() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.manage.freshUser.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 选择用户
|
||||
chooseUser(row) {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.manage.chooseUser.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.selected = row;
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
},
|
||||
// 增删改函数处理
|
||||
operateUser(data) {
|
||||
if (data && data.type === 'ADD') {
|
||||
const index = this.tableData.indexOf(this.tableData.find(elem => { return elem.jobNumber === data.jobNumber; }));
|
||||
if (index < 0) {
|
||||
this.tableData.push({
|
||||
jobNumber: data.jobNumber,
|
||||
userName: data.userName,
|
||||
password: data.password
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuDialog.addFail'));
|
||||
}
|
||||
} else if (data && data.type === 'EDIT') {
|
||||
const index = this.tableData.indexOf(this.tableData.find(elem => { return elem.jobNumber === data.jobNumber; }));
|
||||
if (index >= 0) {
|
||||
this.tableData[index].password = data.password;
|
||||
this.tableData[index].userName = data.userName;
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuDialog.modifyFail'));
|
||||
}
|
||||
} else if (data && data.type === 'DELETE') {
|
||||
const index = this.tableData.indexOf(this.tableData.find(elem => { return elem.jobNumber === data.jobNumber; }));
|
||||
if (index >= 0) {
|
||||
this.tableData.splice(index, 1);
|
||||
this.selected = null;
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuDialog.deleteFail'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
background: rgba(0, 0, 0, x);
|
||||
position: relative;
|
||||
left: -5px;
|
||||
top: -10px;
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
228
src/jmapNew/theme/haerbin_01/menus/menuDialog/passwordBox.vue
Normal file
228
src/jmapNew/theme/haerbin_01/menus/menuDialog/passwordBox.vue
Normal file
@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm password-box"
|
||||
:title="$t('menu.menuDialog.passwordBox')"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="context" style="overflow:hidden">
|
||||
<el-form label-width="80px" size="mini">
|
||||
<el-form-item prop="username">
|
||||
<span slot="label">{{ $t('menu.menuDialog.userNameLabel') }}</span>
|
||||
<el-input v-model="model.username" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<span slot="label">{{ $t('menu.menuDialog.password') }}</span>
|
||||
<el-input v-model="model.password" type="password" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="operate">
|
||||
<el-button-group v-model="key" class="left" size="mini">
|
||||
<el-button size="mini" @click="click(1)">1</el-button>
|
||||
<el-button size="mini" @click="click(2)">2</el-button>
|
||||
<el-button size="mini" @click="click(3)">3</el-button>
|
||||
<el-button size="mini" @click="click(4)">4</el-button>
|
||||
<el-button size="mini" @click="click(5)">5</el-button>
|
||||
</el-button-group>
|
||||
<el-button-group v-model="key" class="right" size="mini">
|
||||
<el-button @click="esc">{{ $t('menu.menuDialog.back') }}</el-button>
|
||||
</el-button-group>
|
||||
<el-button-group v-model="key" class="left" size="mini">
|
||||
<el-button size="mini" @click="click(6)">6</el-button>
|
||||
<el-button size="mini" @click="click(7)">7</el-button>
|
||||
<el-button size="mini" @click="click(8)">8</el-button>
|
||||
<el-button size="mini" @click="click(9)">9</el-button>
|
||||
<el-button size="mini" @click="click(0)">0</el-button>
|
||||
</el-button-group>
|
||||
<el-button-group v-model="key" class="right" size="mini">
|
||||
<el-button @click="clr">{{ $t('menu.menuDialog.clear') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'PasswordBox',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
operation: null,
|
||||
model: {
|
||||
username: '',
|
||||
password: ''
|
||||
},
|
||||
key: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.password.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
/** 强制站控*/
|
||||
return OperationEvent.StationControl.forcedStationControl.passwordConfirm.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(operate) {
|
||||
this.model.username = '';
|
||||
this.model.password = '';
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.model.username = this.$store.state.user.nickname;
|
||||
},
|
||||
doShow(operate) {
|
||||
/** 如果不是断点激活,而是第一次显示需要初始化数据*/
|
||||
if (!this.dialogShow) {
|
||||
this.loadInitData(operate);
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.close.password.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
};
|
||||
|
||||
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
/** 强制站控*/
|
||||
operate.operation = OperationEvent.StationControl.forcedStationControl.passwordConfirm.operation;
|
||||
}
|
||||
|
||||
if (this.model.password == '123456') {
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
|
||||
if (valid) {
|
||||
this.$emit('setLoginResult', {
|
||||
operation: operate.operation,
|
||||
success: valid
|
||||
});
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$emit('setLoginResult', {
|
||||
operation: operate.operation,
|
||||
success: false
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate, [this.$t('menu.menuDialog.IncorrectPassword')]);
|
||||
|
||||
}
|
||||
},
|
||||
click(key) {
|
||||
if (!this.model.password) {
|
||||
this.model.password = '';
|
||||
}
|
||||
this.model.password += key;
|
||||
},
|
||||
esc() {
|
||||
if (this.model.password) {
|
||||
this.model.password = this.model.password.substring(0, this.model.password.length - 1);
|
||||
}
|
||||
},
|
||||
clr() {
|
||||
this.model.password = '';
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.password-box .el-form {
|
||||
margin-top: 10px !important;
|
||||
margin-right: 20px !important;
|
||||
}
|
||||
|
||||
.password-box .el-form-item {
|
||||
margin-bottom: 5px !important;
|
||||
}
|
||||
|
||||
.password-box .context {
|
||||
height: 170px !important;
|
||||
}
|
||||
|
||||
.password-box .operate {
|
||||
margin-top: 10px !important;
|
||||
padding-bottom: 10px !important;
|
||||
}
|
||||
|
||||
.password-box .left {
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
|
||||
.password-box .left .el-button {
|
||||
color: #000;
|
||||
background: #F0F0F0;
|
||||
text-align: center;
|
||||
width: 30px !important;
|
||||
}
|
||||
|
||||
.password-box .right {
|
||||
color: #000;
|
||||
margin-left: 10px !important;
|
||||
background: #F0F0F0;
|
||||
width: 80px !important;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,463 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm station-control-convert"
|
||||
:title="$t('menu.menuDialog.controlModeConversion')"
|
||||
:visible.sync="show"
|
||||
width="700px"
|
||||
:before-close="doClose"
|
||||
:show-close="true"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
border
|
||||
row-key="code"
|
||||
style="width: 100%"
|
||||
height="250"
|
||||
center
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column :id="domIdChoose" prop="check" :label="$t('menu.menuDialog.select')" width="60" style="margin-left:30px">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox ref="check" v-model="scope.row.check" :disabled="scope.row.disabled" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="operate" :label="$t('menu.menuDialog.operatingArea')" width="140">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="control" :label="$t('menu.menuDialog.controlMode')" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" :label="$t('menu.menuDialog.centerStationCommunicationStatus')" width="140">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.status }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="result" :label="$t('menu.menuDialog.transferExecutionStatus')">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.result }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="3" class="control_button">
|
||||
<el-button v-if="isFork" :id="domIdFork" :disabled="disabledCommit" @click="forkCommit">{{ $t('menu.menuDialog.forcedStationControl') }}</el-button>
|
||||
<el-button v-if="isRequest" :id="domIdRequest" :disabled="disabledCommit" @click="requestCommit">{{ $t('menu.menuDialog.requestStationControl') }}
|
||||
</el-button>
|
||||
<el-button v-if="isConter" :id="domIdConter" :disabled="disabledCommit" @click="conterCommit">{{ $t('menu.menuDialog.requestInTheControl') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdCancel" :disabled="disabledClose" @click="cancel">{{ $t('menu.menuDialog.close') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<two-confirmation ref="twoConfirmation" @setOperate="getOperate" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import TwoConfirmation from './childDialog/twoConfirmation';
|
||||
|
||||
export default {
|
||||
name: 'StationControlConvert',
|
||||
components: {
|
||||
TwoConfirmation
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operate: null,
|
||||
dialogShow: false,
|
||||
disabledSend: false,
|
||||
disabledSure: false,
|
||||
disabledClose: false,
|
||||
operation: '',
|
||||
controlProps: {
|
||||
'01': this.$t('menu.menuDialog.inTheControl'),
|
||||
'02': this.$t('menu.menuDialog.stationControl')
|
||||
},
|
||||
selection: [],
|
||||
tableData: [],
|
||||
timer: null,
|
||||
count: 0,
|
||||
flagListBit: [],
|
||||
backOperate: '',
|
||||
timeout: 61,
|
||||
counts: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList',
|
||||
'stationControlList'
|
||||
]),
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'started'
|
||||
]),
|
||||
disabledCommit() {
|
||||
return this.disabledSend || this.disabledSure;
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
isFork() {
|
||||
if (this.dialogShow) {
|
||||
return OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
isRequest() {
|
||||
if (this.dialogShow) {
|
||||
return OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
isConter() {
|
||||
if (this.dialogShow) {
|
||||
return OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
domIdChoose() {
|
||||
if (this.dialogShow) {
|
||||
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
return OperationEvent.StationControl.forcedStationControl.choose.domId;
|
||||
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
return OperationEvent.StationControl.requestStationControl.choose.domId;
|
||||
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
return OperationEvent.StationControl.requestCentralControl.choose.domId;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
domIdConter() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.requestCentralControl.menu.domId : '';
|
||||
},
|
||||
domIdFork() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.forcedStationControl.menu.domId : '';
|
||||
},
|
||||
domIdRequest() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.requestStationControl.menu.domId : '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem) {
|
||||
this.flagListBit[this.selection.forEach(elem => { return elem.stationControlCode == elem.code; })] = false;
|
||||
if (elem.hasOwnProperty('timeout')) {
|
||||
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.acceptConversionResponseTimeout') }, false);
|
||||
} else if (elem.hasOwnProperty('agree')) {
|
||||
if (elem.agree) {
|
||||
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.controlModeTransfersuccees') }, true);
|
||||
} else {
|
||||
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.controlModeTransferFailed') }, false);
|
||||
}
|
||||
}
|
||||
this.disabledClose = false;
|
||||
this.disabledSure = false;
|
||||
}
|
||||
},
|
||||
backOperate: function (operate) {
|
||||
if (this.dialogShow && operate) {
|
||||
if (operate.selection && operate.selection.length) {
|
||||
operate.selection.forEach(elem => {
|
||||
if (operate.commit) {
|
||||
this.updateTableValue(elem.code, { result: `${this.$t('menu.menuDialog.senedMessageOne')}${this.timeout} ${this.$t('menu.menuDialog.senedMessageTwo')}` }, false);
|
||||
} else if (operate.cancel) {
|
||||
this.updateTableValue(elem.code, { result: '' }, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
// 深度数据状态
|
||||
tableData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadTableData();
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
updateTableValue(code, result, success) {
|
||||
this.tableData.forEach((row, index) => {
|
||||
if (row.code == code) {
|
||||
for (const prop in result) {
|
||||
row[prop] = result[prop];
|
||||
}
|
||||
if (success) {
|
||||
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
row.control = this.controlProps['02']; // 01:中控, 02:站控
|
||||
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
row.control = this.controlProps['01']; // 01:中控, 02:站控
|
||||
}
|
||||
row.disabled = true;
|
||||
row.check = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.check && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.disabledSend = !selection.length;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.handleChooseChange(selection);
|
||||
this.selection = selection;
|
||||
}
|
||||
},
|
||||
checkBoxDisabled(row) {
|
||||
const control = (this.$store.getters['map/getDeviceByCode'](row.code) || {});
|
||||
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
if (control && control.status == '02') { // 01:中控, 02:站控
|
||||
return true;
|
||||
}
|
||||
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
if (control && control.status == '01') { // 01:中控, 02:站控
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
loadTableData() {
|
||||
this.tableData = [];
|
||||
this.stationControlList.forEach(control => {
|
||||
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
||||
this.tableData.push({
|
||||
code: control.code,
|
||||
operate: station.name || '',
|
||||
control: '',
|
||||
check: false,
|
||||
disabled: false,
|
||||
status: this.$t('menu.menuDialog.normal'),
|
||||
result: ''
|
||||
});
|
||||
});
|
||||
},
|
||||
initTableDataStatus() {
|
||||
this.tableData.forEach(row => {
|
||||
row.disabled = this.checkBoxDisabled(row);
|
||||
row.check = false;
|
||||
row.result = '';
|
||||
const control = this.$store.getters['map/getDeviceByCode'](row.code);
|
||||
if (control) {
|
||||
row.control = this.controlProps[control.status];
|
||||
}
|
||||
});
|
||||
},
|
||||
doShow(operate) {
|
||||
if (!this.dialogShow) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.disabledSure = false;
|
||||
this.initTableDataStatus();
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
doClose() {
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$refs.multipleTable.setCurrentRow();
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
setTimer() {
|
||||
this.clearTimer();
|
||||
this.flagListBit = new Array(this.selection.length).fill(true);
|
||||
this.timer = setInterval(() => {
|
||||
(this.selection || []).forEach((elem, index) => {
|
||||
if (this.flagListBit[index]) {
|
||||
elem['count'] = (elem['count'] || 0) + 1;
|
||||
elem['count'] > this.timeout && (
|
||||
this.flagListBit[index] = false,
|
||||
this.setRequestTimeout(elem)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
this.flagListBit.findIndex(elem => { return elem; }) < 0 && this.clearTimer();
|
||||
}, 1000);
|
||||
},
|
||||
clearTimer() {
|
||||
this.count = 0;
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
},
|
||||
setRequestTimeout(elem) {
|
||||
elem['count'] = 0;
|
||||
this.$store.dispatch('socket/pushMsgQueue',
|
||||
{ type: 'resp', timeout: 'true', stationControlCode: elem.code }
|
||||
);
|
||||
},
|
||||
handleChooseChange(selection) {
|
||||
this.selection = selection;
|
||||
const stationCodeList = selection.map(elem => { return elem.code; });
|
||||
if (selection && selection.length) {
|
||||
const operate = {
|
||||
operation: '',
|
||||
val: stationCodeList.join('::'),
|
||||
selection: selection
|
||||
};
|
||||
|
||||
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
operate.operation = OperationEvent.StationControl.forcedStationControl.choose.operation;
|
||||
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
operate.operation = OperationEvent.StationControl.requestStationControl.choose.operation;
|
||||
} else if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
operate.operation = OperationEvent.StationControl.requestCentralControl.choose.operation;
|
||||
}
|
||||
|
||||
this.disabledSure = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.disabledSure = false;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
} else if (!selection) {
|
||||
this.$messageBox(this.$t('menu.menuDialog.selectData'));
|
||||
}
|
||||
},
|
||||
requestCommit() {
|
||||
const stationCodeList = this.selection.map(elem => { return elem.code; });
|
||||
const operate = {
|
||||
messages: [this.$t('menu.menuDialog.confirmStationControlTip')],
|
||||
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
|
||||
val: stationCodeList.join('::'),
|
||||
selection: this.selection
|
||||
};
|
||||
|
||||
this.selection.forEach((elem, index) => {
|
||||
operate.messages.push(`${this.$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
|
||||
});
|
||||
|
||||
this.disabledSure = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.twoConfirmation.doShow(operate);
|
||||
} else {
|
||||
this.disabledSure = false;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.disabledSure = false;
|
||||
});
|
||||
},
|
||||
forkCommit() {
|
||||
const stationCodeList = this.selection.map(elem => { return elem.code; });
|
||||
const operate = {
|
||||
messages: [this.$t('menu.menuDialog.confirmInTheControlTip')],
|
||||
operation: OperationEvent.StationControl.forcedStationControl.menu.operation,
|
||||
val: stationCodeList.join('::'),
|
||||
selection: this.selection
|
||||
};
|
||||
|
||||
this.selection.forEach((elem, index) => {
|
||||
operate.messages.push(`${this.$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
|
||||
});
|
||||
|
||||
this.disabledSure = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.twoConfirmation.doShow(operate);
|
||||
} else {
|
||||
this.disabledSure = false;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.disabledSure = false;
|
||||
});
|
||||
},
|
||||
conterCommit() {
|
||||
const stationCodeList = this.selection.map(elem => { return elem.code; });
|
||||
const operate = {
|
||||
messages: [this.$t('menu.menuDialog.confirmInTheControlTip')],
|
||||
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
|
||||
val: stationCodeList.join('::'),
|
||||
selection: this.selection
|
||||
};
|
||||
|
||||
this.selection.forEach((elem, index) => {
|
||||
operate.messages.push(`${this.$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
|
||||
});
|
||||
|
||||
this.disabledSure = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.twoConfirmation.doShow(operate);
|
||||
} else {
|
||||
this.disabledSure = false;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.disabledSure = false;
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
this.backOperate = operate;
|
||||
if (operate.cancel) {
|
||||
this.disabledSure = this.disabledSend = false;
|
||||
}
|
||||
if (operate.commit || operate.timeout) {
|
||||
this.disabledSend = this.disabledSure = true;
|
||||
}
|
||||
this.setTimer();
|
||||
this.disabledClose = true;
|
||||
this.counts = 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.fuzhou-01__systerm .el-dialog .control_button button{
|
||||
max-width:180px;
|
||||
width:auto ;
|
||||
padding-left: 5px ;
|
||||
padding-right: 5px ;
|
||||
min-width: 80px;
|
||||
}
|
||||
</style>
|
179
src/jmapNew/theme/haerbin_01/menus/menuDialog/trainAdd.vue
Normal file
179
src/jmapNew/theme/haerbin_01/menus/menuDialog/trainAdd.vue
Normal file
@ -0,0 +1,179 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules">
|
||||
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
|
||||
<span class="base-label">{{ $t('menu.menuDialog.addLocation') }}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item prop="stationStandCode">
|
||||
<span slot="label">{{ $t('menu.menuDialog.terminalOne') }}</span>
|
||||
<el-select v-model="addModel.stationStandCode" filterable :placeholder="$t('menu.menuDialog.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in stationStandList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="trainNumberLimber">
|
||||
<span id="frontTrainNumber" slot="label">{{ $t('menu.menuDialog.frontTrainNumber') }}</span>
|
||||
<el-input v-model="addModel.trainNumberLimber" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<el-form-item id="groupNumber" :label="$t('menu.menuDialog.addTrainNumber')" label-width="115px" prop="groupNumber">
|
||||
<el-input v-model="addModel.groupNumber" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
|
||||
export default {
|
||||
name: 'TrainAdd',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
groupNumber: '',
|
||||
stationStandCode: '',
|
||||
trainNumberLimber: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.inputTrainNumber'), trigger: 'blur' }
|
||||
],
|
||||
// trainNumberLimber: [
|
||||
// { required: true, message: '请输入前车车次号', trigger: 'blur' }
|
||||
// ],
|
||||
stationStandCode: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.selectTerminal'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.planTrain.addPlanTrain.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuDialog.addPlanTrain');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
|
||||
operation: OperationEvent.Command.planTrain.addPlanTrain.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
} else {
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
background: rgba(0, 0, 0, x);
|
||||
position: relative;
|
||||
left: -5px;
|
||||
top: -18px;
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
#frontTrainNumber,#groupNumber label{
|
||||
line-height: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
157
src/jmapNew/theme/haerbin_01/menus/menuDialog/trainDelete.vue
Normal file
157
src/jmapNew/theme/haerbin_01/menus/menuDialog/trainDelete.vue
Normal file
@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules">
|
||||
<el-form-item prop="stationStandCode">
|
||||
<span slot="label">{{ $t('menu.menuDialog.terminalTwo') }}</span>
|
||||
<el-select v-model="addModel.stationStandCode" filterable :placeholder="$t('menu.menuDialog.pleaseSelect')">
|
||||
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name" :value="item.code" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuDialog.trainNumber')" prop="groupNumber">
|
||||
<el-input v-model="addModel.groupNumber" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
|
||||
export default {
|
||||
name: 'TrainAdd',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
groupNumber: '',
|
||||
stationStandCode: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.inputTrainNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandCode: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.selectTerminal'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.planTrain.delPlanTrain.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuDialog.deletePlanTrain');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
|
||||
operation: OperationEvent.Command.planTrain.delPlanTrain.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
} else {
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
background: rgba(0, 0, 0, x);
|
||||
position: relative;
|
||||
left: -5px;
|
||||
top: -18px;
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules">
|
||||
<el-form-item :label="$t('menu.menuDialog.trainNumber')" label-width="115px" prop="groupNumber">
|
||||
<el-input v-model="addModel.groupNumber" />
|
||||
</el-form-item>
|
||||
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
|
||||
<span class="base-label">{{ $t('menu.menuDialog.purpose') }}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item prop="stationStandCode">
|
||||
<span slot="label">{{ $t('menu.menuDialog.terminalTwo') }}</span>
|
||||
<el-select v-model="addModel.stationStandCode" filterable :placeholder="$t('menu.menuDialog.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in stationStandList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuDialog.trainNumber')" prop="trainNumberLimber">
|
||||
<el-input v-model="addModel.trainNumberLimber" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
|
||||
export default {
|
||||
name: 'TrainTranstalet',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
groupNumber: '',
|
||||
stationStandCode: '',
|
||||
trainNumberLimber: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.inputTrainNumber'), trigger: 'blur' }
|
||||
],
|
||||
trainNumberLimber: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.inputFrontNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandCode: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.selectTerminal'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.planTrain.translatPlanTrain.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuDialog.panPlanCar');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
|
||||
operation: OperationEvent.Command.planTrain.translatPlanTrain.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
} else {
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
166
src/jmapNew/theme/haerbin_01/menus/menuDialog/viewDevice.vue
Normal file
166
src/jmapNew/theme/haerbin_01/menus/menuDialog/viewDevice.vue
Normal file
@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm view-display"
|
||||
:title="$t('menu.menuDialog.deviceDisplaySettings')"
|
||||
:visible.sync="show"
|
||||
width="340px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-checkbox-group v-model="deviceLevels">
|
||||
<div>
|
||||
<el-checkbox :label="1">{{ $t('menu.menuDialog.trainWindow') }}</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="2">{{ $t('menu.menuDialog.sectionBoundary') }}</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="3">{{ $t('menu.menuDialog.linkageAutoRouteShow') }}</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="4">{{ $t('menu.menuDialog.atsAutoTriggerShow') }}</el-checkbox>
|
||||
</div>
|
||||
</el-checkbox-group>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="8" :offset="2">
|
||||
<el-button :id="domIdConfirm" class="commit" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuDialog.confirm') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="3">
|
||||
<el-button :id="domIdCancel" class="cancal" @click="cancel">{{ $t('menu.menuDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'ViewDevice',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
operation: '',
|
||||
deviceLevels: [2, 3, 4, 5]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.setDeviceDisplay();
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
// 如果不是断点激活,而是第一次显示,需要初始化数据
|
||||
if (!this.dialogShow) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
val: this.deviceLevels.sort().join('::')
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.setDeviceDisplay();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
setDeviceDisplay() {
|
||||
const deviceList = [];
|
||||
|
||||
// 区段边界设置
|
||||
const borderBorderShow = this.deviceLevels.indexOf(2) !== -1;
|
||||
const sectionList = this.$store.getters['map/sectionList'];
|
||||
if (sectionList && sectionList.length > 0) {
|
||||
sectionList.forEach(elem => {
|
||||
// 区段边界
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), {borderBorderShow }));
|
||||
});
|
||||
}
|
||||
|
||||
// 车次窗设置
|
||||
const trainWindowShow = this.deviceLevels.indexOf(1) !== -1;
|
||||
const trainWindowList = this.$store.getters['map/trainWindowList'];
|
||||
if (trainWindowList && trainWindowList.length > 0) {
|
||||
trainWindowList.forEach(elem => {
|
||||
// 车次窗
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), {trainWindowShow }));
|
||||
});
|
||||
}
|
||||
|
||||
// 联锁自动进路表示灯和ATS自动触发表示灯设置
|
||||
const linkageAutoRouteShow = this.deviceLevels.indexOf(3) !== -1; // 联锁自动进路表示灯
|
||||
const atsAutoTriggerShow = this.deviceLevels.indexOf(4) !== -1; // ATS自动触发表示灯
|
||||
const signalList = this.$store.getters['map/signalList'];
|
||||
if (signalList && signalList.length > 0) {
|
||||
signalList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { linkageAutoRouteShow, atsAutoTriggerShow }));
|
||||
});
|
||||
}
|
||||
|
||||
this.$store.dispatch('map/updateMapDevices', deviceList);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
</style>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user