Merge remote-tracking branch 'origin/dev' into test
This commit is contained in:
commit
1f881fc204
@ -203,6 +203,7 @@ class SkinCode extends defaultStyle {
|
|||||||
common: { // 通用属性
|
common: { // 通用属性
|
||||||
textFontSize: 11, // 站台默认字体大小
|
textFontSize: 11, // 站台默认字体大小
|
||||||
special: true, // 特殊站台
|
special: true, // 特殊站台
|
||||||
|
haveJumpShow: true, // 站台是否有列车停跳显示
|
||||||
functionButtonShow: [] // 功能灯按钮显示条件(prdType)
|
functionButtonShow: [] // 功能灯按钮显示条件(prdType)
|
||||||
},
|
},
|
||||||
safetyDoor: { // 屏蔽门
|
safetyDoor: { // 屏蔽门
|
||||||
@ -241,6 +242,15 @@ class SkinCode extends defaultStyle {
|
|||||||
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
|
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
|
||||||
detainTrainTextColor: '#E4EF50' // 车站扣除文字颜色
|
detainTrainTextColor: '#E4EF50' // 车站扣除文字颜色
|
||||||
},
|
},
|
||||||
|
jump: {
|
||||||
|
text: '跳', // 停跳显示内容
|
||||||
|
position: -1, // 停跳方向
|
||||||
|
offset: { x: -8, y: 0 },
|
||||||
|
textColor: '#0000FF', // 停跳文字颜色
|
||||||
|
arcColor: '#0000FF', // 停跳圆圈颜色
|
||||||
|
fillColor: 'rgba(0,0,0,0)', // 透明填充颜色
|
||||||
|
r: 8 // 圆半径大小
|
||||||
|
},
|
||||||
stopTime: { // 停站时间
|
stopTime: { // 停站时间
|
||||||
position: 1, // 运行时间方向
|
position: 1, // 运行时间方向
|
||||||
offset: { x: -8, y: 26 }, // 运行时间偏移量
|
offset: { x: -8, y: 26 }, // 运行时间偏移量
|
||||||
@ -491,10 +501,17 @@ class SkinCode extends defaultStyle {
|
|||||||
lrPadding: 1, // 两边间隔
|
lrPadding: 1, // 两边间隔
|
||||||
upPadding: 1, // 上边距离
|
upPadding: 1, // 上边距离
|
||||||
trainBodyFillColor: '#000000', // 列车车身填充颜色
|
trainBodyFillColor: '#000000', // 列车车身填充颜色
|
||||||
|
trainSidelineColor: '#FFFF00',
|
||||||
trainNameFormat: 'tripNumber:serviceNumber:groupNumber'// 列车显示格式
|
trainNameFormat: 'tripNumber:serviceNumber:groupNumber'// 列车显示格式
|
||||||
},
|
},
|
||||||
hsda: {
|
hsda: {
|
||||||
trainHSDATextFontSize: 8// 列车HDSA字号
|
lrPaddingHSDA: 3, // HSDA两边间隔
|
||||||
|
upPaddingHSDA: 20, // HSDA上边距离
|
||||||
|
trainHSDATextFontSize: 8, // 列车HDSA字号
|
||||||
|
textHContent: '扣', // textH文本
|
||||||
|
textSContent: '跳', // textS文本
|
||||||
|
textDContent: '门', // textD文本
|
||||||
|
textAContent: '警' // textA文本
|
||||||
},
|
},
|
||||||
trainAtrStatus: {
|
trainAtrStatus: {
|
||||||
trainAtrStatusOffset: { x: 68, y: 9},
|
trainAtrStatusOffset: { x: 68, y: 9},
|
||||||
@ -521,13 +538,15 @@ class SkinCode extends defaultStyle {
|
|||||||
trainServer: {
|
trainServer: {
|
||||||
serviceNumberPrefix: '00', // 服务号(表号)前缀
|
serviceNumberPrefix: '00', // 服务号(表号)前缀
|
||||||
defaultServiceNumber: 'BB', // 默认服务号(表号)
|
defaultServiceNumber: 'BB', // 默认服务号(表号)
|
||||||
trainServerOffset: { x: 35, y: 3 }// 列车服务号偏移
|
trainServerOffset: { x: 35, y: 3 }, // 列车服务号偏移
|
||||||
|
fontColor: '#00C300'
|
||||||
},
|
},
|
||||||
trainTarget: {
|
trainTarget: {
|
||||||
tripNumberPrefix: '000', // 车次号前缀
|
tripNumberPrefix: '000', // 车次号前缀
|
||||||
defaultDirectionCode: '', // 默认车次号1
|
defaultDirectionCode: '', // 默认车次号1
|
||||||
defaultTripNumber: 'CCC', // 默认车次号2
|
defaultTripNumber: 'CCC', // 默认车次号2
|
||||||
trainTargetOffset: { x: 10, y: 3 }// 列车车次号偏移
|
trainTargetOffset: { x: 10, y: 3 }, // 列车车次号偏移
|
||||||
|
fontColor: '#00C300'
|
||||||
},
|
},
|
||||||
trainTargetNumber: {
|
trainTargetNumber: {
|
||||||
groupNumberPrefix: '000', // 车组号前缀
|
groupNumberPrefix: '000', // 车组号前缀
|
||||||
|
@ -235,7 +235,7 @@ class SkinCode extends defaultStyle {
|
|||||||
this[deviceType.StationStand] = {
|
this[deviceType.StationStand] = {
|
||||||
common: { // 通用属性
|
common: { // 通用属性
|
||||||
textFontSize: 10, // 站台默认字体大小
|
textFontSize: 10, // 站台默认字体大小
|
||||||
haveJumpShow: false , // 站台是否有列车停跳显示
|
haveJumpShow: false, // 站台是否有列车停跳显示
|
||||||
functionButtonShow: [] // 功能灯按钮显示条件(prdType)
|
functionButtonShow: [] // 功能灯按钮显示条件(prdType)
|
||||||
},
|
},
|
||||||
safetyDoor: { // 屏蔽门
|
safetyDoor: { // 屏蔽门
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { deepAssign } from '@/utils/index';
|
import { deepAssign } from '@/utils/index';
|
||||||
import deviceType from './deviceType';
|
// import deviceType from './deviceType';
|
||||||
|
|
||||||
// 所有默认状态在这里都要有 用来转换后台发送的数据状态
|
// 所有默认状态在这里都要有 用来转换后台发送的数据状态
|
||||||
class Status {
|
class Status {
|
||||||
|
@ -7,9 +7,9 @@ class EDetain extends Group {
|
|||||||
this.model = model;
|
this.model = model;
|
||||||
this.isNew = false;
|
this.isNew = false;
|
||||||
this.detain = null;
|
this.detain = null;
|
||||||
if (this.model.style.StationStand.common.special) {
|
// if (this.model.style.StationStand.common.special) {
|
||||||
this.create('E');
|
this.create();
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
create(textName) {
|
create(textName) {
|
||||||
@ -42,7 +42,6 @@ class EDetain extends Group {
|
|||||||
position = -model.width / 4 - gagX;
|
position = -model.width / 4 - gagX;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(textName);
|
|
||||||
this.detain = new Text({
|
this.detain = new Text({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z,
|
z: model.z,
|
||||||
@ -93,11 +92,12 @@ class EDetain extends Group {
|
|||||||
|
|
||||||
show(nameText) {
|
show(nameText) {
|
||||||
if (this.model.style.StationStand.common.special && nameText) {
|
if (this.model.style.StationStand.common.special && nameText) {
|
||||||
|
this.create();
|
||||||
this.detain.setStyle('text', nameText);
|
this.detain.setStyle('text', nameText);
|
||||||
} else {
|
} else {
|
||||||
this.create();
|
this.create();
|
||||||
this.detain.show();
|
|
||||||
}
|
}
|
||||||
|
this.detain.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,43 +11,84 @@ class EJump extends Group {
|
|||||||
this.setStatus(model.allSkip, model.assignSkip);
|
this.setStatus(model.allSkip, model.assignSkip);
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create(textName) {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
this.isNew = true;
|
this.isNew = true;
|
||||||
this.jump = new Text({
|
if (style.StationStand.common.special) {
|
||||||
zlevel: model.zlevel,
|
// inside true 内侧
|
||||||
z: model.z,
|
const gag = 22;
|
||||||
style: {
|
const gagX = 6; // 左右间隔
|
||||||
x: model.x,
|
let height = '';
|
||||||
y: model.y,
|
let position = '';
|
||||||
fontWeight: 'normal',
|
if (model.right) {
|
||||||
fontSize: style.StationStand.common.textFontSize,
|
if (model.inside) {
|
||||||
fontFamily: style.fontFamily,
|
height = -gag;
|
||||||
text: style.StationStand.jump.text,
|
position = -model.width / 4 - gagX;
|
||||||
textFill: style.StationStand.jump.textColor,
|
} else {
|
||||||
textAlign: model.textAlign,
|
height = gag;
|
||||||
textVerticalAlign: model.textVerticalAlign
|
position = model.width / 4 + gagX;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (model.inside) {
|
||||||
|
height = gag;
|
||||||
|
position = model.width / 4 + gagX;
|
||||||
|
} else {
|
||||||
|
height = -gag;
|
||||||
|
position = -model.width / 4 - gagX;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
this.jump = new Text({
|
||||||
this.jumpArc = new Arc({
|
zlevel: model.zlevel,
|
||||||
zlevel: model.zlevel,
|
z: model.z,
|
||||||
z: model.z,
|
position: [0, 0],
|
||||||
shape: {
|
style: {
|
||||||
cx: model.cx,
|
x: model.x + position,
|
||||||
cy: model.cy,
|
y: model.y + height,
|
||||||
r: style.StationStand.jump.r
|
text: textName,
|
||||||
},
|
textAlign: 'center',
|
||||||
style: {
|
fontWeight: 'blod',
|
||||||
stroke: style.StationStand.jump.arcColor,
|
fontSize: `${style.StationStand.detainCar.fontSize} px ${style.fontFamily}`,
|
||||||
fill: style.StationStand.jump.fillColor
|
textFill: textName == 'S' ? 'green' : '#fff',
|
||||||
}
|
textVerticalAlign: 'middle'
|
||||||
});
|
}
|
||||||
this.add(this.jumpArc);
|
});
|
||||||
this.add(this.jump);
|
this.add(this.jump);
|
||||||
this.jumpArc.hide();
|
} else {
|
||||||
|
this.jump = new Text({
|
||||||
|
zlevel: model.zlevel,
|
||||||
|
z: model.z,
|
||||||
|
style: {
|
||||||
|
x: model.x,
|
||||||
|
y: model.y,
|
||||||
|
fontWeight: 'normal',
|
||||||
|
fontSize: style.StationStand.common.textFontSize,
|
||||||
|
fontFamily: style.fontFamily,
|
||||||
|
text: style.StationStand.jump.text,
|
||||||
|
textFill: style.StationStand.jump.textColor,
|
||||||
|
textAlign: model.textAlign,
|
||||||
|
textVerticalAlign: model.textVerticalAlign
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.jumpArc = new Arc({
|
||||||
|
zlevel: model.zlevel,
|
||||||
|
z: model.z,
|
||||||
|
shape: {
|
||||||
|
cx: model.cx,
|
||||||
|
cy: model.cy,
|
||||||
|
r: style.StationStand.jump.r
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
stroke: style.StationStand.jump.arcColor,
|
||||||
|
fill: style.StationStand.jump.fillColor
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.add(this.jumpArc);
|
||||||
|
this.add(this.jump);
|
||||||
|
this.jumpArc.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,11 +97,13 @@ class EJump extends Group {
|
|||||||
this.jump.setStyle('text', val);
|
this.jump.setStyle('text', val);
|
||||||
}
|
}
|
||||||
setStatus(allSkip, assignSkip) {
|
setStatus(allSkip, assignSkip) {
|
||||||
this.jumpArc.hide();
|
if (this.jumpArc) {
|
||||||
if (assignSkip) {
|
this.jumpArc.hide();
|
||||||
this.jumpArc.hide(); // 指定站台跳停
|
if (assignSkip) {
|
||||||
} else if (allSkip) {
|
this.jumpArc.hide(); // 指定站台跳停
|
||||||
this.jumpArc.show(); // 站台全部跳停
|
} else if (allSkip) {
|
||||||
|
this.jumpArc.show(); // 站台全部跳停
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setColor(color) {
|
setColor(color) {
|
||||||
@ -73,8 +116,13 @@ class EJump extends Group {
|
|||||||
this.jump.hide();
|
this.jump.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
show(nameText) {
|
||||||
this.create();
|
if (this.model.style.StationStand.common.special && nameText) {
|
||||||
|
this.create();
|
||||||
|
this.jump.setStyle('text', nameText);
|
||||||
|
} else {
|
||||||
|
this.create();
|
||||||
|
}
|
||||||
this.jump.show();
|
this.jump.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -182,10 +182,14 @@ class StationStand extends Group {
|
|||||||
/** 列车停跳 */
|
/** 列车停跳 */
|
||||||
if (style.StationStand.common.haveJumpShow) {
|
if (style.StationStand.common.haveJumpShow) {
|
||||||
const jumpDirct = model.right ? -1 : 1;
|
const jumpDirct = model.right ? -1 : 1;
|
||||||
const jumpX = model.position.x - jumpDirct * (style.StationStand.jump.offset.x - model.width / 2);
|
let jumpX = model.position.x - jumpDirct * (style.StationStand.jump.offset.x - model.width / 2);
|
||||||
const jumpY = model.position.y + jumpDirct * style.StationStand.jump.offset.y;
|
let jumpY = model.position.y + jumpDirct * style.StationStand.jump.offset.y;
|
||||||
const jumpCX = model.position.x - jumpDirct * (style.StationStand.jump.offset.x - model.width / 2);
|
const jumpCX = model.position.x - jumpDirct * (style.StationStand.jump.offset.x - model.width / 2);
|
||||||
const jumpCY = model.position.y + jumpDirct * style.StationStand.jump.offset.y;
|
const jumpCY = model.position.y + jumpDirct * style.StationStand.jump.offset.y;
|
||||||
|
if (style.StationStand.common.special) {
|
||||||
|
jumpX = model.position.x;
|
||||||
|
jumpY = model.position.y;
|
||||||
|
}
|
||||||
this.jump = new EJump({
|
this.jump = new EJump({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z + 1,
|
z: this.z + 1,
|
||||||
@ -194,6 +198,9 @@ class StationStand extends Group {
|
|||||||
y: jumpY,
|
y: jumpY,
|
||||||
cx: jumpCX,
|
cx: jumpCX,
|
||||||
cy: jumpCY,
|
cy: jumpCY,
|
||||||
|
width: model.width,
|
||||||
|
inside: model.inside,
|
||||||
|
right: model.right,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
textVerticalAlign: 'middle',
|
textVerticalAlign: 'middle',
|
||||||
allSkip: model.allSkip,
|
allSkip: model.allSkip,
|
||||||
@ -351,9 +358,9 @@ class StationStand extends Group {
|
|||||||
recover() {
|
recover() {
|
||||||
this.time && this.time.hide();
|
this.time && this.time.hide();
|
||||||
this.level && this.level.hide();
|
this.level && this.level.hide();
|
||||||
if (!this.style.StationStand.common.special) {
|
// if (!this.style.StationStand.common.special) {
|
||||||
this.detain && this.detain.hide();
|
this.detain && this.detain.hide();
|
||||||
}
|
// }
|
||||||
this.emergent && this.emergent.hide();
|
this.emergent && this.emergent.hide();
|
||||||
this.trainStop && this.trainStop.hide(); // 列车停站
|
this.trainStop && this.trainStop.hide(); // 列车停站
|
||||||
this.trainDepart && this.trainDepart.hide();
|
this.trainDepart && this.trainDepart.hide();
|
||||||
@ -384,6 +391,10 @@ class StationStand extends Group {
|
|||||||
if (!this.style.StationStand.common.special) {
|
if (!this.style.StationStand.common.special) {
|
||||||
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.spareColor);
|
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.spareColor);
|
||||||
}
|
}
|
||||||
|
if (this.style.StationStand.common.special) {
|
||||||
|
this.detain && this.detain.show('E');
|
||||||
|
this.detain && this.detain.setColor('#fff');
|
||||||
|
}
|
||||||
this.emergent && this.emergent.show();
|
this.emergent && this.emergent.show();
|
||||||
if (this.style.StationStand.standEmergent.flicker) {
|
if (this.style.StationStand.standEmergent.flicker) {
|
||||||
this.emergent.getElement().animateStyle(true)
|
this.emergent.getElement().animateStyle(true)
|
||||||
@ -397,7 +408,12 @@ class StationStand extends Group {
|
|||||||
/** 指定列车跳站*/
|
/** 指定列车跳站*/
|
||||||
designatedJumpStop() {
|
designatedJumpStop() {
|
||||||
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.designatedJumpStopColor);
|
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.designatedJumpStopColor);
|
||||||
this.jump && this.jump.show();
|
if (this.style.StationStand.common.special) {
|
||||||
|
this.jump && this.jump.show('S');
|
||||||
|
this.jump && this.jump.setColor('green');
|
||||||
|
} else {
|
||||||
|
this.jump && this.jump.show();
|
||||||
|
}
|
||||||
this.jump && this.jump.setStatus(0, 1);
|
this.jump && this.jump.setStatus(0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,7 +426,12 @@ class StationStand extends Group {
|
|||||||
/** 站台跳停*/
|
/** 站台跳停*/
|
||||||
jumpStop() {
|
jumpStop() {
|
||||||
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.jumpStopColor);
|
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.jumpStopColor);
|
||||||
this.jump && this.jump.show();
|
if (this.style.StationStand.common.special) {
|
||||||
|
this.jump && this.jump.show('S');
|
||||||
|
this.jump && this.jump.setColor('green');
|
||||||
|
} else {
|
||||||
|
this.jump && this.jump.show();
|
||||||
|
}
|
||||||
this.jump && this.jump.setStatus(1, 0);
|
this.jump && this.jump.setStatus(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -488,8 +509,8 @@ class StationStand extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 设置跳停*/
|
/** 设置跳停*/
|
||||||
// model.assignSkip = 1;
|
// model.allSkip = 1;
|
||||||
model.assignSkip && this.designatedJumpStop(); // 指定站台跳停
|
model.assignSkip && this.designatedJumpStop(); // 指定列车跳停
|
||||||
model.allSkip && this.jumpStop(); // 站台全部跳停
|
model.allSkip && this.jumpStop(); // 站台全部跳停
|
||||||
|
|
||||||
/** 设置扣车*/
|
/** 设置扣车*/
|
||||||
|
@ -110,7 +110,7 @@ export default class TrainBody extends Group {
|
|||||||
x: parseInt(model.point.x + style.Train.trainServer.trainServerOffset.x),
|
x: parseInt(model.point.x + style.Train.trainServer.trainServerOffset.x),
|
||||||
y: parseInt(model.point.y + style.Train.trainServer.trainServerOffset.y),
|
y: parseInt(model.point.y + style.Train.trainServer.trainServerOffset.y),
|
||||||
text: serviceNumber.substring(serviceNumber.length - style.Train.trainServer.serviceNumberPrefix.length),
|
text: serviceNumber.substring(serviceNumber.length - style.Train.trainServer.serviceNumberPrefix.length),
|
||||||
textFill: style.trainTextColor,
|
textFill: model.style.Train.trainServer.fontColor || style.trainTextColor,
|
||||||
fontSize: model.fontSize,
|
fontSize: model.fontSize,
|
||||||
fontFamily: style.Train.common.fontFamily,
|
fontFamily: style.Train.common.fontFamily,
|
||||||
textAlign: 'left',
|
textAlign: 'left',
|
||||||
@ -122,7 +122,7 @@ export default class TrainBody extends Group {
|
|||||||
x: parseInt(model.point.x + model.style.Train.trainTarget.trainTargetOffset.x),
|
x: parseInt(model.point.x + model.style.Train.trainTarget.trainTargetOffset.x),
|
||||||
y: parseInt(model.point.y + model.style.Train.trainTarget.trainTargetOffset.y),
|
y: parseInt(model.point.y + model.style.Train.trainTarget.trainTargetOffset.y),
|
||||||
text: tripNumber.substring(tripNumber.length - style.Train.trainTarget.tripNumberPrefix.length),
|
text: tripNumber.substring(tripNumber.length - style.Train.trainTarget.tripNumberPrefix.length),
|
||||||
textFill: style.trainTextColor,
|
textFill: model.style.Train.trainTarget.fontColor || style.trainTextColor,
|
||||||
fontSize: model.fontSize,
|
fontSize: model.fontSize,
|
||||||
fontFamily: style.Train.common.fontFamily,
|
fontFamily: style.Train.common.fontFamily,
|
||||||
textAlign: style.Train.trainTarget.trainTargetTextAlign,
|
textAlign: style.Train.trainTarget.trainTargetTextAlign,
|
||||||
@ -178,7 +178,7 @@ export default class TrainBody extends Group {
|
|||||||
fill: '#ff0000'
|
fill: '#ff0000'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.add(this.atrStatus);
|
// this.add(this.atrStatus);
|
||||||
}
|
}
|
||||||
if (style.Train.common.hasTravelSigns) {
|
if (style.Train.common.hasTravelSigns) {
|
||||||
this.travelSigns = new ETextName({
|
this.travelSigns = new ETextName({
|
||||||
@ -186,8 +186,8 @@ export default class TrainBody extends Group {
|
|||||||
z: model.z + 1,
|
z: model.z + 1,
|
||||||
x: parseInt(model.point.x + style.Train.travelSigns.trainTravelSignsOffset.x),
|
x: parseInt(model.point.x + style.Train.travelSigns.trainTravelSignsOffset.x),
|
||||||
y: parseInt(model.point.y + style.Train.travelSigns.trainTravelSignsOffset.y),
|
y: parseInt(model.point.y + style.Train.travelSigns.trainTravelSignsOffset.y),
|
||||||
text: '<',
|
text: this.deviceModel.right ? '>' : '<',
|
||||||
textFill: style.trainTextColor,
|
textFill: '#00C300',
|
||||||
textStroke: style.trainTextColor,
|
textStroke: style.trainTextColor,
|
||||||
textStrokeWidth: 0,
|
textStrokeWidth: 0,
|
||||||
fontSize: model.fontSize,
|
fontSize: model.fontSize,
|
||||||
@ -221,7 +221,7 @@ export default class TrainBody extends Group {
|
|||||||
x: parseInt(model.point.x + style.Train.travelNum.trainTravelNumOffset.x),
|
x: parseInt(model.point.x + style.Train.travelNum.trainTravelNumOffset.x),
|
||||||
y: parseInt(model.point.y + style.Train.travelNum.trainTravelNumOffset.y),
|
y: parseInt(model.point.y + style.Train.travelNum.trainTravelNumOffset.y),
|
||||||
text: 'AA',
|
text: 'AA',
|
||||||
textFill: style.trainTextColor,
|
textFill: '#00C300',
|
||||||
textStroke: style.trainTextColor,
|
textStroke: style.trainTextColor,
|
||||||
textStrokeWidth: 0,
|
textStrokeWidth: 0,
|
||||||
fontSize: model.fontSize,
|
fontSize: model.fontSize,
|
||||||
@ -238,7 +238,7 @@ export default class TrainBody extends Group {
|
|||||||
x: parseInt(model.point.x + style.Train.delayTime.trainDelayTimeOffset.x),
|
x: parseInt(model.point.x + style.Train.delayTime.trainDelayTimeOffset.x),
|
||||||
y: parseInt(model.point.y + style.Train.delayTime.trainDelayTimeOffset.y),
|
y: parseInt(model.point.y + style.Train.delayTime.trainDelayTimeOffset.y),
|
||||||
text: '0',
|
text: '0',
|
||||||
textFill: style.trainTextColor,
|
textFill: '#DADA00',
|
||||||
textStroke: style.trainTextColor,
|
textStroke: style.trainTextColor,
|
||||||
textStrokeWidth: 0,
|
textStrokeWidth: 0,
|
||||||
fontSize: model.fontSize,
|
fontSize: model.fontSize,
|
||||||
|
226
src/jmapNew/theme/haerbin_01/menus/dialog/trainInitPlan.vue
Normal file
226
src/jmapNew/theme/haerbin_01/menus/dialog/trainInitPlan.vue
Normal file
@ -0,0 +1,226 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
v-dialogDrag
|
||||||
|
class="haerbin-01__systerm stand-stop-time"
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="show"
|
||||||
|
width="300px"
|
||||||
|
:before-close="doClose"
|
||||||
|
:z-index="2000"
|
||||||
|
:modal="false"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
<div class="el-dialog-div">
|
||||||
|
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules" label-position="left">
|
||||||
|
<el-form-item prop="trainCode" label="车组号:">
|
||||||
|
<!--<el-input v-model="addModel.trainCode"/>-->
|
||||||
|
<el-select v-model="addModel.trainCode" filterable>
|
||||||
|
<el-option
|
||||||
|
v-for="train in trainList"
|
||||||
|
:key="train.groupNumber"
|
||||||
|
:label="train.groupNumber"
|
||||||
|
:value="train.code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="车次号:" prop="tripNumber">
|
||||||
|
<!--<el-input v-model="addModel.tripNumber"/>-->
|
||||||
|
<el-select v-model="addModel.tripNumber" @change="tripNumberChange" filterable>
|
||||||
|
<el-option
|
||||||
|
v-for="tripNum in tripNumberList"
|
||||||
|
:key="tripNum"
|
||||||
|
:label="tripNum"
|
||||||
|
:value="tripNum"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="服务号:" prop="serviceNumber">
|
||||||
|
<el-select v-model="addModel.serviceNumber" filterable>
|
||||||
|
<el-option
|
||||||
|
v-for="serviceNumber in serviceNumberList"
|
||||||
|
:key="serviceNumber"
|
||||||
|
:label="serviceNumber"
|
||||||
|
:value="serviceNumber"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<el-row justify="center" class="button-group">
|
||||||
|
<el-col :span="10" :offset="2">
|
||||||
|
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" :offset="4">
|
||||||
|
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
|
import CancelMouseState from '@/mixin/CancelMouseState';
|
||||||
|
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||||
|
import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'TrainCreateNumber',
|
||||||
|
mixins: [
|
||||||
|
CancelMouseState
|
||||||
|
],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
trainNoList: [],
|
||||||
|
selected: null,
|
||||||
|
sectionName: '',
|
||||||
|
tripNumberList: [],
|
||||||
|
serviceNumberList: [],
|
||||||
|
addModel: {
|
||||||
|
trainCode:'',
|
||||||
|
tripNumber:'',
|
||||||
|
serviceNumber: ''
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
trainCode: [
|
||||||
|
{ required: true, message: '请输入列车编码', trigger: 'blur'}
|
||||||
|
],
|
||||||
|
serviceNumber: [
|
||||||
|
{ required: true, message: '请输入服务号', trigger: 'change'}
|
||||||
|
],
|
||||||
|
tripNumber: [
|
||||||
|
{ required: true, message: '请输入车次号', trigger: 'blur'}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
dialogShow: false,
|
||||||
|
loading: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters('map', [
|
||||||
|
'trainList',
|
||||||
|
'stationStandList',
|
||||||
|
'trainWindowSectionCode'
|
||||||
|
]),
|
||||||
|
show() {
|
||||||
|
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||||
|
},
|
||||||
|
domIdCancel() {
|
||||||
|
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||||
|
},
|
||||||
|
domIdConfirm() {
|
||||||
|
return this.dialogShow ? OperationEvent.Train.createPlanTrain.menu.domId : '';
|
||||||
|
},
|
||||||
|
title() {
|
||||||
|
return '新建计划车';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$store.dispatch('training/tipReload');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
tripNumberChange(tripNumber) {
|
||||||
|
getServiceNumbersByTripNum(this.$route.query.group, tripNumber).then(resp => {
|
||||||
|
this.serviceNumberList = [];
|
||||||
|
resp.data.forEach(item => {
|
||||||
|
if (!this.serviceNumberList.includes(item)) {
|
||||||
|
this.serviceNumberList.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
if (this.serviceNumberList.length === 1) {
|
||||||
|
this.addModel.serviceNumber = this.serviceNumberList[0];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
doShow(operate, selected) {
|
||||||
|
this.selected = selected;
|
||||||
|
// 如果不是断点激活,则需要对初始值进行初始化
|
||||||
|
this.addModel = {
|
||||||
|
trainCode:'',
|
||||||
|
tripNumber:'',
|
||||||
|
serviceNumber: ''
|
||||||
|
};
|
||||||
|
getTripNumberList(this.$route.query.group).then(resp => {
|
||||||
|
this.tripNumberList = [];
|
||||||
|
resp.data.forEach(item => {
|
||||||
|
if (!this.tripNumberList.includes(item)) {
|
||||||
|
this.tripNumberList.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).catch(error => {
|
||||||
|
this.$messageBox(error.message);
|
||||||
|
});
|
||||||
|
this.dialogShow = true;
|
||||||
|
this.$nextTick(function () {
|
||||||
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
doClose() {
|
||||||
|
this.loading = false;
|
||||||
|
this.dialogShow = false;
|
||||||
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
|
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||||
|
this.mouseCancelState(this.selected);
|
||||||
|
},
|
||||||
|
commit() {
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const operate = {
|
||||||
|
over: true,
|
||||||
|
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
||||||
|
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
|
||||||
|
param: {
|
||||||
|
sectionCode: this.trainWindowSectionCode,
|
||||||
|
trainCode: this.addModel.trainCode, // 车组号
|
||||||
|
serviceNumber: this.addModel.serviceNumber, // 服务号
|
||||||
|
tripNumber: this.addModel.tripNumber // 车次号
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this.loading = true;
|
||||||
|
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (valid) {
|
||||||
|
this.doClose();
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
this.loading = false;
|
||||||
|
this.doClose();
|
||||||
|
// this.$refs.noticeInfo.doShow(operate);
|
||||||
|
this.$messageBox(error.message);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
const operate = {
|
||||||
|
|
||||||
|
operation: OperationEvent.Command.cancel.menu.operation
|
||||||
|
};
|
||||||
|
|
||||||
|
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||||
|
if (valid) {
|
||||||
|
this.doClose();
|
||||||
|
}
|
||||||
|
}).catch(error => { this.doClose(); });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.chengdou-03__systerm .el-dialog .base-label {
|
||||||
|
background: rgba(0, 0, 0, x);
|
||||||
|
position: relative;
|
||||||
|
left: -5px;
|
||||||
|
top: -18px;
|
||||||
|
padding: 0 5px;
|
||||||
|
background-color: #F0F0F0;
|
||||||
|
}
|
||||||
|
.el-dialog-div {
|
||||||
|
height: 200px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
</style>
|
@ -7,6 +7,7 @@
|
|||||||
<train-move ref="trainMove" />
|
<train-move ref="trainMove" />
|
||||||
<train-switch ref="trainSwitch" />
|
<train-switch ref="trainSwitch" />
|
||||||
<train-edit-number ref="trainEditNumber" />
|
<train-edit-number ref="trainEditNumber" />
|
||||||
|
<train-init-plan ref="trainInitPlan"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -22,6 +23,7 @@ import TrainDelete from './dialog/trainDelete';
|
|||||||
import TrainMove from './dialog/trainMove';
|
import TrainMove from './dialog/trainMove';
|
||||||
import TrainSwitch from './dialog/trainSwitch';
|
import TrainSwitch from './dialog/trainSwitch';
|
||||||
import TrainEditNumber from './dialog/trainEditNumber';
|
import TrainEditNumber from './dialog/trainEditNumber';
|
||||||
|
import TrainInitPlan from './dialog/trainInitPlan';
|
||||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -33,7 +35,8 @@ export default {
|
|||||||
TrainDelete,
|
TrainDelete,
|
||||||
TrainMove,
|
TrainMove,
|
||||||
TrainSwitch,
|
TrainSwitch,
|
||||||
TrainEditNumber
|
TrainEditNumber,
|
||||||
|
TrainInitPlan
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
selected: {
|
||||||
@ -47,44 +50,19 @@ export default {
|
|||||||
return {
|
return {
|
||||||
menu: [],
|
menu: [],
|
||||||
menuNormal: {
|
menuNormal: {
|
||||||
Local: [],
|
Local: [
|
||||||
|
{
|
||||||
|
label: '新建计划列车',
|
||||||
|
handler: this.createPlanTrain,
|
||||||
|
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
||||||
|
}
|
||||||
|
],
|
||||||
Center: [
|
Center: [
|
||||||
// {
|
{
|
||||||
// label: this.$t('menu.menuTrain.addTrainId'),
|
label: '新建计划列车',
|
||||||
// handler: this.addTrainId,
|
handler: this.createPlanTrain,
|
||||||
// auth: { station: true, center: true },
|
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
||||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
}
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: this.$t('menu.menuTrain.deleteTrainId'),
|
|
||||||
// handler: this.delTrainId,
|
|
||||||
// auth: { station: true, center: true },
|
|
||||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: this.$t('menu.menuTrain.editTrainId'),
|
|
||||||
// handler: this.editTrainId,
|
|
||||||
// auth: { station: true, center: true },
|
|
||||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: this.$t('menu.menuTrain.editTrainNo'),
|
|
||||||
// handler: this.editTrainNo,
|
|
||||||
// auth: { station: true, center: true },
|
|
||||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: this.$t('menu.menuTrain.moveTrainId'),
|
|
||||||
// handler: this.moveTrainId,
|
|
||||||
// auth: { station: true, center: true },
|
|
||||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: this.$t('menu.menuTrain.switchTrainId'),
|
|
||||||
// handler: this.switchTrainId,
|
|
||||||
// auth: { station: true, center: true },
|
|
||||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
|
||||||
// }
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
menuForce: [
|
menuForce: [
|
||||||
@ -162,6 +140,23 @@ export default {
|
|||||||
// this.$store.dispatch('map/setTrainWindowShow', false);
|
// this.$store.dispatch('map/setTrainWindowShow', false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
createPlanTrain() {
|
||||||
|
const step = {
|
||||||
|
start: true,
|
||||||
|
code: this.selected.code,
|
||||||
|
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
||||||
|
param: {
|
||||||
|
trainWindowCode: this.selected.code
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||||
|
if (valid) {
|
||||||
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
|
this.$refs.trainInitPlan.doShow(step, this.selected);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
// 设置故障
|
// 设置故障
|
||||||
setStoppage() {
|
setStoppage() {
|
||||||
const step = {
|
const step = {
|
||||||
|
Loading…
Reference in New Issue
Block a user