修改 代码接口名称

This commit is contained in:
ival 2019-08-05 17:46:41 +08:00
parent 3c4fc9ef18
commit 530a1c473e
7 changed files with 62 additions and 35 deletions

View File

@ -152,6 +152,7 @@ class MouseController extends Eventful {
}
checkEvent(e) {
console.log(e.which);
return new EventModel(e);
// var oldEm = new EventModel(this.$zr.curEvent || { event: {} });
// var newEm = new EventModel(e);

View File

@ -13,10 +13,10 @@ export default class ImageControl extends Group {
this.model = model;
this.style = style;
this.z = model.zIndex || 1;
this._create();
this.create();
}
_create() {
create() {
const model = this.model;
this.image = new Image({
zlevel: this.zlevel,

View File

@ -5,10 +5,10 @@ export default class EMouse extends Group {
constructor(device) {
super();
this.device = device;
this.down = true;
this._create();
this.down = false;
this.create();
}
_create() {
create() {
this.text = new Text({
_subType: 'Text',
zlevel: this.device.zlevel,
@ -34,7 +34,9 @@ export default class EMouse extends Group {
}
mouseoutText(e) {
this.text.hide();
if (!this.down) {
this.text.hide();
}
}
mouseoverArc(e) {
@ -44,9 +46,15 @@ export default class EMouse extends Group {
this.device.control.setArcBorder(true);
}
mouseoutArc(e) {
this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);
this.device.control.setTextColor('#FFFFFF');
this.device.control.setTextBorder(false);
this.device.control.setArcBorder(false);
if (!this.down) {
this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);
this.device.control.setTextColor('#FFFFFF');
this.device.control.setTextBorder(false);
this.device.control.setArcBorder(false);
}
}
mouseout(e) {
this.mouseoutText(e);
this.mouseoutArc(e);
}
}

View File

@ -6,9 +6,9 @@ export default class EMouse extends Group {
super();
this.device = device;
this.down = true;
this._create();
this.create();
}
_create() {
create() {
this.text = new Text({
_subType: 'Text',
zlevel: this.device.zlevel,
@ -34,7 +34,9 @@ export default class EMouse extends Group {
}
mouseoutText(e) {
this.text.hide();
if (!this.down) {
this.text.hide();
}
}
mouseoverArc(e) {
@ -44,9 +46,15 @@ export default class EMouse extends Group {
this.device.control.setArcBorder(true);
}
mouseoutArc(e) {
this.device.control.setControlColor(this.device.style.LimitControl.lamp.controlColor);
this.device.control.setTextColor('#FFFFFF');
this.device.control.setTextBorder(false);
this.device.control.setArcBorder(false);
if (!this.down) {
this.device.control.setControlColor(this.device.style.LimitControl.lamp.controlColor);
this.device.control.setTextColor('#FFFFFF');
this.device.control.setTextBorder(false);
this.device.control.setArcBorder(false);
}
}
mouseout(e) {
this.mouseoutText(e);
this.mouseoutArc(e);
}
}

View File

@ -100,15 +100,17 @@ class EMouse extends Group {
}
}
mouseout() {
this.sectionTextShadow && this.sectionTextShadow.hide();
if (this.device.model.isSwitchSection && this.device.model.switch) {
// 道岔区段
const refSwitch = this.device.model.switch.instance;
refSwitch && refSwitch.mouseEvent.mouseout();
} else {
this.TextName && this.TextName.hide();
this.sectionTextBorder && this.sectionTextBorder.hide();
this.lineBorder && this.lineBorder.hide();
if (!this.down) {
this.sectionTextShadow && this.sectionTextShadow.hide();
if (this.device.model.isSwitchSection && this.device.model.switch) {
// 道岔区段
const refSwitch = this.device.model.switch.instance;
refSwitch && refSwitch.mouseEvent.mouseout();
} else {
this.TextName && this.TextName.hide();
this.sectionTextBorder && this.sectionTextBorder.hide();
this.lineBorder && this.lineBorder.hide();
}
}
}
}

View File

@ -20,7 +20,7 @@ export default class Switch extends Group {
this.style = style;
this.zlevel = model.zlevel;
this.z = 6;
this._create();
this.create();
this._createLockRect(); // 创建单锁矩形框显示
this.createMouseEvent();
this.setState(model);
@ -36,7 +36,7 @@ export default class Switch extends Group {
}
}
_create() {
create() {
const model = this.model;
const style = this.style;

View File

@ -6,9 +6,9 @@ export default class EMouse extends Group {
super();
this.device = device;
this.down = true;
this._create();
this.create();
}
_create() {
create() {
this.text = new Text({
_subType: 'Text',
zlevel: this.device.zlevel,
@ -34,7 +34,9 @@ export default class EMouse extends Group {
}
mouseoutText(e) {
this.text.hide();
if (!this.down) {
this.text.hide();
}
}
mouseoverArc(e) {
@ -44,9 +46,15 @@ export default class EMouse extends Group {
this.device.control.setArcBorder(true);
}
mouseoutArc(e) {
this.device.control.setControlColor(this.device.style.ZcControl.lamp.controlColor);
this.device.control.setTextColor('#FFFFFF');
this.device.control.setTextBorder(false);
this.device.control.setArcBorder(false);
if (!this.down) {
this.device.control.setControlColor(this.device.style.ZcControl.lamp.controlColor);
this.device.control.setTextColor('#FFFFFF');
this.device.control.setTextBorder(false);
this.device.control.setArcBorder(false);
}
}
mouseout(e) {
this.mouseoutText(e);
this.mouseoutArc(e);
}
}