rt-sim-training-client/src/jmapNew/shape/Station/EMouse.js
lVAL 08de82a230 线路:宁波1
问题:站台部分操作完成后,深蓝色高亮未清除干净
2021-02-22 17:49:55 +08:00

48 lines
1.6 KiB
JavaScript

import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
export default class EMouse extends Group {
constructor(device) {
super();
this.device = device;
this.create();
}
create() {
this.text = new Text({
_subType: 'Text',
zlevel: this.device.zlevel,
z: this.device.z + 1,
position: [0, 0],
style: {
x: 0,
y: this.device.model.position.y + this.device.style.Station.StationControl.lamp.radiusR + this.device.style.Station.StationControl.text.distance - 25,
fontWeight: this.device.style.Station.StationControl.mouseOverStyle.fontWeight,
fontSize: this.device.style.Station.StationControl.mouseOverStyle.fontSize,
fontFamily: this.device.style.fontFamily,
text: this.device.model.name,
textFill: this.device.style.Station.StationControl.mouseOverStyle.fontColor,
textAlign: this.device.style.Station.StationControl.mouseOverStyle.textAlign,
textVerticalAlign: this.device.style.Station.StationControl.mouseOverStyle.textVerticalAlign
}
});
this.add(this.text);
this.text.hide();
}
mouseover(e) {
if (e.target &&
e.target.type == 'text' &&
e.target._subType == 'ControlSignal') {
this.text.setStyle({x: e.target.style.x});
this.text.show();
}
}
mouseout(e) {
if (!this.device.__down) {
if (e.target) {
this.text.hide();
}
}
}
}