2020-04-13 18:30:21 +08:00
|
|
|
import Group from 'zrender/src/container/Group';
|
|
|
|
import Text from 'zrender/src/graphic/Text';
|
|
|
|
|
|
|
|
export default class EDeviceStatus extends Group {
|
|
|
|
constructor(model) {
|
|
|
|
super();
|
|
|
|
this.model = model;
|
|
|
|
this.zlevel = model.zlevel;
|
|
|
|
this._subType = model._subType;
|
|
|
|
this.z = model.z;
|
|
|
|
this.create(model);
|
|
|
|
}
|
|
|
|
create(model) {
|
|
|
|
this.psd = new Text({
|
|
|
|
zlevel: this.zlevel,
|
|
|
|
z: this.z,
|
|
|
|
style: {
|
|
|
|
x: model.x,
|
|
|
|
y: model.y,
|
|
|
|
fontWeight: model.style.textStyle.fontWeight,
|
2020-04-14 15:45:13 +08:00
|
|
|
fontSize: model.style.FaultStatusGroup.fontSize,
|
2020-04-13 18:30:21 +08:00
|
|
|
fontFamily: model.style.fontFamily,
|
2020-04-14 15:45:13 +08:00
|
|
|
text: model.style.FaultStatusGroup.psd.text,
|
|
|
|
textFill: model.style.FaultStatusGroup.psd.defaultColor,
|
2020-04-13 18:30:21 +08:00
|
|
|
textAlign: model.style.textStyle.textAlign,
|
|
|
|
textVerticalAlign: model.style.textStyle.textVerticalAlign
|
|
|
|
}
|
|
|
|
});
|
|
|
|
this.mfa = new Text({
|
|
|
|
zlevel: this.zlevel,
|
|
|
|
z: this.z,
|
|
|
|
style: {
|
2020-04-14 15:45:13 +08:00
|
|
|
x: model.x + model.style.FaultStatusGroup.distance,
|
2020-04-13 18:30:21 +08:00
|
|
|
y: model.y,
|
|
|
|
fontWeight: model.style.textStyle.fontWeight,
|
2020-04-14 15:45:13 +08:00
|
|
|
fontSize: model.style.FaultStatusGroup.fontSize,
|
2020-04-13 18:30:21 +08:00
|
|
|
fontFamily: model.style.fontFamily,
|
2020-04-14 15:45:13 +08:00
|
|
|
text: model.style.FaultStatusGroup.mfa.text,
|
|
|
|
textFill: model.style.FaultStatusGroup.mfa.defaultColor,
|
2020-04-13 18:30:21 +08:00
|
|
|
textAlign: model.style.textStyle.textAlign,
|
|
|
|
textVerticalAlign: model.style.textStyle.textVerticalAlign
|
|
|
|
}
|
|
|
|
});
|
|
|
|
this.mfb = new Text({
|
|
|
|
zlevel: this.zlevel,
|
|
|
|
z: this.z,
|
|
|
|
style: {
|
2020-04-14 15:45:13 +08:00
|
|
|
x: model.x + model.style.FaultStatusGroup.distance * 2,
|
2020-04-13 18:30:21 +08:00
|
|
|
y: model.y,
|
|
|
|
fontWeight: model.style.textStyle.fontWeight,
|
2020-04-14 15:45:13 +08:00
|
|
|
fontSize: model.style.FaultStatusGroup.fontSize,
|
2020-04-13 18:30:21 +08:00
|
|
|
fontFamily: model.style.fontFamily,
|
2020-04-14 15:45:13 +08:00
|
|
|
text: model.style.FaultStatusGroup.mfb.text,
|
|
|
|
textFill: model.style.FaultStatusGroup.mfb.defaultColor,
|
2020-04-13 18:30:21 +08:00
|
|
|
textAlign: model.style.textStyle.textAlign,
|
|
|
|
textVerticalAlign: model.style.textStyle.textVerticalAlign
|
|
|
|
}
|
|
|
|
});
|
|
|
|
this.pfa = new Text({
|
|
|
|
zlevel: this.zlevel,
|
|
|
|
z: this.z,
|
|
|
|
style: {
|
2020-04-14 15:45:13 +08:00
|
|
|
x: model.x + model.style.FaultStatusGroup.distance * 3,
|
2020-04-13 18:30:21 +08:00
|
|
|
y: model.y,
|
|
|
|
fontWeight: model.style.textStyle.fontWeight,
|
2020-04-14 15:45:13 +08:00
|
|
|
fontSize: model.style.FaultStatusGroup.fontSize,
|
2020-04-13 18:30:21 +08:00
|
|
|
fontFamily: model.style.fontFamily,
|
2020-04-14 15:45:13 +08:00
|
|
|
text: model.style.FaultStatusGroup.pfa.text,
|
|
|
|
textFill: model.style.FaultStatusGroup.pfa.defaultColor,
|
2020-04-13 18:30:21 +08:00
|
|
|
textAlign: model.style.textStyle.textAlign,
|
|
|
|
textVerticalAlign: model.style.textStyle.textVerticalAlign
|
|
|
|
}
|
|
|
|
});
|
|
|
|
this.pfb = new Text({
|
|
|
|
zlevel: this.zlevel,
|
|
|
|
z: this.z,
|
|
|
|
style: {
|
2020-04-14 15:45:13 +08:00
|
|
|
x: model.x + model.style.FaultStatusGroup.distance * 4,
|
2020-04-13 18:30:21 +08:00
|
|
|
y: model.y,
|
|
|
|
fontWeight: model.style.textStyle.fontWeight,
|
2020-04-14 15:45:13 +08:00
|
|
|
fontSize: model.style.FaultStatusGroup.fontSize,
|
2020-04-13 18:30:21 +08:00
|
|
|
fontFamily: model.style.fontFamily,
|
2020-04-14 15:45:13 +08:00
|
|
|
text: model.style.FaultStatusGroup.pfb.text,
|
|
|
|
textFill: model.style.FaultStatusGroup.pfb.defaultColor,
|
2020-04-13 18:30:21 +08:00
|
|
|
textAlign: model.style.textStyle.textAlign,
|
|
|
|
textVerticalAlign: model.style.textStyle.textVerticalAlign
|
|
|
|
}
|
|
|
|
});
|
|
|
|
this.add(this.psd);
|
|
|
|
this.add(this.mfa);
|
|
|
|
this.add(this.mfb);
|
|
|
|
this.add(this.pfa);
|
|
|
|
this.add(this.pfb);
|
|
|
|
}
|
|
|
|
}
|