代码调整

This commit is contained in:
joylink_cuiweidong 2021-01-19 09:20:37 +08:00
parent 4cbc3de4ea
commit 05a8c85d6b
4 changed files with 78 additions and 9 deletions

View File

@ -302,12 +302,12 @@ class SkinCode extends defaultStyle {
z:0,
position: 1, // 扣车标识在站台上显示方向
text: 'H', // 扣车显示内容
insideOffset: { x: 60, y: -18 }, // 内站台扣车偏移量
outsideOffset: { x: 60, y: 25 }, // 外站台扣车偏移量
centerTrainColor: '#F61107', // 中心扣车颜色
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色
fontSize: 18, // 字体大小
insideOffset: { x: 80, y: -18 }, // 内站台扣车偏移量
outsideOffset: { x:80, y: 25 }, // 外站台扣车偏移量
centerTrainColor: '#ff0', // 中心扣车颜色
andCenterTrainColor: '#ff0', // 车站+中心扣车颜色
detainTrainTextColor: '#ff0', // 车站扣除文字颜色
fontSize: 16, // 字体大小
fontWeight: 'bolder',
textVerticalAlign: 'middle' // 车站扣车 文字垂直对齐方式
},

View File

@ -0,0 +1,69 @@
import Group from 'zrender/src/container/Group';
import Polygon from 'zrender/src/graphic/shape/Polygon';
// import Text from 'zrender/src/graphic/Text';
class EStationPlatform extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model.modelData;
const style = this.model.style;
const buttonD = model.right ? 1 : -1;
const platFormOffset = model.inside ? style.StationStand.stationPlatform.insideOffset : style.StationStand.stationPlatform.outsideOffset;
const buttonX = model.position.x - buttonD * (platFormOffset.x - model.width / 2);
const buttonY = model.position.y + buttonD * (platFormOffset.y + buttonD * model.height / 2);
this.stationPlatform = new Polygon({
zlevel: this.model.zlevel,
z: this.model.z,
_subType: 'trainSetButton',
position: [0, 0],
shape: {
points: [
[buttonX, buttonY],
[buttonX - buttonD * 20, buttonY],
[buttonX - buttonD * 20, buttonY - 10],
[buttonX - buttonD * 5, buttonY - 10],
[buttonX, buttonY - 5]
]
},
style: {
fill: style.StationStand.stationPlatform.defaultColor
}
});
this.add(this.stationPlatform);
}
hideMode() {
this.stationPlatform && this.stationPlatform.hide();
}
showMode() {
this.stationPlatform && this.stationPlatform.show();
}
setColor(color) {
this.stationPlatform && this.stationPlatform.setStyle({fill:color});
}
recover() {
// console.log(this.model.modelData.code, 111111111);
const style = this.model.style;
this.setColor(style.StationStand.stationPlatform.defaultColor);
}
setState(model) {
const style = this.model.style;
if (model.stationHoldTrain || model.centerHoldTrain) {
// console.log(model.code, model.stationHoldTrain, model.centerHoldTrain);
this.setColor(style.StationStand.stationPlatform.detainColor);
}
if (model.assignSkip || model.allSkip) {
this.setColor(style.StationStand.stationPlatform.jumpColor);
}
}
}
export default EStationPlatform;

View File

@ -1,7 +1,7 @@
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
class ETime extends Group {
class ETrainSetButton extends Group {
constructor(model) {
super();
this.model = model;
@ -56,4 +56,4 @@ class ETime extends Group {
}
}
export default ETime;
export default ETrainSetButton;

View File

@ -359,7 +359,7 @@ export default {
},
'selected': function (val) {
this.initMenus();
if (val.code && val._event == MouseEvent.Left) {
if (val.code && val._event == MouseEvent.Left && val._type != 'Psd') {
this.dialogVisible = !this.isLocal;
} else if (!val.code) {
if (this.$store.state.training.mode != TrainingMode.TEACH) {