@zhangqingcq/vgce 0.0.30 → 0.0.31

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhangqingcq/vgce",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "Vector graphics configure editor. svg组态编辑器。基于vue3.3+ts+element-plus+vite",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -16,7 +16,8 @@
16
16
  prosToVBind,
17
17
  randomString,
18
18
  resetHandlePointOld,
19
- setSvgActualInfo
19
+ setSvgActualInfo,
20
+ stopEvent
20
21
  } from '@/utils'
21
22
  import {
22
23
  calculateBottom,
@@ -982,6 +983,7 @@
982
983
  :key="item.id"
983
984
  :transform="`translate(${item.x},${item.y})rotate(0)scale(1)`"
984
985
  v-show="item.display"
986
+ @mousewheel="stopEvent"
985
987
  >
986
988
  <g :class="`${getCommonClass(item)}`">
987
989
  <g
@@ -3,7 +3,7 @@
3
3
  import { useGlobalStore } from '@/stores/global'
4
4
  import { EGlobalStoreIntention, EMouseInfoState } from '@/stores/global/types'
5
5
  import type { IDoneJson } from '@/stores/global/types'
6
- import { getCommonClass, prosToVBind, setArrItemByID, valFormat } from '@/utils'
6
+ import { getCommonClass, prosToVBind, setArrItemByID, stopEvent, valFormat } from '@/utils'
7
7
 
8
8
  import { EDoneJsonType, EEventAction, EEventType } from '@/config/types'
9
9
  import ConnectionLine from '@/components/svg-editor/connection-line.vue'
@@ -226,12 +226,6 @@
226
226
  }
227
227
  }
228
228
 
229
- onMounted(() => {
230
- connectNet()
231
- })
232
-
233
- onBeforeUnmount(close)
234
-
235
229
  const connectNet = () => {
236
230
  const m = preview_data.config.net.mqtt
237
231
  if (m && m.url && m.user && m.pwd && m.topics) {
@@ -247,6 +241,12 @@
247
241
  }
248
242
  }
249
243
 
244
+ onMounted(() => {
245
+ connectNet()
246
+ })
247
+
248
+ onBeforeUnmount(close)
249
+
250
250
  defineExpose({
251
251
  setNodeAttrByID
252
252
  })
@@ -278,6 +278,10 @@
278
278
  v-show="item.display"
279
279
  :style="getStyle(item)"
280
280
  @click="eventHandle(item, EEventType.Click)"
281
+ @mousedown="stopEvent"
282
+ @mousemove="stopEvent"
283
+ @mouseup="stopEvent"
284
+ @mousewheel="stopEvent"
281
285
  >
282
286
  <g :class="`${getCommonClass(item)}`">
283
287
  <g
@@ -1,15 +1,7 @@
1
- /**
2
- * 组件分组数据格式
3
- * @property {string} groupType 组件分组类型
4
- * @property {string} title 组件分组标题
5
- * @property {Array} list 分组包含的组件项列表
6
- * @export
7
- * @interface IConfigComponentGroup
8
- */
9
1
  export interface IConfigComponentGroup {
10
- groupType: string
11
- title: string
12
- list: Array<IConfigItem>
2
+ groupType: string //组件分组类型
3
+ title: string //组件分组标题
4
+ list: Array<IConfigItem> //分组包含的组件项列表
13
5
  }
14
6
 
15
7
  export type IConfig = IConfigComponentGroup[]
@@ -79,6 +79,11 @@ export const common_table: IConfigItem = {
79
79
  type: EConfigItemPropsType.InputNumber,
80
80
  val: 200
81
81
  },
82
+ maxHeight: {
83
+ title: '最大高度',
84
+ type: EConfigItemPropsType.InputNumber,
85
+ val: 200
86
+ },
82
87
  stripe: {
83
88
  title: '斑马纹',
84
89
  type: EConfigItemPropsType.Switch,
@@ -99,7 +99,7 @@ export const useContextMenuStore = defineStore('context-menu-store', {
99
99
  switch (type) {
100
100
  case EContextMenuInfoType.Copy:
101
101
  const temp_item = objectDeepClone<IDoneJson>(globalStore.handle_svg_info.info)
102
- temp_item.id = temp_item.name + randomString()
102
+ temp_item.id = randomString()
103
103
  temp_item.title += '-copy'
104
104
  temp_item.x += 10
105
105
  temp_item.y += 10
@@ -11,6 +11,10 @@ import { useConfigStore } from '@/stores/config'
11
11
  import { useSvgEditLayoutStore } from '@/stores/svg-edit-layout'
12
12
  import { kebabCase } from 'lodash-es'
13
13
 
14
+ export const stopEvent = (e: any) => {
15
+ e.stopPropagation()
16
+ }
17
+
14
18
  /**
15
19
  * 生成随机字符串
16
20
  * @param len 生成个数
@@ -471,7 +475,7 @@ export const createLine = (e: MouseEvent, type?: ELineBindAnchors, itemInfo?: ID
471
475
  )
472
476
  }
473
477
  const done_item_json = {
474
- id: straight_line_system.name + randomString(),
478
+ id: randomString(),
475
479
  x: x,
476
480
  y: y,
477
481
  client: {