2019-11-29 12:51:58 +08:00
|
|
|
// import Group from 'zrender/src/container/Group';
|
|
|
|
import Text from 'zrender/src/graphic/Text';
|
|
|
|
|
|
|
|
/** 名称元素*/
|
|
|
|
export default function ETextName(model) {
|
2019-12-17 09:13:57 +08:00
|
|
|
const TextName = new Text({
|
|
|
|
_subType: 'Text',
|
|
|
|
zlevel: model.zlevel,
|
|
|
|
z: model.z,
|
|
|
|
silent: model.silent || false,
|
|
|
|
style: {
|
|
|
|
x: model.x,
|
|
|
|
y: model.y,
|
|
|
|
fontWeight: model.fontWeight,
|
|
|
|
fontSize: model.fontSize,
|
|
|
|
fontFamily: model.fontFamily,
|
|
|
|
text: model.text,
|
|
|
|
textStrokeWidth: model.textStrokeWidth,
|
|
|
|
textFill: model.textFill,
|
|
|
|
textAlign: model.textAlign,
|
|
|
|
textPosition: model.textPosition || 'inside',
|
|
|
|
textVerticalAlign: model.textVerticalAlign || null
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return TextName;
|
2019-11-29 12:51:58 +08:00
|
|
|
}
|
|
|
|
// export default class ETextName extends Group {
|
|
|
|
// constructor(model) {
|
|
|
|
// super();
|
|
|
|
// this.model = model;
|
|
|
|
// this.zlevel = model.zlevel;
|
|
|
|
// this.z = model.z;
|
|
|
|
// this.create();
|
|
|
|
// }
|
|
|
|
|
|
|
|
// create() {
|
|
|
|
// this.TextName = new Text({
|
|
|
|
// _subType: this.model._subType,
|
|
|
|
// zlevel: this.zlevel,
|
|
|
|
// z: this.z,
|
|
|
|
// silent: this.model.silent || false,
|
|
|
|
// style: {
|
|
|
|
// x: this.model.x,
|
|
|
|
// y: this.model.y,
|
|
|
|
// text: this.model.text,
|
|
|
|
// textFont: this.model.textFont,
|
|
|
|
// textFill: this.model.textFill,
|
|
|
|
// textAlign: this.model.textAlign,
|
|
|
|
// textPosition: this.model.textPosition || 'inside',
|
|
|
|
// textVerticalAlign: this.model.textVerticalAlign || null
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// this.add(this.TextName);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// setStyle(model) {
|
|
|
|
// this.TextName.setStyle(model);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// setColor(color) {
|
|
|
|
// this.TextName.setStyle('textFill', color);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// hide() {
|
|
|
|
// this.TextName.hide();
|
|
|
|
// }
|
|
|
|
|
|
|
|
// show() {
|
|
|
|
// this.TextName.show();
|
|
|
|
// }
|
|
|
|
// }
|