1580a89770
问题: a.南京2现地实训进入后,视图有的站没有拆分成两列 b.修改宁波一,设置通过dialog的title提示 c.恢复showStationContent函数的加入位置 d.删除代码中的一些无用注释代码
69 lines
2.2 KiB
JavaScript
69 lines
2.2 KiB
JavaScript
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 * ( model.width / 2 - 20);
|
|
// platFormOffset.x -
|
|
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: 'StationPlatform',
|
|
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() {
|
|
const style = this.model.style;
|
|
this.setColor(style.StationStand.stationPlatform.defaultColor);
|
|
}
|
|
|
|
setState(model) {
|
|
const style = this.model.style;
|
|
if (model.stationHoldTrain || model.centerHoldTrain) {
|
|
this.setColor(style.StationStand.stationPlatform.detainColor);
|
|
}
|
|
if (model.assignSkip || model.allSkip) {
|
|
this.setColor(style.StationStand.stationPlatform.jumpColor);
|
|
}
|
|
}
|
|
}
|
|
|
|
export default EStationPlatform;
|