@zhangqingcq/vgce 0.1.7 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +135 -92
- package/dist/style.css +1 -1
- package/dist/vgce.js +11044 -10941
- package/dist/vgce.umd.cjs +33 -33
- package/package.json +1 -1
- package/src/assets/base.less +69 -68
- package/src/assets/svgs/text-box.svg +1 -0
- package/src/assets/variables.less +6 -6
- package/src/components/svg-editor/center-panel.vue +3 -2
- package/src/components/svg-editor/index.vue +7 -5
- package/src/components/svg-viewer.vue +7 -4
- package/src/config/files/text-box.vue +72 -0
- package/src/config/index.ts +5 -3
- package/src/config/svg/animation/index.ts +3 -2
- package/src/config/svg/animation/thermometer.ts +2 -1
- package/src/config/svg/custom/clock-a.ts +2 -1
- package/src/config/svg/custom/index.ts +6 -5
- package/src/config/svg/custom/light.ts +2 -1
- package/src/config/svg/custom/svg-text.ts +2 -1
- package/src/config/svg/custom/switch-r.ts +2 -1
- package/src/config/svg/index.ts +6 -10
- package/src/config/svg/stateful/alert-light.ts +2 -1
- package/src/config/svg/stateful/index.ts +3 -2
- package/src/config/svg/stateless/bot-2.ts +2 -1
- package/src/config/svg/stateless/bot-9.ts +2 -1
- package/src/config/svg/stateless/hamburger.ts +2 -1
- package/src/config/svg/stateless/hotpot.ts +2 -1
- package/src/config/svg/stateless/index.ts +6 -5
- package/src/config/vue/component/button.ts +2 -1
- package/src/config/vue/component/common-table.ts +2 -1
- package/src/config/vue/component/index.ts +9 -7
- package/src/config/vue/component/now-time.ts +2 -1
- package/src/config/vue/component/progress.ts +2 -1
- package/src/config/vue/component/tag.ts +2 -1
- package/src/config/vue/component/text-box.ts +66 -0
- package/src/config/vue/echarts/index.ts +3 -2
- package/src/config/vue/echarts/pie-charts.ts +2 -1
- package/src/config/vue/index.ts +4 -3
- package/src/utils/index.ts +3 -2
@@ -1,7 +1,7 @@
|
|
1
1
|
import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
|
2
2
|
import type { IConfigItem } from '@/config/types'
|
3
3
|
|
4
|
-
|
4
|
+
const t: IConfigItem = {
|
5
5
|
name: 'now-time',
|
6
6
|
title: '当前时间',
|
7
7
|
tag: 'now-time',
|
@@ -61,3 +61,4 @@ export const now_time: IConfigItem = {
|
|
61
61
|
},
|
62
62
|
events: []
|
63
63
|
}
|
64
|
+
export default t
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
|
2
2
|
import type { IConfigItem } from '@/config/types'
|
3
3
|
|
4
|
-
|
4
|
+
const t: IConfigItem = {
|
5
5
|
name: 'progress-a',
|
6
6
|
tag: 'progress-a',
|
7
7
|
title: '进度条',
|
@@ -27,3 +27,4 @@ export const progress_a: IConfigItem = {
|
|
27
27
|
},
|
28
28
|
events: []
|
29
29
|
}
|
30
|
+
export default t
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
|
2
2
|
import type { IConfigItem } from '@/config/types'
|
3
3
|
|
4
|
-
|
4
|
+
const t: IConfigItem = {
|
5
5
|
name: 'el-tag',
|
6
6
|
tag: 'el-tag',
|
7
7
|
title: '标签',
|
@@ -44,3 +44,4 @@ export const el_tag: IConfigItem = {
|
|
44
44
|
},
|
45
45
|
events: []
|
46
46
|
}
|
47
|
+
export default t
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
|
2
|
+
import type { IConfigItem } from '@/config/types'
|
3
|
+
|
4
|
+
const t: IConfigItem = {
|
5
|
+
name: 'text-box',
|
6
|
+
title: '文字背景框',
|
7
|
+
tag: 'text-box',
|
8
|
+
type: EDoneJsonType.Vue,
|
9
|
+
config: {
|
10
|
+
can_zoom: false,
|
11
|
+
have_anchor: false,
|
12
|
+
actual_rect: true
|
13
|
+
},
|
14
|
+
display: true,
|
15
|
+
props: {
|
16
|
+
width: {
|
17
|
+
title: '宽度',
|
18
|
+
type: EConfigItemPropsType.InputNumber,
|
19
|
+
val: 250
|
20
|
+
},
|
21
|
+
height: {
|
22
|
+
title: '高度',
|
23
|
+
type: EConfigItemPropsType.InputNumber,
|
24
|
+
val: 150
|
25
|
+
},
|
26
|
+
bgColor: {
|
27
|
+
title: '背景颜色',
|
28
|
+
type: EConfigItemPropsType.Color,
|
29
|
+
val: '#000000'
|
30
|
+
},
|
31
|
+
bgOpacity: {
|
32
|
+
title: '背景透明度(%)',
|
33
|
+
type: EConfigItemPropsType.InputNumber,
|
34
|
+
val: 1
|
35
|
+
},
|
36
|
+
borderColor: {
|
37
|
+
title: '边框颜色',
|
38
|
+
type: EConfigItemPropsType.Color,
|
39
|
+
val: '#cccccc'
|
40
|
+
},
|
41
|
+
borderWidth: {
|
42
|
+
title: '边框宽度',
|
43
|
+
type: EConfigItemPropsType.InputNumber,
|
44
|
+
val: 1
|
45
|
+
},
|
46
|
+
borderRadius: {
|
47
|
+
title: '边框圆角',
|
48
|
+
type: EConfigItemPropsType.InputNumber,
|
49
|
+
val: 5
|
50
|
+
},
|
51
|
+
borderOpacity: {
|
52
|
+
title: '边框透明度(%)',
|
53
|
+
type: EConfigItemPropsType.InputNumber,
|
54
|
+
val: 100
|
55
|
+
}
|
56
|
+
},
|
57
|
+
common_animations: {
|
58
|
+
val: '',
|
59
|
+
delay: 'delay-0s',
|
60
|
+
speed: 'slow',
|
61
|
+
repeat: 'infinite'
|
62
|
+
},
|
63
|
+
events: []
|
64
|
+
}
|
65
|
+
|
66
|
+
export default t
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import type { IConfigComponentGroup } from '@/config/types'
|
2
|
-
import
|
2
|
+
import pie_charts from './pie-charts'
|
3
3
|
|
4
|
-
|
4
|
+
const t: IConfigComponentGroup = {
|
5
5
|
groupType: 'echarts',
|
6
6
|
title: '图表',
|
7
7
|
list: [pie_charts]
|
8
8
|
}
|
9
|
+
export default t
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
|
2
2
|
import type { IConfigItem } from '@/config/types'
|
3
3
|
|
4
|
-
|
4
|
+
const t: IConfigItem = {
|
5
5
|
name: 'pie-charts',
|
6
6
|
tag: 'pie-charts',
|
7
7
|
title: '饼图',
|
@@ -58,3 +58,4 @@ export const pie_charts: IConfigItem = {
|
|
58
58
|
},
|
59
59
|
events: []
|
60
60
|
}
|
61
|
+
export default t
|
package/src/config/vue/index.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { IConfigComponentGroup } from '../types'
|
2
|
-
import
|
3
|
-
import
|
2
|
+
import components from './component'
|
3
|
+
import echarts_group from './echarts'
|
4
4
|
|
5
|
-
|
5
|
+
const t: IConfigComponentGroup[] = Object.seal([components, echarts_group])
|
6
|
+
export default t
|
package/src/utils/index.ts
CHANGED
@@ -18,10 +18,11 @@ export const preventDefault = (e: any) => {
|
|
18
18
|
e.preventDefault()
|
19
19
|
}
|
20
20
|
|
21
|
-
export function componentsRegister() {
|
21
|
+
export function componentsRegister(data?: Record<string, any>) {
|
22
22
|
//注册所有组件
|
23
23
|
const instance = getCurrentInstance()
|
24
|
-
|
24
|
+
const t = data ? Object.assign(vueComp, data) : vueComp
|
25
|
+
for (let key in t) {
|
25
26
|
if (!instance?.appContext?.components.hasOwnProperty(key) && vueComp.hasOwnProperty(key)) {
|
26
27
|
instance?.appContext?.app.component(key, vueComp[key])
|
27
28
|
}
|