修改代码

This commit is contained in:
ival 2021-04-07 11:17:41 +08:00
parent 3240ca7760
commit e1a75e68a1
2 changed files with 28 additions and 27 deletions

View File

@ -1,11 +1,11 @@
import * as graphic from '../../core/graphic';
const elementType = Object.fromEntries(Object.keys(graphic).map(type => [type, type]));
const graphicType = Object.fromEntries(Object.keys(graphic).map(type => [type, type]));
export const elementConst = {
[elementType.Line]: {
code: elementType.Line,
[graphicType.Line]: {
code: graphicType.Line,
name:'线段',
formList: {
style: [
@ -16,8 +16,8 @@ export const elementConst = {
]
}
},
[elementType.Text]: {
code: elementType.Text,
[graphicType.Text]: {
code: graphicType.Text,
name:'文字',
formList: {
style: [
@ -28,8 +28,8 @@ export const elementConst = {
]
}
},
[elementType.Rect]: {
code: elementType.Rect,
[graphicType.Rect]: {
code: graphicType.Rect,
name:'矩形',
formList: {
style: [
@ -40,8 +40,8 @@ export const elementConst = {
]
}
},
[elementType.Circle]: {
code: elementType.Circle,
[graphicType.Circle]: {
code: graphicType.Circle,
name:'圆形',
formList:{
style: [
@ -52,8 +52,8 @@ export const elementConst = {
]
}
},
[elementType.Polygon]: {
code: elementType.Polygon,
[graphicType.Polygon]: {
code: graphicType.Polygon,
name:'多边形',
formList: {
style: [
@ -64,8 +64,8 @@ export const elementConst = {
]
}
},
[elementType.Arrow]: {
code: elementType.Arrow,
[graphicType.Arrow]: {
code: graphicType.Arrow,
name:'箭头',
formList: {
style: [
@ -76,8 +76,8 @@ export const elementConst = {
]
}
},
[elementType.Polyline]: {
code: elementType.Polyline,
[graphicType.Polyline]: {
code: graphicType.Polyline,
name:'多边形折线段',
formList: {
style: [
@ -88,8 +88,8 @@ export const elementConst = {
]
}
},
[elementType.Isogon]: {
code: elementType.Isogon,
[graphicType.Isogon]: {
code: graphicType.Isogon,
name:'正多边形',
formList: {
style: [
@ -100,8 +100,8 @@ export const elementConst = {
]
}
},
[elementType.Ellipse]: {
code: elementType.Ellipse,
[graphicType.Ellipse]: {
code: graphicType.Ellipse,
name:'椭圆',
formList: {
style: [
@ -112,8 +112,8 @@ export const elementConst = {
]
}
},
[elementType.Arc]: {
code: elementType.Arc,
[graphicType.Arc]: {
code: graphicType.Arc,
name:'圆弧',
formList: {
style: [
@ -124,8 +124,8 @@ export const elementConst = {
]
}
},
[elementType.Sector]: {
code: elementType.Sector,
[graphicType.Sector]: {
code: graphicType.Sector,
name:'扇形',
formList: {
style: [
@ -136,8 +136,8 @@ export const elementConst = {
]
}
},
[elementType.Heart]: {
code: elementType.Heart,
[graphicType.Heart]: {
code: graphicType.Heart,
name:'心形',
formList: {
style: [
@ -148,8 +148,8 @@ export const elementConst = {
]
}
},
[elementType.Droplet]: {
code: elementType.Droplet,
[graphicType.Droplet]: {
code: graphicType.Droplet,
name:'水滴',
formList: {
style: [

View File

@ -91,6 +91,7 @@ class ShapeFactory extends Eventful {
this.on(shapeEvent.HideBorder, hideBorderHandle, this);
this.on(shapeEvent.ShowTips, showTipsHandle, this.tipsHandle);
this.on(shapeEvent.HideTips, hideTipsHandle, this.tipsHandle);
this.dispose = function() {
that.off(shapeEvent.ShowBorder, showBorderHandle);
that.off(shapeEvent.HideBorder, showBorderHandle);