@zhangqingcq/vgce 0.0.17 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +85 -83
- package/dist/style.css +2 -2
- package/dist/vgce.js +6979 -6928
- package/dist/vgce.umd.cjs +62 -62
- package/package.json +12 -10
- package/src/App.vue +1 -3
- package/src/components/svg-analysis/index.vue +0 -2
- package/src/components/svg-editor/center-panel/index.vue +0 -1
- package/src/components/svg-editor/component-tree/index.vue +0 -1
- package/src/components/svg-editor/connection-panel/index.vue +0 -1
- package/src/components/svg-editor/export-json/index.vue +0 -1
- package/src/components/svg-editor/handle-panel/index.vue +0 -1
- package/src/components/svg-editor/import-json/index.vue +0 -1
- package/src/components/svg-editor/index.vue +0 -1
- package/src/components/svg-editor/left-panel/index.vue +0 -1
- package/src/components/svg-editor/right-panel/code-edit-modal.vue +0 -1
- package/src/components/svg-editor/right-panel/common-animate.vue +0 -1
- package/src/components/svg-editor/right-panel/condition.vue +0 -1
- package/src/components/svg-editor/right-panel/dynamic-el-form-item.vue +4 -4
- package/src/components/svg-editor/right-panel/index.vue +1 -2
- package/src/components/svg-editor/right-panel/list.vue +0 -1
- package/src/components/svg-viewer/index.vue +14 -2
- package/src/components/vue3-ruler-tool/index.vue +0 -1
- package/src/config/files/clock-a.vue +0 -2
- package/src/config/files/common-table.vue +0 -1
- package/src/config/files/light-a.vue +0 -2
- package/src/config/files/now-time.vue +0 -1
- package/src/config/files/pie-charts.vue +0 -1
- package/src/config/files/progress.vue +0 -1
- package/src/config/files/svg-text.vue +0 -2
- package/src/config/files/switch-a.vue +0 -2
- package/src/config/svg/stateless/index.ts +1 -5
- package/src/config/types.ts +2 -2
- package/src/hooks.ts +0 -1
- package/src/index.ts +2 -4
- package/src/main.ts +0 -1
- package/src/stores/config/index.ts +0 -1
- package/src/stores/global/index.ts +0 -2
- package/src/stores/main.ts +0 -3
- package/src/stores/svg-edit-layout/index.ts +0 -1
- package/src/stores/system/index.ts +0 -1
- package/src/utils/fetch.ts +2 -4
- package/src/utils/proxy.ts +0 -1
- package/src/views/EditorS.vue +0 -1
- package/types/index.d.ts +21 -3
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zhangqingcq/vgce",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.19",
|
4
4
|
"description": "Vector graphics configure editor. svg组态编辑器。基于vue3.3+ts+element-plus+vite",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -57,34 +57,36 @@
|
|
57
57
|
},
|
58
58
|
"homepage": "https://github.com/RickyHeaven/VGCE#readme",
|
59
59
|
"dependencies": {
|
60
|
-
"@types/lodash": "^4.
|
60
|
+
"@types/lodash-es": "^4.17.8",
|
61
61
|
"ace-builds": "^1.14.0",
|
62
62
|
"animate.css": "^4.1.1",
|
63
63
|
"axios": "^1.4.0",
|
64
64
|
"echarts": "^5.4.1",
|
65
|
-
"element-plus": "^2.3.
|
66
|
-
"lodash": "^4.17.21",
|
65
|
+
"element-plus": "^2.3.8",
|
66
|
+
"lodash-es": "^4.17.21",
|
67
67
|
"mqtt": "^4.3.7",
|
68
|
-
"pinia": "^2.
|
68
|
+
"pinia": "^2.1.3",
|
69
69
|
"vue": "^3.3.4",
|
70
70
|
"vue-echarts": "^6.5.1",
|
71
|
-
"vue-router": "^4.2.
|
71
|
+
"vue-router": "^4.2.2",
|
72
72
|
"vue3-ace-editor": "^2.2.2"
|
73
73
|
},
|
74
74
|
"devDependencies": {
|
75
75
|
"@tsconfig/node18": "^2.0.1",
|
76
|
-
"@types/node": "^18.16.
|
76
|
+
"@types/node": "^18.16.17",
|
77
77
|
"@vitejs/plugin-vue": "^4.2.3",
|
78
78
|
"@vitejs/plugin-vue-jsx": "^3.0.1",
|
79
79
|
"@vue/tsconfig": "^0.4.0",
|
80
80
|
"less": "^4.1.3",
|
81
81
|
"npm-run-all": "^4.1.5",
|
82
82
|
"prettier": "3.0.0",
|
83
|
-
"typescript": "~5.
|
84
|
-
"
|
83
|
+
"typescript": "~5.0.4",
|
84
|
+
"unplugin-auto-import": "^0.16.6",
|
85
|
+
"unplugin-vue-components": "^0.25.1",
|
86
|
+
"vite": "^4.3.9",
|
85
87
|
"vite-plugin-svg-icons": "^2.0.1",
|
86
88
|
"vite-plugin-windicss": "^1.9.0",
|
87
|
-
"vue-tsc": "^1.
|
89
|
+
"vue-tsc": "^1.6.5",
|
88
90
|
"windicss": "^3.5.6"
|
89
91
|
},
|
90
92
|
"engines": {
|
package/src/App.vue
CHANGED
@@ -5,7 +5,6 @@
|
|
5
5
|
import type { ISystemStraightLine } from '@/components/config/types'
|
6
6
|
import { pinia } from '@/hooks'
|
7
7
|
import { useConfigStore } from '@/stores/config'
|
8
|
-
import { ref } from 'vue'
|
9
8
|
import { useGlobalStore } from '@/stores/global'
|
10
9
|
import { EGlobalStoreIntention, EMouseInfoState } from '@/stores/global/types'
|
11
10
|
import type { IDoneJson } from '@/stores/global/types'
|
@@ -2,7 +2,6 @@
|
|
2
2
|
<script lang="ts" setup>
|
3
3
|
import { pinia } from '@/hooks'
|
4
4
|
import { useSvgEditLayoutStore } from '@/stores/svg-edit-layout'
|
5
|
-
import { ref } from 'vue'
|
6
5
|
import { useGlobalStore } from '@/stores/global'
|
7
6
|
import { EGlobalStoreIntention, EMouseInfoState, EScaleInfoType } from '@/stores/global/types'
|
8
7
|
import type { IDoneJson } from '@/stores/global/types'
|
@@ -2,7 +2,6 @@
|
|
2
2
|
import { VAceEditor } from 'vue3-ace-editor'
|
3
3
|
import '@/components/ace-edit'
|
4
4
|
import { ElButton, ElDialog } from 'element-plus'
|
5
|
-
import { computed, ref } from 'vue'
|
6
5
|
|
7
6
|
const props = withDefaults(defineProps<{ modelValue: any; lang: string; title: string }>(), {
|
8
7
|
modelValue: () => ({}),
|
@@ -1,6 +1,5 @@
|
|
1
1
|
<script setup lang="ts">
|
2
2
|
import { ElTag, ElDrawer, ElTabs, ElTabPane, ElScrollbar, ElIcon } from 'element-plus'
|
3
|
-
import { ref, watch } from 'vue'
|
4
3
|
import { common_animate_list } from '@/components/config'
|
5
4
|
import SvgAnalysis from '@/components/svg-analysis/index.vue'
|
6
5
|
|
@@ -59,22 +59,22 @@
|
|
59
59
|
v-else-if="attr_item.type === EConfigItemPropsType.InputNumber"
|
60
60
|
v-model="attr_item.val"
|
61
61
|
:disabled="Boolean(attr_item?.disabled)"
|
62
|
-
|
62
|
+
/>
|
63
63
|
<el-input
|
64
64
|
v-else-if="attr_item.type === EConfigItemPropsType.Input"
|
65
65
|
v-model="attr_item.val"
|
66
66
|
:disabled="Boolean(attr_item?.disabled)"
|
67
|
-
|
67
|
+
/>
|
68
68
|
<el-color-picker
|
69
69
|
v-else-if="attr_item.type === EConfigItemPropsType.Color"
|
70
70
|
v-model="attr_item.val"
|
71
71
|
:disabled="Boolean(attr_item?.disabled)"
|
72
|
-
|
72
|
+
/>
|
73
73
|
<el-switch
|
74
74
|
v-else-if="attr_item.type === EConfigItemPropsType.Switch"
|
75
75
|
v-model="attr_item.val"
|
76
76
|
:disabled="Boolean(attr_item?.disabled)"
|
77
|
-
|
77
|
+
/>
|
78
78
|
<code-edit-modal
|
79
79
|
v-else-if="attr_item.type === EConfigItemPropsType.JsonEdit"
|
80
80
|
v-model="attr_item.val"
|
@@ -14,7 +14,6 @@
|
|
14
14
|
ElTabPane,
|
15
15
|
ElTabs
|
16
16
|
} from 'element-plus'
|
17
|
-
import { ref } from 'vue'
|
18
17
|
import { pinia } from '@/hooks'
|
19
18
|
import { useConfigStore } from '@/stores/config'
|
20
19
|
import { useGlobalStore } from '@/stores/global'
|
@@ -248,7 +247,7 @@
|
|
248
247
|
</el-form-item>
|
249
248
|
<div
|
250
249
|
v-for="(e, k) in globalStore.handle_svg_info!.info.state"
|
251
|
-
:key="'state' + k"
|
250
|
+
:key="'state' + String(k)"
|
252
251
|
v-if="globalStore.handle_svg_info!.info.state"
|
253
252
|
>
|
254
253
|
<el-form-item class="props-row" :label="String(k)" size="small"> {{ e?.default }}</el-form-item>
|
@@ -2,7 +2,6 @@
|
|
2
2
|
import type { IAttrItem } from '@/config/types'
|
3
3
|
import { ElIcon, ElInput } from 'element-plus'
|
4
4
|
import SvgAnalysis from '@/components/svg-analysis/index.vue'
|
5
|
-
import { computed } from 'vue'
|
6
5
|
|
7
6
|
const props = withDefaults(defineProps<{ modelValue: IAttrItem[] }>(), {
|
8
7
|
modelValue: () => [
|
@@ -1,5 +1,4 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
import { getCurrentInstance, onMounted, onBeforeUnmount, reactive } from 'vue'
|
3
2
|
import { pinia } from '@/hooks'
|
4
3
|
import { useGlobalStore } from '@/stores/global'
|
5
4
|
import { EGlobalStoreIntention, EMouseInfoState } from '@/stores/global/types'
|
@@ -16,6 +15,7 @@
|
|
16
15
|
|
17
16
|
import { sub, close } from '@/utils/mqtt-net'
|
18
17
|
|
18
|
+
const emit = defineEmits(['onMessage'])
|
19
19
|
//注册所有组件
|
20
20
|
const instance = getCurrentInstance()
|
21
21
|
Object.keys(vueComp).forEach((key: string) => {
|
@@ -46,7 +46,14 @@
|
|
46
46
|
y: 50
|
47
47
|
}
|
48
48
|
},
|
49
|
-
net: {
|
49
|
+
net: {
|
50
|
+
mqtt: {
|
51
|
+
url: '',
|
52
|
+
user: '',
|
53
|
+
pwd: '',
|
54
|
+
topics: ''
|
55
|
+
}
|
56
|
+
}
|
50
57
|
},
|
51
58
|
done_json: []
|
52
59
|
}
|
@@ -215,6 +222,11 @@
|
|
215
222
|
sub(m.url, m.user, m.pwd, m.topics, (topics: string, message: string) => {
|
216
223
|
console.log(topics)
|
217
224
|
console.log(message.toString())
|
225
|
+
//暂时先暴露给外部,让用户自己处理消息,后期功能会补上
|
226
|
+
emit('onMessage', {
|
227
|
+
topics,
|
228
|
+
message
|
229
|
+
})
|
218
230
|
})
|
219
231
|
}
|
220
232
|
}
|
@@ -4,7 +4,6 @@
|
|
4
4
|
import { PieChart } from 'echarts/charts'
|
5
5
|
import { TitleComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
6
6
|
import VChart, { THEME_KEY } from 'vue-echarts'
|
7
|
-
import { watch, provide, reactive } from 'vue'
|
8
7
|
use([SVGRenderer, PieChart, TitleComponent, TooltipComponent, LegendComponent])
|
9
8
|
|
10
9
|
provide(THEME_KEY, 'dark')
|
package/src/config/types.ts
CHANGED
@@ -37,7 +37,7 @@ export interface IAnimations {
|
|
37
37
|
}
|
38
38
|
|
39
39
|
export interface IConfigItemProps {
|
40
|
-
[key:
|
40
|
+
[key: keyof any]: {
|
41
41
|
title: string
|
42
42
|
type: EConfigItemPropsType
|
43
43
|
val: any
|
@@ -77,7 +77,7 @@ interface IDoneJsonConfig {
|
|
77
77
|
}
|
78
78
|
|
79
79
|
export interface IConfigItemState {
|
80
|
-
|
80
|
+
[k: keyof any]: {
|
81
81
|
title: string
|
82
82
|
default: false
|
83
83
|
props: { [key: string]: { openVal: any; closeVal: any } }
|
package/src/hooks.ts
CHANGED
package/src/index.ts
CHANGED
@@ -8,7 +8,5 @@ import 'virtual:windi.css'
|
|
8
8
|
import 'virtual:svg-icons-register'
|
9
9
|
import './assets/main.less'
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
export { SvgEditor, SvgViewer }
|
11
|
+
export { default as SvgEditor } from '@/components/svg-editor/index.vue'
|
12
|
+
export { default as SvgViewer } from '@/components/svg-viewer/index.vue'
|
package/src/main.ts
CHANGED
package/src/stores/main.ts
CHANGED
package/src/utils/fetch.ts
CHANGED
@@ -3,10 +3,8 @@
|
|
3
3
|
* @author Ricky email:zhangqingcq@foxmail.com
|
4
4
|
* @created 2023.06.21
|
5
5
|
*/
|
6
|
-
import
|
6
|
+
import { isEmpty } from 'lodash-es'
|
7
7
|
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'
|
8
|
-
import _ from 'lodash'
|
9
|
-
|
10
8
|
import type { Collection } from './types'
|
11
9
|
|
12
10
|
// const host = window.location.origin
|
@@ -164,7 +162,7 @@ function checkRequest(
|
|
164
162
|
if (config && config.headers && config.headers['Content-Type'] === 'multipart/form-data') {
|
165
163
|
data_ = data
|
166
164
|
} else {
|
167
|
-
if (data && !
|
165
|
+
if (data && !isEmpty(data)) {
|
168
166
|
if (Array.isArray(data)) {
|
169
167
|
data_ = []
|
170
168
|
for (let e of data) {
|
package/src/utils/proxy.ts
CHANGED
package/src/views/EditorS.vue
CHANGED
package/types/index.d.ts
CHANGED
@@ -3,7 +3,25 @@
|
|
3
3
|
* @author Ricky email:zhangqingcq@foxmail.com
|
4
4
|
* @created 2023.07.10
|
5
5
|
*/
|
6
|
+
import { DefineComponent } from 'vue'
|
7
|
+
import type { IConfig } from '../src/config/types'
|
8
|
+
import type { IDataModel } from '../src/components/svg-editor/types'
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
export declare const SvgEditor: DefineComponent<{
|
11
|
+
data?: string
|
12
|
+
customToolbar?: IConfig
|
13
|
+
saveFile?: boolean
|
14
|
+
onOnPreview?: (d: IDataModel) => void
|
15
|
+
onOnSave?: (d: IDataModel) => void
|
16
|
+
onOnReturn?: () => void
|
17
|
+
}>
|
18
|
+
export declare const SvgViewer: DefineComponent<{
|
19
|
+
data?: IDataModel
|
20
|
+
canvasDrag?: boolean
|
21
|
+
onOnMessage?: (d: { topics: string, message: string }) => void
|
22
|
+
}>
|
23
|
+
|
24
|
+
export default {
|
25
|
+
SvgEditor,
|
26
|
+
SvgViewer
|
27
|
+
}
|