2019-11-29 12:51:58 +08:00
|
|
|
export default class EMouse {
|
2020-04-23 17:11:51 +08:00
|
|
|
constructor(device) {
|
|
|
|
this.device = device;
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
|
2020-04-23 17:11:51 +08:00
|
|
|
mouseover(e) {
|
|
|
|
if (this.device.prdType) {
|
|
|
|
this.device.setVisible(true);
|
|
|
|
const instance = this.device.getInstanceByCode(this.device.model.sectionCode);
|
|
|
|
if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) {
|
|
|
|
instance.mouseEvent.mouseEnter(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
|
2020-04-23 17:11:51 +08:00
|
|
|
mouseout(e) {
|
|
|
|
if (this.device.prdType) {
|
2020-09-02 17:11:06 +08:00
|
|
|
this.device.setVisible(false);
|
2020-04-23 17:11:51 +08:00
|
|
|
const instance = this.device.getInstanceByCode(this.device.model.sectionCode);
|
|
|
|
if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {
|
|
|
|
instance.mouseEvent.mouseLeave(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
|
2020-09-01 18:09:25 +08:00
|
|
|
mouseEnter() {
|
2020-04-23 17:11:51 +08:00
|
|
|
if (this.device.prdType) {
|
|
|
|
this.device.setVisible(true);
|
|
|
|
}
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
|
2020-09-01 18:09:25 +08:00
|
|
|
mouseLeave() {
|
2020-04-23 17:11:51 +08:00
|
|
|
if (this.device.prdType ) {
|
|
|
|
this.device.setVisible(false);
|
|
|
|
}
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
}
|