Merge branch 'test' of git.code.tencent.com:lian-cbtc/jl-client into yly
This commit is contained in:
commit
e0e64340fc
@ -149,13 +149,13 @@ export default class Station extends Group {
|
|||||||
createControlMode() {
|
createControlMode() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
if (!this.style.Station.StationControl.disPlayNone) {
|
if (!this.style.Station.StationControl.disPlayNone) {
|
||||||
const queryList = window.location.search.substring(1).split('&');
|
const queryList = window.location.search.substring(1).split('&');
|
||||||
const queryCtc = queryList.find(item => {
|
const queryCtc = queryList.find(item => {
|
||||||
return item.includes('ctc');
|
return item.includes('ctc');
|
||||||
});
|
});
|
||||||
if (queryCtc) {
|
if (queryCtc) {
|
||||||
this.createCtcControlMode()
|
this.createCtcControlMode();
|
||||||
} else if (this.style.Station.StationControl.special) {
|
} else if (this.style.Station.StationControl.special) {
|
||||||
if (model.visible && model.createControlMode) { // model.createControlMode 控制模式
|
if (model.visible && model.createControlMode) { // model.createControlMode 控制模式
|
||||||
this.createControlModeAU();
|
this.createControlModeAU();
|
||||||
this.createControlModeCC();
|
this.createControlModeCC();
|
||||||
@ -168,129 +168,129 @@ export default class Station extends Group {
|
|||||||
this.createCenterControl(); // 中控按钮
|
this.createCenterControl(); // 中控按钮
|
||||||
this.createSubstationControl(); // 站控按钮
|
this.createSubstationControl(); // 站控按钮
|
||||||
this.createInterconnectedControl(); // 联锁控
|
this.createInterconnectedControl(); // 联锁控
|
||||||
this.createVeryControl();
|
this.createVeryControl();
|
||||||
this.createSelfDiscipline();
|
this.createSelfDiscipline();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.setState(model);
|
this.setState(model);
|
||||||
}
|
}
|
||||||
createCtcControlMode() {//大铁
|
createCtcControlMode() { // 大铁
|
||||||
//非常站控
|
// 非常站控
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
// 分散自律
|
// 分散自律
|
||||||
this.selfDisciplineThree = new EThreeLamp({
|
this.selfDisciplineThree = new EThreeLamp({
|
||||||
_subType: 'veryControl',
|
_subType: 'veryControl',
|
||||||
style: this.style,
|
style: this.style,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.selfDisciplineThree.offset.x,
|
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.selfDisciplineThree.offset.x,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.selfDisciplineThree.offset.y
|
y: model.controlModePoint.y + this.style.Station.StationControl.selfDisciplineThree.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.selfDisciplineThree.text,
|
context: this.style.Station.StationControl.selfDisciplineThree.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.selfDisciplineThree);
|
this.add(this.selfDisciplineThree);
|
||||||
// 非常站控
|
// 非常站控
|
||||||
this.veryControl = new ESingleControl({
|
this.veryControl = new ESingleControl({
|
||||||
_subType: 'veryControl',
|
_subType: 'veryControl',
|
||||||
style: this.style,
|
style: this.style,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.veryControl.offset.x,
|
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.veryControl.offset.x,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.veryControl.offset.y
|
y: model.controlModePoint.y + this.style.Station.StationControl.veryControl.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.veryControl.text,
|
context: this.style.Station.StationControl.veryControl.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.veryControl);
|
this.add(this.veryControl);
|
||||||
//按图排路
|
// 按图排路
|
||||||
this.graphRoad = new ESingleControl({
|
this.graphRoad = new ESingleControl({
|
||||||
_subType: 'graphRoad',
|
_subType: 'graphRoad',
|
||||||
style: this.style,
|
style: this.style,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.graphRoad.offset.x,
|
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.graphRoad.offset.x,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.graphRoad.offset.y
|
y: model.controlModePoint.y + this.style.Station.StationControl.graphRoad.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.graphRoad.text,
|
context: this.style.Station.StationControl.graphRoad.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.graphRoad);
|
this.add(this.graphRoad);
|
||||||
//计划控制
|
// 计划控制
|
||||||
this.planControl = new ESingleControl({
|
this.planControl = new ESingleControl({
|
||||||
_subType: 'planControl',
|
_subType: 'planControl',
|
||||||
style: this.style,
|
style: this.style,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.planControl.offset.x,
|
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.planControl.offset.x,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.planControl.offset.y
|
y: model.controlModePoint.y + this.style.Station.StationControl.planControl.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.planControl.text,
|
context: this.style.Station.StationControl.planControl.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.planControl);
|
this.add(this.planControl);
|
||||||
//中心通信
|
// 中心通信
|
||||||
this.centerCommunication = new ESingleControl({
|
this.centerCommunication = new ESingleControl({
|
||||||
_subType: 'centerCommunication',
|
_subType: 'centerCommunication',
|
||||||
style: this.style,
|
style: this.style,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.centerCommunication.offset.x,
|
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.centerCommunication.offset.x,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.centerCommunication.offset.y
|
y: model.controlModePoint.y + this.style.Station.StationControl.centerCommunication.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.centerCommunication.text,
|
context: this.style.Station.StationControl.centerCommunication.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.centerCommunication);
|
this.add(this.centerCommunication);
|
||||||
//自律机通信
|
// 自律机通信
|
||||||
this.selfDisciplineCommunication = new ESingleControl({
|
this.selfDisciplineCommunication = new ESingleControl({
|
||||||
_subType: 'selfDisciplineCommunication',
|
_subType: 'selfDisciplineCommunication',
|
||||||
style: this.style,
|
style: this.style,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.selfDisciplineCommunication.offset.x,
|
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.selfDisciplineCommunication.offset.x,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.selfDisciplineCommunication.offset.y
|
y: model.controlModePoint.y + this.style.Station.StationControl.selfDisciplineCommunication.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.selfDisciplineCommunication.text,
|
context: this.style.Station.StationControl.selfDisciplineCommunication.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.selfDisciplineCommunication);
|
this.add(this.selfDisciplineCommunication);
|
||||||
//允许转回
|
// 允许转回
|
||||||
this.allowedTurnBack = new ESingleControl({
|
this.allowedTurnBack = new ESingleControl({
|
||||||
_subType: 'allowedTurnBack',
|
_subType: 'allowedTurnBack',
|
||||||
style: this.style,
|
style: this.style,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.allowedTurnBack.offset.x,
|
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.allowedTurnBack.offset.x,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.allowedTurnBack.offset.y
|
y: model.controlModePoint.y + this.style.Station.StationControl.allowedTurnBack.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.allowedTurnBack.text,
|
context: this.style.Station.StationControl.allowedTurnBack.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.allowedTurnBack);
|
this.add(this.allowedTurnBack);
|
||||||
// 列控
|
// 列控
|
||||||
this.trainControl = new ESingleControl({
|
this.trainControl = new ESingleControl({
|
||||||
_subType: 'trainControl',
|
_subType: 'trainControl',
|
||||||
style: this.style,
|
style: this.style,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.trainControl.offset.x,
|
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.trainControl.offset.x,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.trainControl.offset.y
|
y: model.controlModePoint.y + this.style.Station.StationControl.trainControl.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.trainControl.text,
|
context: this.style.Station.StationControl.trainControl.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.trainControl);
|
this.add(this.trainControl);
|
||||||
}
|
}
|
||||||
createControlModeAU() { // 西安二
|
createControlModeAU() { // 西安二
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
this.stationControlAU = new Text({
|
this.stationControlAU = new Text({
|
||||||
@ -428,95 +428,95 @@ export default class Station extends Group {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
createSelfDiscipline() {
|
createSelfDiscipline() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
if (this.style.Station.StationControl.selfDiscipline) {
|
if (this.style.Station.StationControl.selfDiscipline) {
|
||||||
this.selfDiscipline = new ESingleControl({
|
this.selfDiscipline = new ESingleControl({
|
||||||
_subType: 'self_discipline',
|
_subType: 'self_discipline',
|
||||||
style: this.style,
|
style: this.style,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.selfDiscipline.offset.x,
|
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.selfDiscipline.offset.x,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.selfDiscipline.offset.y
|
y: model.controlModePoint.y + this.style.Station.StationControl.selfDiscipline.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.selfDiscipline.text,
|
context: this.style.Station.StationControl.selfDiscipline.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.selfDiscipline);
|
this.add(this.selfDiscipline);
|
||||||
}
|
}
|
||||||
if (this.style.Station.StationControl.selfDisciplineControl) {
|
if (this.style.Station.StationControl.selfDisciplineControl) {
|
||||||
this.selfDisciplineControl = new ESingleControl({
|
this.selfDisciplineControl = new ESingleControl({
|
||||||
_subType: 'self_discipline_control',
|
_subType: 'self_discipline_control',
|
||||||
style: this.style,
|
style: this.style,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.selfDisciplineControl.offset.x,
|
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.selfDisciplineControl.offset.x,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.selfDisciplineControl.offset.y
|
y: model.controlModePoint.y + this.style.Station.StationControl.selfDisciplineControl.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.selfDisciplineControl.text,
|
context: this.style.Station.StationControl.selfDisciplineControl.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.selfDisciplineControl);
|
this.add(this.selfDisciplineControl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
createVeryControl() {
|
createVeryControl() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
if (this.style.Station.StationControl.veryControl) {
|
if (this.style.Station.StationControl.veryControl) {
|
||||||
this.veryControl = new ESingleControl({
|
this.veryControl = new ESingleControl({
|
||||||
_subType: 'very',
|
_subType: 'very',
|
||||||
style: this.style,
|
style: this.style,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.veryControl.offset.x,
|
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.veryControl.offset.x,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.centerControl.offset.y
|
y: model.controlModePoint.y + this.style.Station.StationControl.centerControl.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.veryControl.text,
|
context: this.style.Station.StationControl.veryControl.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.veryControl);
|
this.add(this.veryControl);
|
||||||
}
|
}
|
||||||
if (this.style.Station.StationControl.veryControlButton) {
|
if (this.style.Station.StationControl.veryControlButton) {
|
||||||
this.veryControlButton = new Rect({
|
this.veryControlButton = new Rect({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
_subType: 'veryControlButton',
|
_subType: 'veryControlButton',
|
||||||
shape: {
|
shape: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.veryControlButton.offset.x - this.style.Station.StationControl.lamp.radiusR,
|
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.veryControlButton.offset.x - this.style.Station.StationControl.lamp.radiusR,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.veryControlButton.offset.y - this.style.Station.StationControl.lamp.radiusR,
|
y: model.controlModePoint.y + this.style.Station.StationControl.veryControlButton.offset.y - this.style.Station.StationControl.lamp.radiusR,
|
||||||
width: this.style.Station.StationControl.lamp.radiusR * 2,
|
width: this.style.Station.StationControl.lamp.radiusR * 2,
|
||||||
height: this.style.Station.StationControl.lamp.radiusR * 2
|
height: this.style.Station.StationControl.lamp.radiusR * 2
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: 1,
|
lineWidth: 1,
|
||||||
stroke: '#fff',
|
stroke: '#fff',
|
||||||
fill: this.style.Station.StationControl.veryControlButton.defaultColor
|
fill: this.style.Station.StationControl.veryControlButton.defaultColor
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.add(this.veryControlButton);
|
this.add(this.veryControlButton);
|
||||||
this.veryControlButtonText = new Text({
|
this.veryControlButtonText = new Text({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
_subType: 'veryControlButtonText',
|
_subType: 'veryControlButtonText',
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.veryControlButton.offset.y,
|
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.veryControlButton.offset.y,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.veryControlButton.offset.y + this.style.Station.StationControl.lamp.radiusR + this.style.Station.StationControl.text.distance,
|
y: model.controlModePoint.y + this.style.Station.StationControl.veryControlButton.offset.y + this.style.Station.StationControl.lamp.radiusR + this.style.Station.StationControl.text.distance,
|
||||||
fontWeight: this.style.Station.StationControl.text.fontWeight,
|
fontWeight: this.style.Station.StationControl.text.fontWeight,
|
||||||
fontSize: this.style.Station.StationControl.text.fontSize,
|
fontSize: this.style.Station.StationControl.text.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
text: this.style.Station.StationControl.veryControlButton.text,
|
text: this.style.Station.StationControl.veryControlButton.text,
|
||||||
textFill: this.style.Station.StationControl.text.fontColor,
|
textFill: this.style.Station.StationControl.text.fontColor,
|
||||||
textAlign: this.style.Station.StationControl.text.textAlign,
|
textAlign: this.style.Station.StationControl.text.textAlign,
|
||||||
textVerticalAlign: this.style.Station.StationControl.text.textVerticalAlign
|
textVerticalAlign: this.style.Station.StationControl.text.textVerticalAlign
|
||||||
},
|
},
|
||||||
pop: false,
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.veryControlButtonText);
|
this.add(this.veryControlButtonText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
createCenterControl() { // 中控按钮
|
createCenterControl() { // 中控按钮
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
if (this.style.Station.StationControl.centerControl.show) {
|
if (this.style.Station.StationControl.centerControl.show) {
|
||||||
@ -695,7 +695,7 @@ export default class Station extends Group {
|
|||||||
});
|
});
|
||||||
this.add(this.interconnectedControl);
|
this.add(this.interconnectedControl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleCenter() { // 中控
|
handleCenter() { // 中控
|
||||||
this.noneBeforeMode = 'Center';
|
this.noneBeforeMode = 'Center';
|
||||||
@ -765,9 +765,9 @@ export default class Station extends Group {
|
|||||||
this.centerControl && this.centerControl.setTextColor(this.style.Station.StationControl.lamp.grayColor);
|
this.centerControl && this.centerControl.setTextColor(this.style.Station.StationControl.lamp.grayColor);
|
||||||
this.interconnectedControl && this.interconnectedControl.setColor(this.style.Station.StationControl.lamp.purpleColor);
|
this.interconnectedControl && this.interconnectedControl.setColor(this.style.Station.StationControl.lamp.purpleColor);
|
||||||
this.interconnectedControl && this.interconnectedControl.setTextColor(this.style.Station.StationControl.lamp.purpleColor);
|
this.interconnectedControl && this.interconnectedControl.setTextColor(this.style.Station.StationControl.lamp.purpleColor);
|
||||||
this.veryControl && this.veryControl.setColor(this.style.Station.StationControl.veryControl.lightColor);
|
this.veryControl && this.veryControl.setColor(this.style.Station.StationControl.veryControl.lightColor);
|
||||||
this.veryControlButton && this.veryControlButton.setStyle({ fill: this.style.Station.StationControl.veryControlButton.lightColor });
|
this.veryControlButton && this.veryControlButton.setStyle({ fill: this.style.Station.StationControl.veryControlButton.lightColor });
|
||||||
}
|
}
|
||||||
|
|
||||||
handleNone() { // 空
|
handleNone() { // 空
|
||||||
if (this.style.Station.stationText.noneModeColor) {
|
if (this.style.Station.stationText.noneModeColor) {
|
||||||
@ -794,11 +794,11 @@ export default class Station extends Group {
|
|||||||
this.troButton && this.troButton.hide();
|
this.troButton && this.troButton.hide();
|
||||||
this.substationArrowsControl && this.substationArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
this.substationArrowsControl && this.substationArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||||
this.emergencyArrowsControl && this.emergencyArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
this.emergencyArrowsControl && this.emergencyArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||||
this.stationControlCC && this.stationControlCC.setStyle({text:'EL', textFill:this.style.Station.StationControl.text.emergencyControlColor});
|
this.stationControlCC && this.stationControlCC.setStyle({text:'EL', textFill:this.style.Station.StationControl.text.emergencyControlColor});
|
||||||
this.veryControl && this.veryControl.setColor(this.style.Station.StationControl.veryControl.defaultColor);
|
this.veryControl && this.veryControl.setColor(this.style.Station.StationControl.veryControl.defaultColor);
|
||||||
this.selfDiscipline && this.selfDiscipline.setColor(this.style.Station.StationControl.selfDiscipline.defaultColor);
|
this.selfDiscipline && this.selfDiscipline.setColor(this.style.Station.StationControl.selfDiscipline.defaultColor);
|
||||||
this.selfDisciplineControl && this.selfDisciplineControl.setColor(this.style.Station.StationControl.selfDisciplineControl.defaultColor);
|
this.selfDisciplineControl && this.selfDisciplineControl.setColor(this.style.Station.StationControl.selfDisciplineControl.defaultColor);
|
||||||
this.veryControlButton && this.veryControlButton.setStyle({ fill: this.style.Station.StationControl.veryControlButton.defaultColor });
|
this.veryControlButton && this.veryControlButton.setStyle({ fill: this.style.Station.StationControl.veryControlButton.defaultColor });
|
||||||
if (this.style.Station.stationText.isSpecialType) {
|
if (this.style.Station.stationText.isSpecialType) {
|
||||||
this.stationText.setColor(this.style.Station.stationText.noneModeColor);
|
this.stationText.setColor(this.style.Station.stationText.noneModeColor);
|
||||||
this.stationText.setBackground(this.style.Station.stationText.defaultBackColor);
|
this.stationText.setBackground(this.style.Station.stationText.defaultBackColor);
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
<stage-runplan v-if="isCtc" ref="stageRunplan" @closeFlash="closeStageFlash" @noticeInfo="noticeInfo" />
|
<stage-runplan v-if="isCtc" ref="stageRunplan" @closeFlash="closeStageFlash" @noticeInfo="noticeInfo" />
|
||||||
<notice-info v-if="isCtc" ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
<notice-info v-if="isCtc" ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
||||||
<cmdManage v-if="isCtc" ref="cmdManage" />
|
<cmdManage v-if="isCtc" ref="cmdManage" />
|
||||||
|
<signedCmd v-if="isCtc" ref="signedCmd" @signedCmdClose="signedCmdClose" @changeSignedStatus="changeSignedStatus" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -102,6 +103,7 @@ import CtcBarIcon16 from '@/assets/ctc_icon/pic16.png';
|
|||||||
import CtcBarIcon17 from '@/assets/ctc_icon/pic17.png';
|
import CtcBarIcon17 from '@/assets/ctc_icon/pic17.png';
|
||||||
import CtcBarIcon18 from '@/assets/ctc_icon/pic18.png';
|
import CtcBarIcon18 from '@/assets/ctc_icon/pic18.png';
|
||||||
import cmdManage from '@/views/dispatcherStationManage/cmdManage.vue';
|
import cmdManage from '@/views/dispatcherStationManage/cmdManage.vue';
|
||||||
|
import signedCmd from '@/views/dispatcherStationManage/signedCmd.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Menus',
|
name: 'Menus',
|
||||||
@ -124,7 +126,8 @@ export default {
|
|||||||
// DispatcherLoger,
|
// DispatcherLoger,
|
||||||
BottomTable,
|
BottomTable,
|
||||||
MenuPanel,
|
MenuPanel,
|
||||||
cmdManage
|
cmdManage,
|
||||||
|
signedCmd
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
selected: {
|
||||||
@ -243,8 +246,19 @@ export default {
|
|||||||
window.onclick = function (e) {};
|
window.onclick = function (e) {};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
changeSignedStatus(info) {
|
||||||
|
this.isCtc && this.$refs.cmdManage.changeSignedStatus(info);
|
||||||
|
},
|
||||||
|
signedCmdClose() {
|
||||||
|
this.isCtc && this.$refs.cmdManage.doShow();
|
||||||
|
},
|
||||||
showCmdManage() {
|
showCmdManage() {
|
||||||
this.$refs.cmdManage.doShow();
|
if (!this.isCtc) { return; }
|
||||||
|
if (this.hasCommandMsg) {
|
||||||
|
this.$refs.signedCmd.doShow();
|
||||||
|
} else {
|
||||||
|
this.$refs.cmdManage.doShow();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getRailwaySimulationRunplanSend() {
|
getRailwaySimulationRunplanSend() {
|
||||||
const stationCode = this.$store.state.training.roleDeviceCode;
|
const stationCode = this.$store.state.training.roleDeviceCode;
|
||||||
|
113
src/jmapNew/theme/datie_tky/menus/menuSection.vue
Normal file
113
src/jmapNew/theme/datie_tky/menus/menuSection.vue
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<pop-menu ref="popMenu" :menu="menu" />
|
||||||
|
<set-fault ref="setFault" pop-class="datie-02__systerm" />
|
||||||
|
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import PopMenu from '@/components/PopMenu';
|
||||||
|
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||||
|
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||||
|
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||||
|
// import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
|
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'SectionMenu',
|
||||||
|
components: {
|
||||||
|
PopMenu,
|
||||||
|
NoticeInfo,
|
||||||
|
SetFault
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
selected: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
menu: [],
|
||||||
|
menuNormal: {
|
||||||
|
Local: [
|
||||||
|
]
|
||||||
|
},
|
||||||
|
menuForce: [
|
||||||
|
{
|
||||||
|
label: '区段故障解锁',
|
||||||
|
// handler: this.setStoppage,
|
||||||
|
handler: this.cancelStoppage,
|
||||||
|
// cmdType: CMD.Fault.CMD_SET_FAULT
|
||||||
|
cmdType: CMD.Fault.CMD_CANCEL_FAULT
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters('training', [
|
||||||
|
'mode',
|
||||||
|
'operatemode'
|
||||||
|
]),
|
||||||
|
...mapGetters('menuOperation', [
|
||||||
|
'buttonOperation'
|
||||||
|
])
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
'$store.state.menuOperation.menuCount': function (val) {
|
||||||
|
// console.log(this.buttonOperation, '***********');
|
||||||
|
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Section) && (!this.buttonOperation || this.$route.query.ctc)) {
|
||||||
|
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||||
|
} else {
|
||||||
|
this.doClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
initMenu() {
|
||||||
|
// 编辑模式菜单列表
|
||||||
|
if (this.selected.type != '04') {
|
||||||
|
// this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||||
|
this.menu = this.menuNormal.Local;
|
||||||
|
} else {
|
||||||
|
this.menu = [];
|
||||||
|
}
|
||||||
|
// 故障模式菜单列表
|
||||||
|
if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') {
|
||||||
|
this.menu = this.menuForce;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
doShow(point) {
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 设置故障
|
||||||
|
setStoppage() {
|
||||||
|
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
|
||||||
|
if (valid) {
|
||||||
|
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消故障
|
||||||
|
cancelStoppage() {
|
||||||
|
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
|
||||||
|
if (valid) {
|
||||||
|
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -76,6 +76,7 @@ const IscsStationConfig = () => import('@/views/iscs/iscsSystem/stationConfig/in
|
|||||||
|
|
||||||
const NewMapDraft = () => import('@/views/newMap/newMapdraft/index');
|
const NewMapDraft = () => import('@/views/newMap/newMapdraft/index');
|
||||||
const NewMapDraftSystem = () => import('@/views/newMap/newMapdraftSystem/index');
|
const NewMapDraftSystem = () => import('@/views/newMap/newMapdraftSystem/index');
|
||||||
|
const MapDraftPicture = () => import('@/views/newMap/mapDraftPicture/index');
|
||||||
const NewDesignPlatformUser = () => import('@/views/newMap/newDesignUser/index');
|
const NewDesignPlatformUser = () => import('@/views/newMap/newDesignUser/index');
|
||||||
|
|
||||||
const Taskmanage = () => import('@/views/lesson/taskmanage/list');
|
const Taskmanage = () => import('@/views/lesson/taskmanage/list');
|
||||||
@ -1356,6 +1357,11 @@ export const asyncRouter = [
|
|||||||
component: NewMapDraftSystem,
|
component: NewMapDraftSystem,
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
|
{ // 地图画面管理
|
||||||
|
path: 'usermap/map/pictureDraw/:mapId/:view',
|
||||||
|
component: MapDraftPicture,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path:'iscs/design',
|
path:'iscs/design',
|
||||||
redirect: '/iscs/design',
|
redirect: '/iscs/design',
|
||||||
|
@ -73,7 +73,8 @@ export default {
|
|||||||
{label: '电力调度', value: 'ELECTRIC_DISPATCHER', enLabel: 'Electric dispatcher'},
|
{label: '电力调度', value: 'ELECTRIC_DISPATCHER', enLabel: 'Electric dispatcher'},
|
||||||
{label: '行调', value: 'DISPATCHER', enLabel: 'Dispatcher '},
|
{label: '行调', value: 'DISPATCHER', enLabel: 'Dispatcher '},
|
||||||
{label: '上级部门', value: 'PARENT_DEPARTMENT', enLabel: 'Parent department'},
|
{label: '上级部门', value: 'PARENT_DEPARTMENT', enLabel: 'Parent department'},
|
||||||
{label: '停车场信号楼', value: 'PARKING_LOT_SIGNAL_BUILDING', enLabel: 'Parking Signal Building'}
|
{label: '停车场信号楼', value: 'PARKING_LOT_SIGNAL_BUILDING', enLabel: 'Parking Signal Building'},
|
||||||
|
{label: '车站助理', value: 'STATION_ASSISTANT', enLabel: 'StationAssistant'}
|
||||||
],
|
],
|
||||||
|
|
||||||
releaseReview: [
|
releaseReview: [
|
||||||
|
@ -143,7 +143,7 @@ export const IbpOperation = {
|
|||||||
PRERESET_Z: {operate: '14', event: 'PRERESET_Z', name: '计轴预复位'},
|
PRERESET_Z: {operate: '14', event: 'PRERESET_Z', name: '计轴预复位'},
|
||||||
SD: {operate: '15', event: 'SD', name: '试灯'},
|
SD: {operate: '15', event: 'SD', name: '试灯'},
|
||||||
XXGM: {operate: '16', event: 'XXGM', name: '下行屏蔽门开门'},
|
XXGM: {operate: '16', event: 'XXGM', name: '下行屏蔽门开门'},
|
||||||
SXGM: {operate: '17', event: 'SXGM', name: '上行屏蔽门开门'},
|
SXGM: {operate: '17', event: 'SXGM', name: '上行屏蔽门开门'}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -167,7 +167,8 @@ export const SimulationType = {
|
|||||||
DISPATCHER: '行调',
|
DISPATCHER: '行调',
|
||||||
STATION_SUPERVISOR: '车站值班员',
|
STATION_SUPERVISOR: '车站值班员',
|
||||||
DRIVER: '司机',
|
DRIVER: '司机',
|
||||||
MAINTAINER: '通号'
|
MAINTAINER: '通号',
|
||||||
|
STATION_ASSISTANT: '车站助理'
|
||||||
};
|
};
|
||||||
export const UrlConfig = {
|
export const UrlConfig = {
|
||||||
displayNew: '/displayNew',
|
displayNew: '/displayNew',
|
||||||
|
@ -24,10 +24,11 @@ export function handlerUrl(data) {
|
|||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// const data = null;
|
// const data = null;
|
||||||
// BASE_API = 'https://joylink.club/jlcloud';
|
// BASE_API = 'https://joylink.club/jlcloud';
|
||||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||||
|
// BASE_API = 'http://192.168.3.233/rtss-server';
|
||||||
// BASE_API = 'http://114.116.51.125/jlcloud';
|
// BASE_API = 'http://114.116.51.125/jlcloud';
|
||||||
// BASE_API = 'http://192.168.8.152:9000'; // 袁琪
|
// BASE_API = 'http://192.168.8.152:9000'; // 袁琪
|
||||||
BASE_API = 'http://192.168.3.94:9000'; // 旭强
|
// BASE_API = 'http://192.168.3.94:9000'; // 旭强
|
||||||
// BASE_API = 'http://192.168.3.15:9000'; // 张赛
|
// BASE_API = 'http://192.168.3.15:9000'; // 张赛
|
||||||
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
|
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
|
||||||
// BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
|
// BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<div class="box-top">
|
<div class="box-top">
|
||||||
<div class="top-title">收令箱</div>
|
<div class="top-title">收令箱</div>
|
||||||
<div class="top-table">
|
<div class="top-table">
|
||||||
<el-table :data="cmdTableData" style="width: 100%" height="160" highlight-current-row @current-change="handleCurrentChange">
|
<el-table :data="cmdTableData" style="width: 100%" height="160" highlight-current-row :row-class-name="tableRowClassName" @current-change="handleCurrentChange">
|
||||||
<el-table-column prop="title" label="标题" />
|
<el-table-column prop="title" label="标题" />
|
||||||
<el-table-column prop="number" label="号码" width="80" />
|
<el-table-column prop="number" label="号码" width="80" />
|
||||||
<el-table-column label="命令类型" width="100">
|
<el-table-column label="命令类型" width="100">
|
||||||
@ -193,6 +193,13 @@ export default {
|
|||||||
this.searchCmd();
|
this.searchCmd();
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
tableRowClassName({row, rowIndex}) {
|
||||||
|
const status = this.getSignInfo(row.receiverInfos).signedStatus;
|
||||||
|
if (status === 'SIGNED') {
|
||||||
|
return 'signed-row';
|
||||||
|
}
|
||||||
|
return 'unsigned-row';
|
||||||
|
},
|
||||||
doShow() {
|
doShow() {
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
this.$store.commit('socket/clearDispatchCommandMsg');
|
this.$store.commit('socket/clearDispatchCommandMsg');
|
||||||
@ -219,27 +226,14 @@ export default {
|
|||||||
},
|
},
|
||||||
signCmd(status) {
|
signCmd(status) {
|
||||||
if (!this.commandId) { return; }
|
if (!this.commandId) { return; }
|
||||||
|
const signInfo = { commandId: this.commandId, signedBy: this.getActiveUser.memberId, signedStatus: status };
|
||||||
const data = {
|
const data = {
|
||||||
signInfo: {
|
signInfo: signInfo
|
||||||
commandId: this.commandId,
|
|
||||||
signedBy: this.getActiveUser.memberId,
|
|
||||||
signedStatus: status
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
sendCommandNew(this.group, 'CTC_SIGN_DISPATCH_COMMAND', data).then((res) => {
|
sendCommandNew(this.group, 'CTC_SIGN_DISPATCH_COMMAND', data).then((res) => {
|
||||||
console.log(res, '---res');
|
console.log(res, '---res');
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
const index = this.cmdTableData.findIndex(item => {
|
this.changeSignedStatus(signInfo);
|
||||||
return item.id == this.commandId;
|
|
||||||
});
|
|
||||||
if (index >= 0) {
|
|
||||||
const obj = this.cmdTableData[index];
|
|
||||||
const mId = this.getActiveUser.memberId;
|
|
||||||
obj.receiverInfos[mId].signedBy = mId;
|
|
||||||
obj.receiverInfos[mId].signedStatus = status;
|
|
||||||
obj.receiverInfos[mId].time = parseTime(this.initTime);
|
|
||||||
this.cmdTableData.splice(index, 1, obj);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.$messageBox(`${this.signedStatusObj[status]}调度命令失败:${res.message}`);
|
this.$messageBox(`${this.signedStatusObj[status]}调度命令失败:${res.message}`);
|
||||||
}
|
}
|
||||||
@ -247,6 +241,19 @@ export default {
|
|||||||
this.$messageBox(`${this.signedStatusObj[status]}调度命令失败:${error.message}`);
|
this.$messageBox(`${this.signedStatusObj[status]}调度命令失败:${error.message}`);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
changeSignedStatus(signInfo) {
|
||||||
|
const index = this.cmdTableData.findIndex(item => {
|
||||||
|
return item.id == signInfo.commandId;
|
||||||
|
});
|
||||||
|
if (index >= 0) {
|
||||||
|
const obj = this.cmdTableData[index];
|
||||||
|
const mId = signInfo.signedBy;
|
||||||
|
obj.receiverInfos[mId].signedBy = mId;
|
||||||
|
obj.receiverInfos[mId].signedStatus = signInfo.signedStatus;
|
||||||
|
obj.receiverInfos[mId].time = parseTime(this.initTime);
|
||||||
|
this.cmdTableData.splice(index, 1, obj);
|
||||||
|
}
|
||||||
|
},
|
||||||
searchCmd() {
|
searchCmd() {
|
||||||
sendCommandNew(this.group, 'CTC_QUERY_DISPATCH_COMMAND').then((res) => {
|
sendCommandNew(this.group, 'CTC_QUERY_DISPATCH_COMMAND').then((res) => {
|
||||||
console.log(res, '---res');
|
console.log(res, '---res');
|
||||||
@ -298,6 +305,16 @@ export default {
|
|||||||
.content-box {
|
.content-box {
|
||||||
width: calc(100% - 150px);
|
width: calc(100% - 150px);
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
|
.box-top {
|
||||||
|
.el-table {
|
||||||
|
/deep/ .signed-row {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
/deep/ .unsigned-row {
|
||||||
|
color: blue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.box-middle {
|
.box-middle {
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
<el-tab-pane label="操作" name="operate">
|
<el-tab-pane label="操作" name="operate">
|
||||||
<div class="operate-box">
|
<div class="operate-box">
|
||||||
<div class="create-cmd">
|
<div class="create-cmd">
|
||||||
<el-button type="primary" @click="initData">新建调度命令</el-button>
|
<el-button type="primary" @click="createCmd">新建调度命令</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@ -253,6 +253,16 @@ export default {
|
|||||||
beforeDestroy() {},
|
beforeDestroy() {},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
methods:{
|
methods:{
|
||||||
|
createCmd() {
|
||||||
|
this.$confirm('当前调度命令已经被编辑修改过了,你要放弃所有的修改吗?', '操作提示', {
|
||||||
|
confirmButtonText: '是',
|
||||||
|
cancelButtonText: '否'
|
||||||
|
}).then(() => {
|
||||||
|
this.initData();
|
||||||
|
}).catch(() => {
|
||||||
|
console.log('取消新建调度命令!');
|
||||||
|
});
|
||||||
|
},
|
||||||
initData() {
|
initData() {
|
||||||
this.command = {
|
this.command = {
|
||||||
title: '',
|
title: '',
|
||||||
@ -284,6 +294,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSenderName() {
|
getSenderName() {
|
||||||
|
this.memberDataList = Object.values(this.memberData);
|
||||||
const activeUser = this.memberDataList.find(item => {
|
const activeUser = this.memberDataList.find(item => {
|
||||||
return item.userId == this.$store.state.user.id;
|
return item.userId == this.$store.state.user.id;
|
||||||
});
|
});
|
||||||
@ -293,7 +304,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
doShow() {
|
doShow() {
|
||||||
this.memberDataList = Object.values(this.memberData);
|
|
||||||
this.getSenderName();
|
this.getSenderName();
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
},
|
},
|
||||||
|
275
src/views/dispatcherStationManage/signedCmd.vue
Normal file
275
src/views/dispatcherStationManage/signedCmd.vue
Normal file
@ -0,0 +1,275 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
v-dialogDrag
|
||||||
|
class="cmd-manage chengdou-03__systerm"
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="show"
|
||||||
|
width="1000px"
|
||||||
|
:before-close="doClose"
|
||||||
|
:z-index="2010"
|
||||||
|
:modal="false"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
|
<div class="main">
|
||||||
|
<div class="top">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<div>
|
||||||
|
<span>命令类型名称:</span>
|
||||||
|
<span>{{ typeObj[signedData.type] }}</span>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div>
|
||||||
|
<span>命令号码:</span>
|
||||||
|
<span>{{ signedData.number }}</span>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div>
|
||||||
|
<span>日期:</span>
|
||||||
|
<span>{{ getParseTime(signedData.sendTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div>
|
||||||
|
<span>发令时刻:</span>
|
||||||
|
<span>{{ getParseTime(signedData.sendTime, '{h}:{i}:{s}') }}</span>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="9">
|
||||||
|
<div>
|
||||||
|
<span>发令单位:</span>
|
||||||
|
<span>{{ signedData.companyOfSender }}</span>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="15">
|
||||||
|
<div>
|
||||||
|
<span>调度员姓名:</span>
|
||||||
|
<span>{{ signedData.senderName }}</span>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
<div class="content-box">
|
||||||
|
<div class="box-title">命令内容</div>
|
||||||
|
<div class="box-top">
|
||||||
|
<el-input v-model="signedData.content" readonly type="textarea" rows="9" resize="none" placeholder="请输入内容" />
|
||||||
|
</div>
|
||||||
|
<div class="box-table">
|
||||||
|
<el-table :data="getTableData" style="width: 100%" height="200">
|
||||||
|
<el-table-column type="index" label="序" width="50" />
|
||||||
|
<el-table-column prop="deviceName" label="受令单位" />
|
||||||
|
<el-table-column prop="copyers" label="抄知处所" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<div class="box-bottom">
|
||||||
|
<div>
|
||||||
|
<el-checkbox v-model="needprint">签收后打印</el-checkbox>
|
||||||
|
<el-checkbox v-model="needRead">需他人阅读</el-checkbox>
|
||||||
|
</div>
|
||||||
|
<div class="bottom-signed">
|
||||||
|
<span>签收人姓名:</span>
|
||||||
|
<el-input v-model="signedBy" readonly style="width: 150px" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="bottom-btn">
|
||||||
|
<el-button :disabled="!commandId || currentHasSigned" @click="signCmd('REFUSE')">拒签</el-button>
|
||||||
|
<el-button :disabled="!commandId || currentHasSigned" @click="signCmd('SIGNED')">签收</el-button>
|
||||||
|
<el-button @click="doClose">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { sendCommandNew } from '@/api/jmap/training';
|
||||||
|
import { mapState } from 'vuex';
|
||||||
|
import { parseTime } from '@/utils/index';
|
||||||
|
export default {
|
||||||
|
name:'CmdManage',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
signedData: {},
|
||||||
|
needRead: false,
|
||||||
|
needprint: false,
|
||||||
|
dialogShow: false,
|
||||||
|
signedId: '',
|
||||||
|
signedBy: '',
|
||||||
|
typeObj: {
|
||||||
|
NORMAL: '正常调度命令'
|
||||||
|
},
|
||||||
|
signedStatusObj: {
|
||||||
|
UNSIGNED: '未签收',
|
||||||
|
SIGNED: '签收',
|
||||||
|
REFUSE: '拒签'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState('training', [
|
||||||
|
'memberList', 'simulationUserList', 'initTime'
|
||||||
|
]),
|
||||||
|
...mapState('socket', [
|
||||||
|
'dispatchCommandMsg'
|
||||||
|
]),
|
||||||
|
show() {
|
||||||
|
return this.dialogShow;
|
||||||
|
},
|
||||||
|
group() {
|
||||||
|
return this.$route.query.group;
|
||||||
|
},
|
||||||
|
title() {
|
||||||
|
return '调度命令管理';
|
||||||
|
},
|
||||||
|
commandId() {
|
||||||
|
return this.signedData.id || '';
|
||||||
|
},
|
||||||
|
currentHasSigned() {
|
||||||
|
let hasSigned = false;
|
||||||
|
if (this.signedData.receiverInfos) {
|
||||||
|
const obj = this.getSignInfo(this.signedData.receiverInfos);
|
||||||
|
if (obj && obj.signedStatus != 'UNSIGNED') {
|
||||||
|
hasSigned = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return hasSigned;
|
||||||
|
},
|
||||||
|
getActiveUser() {
|
||||||
|
const userInfo = this.simulationUserList.find(item => {
|
||||||
|
return item.userId == this.$store.state.user.id;
|
||||||
|
});
|
||||||
|
const activeUser = userInfo || {};
|
||||||
|
return activeUser;
|
||||||
|
},
|
||||||
|
getTableData() {
|
||||||
|
const receiverList = Object.values(this.signedData.receiverInfos || {});
|
||||||
|
const mList = [];
|
||||||
|
receiverList.forEach(ii => {
|
||||||
|
const obj = this.memberList.find(item => {
|
||||||
|
return item.id == ii.receiverId;
|
||||||
|
});
|
||||||
|
if (obj) {
|
||||||
|
mList.push({
|
||||||
|
commandId: this.commandId,
|
||||||
|
...ii,
|
||||||
|
...obj
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const list = [];
|
||||||
|
mList.forEach(item => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
|
||||||
|
const obj = {
|
||||||
|
...this.signedData,
|
||||||
|
...item,
|
||||||
|
deviceName: device ? device.name : ''
|
||||||
|
};
|
||||||
|
list.push(obj);
|
||||||
|
});
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {},
|
||||||
|
beforeDestroy() {},
|
||||||
|
mounted() {},
|
||||||
|
methods:{
|
||||||
|
getParseTime(val, f) {
|
||||||
|
return val ? parseTime(val, f) : '';
|
||||||
|
},
|
||||||
|
getSenderName() {
|
||||||
|
this.signedBy = '';
|
||||||
|
this.signedId = '';
|
||||||
|
const activeUser = this.simulationUserList.find(item => {
|
||||||
|
return item.userId == this.$store.state.user.id;
|
||||||
|
});
|
||||||
|
if (activeUser) {
|
||||||
|
this.signedBy = activeUser.nickName;
|
||||||
|
this.signedId = activeUser.memberId;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
doShow() {
|
||||||
|
this.getSenderName();
|
||||||
|
this.getSignedData();
|
||||||
|
this.dialogShow = true;
|
||||||
|
},
|
||||||
|
doClose() {
|
||||||
|
this.dialogShow = false;
|
||||||
|
this.$emit('signedCmdClose');
|
||||||
|
},
|
||||||
|
getSignedData() {
|
||||||
|
this.signedData = {};
|
||||||
|
if (this.dispatchCommandMsg.type == 'ADD') {
|
||||||
|
this.signedData = this.dispatchCommandMsg.body;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getSignInfo(info) {
|
||||||
|
const obj = info[this.getActiveUser.memberId] || {};
|
||||||
|
return obj;
|
||||||
|
},
|
||||||
|
getSignedBy(info) {
|
||||||
|
const signedInfo = this.simulationUserList.find(item => {
|
||||||
|
return item.memberId == info.signedBy;
|
||||||
|
});
|
||||||
|
let name = '';
|
||||||
|
if (signedInfo) {
|
||||||
|
name = signedInfo.nickName;
|
||||||
|
}
|
||||||
|
return name;
|
||||||
|
},
|
||||||
|
signCmd(status) {
|
||||||
|
if (!this.commandId) { return; }
|
||||||
|
const signInfo = { commandId: this.commandId, signedBy: this.signedId, signedStatus: status };
|
||||||
|
const data = {
|
||||||
|
signInfo: signInfo
|
||||||
|
};
|
||||||
|
sendCommandNew(this.group, 'CTC_SIGN_DISPATCH_COMMAND', data).then((res) => {
|
||||||
|
console.log(res, '---res');
|
||||||
|
this.$emit('changeSignedStatus', signInfo);
|
||||||
|
this.doClose();
|
||||||
|
}).catch(error => {
|
||||||
|
this.$messageBox('查询调度命令失败:' + error.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.main {
|
||||||
|
height: 100%;
|
||||||
|
.top {
|
||||||
|
padding: 5px 10px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
span {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content-box {
|
||||||
|
.box-title {
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
}
|
||||||
|
.box-bottom {
|
||||||
|
height: 50px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
.bottom-signed {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.bottom-btn {
|
||||||
|
height: 40px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: flex-end;
|
||||||
|
}
|
||||||
|
</style>
|
File diff suppressed because it is too large
Load Diff
@ -750,6 +750,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
|
that.audioPlay = false;
|
||||||
switch (error.code || error.name) {
|
switch (error.code || error.name) {
|
||||||
case 'PERMISSION_DENIED':
|
case 'PERMISSION_DENIED':
|
||||||
case 'PermissionDeniedError':
|
case 'PermissionDeniedError':
|
||||||
|
@ -124,9 +124,9 @@ export default {
|
|||||||
'$store.state.training.operateErrMsg': function (val) {
|
'$store.state.training.operateErrMsg': function (val) {
|
||||||
this.tipInfo({ color: val.color, message: val.errMsg });
|
this.tipInfo({ color: val.color, message: val.errMsg });
|
||||||
},
|
},
|
||||||
'$store.state.socket.simulationOver':function(val) {
|
'$store.state.socket.simulationOver':function(val) {
|
||||||
this.back();
|
this.back();
|
||||||
},
|
},
|
||||||
'$store.state.training.simulationUserList': function(val) {
|
'$store.state.training.simulationUserList': function(val) {
|
||||||
const userInfo = this.$store.state.training.simulationUserList.find(user => user.userId == this.$store.state.user.id );
|
const userInfo = this.$store.state.training.simulationUserList.find(user => user.userId == this.$store.state.user.id );
|
||||||
if (userInfo.type === 'STATION_SUPERVISOR') {
|
if (userInfo.type === 'STATION_SUPERVISOR') {
|
||||||
|
@ -463,6 +463,26 @@ export default {
|
|||||||
this.jl3dmaintainershow = false;
|
this.jl3dmaintainershow = false;
|
||||||
this.drivingShow = false;
|
this.drivingShow = false;
|
||||||
break;
|
break;
|
||||||
|
case 'STATION_ASSISTANT':
|
||||||
|
if (this.selfJmap) { Vue.prototype.$jlmap = this.selfJmap; }
|
||||||
|
this.$store.dispatch('training/setPrdType', '01');
|
||||||
|
this.$store.dispatch('training/setRoles', 'STATION_ASSISTANT');
|
||||||
|
this.$refs.menuSchema.chiShowStation = deviceCode;
|
||||||
|
this.showStation = deviceCode;
|
||||||
|
if (this.lineCode === '14') {
|
||||||
|
const list = [];
|
||||||
|
const mapDevice = this.$store.state.map.mapDevice;
|
||||||
|
this.$jlmap.setMap(this.$store.state.map.map, this.$store.state.map.mapDevice, {routeDate: this.$store.state.map.routeData, autoReentryData: this.$store.state.map.autoReentryData});
|
||||||
|
for (const key in mapDevice) {
|
||||||
|
list.push(mapDevice[key]);
|
||||||
|
}
|
||||||
|
this.$jlmap.updateShowMode(list, '02');
|
||||||
|
}
|
||||||
|
this.$jlmap.amendDevice([...this.sectionList, ...this.signalList, ...this.trainWindowList]);
|
||||||
|
this.mapViewLoadedOver && this.switchStationMode(deviceCode);
|
||||||
|
this.jl3dmaintainershow = false;
|
||||||
|
this.drivingShow = false;
|
||||||
|
break;
|
||||||
case 'DEPOT_DISPATCHER':
|
case 'DEPOT_DISPATCHER':
|
||||||
this.$store.dispatch('training/setPrdType', '09');
|
this.$store.dispatch('training/setPrdType', '09');
|
||||||
this.$store.dispatch('training/setRoles', 'DEPOT_DISPATCHER');
|
this.$store.dispatch('training/setRoles', 'DEPOT_DISPATCHER');
|
||||||
@ -600,7 +620,7 @@ export default {
|
|||||||
if (this.$store.state.training.prdType == '04') {
|
if (this.$store.state.training.prdType == '04') {
|
||||||
this.panelShow = false;
|
this.panelShow = false;
|
||||||
this.drivingShow = true;
|
this.drivingShow = true;
|
||||||
this.$refs.Jl3dDrive.show(this.mapId, this.group, 34, 'isTraining');
|
this.$refs.Jl3dDrive.show(this.mapId, this.group, 34, 'isTraining', this.deviceCode);
|
||||||
} else {
|
} else {
|
||||||
const routeData = this.$router.resolve({
|
const routeData = this.$router.resolve({
|
||||||
path:'/jlmap3d/sandbox',
|
path:'/jlmap3d/sandbox',
|
||||||
@ -733,8 +753,8 @@ export default {
|
|||||||
} else if (item.messageType === 'PLAY_CHANGE' && item.userId == this.userId) {
|
} else if (item.messageType === 'PLAY_CHANGE' && item.userId == this.userId) {
|
||||||
this.userRole = item.type || 'AUDIENCE';
|
this.userRole = item.type || 'AUDIENCE';
|
||||||
this.$store.dispatch('training/setRoleDeviceCode', item.deviceCode);
|
this.$store.dispatch('training/setRoleDeviceCode', item.deviceCode);
|
||||||
this.setSimulationPrdType(this.centralizedStationMap[item.deviceCode]);
|
|
||||||
this.deviceCode = item.deviceCode;
|
this.deviceCode = item.deviceCode;
|
||||||
|
this.setSimulationPrdType(this.centralizedStationMap[item.deviceCode]);
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (item.deviceCode && this.$store.state.training.prdType !== '09') { this.setCenter(item.deviceCode); }
|
if (item.deviceCode && this.$store.state.training.prdType !== '09') { this.setCenter(item.deviceCode); }
|
||||||
});
|
});
|
||||||
|
@ -113,10 +113,13 @@ export default {
|
|||||||
}, {
|
}, {
|
||||||
labelName: '车辆段',
|
labelName: '车辆段',
|
||||||
children: []
|
children: []
|
||||||
},{
|
}, {
|
||||||
labelName: 'CTC操作员',
|
labelName: 'CTC操作员',
|
||||||
children: []
|
children: []
|
||||||
}]
|
}, {
|
||||||
|
labelName: '车站助理',
|
||||||
|
children: []
|
||||||
|
}]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -150,6 +153,7 @@ export default {
|
|||||||
const driverList = [];
|
const driverList = [];
|
||||||
const maintainerList = [];
|
const maintainerList = [];
|
||||||
const ctcOperatorList = [];
|
const ctcOperatorList = [];
|
||||||
|
const stationAssistantList = [];
|
||||||
val.forEach(item => {
|
val.forEach(item => {
|
||||||
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
|
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
@ -177,10 +181,14 @@ export default {
|
|||||||
this.memberData[item.id].labelName = '通号' + (item.name || '');
|
this.memberData[item.id].labelName = '通号' + (item.name || '');
|
||||||
maintainerList.push(this.memberData[item.id]);
|
maintainerList.push(this.memberData[item.id]);
|
||||||
break;
|
break;
|
||||||
case 'RAIL_CTC':
|
case 'RAIL_CTC':
|
||||||
this.memberData[item.id].labelName = 'CTC操作员' + device.name;
|
this.memberData[item.id].labelName = 'CTC操作员' + device.name;
|
||||||
ctcOperatorList.push(this.memberData[item.id]);
|
ctcOperatorList.push(this.memberData[item.id]);
|
||||||
break
|
break;
|
||||||
|
case 'STATION_ASSISTANT':
|
||||||
|
this.memberData[item.id].labelName = '车站助理' + +device.name + (item.name ? `-${item.name }` : '');
|
||||||
|
stationAssistantList.push(this.memberData[item.id]);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.treeData = [{
|
this.treeData = [{
|
||||||
@ -208,10 +216,14 @@ export default {
|
|||||||
id: 'electricDispatcher',
|
id: 'electricDispatcher',
|
||||||
children: electricDispatcherList
|
children: electricDispatcherList
|
||||||
}, {
|
}, {
|
||||||
labelName: 'CTC操作员',
|
labelName: 'CTC操作员',
|
||||||
id: 'ctcOperator',
|
id: 'ctcOperator',
|
||||||
children: ctcOperatorList
|
children: ctcOperatorList
|
||||||
}
|
}, {
|
||||||
|
labelName: '车站助理',
|
||||||
|
id: 'stationAssistant',
|
||||||
|
children: stationAssistantList
|
||||||
|
}
|
||||||
];
|
];
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.$refs.tree) {
|
if (this.$refs.tree) {
|
||||||
|
@ -129,9 +129,9 @@ export default {
|
|||||||
lineCode() {
|
lineCode() {
|
||||||
return this.$route.query.lineCode;
|
return this.$route.query.lineCode;
|
||||||
},
|
},
|
||||||
datie(){
|
datie() {
|
||||||
return this.$route.query.lineCode == '16'
|
return this.$route.query.lineCode == '16';
|
||||||
},
|
},
|
||||||
mapId() {
|
mapId() {
|
||||||
return this.$route.query.mapId;
|
return this.$route.query.mapId;
|
||||||
},
|
},
|
||||||
@ -306,6 +306,10 @@ export default {
|
|||||||
this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR');
|
this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR');
|
||||||
this.$emit('getUserRole');
|
this.$emit('getUserRole');
|
||||||
break;
|
break;
|
||||||
|
case 'STATION_ASSISTANT':
|
||||||
|
this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'STATION_ASSISTANT');
|
||||||
|
this.$emit('getUserRole');
|
||||||
|
break;
|
||||||
case 'CI':
|
case 'CI':
|
||||||
this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'CI');
|
this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'CI');
|
||||||
this.$emit('getUserRole');
|
this.$emit('getUserRole');
|
||||||
|
660
src/views/newMap/mapDraftPicture/index.vue
Normal file
660
src/views/newMap/mapDraftPicture/index.vue
Normal file
@ -0,0 +1,660 @@
|
|||||||
|
<template>
|
||||||
|
<transition name="el-zoom-in-center">
|
||||||
|
<div class="mapPaint">
|
||||||
|
<div v-show="maskOpen" class="mask" />
|
||||||
|
<div class="map-view">
|
||||||
|
<div class="operation_box" :class="{'rightShow': draftShow}">
|
||||||
|
<el-button-group>
|
||||||
|
<el-button size="small" :disabled="!stepData.length" @click="revocation">撤销</el-button>
|
||||||
|
<el-button size="small" :disabled="!recoverStepData.length" @click="recover">恢复</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
</div>
|
||||||
|
<div class="operation_box back_box">
|
||||||
|
<el-button size="small" @click="backRoute">返回</el-button>
|
||||||
|
<el-button size="small" style="margin-left: 5px;" @click="updateObjAxis">更新坐标</el-button>
|
||||||
|
</div>
|
||||||
|
<jlmap-visual ref="jlmapVisual" :draft-show="draftShow" @onSelect="clickEvent" @onMenu="onContextmenu" />
|
||||||
|
</div>
|
||||||
|
<div class="map-draft" :class="{'hide': draftShow}">
|
||||||
|
<div class="btn_left_box" @click="clickRightBtn"><i :class="draftShow?'el-icon-arrow-right':'el-icon-arrow-left'" /></div>
|
||||||
|
<div class="box">
|
||||||
|
<map-operate
|
||||||
|
ref="mapOperate"
|
||||||
|
:map-info="mapInfo"
|
||||||
|
:selected="selected"
|
||||||
|
:map-saveing="mapSaveing"
|
||||||
|
@saveMapEvent="saveMapEvent"
|
||||||
|
@updateMapModel="updateMapModel"
|
||||||
|
@setCenter="setCenter"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<pop-menu ref="popMenu" :menu="menu" />
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { saveMap, verifyMap, getMapDetail, postBuildMapImport, getRouteNewList, getAutoReentryList } from '@/api/jmap/mapdraft';
|
||||||
|
import { ViewMode, TrainingMode, getDeviceMenuByDeviceType, DeviceMenu } from '@/scripts/ConstDic';
|
||||||
|
import JlmapVisual from '@/views/newMap/jlmapNew/index';
|
||||||
|
import MapOperate from './mapoperate/index';
|
||||||
|
import { EventBus } from '@/scripts/event-bus';
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
import PopMenu from '@/components/PopMenu';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'MapView',
|
||||||
|
components: {
|
||||||
|
JlmapVisual,
|
||||||
|
MapOperate,
|
||||||
|
PopMenu
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
viewSelect: ViewMode.MIX,
|
||||||
|
mapSaveing: false,
|
||||||
|
ViewMode: ViewMode,
|
||||||
|
viewDraft: 'draft',
|
||||||
|
autoSaveTask: null,
|
||||||
|
selected: null,
|
||||||
|
mapInfo: { name: this.$t('map.pleaseSelectMap') },
|
||||||
|
oldDevice: null,
|
||||||
|
draftShow: false,
|
||||||
|
size: {
|
||||||
|
width: document.documentElement.clientWidth - 521,
|
||||||
|
height: document.documentElement.clientHeight - 90
|
||||||
|
},
|
||||||
|
updtModel: {
|
||||||
|
code: '',
|
||||||
|
scaling: '',
|
||||||
|
origin: {
|
||||||
|
x: '',
|
||||||
|
y: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
menu: [],
|
||||||
|
menuNormal: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters('map', [
|
||||||
|
'stepData',
|
||||||
|
'recoverStepData',
|
||||||
|
'stationList'
|
||||||
|
]),
|
||||||
|
maskOpen() {
|
||||||
|
return this.$store.state.config.maskOpen;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
'$store.state.map.mapDataLoadedCount': function () {
|
||||||
|
this.initAutoSaveTask();
|
||||||
|
},
|
||||||
|
'$store.state.app.windowSizeCount': function() {
|
||||||
|
this.setWindowSize();
|
||||||
|
},
|
||||||
|
$route() {
|
||||||
|
this.clearAutoSave();
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.loadInitPage();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
'$store.state.menuOperation.menuCount': function () {
|
||||||
|
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
|
||||||
|
this.popDoShow(this.$store.state.menuOperation.menuPosition);
|
||||||
|
} else {
|
||||||
|
this.popDoClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.setWindowSize();
|
||||||
|
this.loadInitPage();
|
||||||
|
EventBus.$on('SELECTON', () => {
|
||||||
|
this.selected = null;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
EventBus.$off('SELECTON');
|
||||||
|
this.clearAutoSave();
|
||||||
|
this.$store.dispatch('map/mapClear');
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
clickRightBtn() {
|
||||||
|
this.draftShow = !this.draftShow;
|
||||||
|
},
|
||||||
|
getMapOrigin() {
|
||||||
|
const dataZoom = this.$store.state.map.dataZoom;
|
||||||
|
if (dataZoom && dataZoom.offsetX) {
|
||||||
|
this.updtModel.origin.x = Number.parseInt(dataZoom.offsetX);
|
||||||
|
this.updtModel.origin.y = Number.parseInt(dataZoom.offsetY);
|
||||||
|
this.updtModel.scaling = dataZoom.scaleRate;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 设置地图定位
|
||||||
|
mapLocation(item) {
|
||||||
|
if (item) {
|
||||||
|
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
|
||||||
|
this.popDoClose();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
initMenu() {
|
||||||
|
this.menuNormal = [];
|
||||||
|
this.stationList.forEach(station => {
|
||||||
|
if (station.chargeStationCodeList && station.chargeStationCodeList.length) {
|
||||||
|
const node = {
|
||||||
|
label: station.name,
|
||||||
|
children: []
|
||||||
|
};
|
||||||
|
station.chargeStationCodeList.forEach(item => {
|
||||||
|
const next = this.$store.getters['map/getDeviceByCode'](item);
|
||||||
|
node.children.push({
|
||||||
|
code: next.code,
|
||||||
|
label: next.name,
|
||||||
|
handler: this.mapLocation
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.menuNormal.push(node);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.menu = [...this.menuNormal];
|
||||||
|
},
|
||||||
|
popDoShow(point) {
|
||||||
|
this.popClickEvent();
|
||||||
|
this.initMenu();
|
||||||
|
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||||
|
this.$refs.popMenu.resetShowPosition(point);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
popClickEvent() {
|
||||||
|
const self = this;
|
||||||
|
window.onclick = function () {
|
||||||
|
self.popDoClose();
|
||||||
|
};
|
||||||
|
},
|
||||||
|
popDoClose() {
|
||||||
|
if (this.$refs && this.$refs.popMenu) {
|
||||||
|
this.$refs.popMenu.close();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
updateObjAxis() {
|
||||||
|
this.getMapOrigin();
|
||||||
|
this.$confirm('您确认按当前绘图位置更新坐标及缩放比例?', this.$t('tip.hint'), {
|
||||||
|
confirmButtonText: this.$t('tip.confirm'),
|
||||||
|
cancelButtonText: this.$t('tip.cancel'),
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
const map = this.$store.state.map.map;
|
||||||
|
this.$store.dispatch('map/saveMapDeviceDefaultRelations').then(() => {
|
||||||
|
const param = {
|
||||||
|
mapId: this.$route.params.mapId,
|
||||||
|
skinVO: {
|
||||||
|
code: this.$store.state.map.map.skinVO.code,
|
||||||
|
name: this.$store.state.map.map.skinVO.name
|
||||||
|
},
|
||||||
|
origin: {
|
||||||
|
x: this.updtModel.origin.x || map.origin.x,
|
||||||
|
y: this.updtModel.origin.y || map.origin.y
|
||||||
|
},
|
||||||
|
scaling: this.updtModel.scaling
|
||||||
|
};
|
||||||
|
saveMap(Object.assign(map, param)).then(() => {
|
||||||
|
this.$message.success(this.$t('map.updateSuccessfully'));
|
||||||
|
}).catch(() => {
|
||||||
|
this.$messageBox(this.$t('map.updateFailed'));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}).catch(() => { });
|
||||||
|
},
|
||||||
|
setWindowSize() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const width = this.$store.state.app.width;
|
||||||
|
const height = this.$store.state.app.height - 90;
|
||||||
|
this.$store.dispatch('config/resize', { width, height });
|
||||||
|
});
|
||||||
|
},
|
||||||
|
endViewLoading(isSuccess) {
|
||||||
|
if (!isSuccess) {
|
||||||
|
this.$store.dispatch('map/mapClear');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
EventBus.$emit('viewLoading', false);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
loadInitPage() {
|
||||||
|
this.$store.dispatch('training/changeMode', { mode: TrainingMode.MAP_EDIT });
|
||||||
|
this.$store.commit('map/clearStepData'); // 清空步骤
|
||||||
|
this.mapInfo = { name: this.$t('map.pleaseSelectMap'), id: this.$route.params.mapId };
|
||||||
|
if (parseInt(this.mapInfo.id)) {
|
||||||
|
this.mapInfo.name = this.$route.query.name;
|
||||||
|
getMapDetail(this.$route.params.mapId).then(response => {
|
||||||
|
this.$store.dispatch('map/setMapData', response.data).then(() => {
|
||||||
|
this.$store.dispatch('training/setMapDefaultState');
|
||||||
|
});
|
||||||
|
this.initAutoSaveTask();
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log(error, '加载地图错误提示');
|
||||||
|
this.$message.error(this.$t('tip.failedLoadMap'));
|
||||||
|
this.endViewLoading();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.endViewLoading();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
initAutoSaveTask() {
|
||||||
|
const timeout = 1000 * 60 * 3;
|
||||||
|
this.clearAutoSave(this.autoSaveTask);
|
||||||
|
if (this.viewDraft === 'draft') {
|
||||||
|
this.autoSaveTask = setInterval(this.saveMapEvent, timeout);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
clearAutoSave() {
|
||||||
|
if (this.autoSaveTask) {
|
||||||
|
clearInterval(this.autoSaveTask);
|
||||||
|
this.autoSaveTask = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleSelectControlPage (model) {
|
||||||
|
if (this.$refs.mapOperate) {
|
||||||
|
this.$refs.mapOperate.handleSelectControlPage(model);
|
||||||
|
this.$store.dispatch('menuOperation/setMapDrawSelectCount');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleSelectPhysicalView(handle) {
|
||||||
|
if (this.$refs.jlmapVisual) {
|
||||||
|
this.$refs.jlmapVisual.setLevelVisible(handle);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
clickEvent(em) {
|
||||||
|
const device = this.getDeviceByEm(em);
|
||||||
|
this.deviceHighLight(this.oldDevice, false);
|
||||||
|
this.deviceHighLight(device, true);
|
||||||
|
this.oldDevice = device;
|
||||||
|
this.onSelect(device);
|
||||||
|
},
|
||||||
|
// 获取设备数据
|
||||||
|
getDeviceByEm(em) {
|
||||||
|
var device = this.$store.getters['map/getDeviceByCode'](em.deviceCode) || null;
|
||||||
|
if (device) {
|
||||||
|
device._viewVal = em.val;
|
||||||
|
}
|
||||||
|
return device;
|
||||||
|
},
|
||||||
|
onSelect(device) {
|
||||||
|
this.selected = device || null;
|
||||||
|
this.selected && this.handleSelectControlPage(device);
|
||||||
|
},
|
||||||
|
onContextmenu(em) {
|
||||||
|
this.point = {
|
||||||
|
x: em.clientX,
|
||||||
|
y: em.clientY
|
||||||
|
};
|
||||||
|
if (!em.deviceType) {
|
||||||
|
var menu = getDeviceMenuByDeviceType('Cancel');
|
||||||
|
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
verifySectionPoint(map) { // 校验区段坐标不为空
|
||||||
|
let flag = true;
|
||||||
|
map.sectionList.forEach(elem => {
|
||||||
|
if (elem.points.length > 0) {
|
||||||
|
for (let index = 0; index < elem.points.length; index++) {
|
||||||
|
if (String(elem.points[index].x) === 'undefined' || String(elem.points[index].y) === 'undefined') {
|
||||||
|
this.$message(`${elem.name}${this.$t('tip.sectionPointsDeficiency')}`);
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$message(this.$t('tip.sectionPointsDeficiency'));
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return flag;
|
||||||
|
},
|
||||||
|
verifySectionRelation(map) {
|
||||||
|
let flag = true;
|
||||||
|
const tipInfoList = [];
|
||||||
|
map.sectionList.forEach(section => {
|
||||||
|
section.type === '01' && map.sectionList.forEach(item => {
|
||||||
|
if (section.code !== item.code && item.type === '01' && this.checkSectionPointsHasCoincide(section.points, item.points) && !this.checkCorrelation(section, item)) {
|
||||||
|
tipInfoList.push('区段' + section.name + '(' + section.code + '): 或者区段' + item.name + '(' + item.code + ')' + '关联关系设置错误!' );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
if (!tipInfoList.length) {
|
||||||
|
flag = true;
|
||||||
|
} else {
|
||||||
|
flag = false;
|
||||||
|
this.$messageBox(this.$t('tip.dataValidationFailed'));
|
||||||
|
this.tableToExcel(tipInfoList);
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
},
|
||||||
|
async verifyInterlockDevice(map) {
|
||||||
|
let flag = true;
|
||||||
|
const tipInfoList = [];
|
||||||
|
const routeCodeList = [];
|
||||||
|
const cycleCodeList = [];
|
||||||
|
const resp1 = await getRouteNewList(this.$route.params.mapId, {pageSize:9999, pageNum:1});
|
||||||
|
if (resp1.data && resp1.data.list) {
|
||||||
|
resp1.data.list.forEach(item => {
|
||||||
|
routeCodeList.push(item.code);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const resp2 = await getAutoReentryList(this.$route.params.mapId, {pageSize:9999, pageNum:1});
|
||||||
|
if (resp2.data && resp2.data.list) {
|
||||||
|
resp2.data.list.forEach(item => {
|
||||||
|
cycleCodeList.push(item.code);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
map.cycleButtonList.forEach(cycleButton => {
|
||||||
|
if (!cycleCodeList.includes(cycleButton.cycleCode)) {
|
||||||
|
flag = false;
|
||||||
|
tipInfoList.push('自动折返功能按钮' + cycleButton.name + '(' + cycleButton.code + ')' + '的关联自动折返数据不存在!');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
map.automaticRouteButtonList.forEach(routeButton => {
|
||||||
|
if (!routeCodeList.includes(routeButton.automaticRouteCode)) {
|
||||||
|
flag = false;
|
||||||
|
tipInfoList.push('自动进路功能按钮' + routeButton.name + '(' + routeButton.code + ')' + '的关联进路数据不存在!');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!flag) {
|
||||||
|
this.$messageBox(this.$t('tip.dataValidationFailed'));
|
||||||
|
this.tableToExcel(tipInfoList);
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
},
|
||||||
|
verifyStationPosition(map) {
|
||||||
|
let flag = true;
|
||||||
|
const tipInfoList = [];
|
||||||
|
map.stationStandList.forEach(stationStand => {
|
||||||
|
const section = this.$store.getters['map/getDeviceByCode'](stationStand.standTrackCode);
|
||||||
|
const list = [];
|
||||||
|
section && section.points.forEach(point => {
|
||||||
|
list.push(point.x);
|
||||||
|
});
|
||||||
|
if (stationStand.position.x > Math.max(...list) || stationStand.position.x < Math.min(...list)) {
|
||||||
|
flag = false;
|
||||||
|
tipInfoList.push('站台' + stationStand.name + '(' + stationStand.code + ')' + '位置偏移出关联站台轨,请检查关联站台轨是否正确!');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!flag) {
|
||||||
|
this.$messageBox(this.$t('tip.dataValidationFailed'));
|
||||||
|
this.tableToExcel(tipInfoList);
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
},
|
||||||
|
verifySignalPosition(map) {
|
||||||
|
let flag = true;
|
||||||
|
const tipInfoList = [];
|
||||||
|
map.signalList.forEach(signal => {
|
||||||
|
const section = this.$store.getters['map/getDeviceByCode'](signal.sectionCode);
|
||||||
|
if (section) {
|
||||||
|
const offsetX = signal.positionPoint ? signal.positionPoint.x : 0;
|
||||||
|
const signalPositionX = signal.position.x - offsetX;
|
||||||
|
const max = Math.max(section.points[section.points.length - 1].x, section.points[0].x);
|
||||||
|
const min = Math.min(section.points[section.points.length - 1].x, section.points[0].x);
|
||||||
|
if (signalPositionX < min && signalPositionX > max) {
|
||||||
|
tipInfoList.push('信号机' + signal.name + '(' + signal.code + ')未在其关联的区段' + section.name + '(' + section.code + ')里');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
tipInfoList.push('信号机' + signal.name + '(' + signal.code + ')所关联的区段不存在');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!tipInfoList.length) {
|
||||||
|
flag = true;
|
||||||
|
} else {
|
||||||
|
flag = false;
|
||||||
|
this.$messageBox(this.$t('tip.dataValidationFailed'));
|
||||||
|
this.tableToExcel(tipInfoList);
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
},
|
||||||
|
checkPointsCoincide(point1, point2) { // 校验两点是否重合
|
||||||
|
if (point1 && point2) {
|
||||||
|
return point1.x === point2.x && point1.y === point2.y;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
checkSectionPointsHasCoincide(points1, points2) { // 校验两区段的左右点是否有重合
|
||||||
|
return points1.length && points2.length && (this.checkPointsCoincide(points1[0], points2[0]) || this.checkPointsCoincide(points1[0], points2[points2.length - 1]) || this.checkPointsCoincide(points1[points1.length - 1], points2[points2.length - 1]) || this.checkPointsCoincide(points1[points1.length - 1], points2[0]));
|
||||||
|
},
|
||||||
|
checkCorrelation(section1, section2) { // 校验后者是否与前者有关联关系
|
||||||
|
return section1.leftSectionCode === section2.code || section1.rightSectionCode === section2.code;
|
||||||
|
},
|
||||||
|
saveMapEvent() { // 保存地图
|
||||||
|
const map = this.$store.state.map.map;
|
||||||
|
if (this.$refs.jlmapVisual && map && parseInt(this.$route.params.mapId)) {
|
||||||
|
this.mapSaveing = true;
|
||||||
|
this.$store.dispatch('map/saveMapDeviceDefaultRelations').then(() => { // 草稿地图关系处理
|
||||||
|
saveMap(Object.assign(map, { mapId: this.$route.params.mapId })).then(() => {
|
||||||
|
this.$message.success(this.$t('tip.saveSuccessfully'));
|
||||||
|
this.mapSaveing = false;
|
||||||
|
this.initAutoSaveTask();
|
||||||
|
}).catch(error => {
|
||||||
|
console.log(error);
|
||||||
|
this.$messageBox(this.$t('tip.saveFailed'));
|
||||||
|
this.mapSaveing = false;
|
||||||
|
if (error.code === 40004 || error.code === 40005 || error.code === 40003) {
|
||||||
|
this.clearAutoSave();
|
||||||
|
} else {
|
||||||
|
this.initAutoSaveTask();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).catch(error => {
|
||||||
|
console.log(error, '错误提示');
|
||||||
|
this.mapSaveing = false;
|
||||||
|
this.$message(this.$t('tip.saveFailed'));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async checkOver() {
|
||||||
|
if (this.$refs.jlmapVisual) {
|
||||||
|
const map = this.$store.state.map.map;
|
||||||
|
if (map && this.$route.params.mapId) {
|
||||||
|
const checkInterlockDevice = await this.verifyInterlockDevice(map);
|
||||||
|
if (this.verifySectionRelation(map) && this.verifySignalPosition(map) && checkInterlockDevice && this.verifyStationPosition(map)) {
|
||||||
|
verifyMap(this.$route.params.mapId).then(res => {
|
||||||
|
if (res.data.length) {
|
||||||
|
this.tableToExcel(res.data);
|
||||||
|
this.$messageBox(this.$t('tip.dataValidationFailed'));
|
||||||
|
} else {
|
||||||
|
this.$message.success(this.$t('tip.dataValidationSuccess'));
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message.error(this.$t('tip.requestFailed'));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tableToExcel(data) {
|
||||||
|
const filterVal = ['index'];
|
||||||
|
const arr = [];
|
||||||
|
data.forEach(item => {
|
||||||
|
arr.push({ index: item });
|
||||||
|
});
|
||||||
|
const dataList = this.formatJson(filterVal, arr);
|
||||||
|
import('@/utils/Export2Excel').then(excel => { excel.export_json_to_excel([this.$t('tip.dataQuestion')], dataList, this.$t('tip.dataList')); });
|
||||||
|
},
|
||||||
|
formatJson(filterVal, jsonData) {
|
||||||
|
return jsonData.map(v => filterVal.map(j => v[j]));
|
||||||
|
},
|
||||||
|
|
||||||
|
backRoute() {
|
||||||
|
this.$router.push({ path: `/design/usermap/home` });
|
||||||
|
},
|
||||||
|
updateMapModel(models) { // 创建 跟新元素
|
||||||
|
this.$store.dispatch('map/updateSystemMapDevices', models);
|
||||||
|
},
|
||||||
|
// 撤销
|
||||||
|
revocation() {
|
||||||
|
this.$store.dispatch('map/setRevocation');
|
||||||
|
},
|
||||||
|
// 恢复
|
||||||
|
recover() {
|
||||||
|
this.$store.dispatch('map/setRecover');
|
||||||
|
},
|
||||||
|
// 设置显示中心
|
||||||
|
setCenter(code) {
|
||||||
|
this.$refs.jlmapVisual.setCenter(code);
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](code);
|
||||||
|
this.deviceHighLight(this.oldDevice, false);
|
||||||
|
this.deviceHighLight(device, true);
|
||||||
|
this.oldDevice = device;
|
||||||
|
},
|
||||||
|
createMap() {
|
||||||
|
this.$refs.mapCreate.show();
|
||||||
|
},
|
||||||
|
importf() { // 导入地图jsons数据
|
||||||
|
const loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: '正在导入中...',
|
||||||
|
spinner: 'el-icon-loading',
|
||||||
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
const obj = this.$refs.files;
|
||||||
|
if (!obj.files) return;
|
||||||
|
const f = obj.files[0];
|
||||||
|
const reader = new FileReader();
|
||||||
|
const that = this;
|
||||||
|
reader.readAsText(f, 'utf-8');
|
||||||
|
reader.onload = function(e) {
|
||||||
|
const data = e.target.result;
|
||||||
|
postBuildMapImport(JSON.parse(data)).then(() => {
|
||||||
|
loading.close();
|
||||||
|
that.$message.success('导入成功!');
|
||||||
|
that.refresh();
|
||||||
|
loading.close();
|
||||||
|
}).catch(error => {
|
||||||
|
loading.close();
|
||||||
|
that.$message.error('导入失败' + error.message);
|
||||||
|
});
|
||||||
|
obj.value = '';
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 高亮设备
|
||||||
|
deviceHighLight(device, flag) {
|
||||||
|
if (device && device.instance && typeof device.instance.drawSelected === 'function' ) {
|
||||||
|
if (device._type === 'Section' && device.type === '04') {
|
||||||
|
device.relevanceSectionList.forEach(item => {
|
||||||
|
const sectionModel = this.$store.getters['map/getDeviceByCode'](item);
|
||||||
|
sectionModel && sectionModel.instance.drawSelected(flag);
|
||||||
|
});
|
||||||
|
} else if (device._type === 'Section' && device.type === '01' && device.logicSectionCodeList && device.logicSectionCodeList.length) {
|
||||||
|
device.logicSectionCodeList.forEach(item => {
|
||||||
|
const sectionModel = this.$store.getters['map/getDeviceByCode'](item);
|
||||||
|
sectionModel && sectionModel.instance.drawSelected(flag);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
device.instance.drawSelected(flag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
@import "src/styles/mixin.scss";
|
||||||
|
/deep/ {
|
||||||
|
.menu-item{
|
||||||
|
background: #f1ecec;
|
||||||
|
.pop-menu {
|
||||||
|
background: #5F9EA0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.mask{
|
||||||
|
opacity: 0;
|
||||||
|
background: #000;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
|
.operation_box{
|
||||||
|
position: absolute;
|
||||||
|
right: 20px;
|
||||||
|
top: 15px;
|
||||||
|
z-index: 9;
|
||||||
|
&.rightShow{
|
||||||
|
right: 540px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.back_box{
|
||||||
|
left: 10px;
|
||||||
|
display: inline-block;
|
||||||
|
width: 180px;
|
||||||
|
}
|
||||||
|
.btn_left_box{
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 50%;
|
||||||
|
padding: 8px 3px;
|
||||||
|
background: #fff;
|
||||||
|
z-index: 10;
|
||||||
|
transform: translateX(-22px);
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 5px 0 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box{
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mapPaint{
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map-view {
|
||||||
|
float: left;
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map-draft {
|
||||||
|
width: 520px;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
transform: translateX(520px);
|
||||||
|
transition: all 0.5s;
|
||||||
|
background: #fff;
|
||||||
|
z-index: 9;
|
||||||
|
/deep/{
|
||||||
|
.v-modal{
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.hide{
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.uploadDemo {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
float: right;
|
||||||
|
padding: 3px 0;
|
||||||
|
margin-right: 3px;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
input {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
opacity: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,50 @@
|
|||||||
|
<template>
|
||||||
|
<div style="height:100%">
|
||||||
|
<div class="view-control-content">
|
||||||
|
<config-list ref="createForm" :form="createForm" :form-model="addModel" :rules="createRules" />
|
||||||
|
</div>
|
||||||
|
<div class="button_box">
|
||||||
|
<el-button-group class="map-draft-group">
|
||||||
|
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import ConfigList from '../config/list';
|
||||||
|
export default {
|
||||||
|
name:'CreateOperate',
|
||||||
|
components: {
|
||||||
|
ConfigList
|
||||||
|
},
|
||||||
|
props:{
|
||||||
|
createForm:{
|
||||||
|
type:Object,
|
||||||
|
required:true
|
||||||
|
},
|
||||||
|
addModel:{
|
||||||
|
type:Object,
|
||||||
|
required:true
|
||||||
|
},
|
||||||
|
createRules:{
|
||||||
|
type:Object,
|
||||||
|
required:true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
create() {
|
||||||
|
this.$refs['createForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.$emit('create');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
resetFields() {
|
||||||
|
this.$refs.createForm && this.$refs.createForm.resetFields();
|
||||||
|
},
|
||||||
|
resetForm() {
|
||||||
|
this.$refs.createForm.resetForm();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,67 @@
|
|||||||
|
<template>
|
||||||
|
<div style="height:100%">
|
||||||
|
<div class="view-control-content">
|
||||||
|
<config-list ref="dataform" :form="form" :form-model="editModel" :rules="rules" />
|
||||||
|
</div>
|
||||||
|
<div class="button_box">
|
||||||
|
<el-button-group class="map-draft-group">
|
||||||
|
<el-button type="primary" size="small" @click="edit">{{ $t('map.updateObj') }}</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import ConfigList from '../config/list';
|
||||||
|
export default {
|
||||||
|
name:'OperateProperty',
|
||||||
|
components: {
|
||||||
|
ConfigList
|
||||||
|
},
|
||||||
|
props:{
|
||||||
|
form:{
|
||||||
|
type:Object,
|
||||||
|
required:true
|
||||||
|
},
|
||||||
|
editModel:{
|
||||||
|
type:Object,
|
||||||
|
required:true
|
||||||
|
},
|
||||||
|
rules:{
|
||||||
|
type:Object,
|
||||||
|
required:true
|
||||||
|
},
|
||||||
|
type:{
|
||||||
|
type:String,
|
||||||
|
required:true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isDeleteHide:true
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
// 修改对象
|
||||||
|
edit() {
|
||||||
|
this.$refs['dataform'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const data = Object.assign({_type: this.type}, this.editModel);
|
||||||
|
if (this.type == 'Text') {
|
||||||
|
data.content = `${this.editModel.prepend}::${this.editModel.content}`;
|
||||||
|
}
|
||||||
|
this.$emit('updateMapModel', data);
|
||||||
|
this.$emit('clearDeviceSelect');
|
||||||
|
} else {
|
||||||
|
this.$message('还有属性未填写,修改未生效!');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
resetFields() {
|
||||||
|
this.$refs.dataform && this.$refs.dataform.resetFields();
|
||||||
|
},
|
||||||
|
clearValidate() {
|
||||||
|
this.$refs.dataform && this.$refs.dataform.clearValidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
477
src/views/newMap/mapDraftPicture/mapoperate/config/list.vue
Normal file
477
src/views/newMap/mapDraftPicture/mapoperate/config/list.vue
Normal file
@ -0,0 +1,477 @@
|
|||||||
|
<template>
|
||||||
|
<el-form ref="form" :label-width="form.labelWidth" size="mini" :rules="rules" :model="formModel" class="form_data">
|
||||||
|
<template v-for="(items, index) in form.items">
|
||||||
|
<fieldset v-if="items.item.length" :key="index" :class="items.name?'card':'noCard'">
|
||||||
|
<legend class="card_title">{{ items.name }}</legend>
|
||||||
|
<template v-for="item in items.item">
|
||||||
|
<template v-if="checkFieldType(item, 'select')">
|
||||||
|
<el-form-item :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||||
|
<el-select
|
||||||
|
v-model="formModel[item.prop]"
|
||||||
|
filterable
|
||||||
|
:placeholder="item.placeholder"
|
||||||
|
:disabled="item.disabled"
|
||||||
|
:clearable="item.clearable"
|
||||||
|
@change="((val)=>{deviceChange(val, item)})"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="option in item.options"
|
||||||
|
:key="option[item.optionValue]"
|
||||||
|
:label="handleLabel(option, item.optionLabel)"
|
||||||
|
:value="option[item.optionValue]"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-if="checkFieldType(item, 'multiSelect')">
|
||||||
|
<el-form-item :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||||
|
<el-select
|
||||||
|
v-model="formModel[item.prop]"
|
||||||
|
filterable
|
||||||
|
multiple
|
||||||
|
:placeholder="item.placeholder"
|
||||||
|
:disabled="item.disabled"
|
||||||
|
:clearable="item.clearable"
|
||||||
|
@change="((val)=>{deviceChange(val, item)})"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="option in item.options"
|
||||||
|
:key="option[item.optionValue]"
|
||||||
|
:label="handleLabel(option, item.optionLabel)"
|
||||||
|
:value="option[item.optionValue]"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-if="checkFieldType(item, 'selectHover')">
|
||||||
|
<el-form-item :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||||
|
<el-select
|
||||||
|
v-model="formModel[item.prop]"
|
||||||
|
filterable
|
||||||
|
:placeholder="item.placeholder"
|
||||||
|
:disabled="item.disabled"
|
||||||
|
:clearable="item.clearable"
|
||||||
|
@change="((val)=>{deviceChange(val, item)})"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="option in item.options"
|
||||||
|
:key="option.code"
|
||||||
|
:label="handleLabel(option, item.optionLabel)"
|
||||||
|
:value="option.code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
<el-button
|
||||||
|
:type="item.buttonShowType ? 'danger' : 'primary'"
|
||||||
|
@click="item.hover(item.buttonType)"
|
||||||
|
>{{ $t('map.activate') }}</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-if="checkFieldType(item, 'multiSelectHover')">
|
||||||
|
<el-form-item :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||||
|
<el-select
|
||||||
|
v-model="formModel[item.prop]"
|
||||||
|
filterable
|
||||||
|
multiple
|
||||||
|
:placeholder="item.placeholder"
|
||||||
|
:disabled="item.disabled"
|
||||||
|
:clearable="item.clearable"
|
||||||
|
@change="((val)=>{deviceChange(val, item)})"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="option in item.options"
|
||||||
|
:key="option.code"
|
||||||
|
:label="handleLabel(option, item.optionLabel)"
|
||||||
|
:value="option.code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
<el-button
|
||||||
|
:type="item.buttonShowType ? 'danger' : 'primary'"
|
||||||
|
@click="item.hover(item.buttonType)"
|
||||||
|
>{{ $t('map.activate') }}</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-if="checkFieldType(item, 'input')">
|
||||||
|
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||||
|
<el-input v-model="formModel[item.prop]" type="text" :disabled="item.disabled" maxlength="30" :show-word-limit="true" @input="((val)=>{deviceChange(val, item)})" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-if="checkFieldType(item, 'number')">
|
||||||
|
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||||
|
<template v-if="!item.firstLevel">
|
||||||
|
<template>
|
||||||
|
<el-input-number v-model="formModel[item.prop]" :min="item.min" :max="item.max" :label="item.label" :disabled="item.disabled" style="width: 140px" @change="((val)=>{deviceChange(val,item)})" />
|
||||||
|
</template>
|
||||||
|
<span class="numberSpan">{{ item.placeholder }}</span>
|
||||||
|
<el-button v-if="item.button" type="primary" size="mini" class="numberBtn" @click="item.clickFunction">{{ item.buttonText }}</el-button>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-input-number v-model="formModel[item.firstLevel][item.secondLevel]" :min="item.min" :max="item.max" :label="item.label" :disabled="item.disabled" />
|
||||||
|
<span class="numberSpan">{{ item.placeholder }}</span>
|
||||||
|
<el-button v-if="item.button" type="primary" size="mini" class="numberBtn" @click="item.clickFunction">{{ item.buttonText }}</el-button>
|
||||||
|
</template>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-if="checkFieldType(item, 'color')">
|
||||||
|
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||||
|
<el-color-picker v-model="formModel[item.prop]" show-alpha :predefine="skins" :disabled="item.disabled" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-if="checkFieldType(item, 'radio')">
|
||||||
|
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||||
|
<el-radio-group v-model="formModel[item.prop]" :disabled="item.disabled">
|
||||||
|
<el-radio v-for="(opts, indexs) in item.radioList" :key="indexs" :border="item.border" :label="opts[item.optionValue]">{{ opts[item.optionLabel] }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<!-- 坐标点并列显示 -->
|
||||||
|
<template v-if="checkFieldType(item, 'coordinate')">
|
||||||
|
<div v-if="!item.isHidden" :key="item.prop" class="coordinate">
|
||||||
|
<span class="title" :style="{width: item.width}">{{ item.label }}</span>
|
||||||
|
<div v-for="opt in item.children" :key="opt.code" class="listWidth">
|
||||||
|
<el-form-item :label="opt.label" :prop="opt.prop" :label-width="opt.labelWidth">
|
||||||
|
<template>
|
||||||
|
<el-input-number v-model="formModel[opt.firstLevel][opt.secondLevel]" :label="opt.label" :disabled="opt.disabled" @change="((val)=>{deviceChange(val, opt)})" />
|
||||||
|
</template>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-if="checkFieldType(item, 'sectionUnit')">
|
||||||
|
<div :key="item.prop" class="coordinate">
|
||||||
|
<span class="title" :style="{width: item.width}">{{ item.label }}</span>
|
||||||
|
<div class="point-section">
|
||||||
|
<template v-for="(sectionUnit, j) in formModel[item.prop]">
|
||||||
|
<div :key="j" class="sectionUnit">
|
||||||
|
<el-form-item label="左端区段" :prop="'sectionUnitList[' + j + '].leftCode'" label-width="70px">
|
||||||
|
<el-select v-model="sectionUnit.leftCode" filterable placeholder="请选择" clearable class="sectionUnitCode">
|
||||||
|
<el-option
|
||||||
|
v-for="elem in item.options"
|
||||||
|
:key="elem.code"
|
||||||
|
:label="elem.name"
|
||||||
|
:value="elem.code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
<el-button
|
||||||
|
:type="item.buttonShowType && item.listIndex === ('leftCode' + j) ? 'danger' : 'primary'"
|
||||||
|
@click="item.hover(item.buttonType, `leftCode${j}`)"
|
||||||
|
>{{ $t('map.activate') }}</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="右端区段" :prop="'sectionUnitList[' + j + '].rightCode'" label-width="70px">
|
||||||
|
<el-select v-model="sectionUnit.rightCode" filterable placeholder="请选择" clearable class="sectionUnitCode">
|
||||||
|
<el-option
|
||||||
|
v-for="elem in item.options"
|
||||||
|
:key="elem.code"
|
||||||
|
:label="elem.name"
|
||||||
|
:value="elem.code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
<el-button
|
||||||
|
:type="item.buttonShowType && item.listIndex === ('rightCode' + j) ? 'danger' : 'primary'"
|
||||||
|
@click="item.hover(item.buttonType, `rightCode${j}`)"
|
||||||
|
>{{ $t('map.activate') }}</el-button>
|
||||||
|
<el-button type="success" icon="el-icon-plus" circle @click="item.addSectionUnit(j)" />
|
||||||
|
<el-button v-if="j" type="danger" icon="el-icon-delete" circle @click="item.delSectionUnit(j)" />
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<!-- 多个坐标点绘制 -->
|
||||||
|
<template v-if="checkFieldType(item, 'points')">
|
||||||
|
<div v-if="!item.isHidden" :key="item.prop" class="coordinate">
|
||||||
|
<span class="title" :style="{width: item.width}">{{ item.label }}</span>
|
||||||
|
<div class="point-section">
|
||||||
|
<template v-for="(point, j) in formModel[item.prop]">
|
||||||
|
<div :key="j" style="overflow: hidden;">
|
||||||
|
<span v-if="!item.hiddenSpan" class="pointsEach" :style="{'margin-right': j == 0 || j == formModel[item.prop].length - 1 ? '9px' : '5px'}">{{ j == 0 ? '起 点' : j == formModel[item.prop].length - 1 ? '终 点' : `中点${j}` }}</span>
|
||||||
|
<el-form-item
|
||||||
|
label=""
|
||||||
|
:prop="'points[' + j + '].x'"
|
||||||
|
class="pointsEachItem"
|
||||||
|
label-width="0px"
|
||||||
|
>
|
||||||
|
<el-input-number v-model="point.x" :disabled="item.pointDisabled" />
|
||||||
|
</el-form-item>
|
||||||
|
<span class="pointsEachNext">, </span>
|
||||||
|
<el-form-item
|
||||||
|
label=""
|
||||||
|
:prop="'points[' + j + '].y'"
|
||||||
|
class="pointsEachItem"
|
||||||
|
style="margin-right: 5px;"
|
||||||
|
label-width="4px"
|
||||||
|
>
|
||||||
|
<el-input-number v-model="point.y" :disabled="item.pointDisabled" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-button
|
||||||
|
icon="el-icon-plus"
|
||||||
|
:disabled="item.pointDisabled"
|
||||||
|
circle
|
||||||
|
class="point-button"
|
||||||
|
@click="item.addPoint(j)"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
icon="el-icon-minus"
|
||||||
|
:disabled="j == 0 || j == formModel[item.prop].length - 1"
|
||||||
|
circle
|
||||||
|
class="point-button"
|
||||||
|
style="margin-left: 4px;"
|
||||||
|
@click="item.delPoint(j)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<!-- 多个坐标点绘制 -->
|
||||||
|
<template v-if="checkFieldType(item, 'coordinatePoint')">
|
||||||
|
<div :key="item.prop" class="coordinate">
|
||||||
|
<span class="title" :style="{width: item.width}">{{ item.label }}</span>
|
||||||
|
<div class="point-section" :style="{ width: `calc(100% - 10px - ${item.width})` }">
|
||||||
|
<template v-for="(point, j) in formModel[item.prop]">
|
||||||
|
<div :key="j" style="overflow: hidden;">
|
||||||
|
<span style="display: table; margin-right: 6px; font-size: 14px; float: left; line-height: 28px;">{{ j + 1 }}.</span>
|
||||||
|
<el-form-item style="display: table; float: left;" label-width="0px">
|
||||||
|
<el-input-number v-model="point.x" :disabled="item.pointDisabled" />
|
||||||
|
</el-form-item>
|
||||||
|
<span style="display: table; margin-left: 8px; float: left; line-height: 28px;">, </span>
|
||||||
|
<el-form-item style="display: table; float: left; margin-right: 5px;" label-width="4px">
|
||||||
|
<el-input-number v-model="point.y" :disabled="item.pointDisabled" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-button
|
||||||
|
icon="el-icon-plus"
|
||||||
|
:disabled="item.pointDisabled"
|
||||||
|
circle
|
||||||
|
class="point-button"
|
||||||
|
@click="item.addPoint(j)"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
icon="el-icon-minus"
|
||||||
|
:disabled="j == 0"
|
||||||
|
circle
|
||||||
|
class="point-button"
|
||||||
|
style="margin-left: 4px;"
|
||||||
|
@click="item.delPoint(j)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-if="checkFieldType(item, 'checkbox')">
|
||||||
|
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||||
|
<el-checkbox v-model="formModel[item.prop]" :disabled="item.disabled" @change="((val)=>{deviceChange(val, item)})" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-if="checkFieldType(item, 'font')">
|
||||||
|
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||||
|
<el-font v-model="formModel[item.prop]" :disabled="item.disabled" :placeholder="item.placeholder" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-if="checkFieldType(item, 'fontContent')">
|
||||||
|
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||||
|
<el-input v-model="formModel[item.content]" :placeholder="item.placeholder" class="input-with-select">
|
||||||
|
<el-select slot="prepend" v-model="formModel[item.prepend]" :placeholder="item.placeholder">
|
||||||
|
<el-option :label="$t('map.horizontal')" value="H" />
|
||||||
|
<el-option :label="$t('map.vertical')" value="V" />
|
||||||
|
</el-select>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-if="checkFieldType(item, 'lengthFact')">
|
||||||
|
<div v-if="!item.isHidden" :key="item.prop" class="coordinate">
|
||||||
|
<span class="title" :style="{width: item.width}">{{ item.label }}</span>
|
||||||
|
<div class="point-section">
|
||||||
|
<template v-for="(elem, j) in formModel[item.prop]">
|
||||||
|
<div :key="j" style="overflow: hidden;">
|
||||||
|
<el-form-item :label="elem.name" :prop="'logicLengthList[' + j + '].lengthFact'" label-width="20px">
|
||||||
|
<el-input-number v-model="elem.lengthFact" :min="0" :precision="3" style="width: 120px;" /><span>米</span>
|
||||||
|
<el-button v-if="!j" type="primary" size="mini" style="margin-left: 20px;" @click="item.mergeLength">合并长度</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</fieldset>
|
||||||
|
</template>
|
||||||
|
<slot />
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ElFont from '@/views/components/font/index';
|
||||||
|
export default {
|
||||||
|
name: 'ConfigList',
|
||||||
|
components: {
|
||||||
|
ElFont
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
formModel: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
type: Object,
|
||||||
|
default: function () {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
skins: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
deviceChange(data, item) {
|
||||||
|
if (item.deviceChange) {
|
||||||
|
item.deviceChange(data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleLabel(option, label) {
|
||||||
|
if (label == 'name') {
|
||||||
|
return option.name;
|
||||||
|
} else if (label == 'code') {
|
||||||
|
return option.code;
|
||||||
|
} else if (label == 'label') {
|
||||||
|
return option.label;
|
||||||
|
} else if (label == 'name&&code') {
|
||||||
|
if (option.code) {
|
||||||
|
return option.name + ' (' + option.code + ')';
|
||||||
|
} else {
|
||||||
|
return option.name;
|
||||||
|
}
|
||||||
|
} else if (label == 'code&&name') {
|
||||||
|
return option.code + ' (' + option.name + ')';
|
||||||
|
} else {
|
||||||
|
return option.label;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
decompose(item, prop) {
|
||||||
|
if (!prop.includes('.')) {
|
||||||
|
return prop;
|
||||||
|
}
|
||||||
|
const keyArr = prop.split('.');
|
||||||
|
return keyArr[0][keyArr[1]];
|
||||||
|
},
|
||||||
|
checkFieldType(field, type) {
|
||||||
|
if (field.hasOwnProperty('isHidden')) {
|
||||||
|
return field.type === type && !field.isHidden;
|
||||||
|
} else {
|
||||||
|
return field.type === type;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validate(callback) {
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
callback(true);
|
||||||
|
} else {
|
||||||
|
callback(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
resetForm() {
|
||||||
|
this.$refs.form.resetFields();
|
||||||
|
},
|
||||||
|
clearValidate() {
|
||||||
|
this.$refs.form.clearValidate(); // 只移除校验结果
|
||||||
|
},
|
||||||
|
resetFields() {
|
||||||
|
this.$refs.form.resetFields(); // 移除校验结果 并 重置字段值
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
|
||||||
|
.coordinate {
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
text-align: right;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #606266;
|
||||||
|
line-height: 40px;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
line-height: 28px;
|
||||||
|
width: 120px;
|
||||||
|
font-weight: bold;
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
margin-right: 7px;
|
||||||
|
}
|
||||||
|
.listWidth{
|
||||||
|
display: table;
|
||||||
|
float: left;
|
||||||
|
margin-right: 20px;
|
||||||
|
&:last-child{
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.point-section {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.point-button {
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
float: left;
|
||||||
|
|
||||||
|
/deep/ {
|
||||||
|
.el-icon-plus,
|
||||||
|
.el-icon-minus {
|
||||||
|
transform: translateY(0px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-input-number--mini {
|
||||||
|
width: 110px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form_data{
|
||||||
|
padding: 6px 10px 10px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card{
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
|
||||||
|
.card_title {
|
||||||
|
padding: 0px 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.noCard{
|
||||||
|
border: none;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ {
|
||||||
|
.input-with-select .el-input-group__prepend {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.numberSpan{padding-left: 1px;}
|
||||||
|
.numberBtn{margin-left: 20px;}
|
||||||
|
.sectionUnit{border: 1px solid #CCCCCC; border-radius: 5px;padding: 2px;padding-top: 10px;}
|
||||||
|
.sectionUnitCode{width: 115px;}
|
||||||
|
.pointsEach{display: table; margin-right: 3px; font-size: 14px; float: left; line-height: 28px;}
|
||||||
|
.pointsEachNext{display: table; margin-left: 8px; float: left; line-height: 28px;}
|
||||||
|
.pointsEachItem{display: table; float: left; }
|
||||||
|
</style>
|
||||||
|
|
84
src/views/newMap/mapDraftPicture/mapoperate/device.vue
Normal file
84
src/views/newMap/mapDraftPicture/mapoperate/device.vue
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<operate-property
|
||||||
|
ref="dataform"
|
||||||
|
:form="form"
|
||||||
|
:edit-model="editModel"
|
||||||
|
:rules="rules"
|
||||||
|
type="Line"
|
||||||
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import OperateProperty from './components/operateProperty';
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
export default {
|
||||||
|
name: 'Device',
|
||||||
|
components: {
|
||||||
|
OperateProperty
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
editModel: {},
|
||||||
|
rules: {},
|
||||||
|
typeList: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters('map', [
|
||||||
|
'signalList',
|
||||||
|
'sectionList',
|
||||||
|
'switchList',
|
||||||
|
'stationList',
|
||||||
|
'stationStandList'
|
||||||
|
]),
|
||||||
|
form () {
|
||||||
|
return {
|
||||||
|
labelWidth: '130px',
|
||||||
|
items: {
|
||||||
|
code: {
|
||||||
|
name: '',
|
||||||
|
item: []
|
||||||
|
},
|
||||||
|
draw: {
|
||||||
|
name: this.$t('map.drawData'),
|
||||||
|
item: [
|
||||||
|
{ prop: 'type', label: '类型', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.typeList },
|
||||||
|
{ prop: 'code', label: this.$t('map.textCode'), type: 'select', optionLabel: 'code', optionValue: 'code', options: this.textList, deviceChange: this.deviceChange },
|
||||||
|
{ prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '120px', children: [
|
||||||
|
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false },
|
||||||
|
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false }
|
||||||
|
] }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
map: {
|
||||||
|
name: this.$t('map.mapData'),
|
||||||
|
item: []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
deviceList () {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
updateMapModel() {
|
||||||
|
|
||||||
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
|
||||||
|
},
|
||||||
|
deviceChange() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
236
src/views/newMap/mapDraftPicture/mapoperate/index.vue
Normal file
236
src/views/newMap/mapDraftPicture/mapoperate/index.vue
Normal file
@ -0,0 +1,236 @@
|
|||||||
|
<template>
|
||||||
|
<transition name="el-zoom-in-center">
|
||||||
|
<div class="map-control">
|
||||||
|
<div class="map-operate">
|
||||||
|
<div class="draftMapName">
|
||||||
|
<span>{{ $t('map.mapName') }}</span>
|
||||||
|
<el-tooltip class="item" effect="dark" :content="mapInfo.name" placement="top">
|
||||||
|
<b>{{ mapInfo.name }}</b>
|
||||||
|
</el-tooltip>
|
||||||
|
</div>
|
||||||
|
<el-button v-if="isSave" type="text" style="padding: 3px 0;float: right;" :disabled="$attrs.mapSaveing" @click="saveMapEvent">{{ $t('map.save') }}</el-button>
|
||||||
|
</div>
|
||||||
|
<el-tabs v-model="enabledTab" class="mapEdit" type="card">
|
||||||
|
<el-tab-pane v-for="(each,index) in tabList" :key="index" :label="each.label" class="tab_pane_box" :name="each.name" :lazy="lazy">
|
||||||
|
<component
|
||||||
|
:is="each.menus"
|
||||||
|
:ref="each.name"
|
||||||
|
:selected="selected"
|
||||||
|
v-bind="$attrs"
|
||||||
|
v-on="$listeners"
|
||||||
|
@deviceSelect="deviceSelect"
|
||||||
|
/>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import DeviceDraft from './device';
|
||||||
|
import MultiSelect from './multiSelect';
|
||||||
|
export default {
|
||||||
|
name: 'MapOperate',
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
selected: {
|
||||||
|
type: Object,
|
||||||
|
default: function () {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mapInfo: {
|
||||||
|
type: Object,
|
||||||
|
default: function() { return {name: this.$t('map.pleaseSelectMap')}; }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
lazy: true,
|
||||||
|
tabList:[
|
||||||
|
{label: '设备', name: 'device', menus: DeviceDraft},
|
||||||
|
{label: '多选', name: 'multiSelect', menus: MultiSelect}
|
||||||
|
],
|
||||||
|
selectDevice:'',
|
||||||
|
enabledTab: 'Line'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isSave() {
|
||||||
|
return this.mapInfo && this.mapInfo.id;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
'$store.state.map.updateCount': function () {
|
||||||
|
this.$refs[this.enabledTab][0].edit();
|
||||||
|
},
|
||||||
|
selected(val) {
|
||||||
|
if (this.selected) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs[this.enabledTab][0].deviceSelect(val);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
handleSelectControlPage(device) {
|
||||||
|
const type = device._type;
|
||||||
|
if (this.selectDevice) {
|
||||||
|
this.enabledTab = this.selectDevice;
|
||||||
|
} else {
|
||||||
|
this.enabledTab = type;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deviceSelect(type) {
|
||||||
|
this.selectDevice = type;
|
||||||
|
},
|
||||||
|
saveMapEvent() {
|
||||||
|
this.$emit('saveMapEvent');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
.draftMapName{
|
||||||
|
width:280px;
|
||||||
|
overflow:hidden;
|
||||||
|
height:17px;
|
||||||
|
text-overflow:ellipsis;
|
||||||
|
white-space:nowrap;
|
||||||
|
}
|
||||||
|
.el-dropdown-link {
|
||||||
|
cursor: pointer;
|
||||||
|
color: #409EFF;
|
||||||
|
}
|
||||||
|
.el-icon-arrow-down {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.map-control {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.operate-button{
|
||||||
|
padding: 3px 0;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
// .physical-view {
|
||||||
|
// line-height: 25px;
|
||||||
|
// height: 118px;
|
||||||
|
// padding-left: 12px;
|
||||||
|
|
||||||
|
// .el-checkbox {
|
||||||
|
// width: 70px;
|
||||||
|
// margin: 0;
|
||||||
|
// margin-right: 30px;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
.map-operate{
|
||||||
|
height: 47px;
|
||||||
|
padding: 15px;
|
||||||
|
display:flex;
|
||||||
|
}
|
||||||
|
.mapEdit{
|
||||||
|
height: calc(100% - 47px);
|
||||||
|
.tab_pane_box{
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .button_box{
|
||||||
|
width: 100%;
|
||||||
|
background: #ffffff;
|
||||||
|
border-top: 1px #f3f1f1 solid;
|
||||||
|
box-shadow: 4px 7px 10px #565656;
|
||||||
|
border-radius: 0;
|
||||||
|
border-bottom: 1px transparent solid;
|
||||||
|
position:absolute;
|
||||||
|
bottom:0;
|
||||||
|
z-index:3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .view-control-content{
|
||||||
|
height:100%;
|
||||||
|
padding-bottom:46px;
|
||||||
|
overflow-y:auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .map-draft-group {
|
||||||
|
float: right;
|
||||||
|
margin: 6px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .view-control {
|
||||||
|
height:100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ {
|
||||||
|
.mapEdit .el-tabs__nav-wrap.is-scrollable {
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
|
.mapEdit .el-tabs__header .el-tabs__item.is-active {
|
||||||
|
border-bottom-color: #f5f7fa;
|
||||||
|
background: #f5f7fa;
|
||||||
|
}
|
||||||
|
.mapEdit .el-tabs__active-bar{
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
.mapEdit .el-tabs__content {
|
||||||
|
height: calc(100% - 56px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card .el-tabs__nav .el-tabs__item.is-active {
|
||||||
|
border-bottom: 2px solid #E4E7ED;
|
||||||
|
background: #409eff;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.card .el-tabs__nav .el-tabs__item{
|
||||||
|
padding: 0 20px!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mapEdit .el-tabs__nav-prev {
|
||||||
|
width: 20px;
|
||||||
|
height: 41px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
box-shadow: 1px 1px 4px #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mapEdit .el-tabs__nav-next {
|
||||||
|
width: 20px;
|
||||||
|
height: 41px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
box-shadow: 1px 1px 4px #ccc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 页面页签样式
|
||||||
|
/deep/ {
|
||||||
|
.card .el-transfer-panel__filter{
|
||||||
|
margin: 5px 15px;
|
||||||
|
}
|
||||||
|
.card .el-transfer-panel__list.is-filterable{
|
||||||
|
height: 290px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card .el-transfer-panel__body{
|
||||||
|
height: 328px;
|
||||||
|
}
|
||||||
|
.card .el-transfer__buttons{
|
||||||
|
padding: 0 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card .el-transfer{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
13
src/views/newMap/mapDraftPicture/mapoperate/multiSelect.vue
Normal file
13
src/views/newMap/mapDraftPicture/mapoperate/multiSelect.vue
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "multiSelect"
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
@ -45,173 +45,190 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { DeviceMenu } from '@/scripts/ConstDic'
|
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||||
import { listMap, deleteAllMap } from '@/api/jmap/mapdraft'
|
import { listMap, deleteAllMap } from '@/api/jmap/mapdraft';
|
||||||
import { UrlConfig } from '@/scripts/ConstDic'
|
import { UrlConfig } from '@/scripts/ConstDic';
|
||||||
import { removeSessionStorage } from '@/utils/auth'
|
import { removeSessionStorage } from '@/utils/auth';
|
||||||
import MapOperateMenu from './mapmanage/operateMenu'
|
import MapOperateMenu from './mapmanage/operateMenu';
|
||||||
import MapImport from './mapmanage/mapImport'
|
import MapImport from './mapmanage/mapImport';
|
||||||
import { getSessionStorage } from '@/utils/auth'
|
import { getSessionStorage } from '@/utils/auth';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'UserMapList',
|
name: 'UserMapList',
|
||||||
components: {
|
components: {
|
||||||
MapOperateMenu,
|
MapOperateMenu,
|
||||||
MapImport,
|
MapImport
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true,
|
loading: true,
|
||||||
defaultShowKeys: [],
|
defaultShowKeys: [],
|
||||||
filterText: '',
|
filterText: '',
|
||||||
treeData: [],
|
treeData: [],
|
||||||
treeList: [],
|
treeList: [],
|
||||||
selected: {},
|
selected: {},
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'name',
|
label: 'name'
|
||||||
},
|
},
|
||||||
point: {
|
point: {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0
|
||||||
},
|
},
|
||||||
editModel: {},
|
editModel: {},
|
||||||
lineCode: '',
|
lineCode: '',
|
||||||
loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts', 'hlsdrts', 'designhlsdrts'],
|
loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts', 'hlsdrts', 'designhlsdrts']
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
project() {
|
||||||
|
return getSessionStorage('project');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
filterText(val) {
|
||||||
|
this.$refs.tree.filter(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
removeSessionStorage('demonList');
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.loadInitData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
filterNode(value, data) {
|
||||||
|
if (!value) return true;
|
||||||
|
return data.name.indexOf(value) !== -1;
|
||||||
|
},
|
||||||
|
createMap() {
|
||||||
|
this.$emit('createMap');
|
||||||
|
},
|
||||||
|
deleteAllMap() {
|
||||||
|
this.$confirm('确定删除全部地图数据?', '警告', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
deleteAllMap().then(res => {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '删除成功!'
|
||||||
|
});
|
||||||
|
this.loadInitData();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(e => {});
|
||||||
|
},
|
||||||
|
async loadInitData() {
|
||||||
|
this.loading = true;
|
||||||
|
this.treeData = this.treeList = [];
|
||||||
|
try {
|
||||||
|
const res = await listMap({ drawWay: true });
|
||||||
|
res.data &&
|
||||||
|
res.data.forEach(elem => {
|
||||||
|
elem.type = 'map';
|
||||||
|
elem.children = [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
name: this.$t('designPlatform.mapDesign'),
|
||||||
|
type: 'mapDesign',
|
||||||
|
mapId: elem.id,
|
||||||
|
mapName: elem.name,
|
||||||
|
lineCode: elem.lineCode
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
name: '系统配置绘图',
|
||||||
|
type: 'mapSystem',
|
||||||
|
mapId: elem.id,
|
||||||
|
mapName: elem.name,
|
||||||
|
lineCode: elem.lineCode
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '3',
|
||||||
|
name: '画面管理',
|
||||||
|
type: 'mapPicture',
|
||||||
|
mapId: elem.id,
|
||||||
|
mapName: elem.name,
|
||||||
|
lineCode: elem.lineCode
|
||||||
|
}
|
||||||
|
];
|
||||||
|
});
|
||||||
|
this.treeData = res.data;
|
||||||
|
this.treeList = this.filterText
|
||||||
|
? res.data.filter(elem => {
|
||||||
|
return elem.name.includes(this.filterText);
|
||||||
|
})
|
||||||
|
: res.data;
|
||||||
|
this.loading = false;
|
||||||
|
} catch (error) {
|
||||||
|
this.loading = false;
|
||||||
|
this.$messageBox(this.$t('error.refreshFailed'));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
clickEvent(obj, data, ele) {
|
||||||
|
switch (obj.type) {
|
||||||
|
case 'mapDesign': {
|
||||||
|
if (this.loadingProjectList.includes(this.project)) {
|
||||||
|
this.$store.dispatch('app/transitionAnimations');
|
||||||
|
}
|
||||||
|
this.$router.push({
|
||||||
|
path: `${UrlConfig.newDesignuser.mapDraw}/${obj.mapId}/draft`,
|
||||||
|
query: { name: obj.mapName, lineCode: obj.lineCode }
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'mapSystem': {
|
||||||
|
if (this.loadingProjectList.includes(this.project)) {
|
||||||
|
this.$store.dispatch('app/transitionAnimations');
|
||||||
|
}
|
||||||
|
this.$router.push({
|
||||||
|
path: `/design/usermap/map/systemDraw/${obj.mapId}/draft`,
|
||||||
|
query: { name: obj.mapName, lineCode: obj.lineCode }
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'mapPicture': {
|
||||||
|
if (this.loadingProjectList.includes(this.project)) {
|
||||||
|
this.$store.dispatch('app/transitionAnimations');
|
||||||
|
}
|
||||||
|
this.$router.push({
|
||||||
|
path: `/design/usermap/map/pictureDraw/${obj.mapId}/draft`,
|
||||||
|
query: { name: obj.mapName, lineCode: obj.lineCode }
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showContextMenu(e, obj, node, vueElem) {
|
||||||
|
this.$refs.tree.setCurrentKey(obj.id);
|
||||||
|
this.$refs.tree.currentNode = node;
|
||||||
|
if (obj && obj.type == 'map') {
|
||||||
|
e.preventDefault();
|
||||||
|
const menu = DeviceMenu.Map;
|
||||||
|
|
||||||
|
this.point = {
|
||||||
|
x: e.clientX,
|
||||||
|
y: e.clientY
|
||||||
|
};
|
||||||
|
this.editModel = obj;
|
||||||
|
this.editModel.lineCode = obj.lineCode;
|
||||||
|
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
jlmap3d() {
|
||||||
|
this.$router.push({ path: '/design/jlmap3d/edit', query: { mapid: this.editModel.id } });
|
||||||
|
},
|
||||||
|
assetmanager3d() {
|
||||||
|
this.$router.push({ path: '/design/jlmap3d/assetmanager' });
|
||||||
|
},
|
||||||
|
importMap() {
|
||||||
|
this.$refs.mapImport.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
computed: {
|
|
||||||
project() {
|
|
||||||
return getSessionStorage('project')
|
|
||||||
},
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
filterText(val) {
|
|
||||||
this.$refs.tree.filter(val)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
removeSessionStorage('demonList')
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.loadInitData()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
filterNode(value, data) {
|
|
||||||
if (!value) return true
|
|
||||||
return data.name.indexOf(value) !== -1
|
|
||||||
},
|
|
||||||
createMap() {
|
|
||||||
this.$emit('createMap')
|
|
||||||
},
|
|
||||||
deleteAllMap() {
|
|
||||||
this.$confirm('确定删除全部地图数据?', '警告', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
deleteAllMap().then(res => {
|
|
||||||
this.$message({
|
|
||||||
type: 'success',
|
|
||||||
message: '删除成功!',
|
|
||||||
})
|
|
||||||
this.loadInitData()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.catch(e => {})
|
|
||||||
},
|
|
||||||
async loadInitData() {
|
|
||||||
this.loading = true
|
|
||||||
this.treeData = this.treeList = []
|
|
||||||
try {
|
|
||||||
const res = await listMap({ drawWay: true })
|
|
||||||
res.data &&
|
|
||||||
res.data.forEach(elem => {
|
|
||||||
elem.type = 'map'
|
|
||||||
elem.children = [
|
|
||||||
{
|
|
||||||
id: '1',
|
|
||||||
name: this.$t('designPlatform.mapDesign'),
|
|
||||||
type: 'mapDesign',
|
|
||||||
mapId: elem.id,
|
|
||||||
mapName: elem.name,
|
|
||||||
lineCode: elem.lineCode,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '2',
|
|
||||||
name: '系统配置绘图',
|
|
||||||
type: 'mapSystem',
|
|
||||||
mapId: elem.id,
|
|
||||||
mapName: elem.name,
|
|
||||||
lineCode: elem.lineCode,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
})
|
|
||||||
|
|
||||||
this.treeData = res.data
|
|
||||||
this.treeList = this.filterText
|
|
||||||
? res.data.filter(elem => {
|
|
||||||
return elem.name.includes(this.filterText)
|
|
||||||
})
|
|
||||||
: res.data
|
|
||||||
this.loading = false
|
|
||||||
} catch (error) {
|
|
||||||
this.loading = false
|
|
||||||
this.$messageBox(this.$t('error.refreshFailed'))
|
|
||||||
}
|
|
||||||
},
|
|
||||||
clickEvent(obj, data, ele) {
|
|
||||||
switch (obj.type) {
|
|
||||||
case 'mapDesign': {
|
|
||||||
if (this.loadingProjectList.includes(this.project)) {
|
|
||||||
this.$store.dispatch('app/transitionAnimations')
|
|
||||||
}
|
|
||||||
this.$router.push({
|
|
||||||
path: `${UrlConfig.newDesignuser.mapDraw}/${obj.mapId}/draft`,
|
|
||||||
query: { name: obj.mapName, lineCode: obj.lineCode },
|
|
||||||
})
|
|
||||||
break
|
|
||||||
}
|
|
||||||
case 'mapSystem': {
|
|
||||||
if (this.loadingProjectList.includes(this.project)) {
|
|
||||||
this.$store.dispatch('app/transitionAnimations')
|
|
||||||
}
|
|
||||||
this.$router.push({
|
|
||||||
path: `/design/usermap/map/systemDraw/${obj.mapId}/draft`,
|
|
||||||
query: { name: obj.mapName, lineCode: obj.lineCode },
|
|
||||||
})
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
showContextMenu(e, obj, node, vueElem) {
|
|
||||||
this.$refs.tree.setCurrentKey(obj.id)
|
|
||||||
this.$refs.tree.currentNode = node
|
|
||||||
if (obj && obj.type == 'map') {
|
|
||||||
e.preventDefault()
|
|
||||||
const menu = DeviceMenu.Map
|
|
||||||
|
|
||||||
this.point = {
|
|
||||||
x: e.clientX,
|
|
||||||
y: e.clientY,
|
|
||||||
}
|
|
||||||
this.editModel = obj
|
|
||||||
this.editModel.lineCode = obj.lineCode
|
|
||||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu })
|
|
||||||
}
|
|
||||||
},
|
|
||||||
jlmap3d() {
|
|
||||||
this.$router.push({ path: '/design/jlmap3d/edit', query: { mapid: this.editModel.id } })
|
|
||||||
},
|
|
||||||
assetmanager3d() {
|
|
||||||
this.$router.push({ path: '/design/jlmap3d/assetmanager' })
|
|
||||||
},
|
|
||||||
importMap() {
|
|
||||||
this.$refs.mapImport.show()
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.clearfix {
|
.clearfix {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="border: 1px solid #000000;margin-top: 20px;padding: 20px;">
|
<div style="border: 1px solid #000000;margin-top: 20px;padding: 20px;background: #9df59b;">
|
||||||
<div style="text-align: center;font-size: 28px;">许 可 证</div>
|
<div style="text-align: center;font-size: 28px;">许 可 证</div>
|
||||||
<div style="font-size: 14px;margin-top: 15px;display: flex;align-items: center;margin-bottom: 20px;justify-content: end;">
|
<div style="font-size: 14px;margin-top: 15px;display: flex;align-items: center;margin-bottom: 20px;justify-content: end;">
|
||||||
<div>第</div>
|
<div>第</div>
|
||||||
|
@ -239,7 +239,7 @@ export default {
|
|||||||
noticeMinute2: '', noticeTripNumber2: '', stationSeal: true, signature: '', year: '', moon: '', day: ''};
|
noticeMinute2: '', noticeTripNumber2: '', stationSeal: true, signature: '', year: '', moon: '', day: ''};
|
||||||
},
|
},
|
||||||
query() {
|
query() {
|
||||||
const params = { type: this.attachmentType, stationCode: this.$store.state.map.showCentralizedStationCode };
|
const params = { type: this.attachmentType };
|
||||||
commitOperate(menuOperate.Rail.railQueryTicket, params, 3).then(({valid, response, operate}) => {
|
commitOperate(menuOperate.Rail.railQueryTicket, params, 3).then(({valid, response, operate}) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.attachmentType === 'RAIL_TICKET') {
|
if (this.attachmentType === 'RAIL_TICKET') {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="border: 1px solid #000000;margin-top: 20px;padding: 20px;">
|
<div style="border: 1px solid #000000;margin-top: 20px;padding: 20px;background: #e799d8;">
|
||||||
<div style="text-align: center;font-size: 28px;">许 可 证</div>
|
<div style="text-align: center;font-size: 28px;">许 可 证</div>
|
||||||
<div style="font-size: 14px;margin-top: 15px;display: flex;align-items: center;margin-bottom: 20px;justify-content: end;">
|
<div style="font-size: 14px;margin-top: 15px;display: flex;align-items: center;margin-bottom: 20px;justify-content: end;">
|
||||||
<div>第</div>
|
<div>第</div>
|
||||||
|
@ -31,6 +31,9 @@
|
|||||||
<el-input v-model="ticketForm.no" size="small" :disabled="switchFlag" style="width: 80px;" />
|
<el-input v-model="ticketForm.no" size="small" :disabled="switchFlag" style="width: 80px;" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="text-align: center;">
|
||||||
|
<!-- <el-select v-model=""></el-select>-->
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user