2019-11-29 12:51:58 +08:00
|
|
|
import Group from 'zrender/src/container/Group';
|
|
|
|
import Polygon from 'zrender/src/graphic/shape/Polygon';
|
|
|
|
|
|
|
|
class ESwLnversion extends Group {
|
2020-03-24 13:39:20 +08:00
|
|
|
constructor(model) {
|
|
|
|
super();
|
|
|
|
this.model = model;
|
|
|
|
this.create();
|
|
|
|
}
|
|
|
|
|
|
|
|
create() {
|
|
|
|
const model = this.model;
|
|
|
|
const style = this.model.style;
|
|
|
|
this.relocShelter = new Polygon({ // 遮盖B区段范围
|
|
|
|
zlevel: model.zlevel,
|
|
|
|
z: model.z,
|
|
|
|
shape: {
|
|
|
|
points: model.shelterPoints
|
|
|
|
},
|
|
|
|
style: {
|
|
|
|
fill: style.backgroundColor
|
|
|
|
// fill: 'yellow'
|
|
|
|
},
|
|
|
|
cursor: model.cursor,
|
|
|
|
onmouseover: model.onmouseover,
|
|
|
|
onmouseout: model.onmouseout
|
|
|
|
});
|
|
|
|
this.hide();
|
|
|
|
this.add(this.relocShelter);
|
|
|
|
}
|
|
|
|
|
|
|
|
hide() {
|
|
|
|
this.relocShelter.hide();
|
2020-04-09 17:03:22 +08:00
|
|
|
this.relocShelter.setStyle({ fill: this.model.style.backgroundColor });
|
|
|
|
this.stopAnimation(false);
|
2020-03-24 13:39:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
show() {
|
|
|
|
this.relocShelter.show();
|
|
|
|
}
|
|
|
|
|
|
|
|
setColor(color) {
|
|
|
|
this.relocShelter.setStyle({ fill: color });
|
|
|
|
}
|
|
|
|
|
|
|
|
stopAnimation(flag) {
|
|
|
|
this.relocShelter.stopAnimation(flag);
|
|
|
|
}
|
|
|
|
|
2020-06-01 10:27:34 +08:00
|
|
|
getSection() {
|
|
|
|
return this.relocShelter;
|
|
|
|
}
|
|
|
|
|
2020-03-24 13:39:20 +08:00
|
|
|
animateStyle(cb) {
|
|
|
|
this.eachChild((child) => {
|
|
|
|
cb(child);
|
|
|
|
});
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ESwLnversion;
|