@zhangqingcq/vgce 0.0.30 → 0.0.32
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/style.css +2 -2
- package/dist/vgce.js +7022 -6935
- package/dist/vgce.umd.cjs +62 -62
- package/package.json +1 -1
- package/src/assets/base.less +23 -6
- package/src/assets/variables.less +8 -0
- package/src/components/svg-editor/center-panel.vue +22 -23
- package/src/components/svg-editor/component-tree.vue +3 -2
- package/src/components/svg-editor/connection-line.vue +40 -4
- package/src/components/svg-editor/connection-panel.vue +24 -0
- package/src/components/svg-editor/index.vue +9 -3
- package/src/components/svg-editor/top-panel.vue +5 -3
- package/src/components/svg-viewer.vue +27 -37
- package/src/components/vue3-ruler-tool.vue +10 -0
- package/src/config/types.ts +3 -11
- package/src/config/vue/component/common-table.ts +5 -0
- package/src/stores/system/index.ts +1 -1
- package/src/utils/index.ts +19 -2
package/src/utils/index.ts
CHANGED
@@ -4,12 +4,29 @@ import type { IConfigItem } from '@/config/types'
|
|
4
4
|
import { EDoneJsonType } from '@/config/types'
|
5
5
|
import type { IDoneJson, IPointCoordinate } from '@/stores/global/types'
|
6
6
|
import { EGlobalStoreIntention, EMouseInfoState } from '@/stores/global/types'
|
7
|
-
import { straight_line_system } from '@/components/config'
|
8
7
|
import { useGlobalStore } from '@/stores/global'
|
9
8
|
import { pinia } from '@/hooks'
|
10
9
|
import { useConfigStore } from '@/stores/config'
|
11
10
|
import { useSvgEditLayoutStore } from '@/stores/svg-edit-layout'
|
12
11
|
import { kebabCase } from 'lodash-es'
|
12
|
+
import { vueComp } from '@/config'
|
13
|
+
|
14
|
+
export const stopEvent = (e: any) => {
|
15
|
+
e.stopPropagation()
|
16
|
+
}
|
17
|
+
export const preventDefault = (e: any) => {
|
18
|
+
e.preventDefault()
|
19
|
+
}
|
20
|
+
|
21
|
+
export function componentsRegister() {
|
22
|
+
//注册所有组件
|
23
|
+
const instance = getCurrentInstance()
|
24
|
+
for (let key in vueComp) {
|
25
|
+
if (!instance?.appContext?.components.hasOwnProperty(key) && vueComp.hasOwnProperty(key)) {
|
26
|
+
instance?.appContext?.app.component(key, vueComp[key])
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
13
30
|
|
14
31
|
/**
|
15
32
|
* 生成随机字符串
|
@@ -471,7 +488,7 @@ export const createLine = (e: MouseEvent, type?: ELineBindAnchors, itemInfo?: ID
|
|
471
488
|
)
|
472
489
|
}
|
473
490
|
const done_item_json = {
|
474
|
-
id:
|
491
|
+
id: randomString(),
|
475
492
|
x: x,
|
476
493
|
y: y,
|
477
494
|
client: {
|