@zhangqingcq/vgce 0.1.30 → 0.1.32

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.1.30",
3
+ "version": "0.1.32",
4
4
  "description": "Vector graphics configure editor. svg组态编辑器。基于vue3.3+ts+element-plus+vite",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -105,6 +105,7 @@
105
105
  }
106
106
  }
107
107
  const bindAnchor = (e: any, type: ELineBindAnchors) => {
108
+ e.stopPropagation()
108
109
  if (globalStore.intention === EGlobalStoreIntention.None) {
109
110
  createLine(e, type, props.itemInfo)
110
111
  if (globalStore.handle_svg_info) {
@@ -67,7 +67,6 @@
67
67
 
68
68
  const canZoom = computed(() => props.itemInfo.config.can_zoom)
69
69
  const onHandleMouseDown = (type: EScaleInfoType, e: MouseEvent) => {
70
- console.log('handMousedown', e)
71
70
  const { clientX, clientY } = e
72
71
  e.stopPropagation()
73
72
  globalStore.intention = EGlobalStoreIntention.Zoom
@@ -45,6 +45,7 @@
45
45
  data?: string
46
46
  saveFile?: boolean
47
47
  mqtt?: { cover: boolean; url: string; user: string; pwd: string; topics: string }
48
+ slotBackground?: boolean
48
49
  }>(),
49
50
  {
50
51
  saveFile: false,
@@ -54,7 +55,8 @@
54
55
  user: '',
55
56
  pwd: '',
56
57
  topics: ''
57
- })
58
+ }),
59
+ slotBackground: false
58
60
  }
59
61
  )
60
62
  const globalStore = useGlobalStore(pinia)
@@ -198,7 +200,7 @@
198
200
  style="border-left: 1px solid #efefef"
199
201
  >
200
202
  <el-scrollbar class="el-scroll-pc">
201
- <right-panel></right-panel>
203
+ <right-panel :slotBackground="props.slotBackground"></right-panel>
202
204
  </el-scrollbar>
203
205
  </el-aside>
204
206
  </el-container>
@@ -38,6 +38,7 @@
38
38
  const globalStore = useGlobalStore(pinia)
39
39
  const svgEditLayoutStore = useSvgEditLayoutStore(pinia)
40
40
 
41
+ const props = defineProps<{ slotBackground: boolean }>()
41
42
  const activeName = ref('page')
42
43
  const activeNameB = ref('style')
43
44
 
@@ -117,7 +118,7 @@
117
118
  <el-tabs class="mx-2 rightTabs" v-if="globalStore.intention != EGlobalStoreIntention.Select" v-model="activeName">
118
119
  <el-tab-pane label="图纸" name="page">
119
120
  <el-form label-width="60px" label-position="left">
120
- <el-form-item label="背景色" size="small">
121
+ <el-form-item label="背景色" size="small" v-if="!props.slotBackground">
121
122
  <el-color-picker v-model="configStore.svg.background_color" />
122
123
  </el-form-item>
123
124
  <el-form-item label="画布" size="small">
@@ -1,48 +1,48 @@
1
- <script setup lang="ts">
2
- import { ElTable, ElTableColumn } from 'element-plus'
3
-
4
- const props = withDefaults(
5
- defineProps<{
6
- colConfig: ICol[]
7
- data: any[]
8
- height?: number
9
- maxHeight?: number
10
- stripe?: boolean
11
- border?: boolean
12
- size?: string
13
- fit?: boolean
14
- operateDisplay?: boolean
15
- selectionData?: any[]
16
- }>(),
17
- {
18
- colConfig: () => [],
19
- data: () => [],
20
- height: 200,
21
- stripe: false,
22
- border: false,
23
- fit: false,
24
- operateDisplay: false,
25
- selectionData: () => []
26
- }
27
- )
28
- const table_props = ref({})
29
- watchEffect(() => {
30
- const { colConfig, ...temp_props } = props
31
- table_props.value = temp_props
32
- })
33
-
34
- interface ICol {
35
- prop: string
36
- label: string
37
- width: string
38
- fixed: string | boolean
39
- sortable: boolean
40
- 'show-overflow-tooltip': boolean
41
- }
42
- </script>
43
-
44
- <template>
45
- <el-table v-bind="table_props">
46
- <el-table-column v-for="item in props.colConfig" :key="item.prop" v-bind="item"></el-table-column>
47
- </el-table>
48
- </template>
1
+ <script setup lang="ts">
2
+ import { ElTable, ElTableColumn } from 'element-plus'
3
+
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ colConfig: ICol[]
7
+ data: any[]
8
+ height?: number
9
+ maxHeight?: number
10
+ stripe?: boolean
11
+ border?: boolean
12
+ size?: string
13
+ fit?: boolean
14
+ operateDisplay?: boolean
15
+ selectionData?: any[]
16
+ }>(),
17
+ {
18
+ colConfig: () => [],
19
+ data: () => [],
20
+ height: 200,
21
+ stripe: false,
22
+ border: false,
23
+ fit: false,
24
+ operateDisplay: false,
25
+ selectionData: () => []
26
+ }
27
+ )
28
+ const table_props = ref({})
29
+ watchEffect(() => {
30
+ const { colConfig, ...temp_props } = props
31
+ table_props.value = temp_props
32
+ })
33
+
34
+ interface ICol {
35
+ prop: string
36
+ label: string
37
+ width: string
38
+ fixed: string | boolean
39
+ sortable: boolean
40
+ 'show-overflow-tooltip': boolean
41
+ }
42
+ </script>
43
+
44
+ <template>
45
+ <el-table v-bind="table_props">
46
+ <el-table-column v-for="item in props.colConfig" :key="item.prop" v-bind="item"></el-table-column>
47
+ </el-table>
48
+ </template>
@@ -18,25 +18,25 @@ const t: IConfigItem = {
18
18
  type: EConfigItemPropsType.JsonEdit,
19
19
  val: [
20
20
  {
21
- prop: 'date',
22
- label: '第一列',
23
- width: '120px',
21
+ prop: 'index',
22
+ label: '序号',
23
+ 'min-width': '80',
24
24
  fixed: false,
25
25
  sortable: false,
26
26
  'show-overflow-tooltip': false
27
27
  },
28
28
  {
29
29
  prop: 'name',
30
- label: '第二列',
31
- width: '120px',
30
+ label: '名字',
31
+ 'min-width': '120',
32
32
  fixed: false,
33
33
  sortable: false,
34
34
  'show-overflow-tooltip': false
35
35
  },
36
36
  {
37
- prop: 'address',
38
- label: '第三列测试',
39
- width: '280px',
37
+ prop: 'age',
38
+ label: '年龄',
39
+ 'min-width': '80',
40
40
  fixed: false,
41
41
  sortable: false,
42
42
  'show-overflow-tooltip': false
@@ -48,31 +48,31 @@ const t: IConfigItem = {
48
48
  type: EConfigItemPropsType.JsonEdit,
49
49
  val: [
50
50
  {
51
- date: '2016-05-03',
52
- name: 'Tom',
53
- address: 'No. 189, Grove St, Los Angeles'
51
+ index: '1',
52
+ name: 'Jack',
53
+ age: '34'
54
54
  },
55
55
  {
56
- date: '2016-05-02',
57
- name: 'Tom',
58
- address: 'No. 189, Grove St, Los Angeles'
56
+ index: '2',
57
+ name: 'Marry',
58
+ age: '18'
59
59
  },
60
60
  {
61
- date: '2016-05-04',
62
- name: 'Tom',
63
- address: 'No. 189, Grove St, Los Angeles'
61
+ index: '3',
62
+ name: 'Lee',
63
+ age: '23'
64
64
  },
65
65
  {
66
- date: '2016-05-01',
67
- name: 'Tom',
68
- address: 'No. 189, Grove St, Los Angeles'
66
+ index: '4',
67
+ name: 'Steve',
68
+ age: '31'
69
69
  }
70
70
  ]
71
71
  },
72
72
  width: {
73
73
  title: '宽度',
74
74
  type: EConfigItemPropsType.InputNumber,
75
- val: 500
75
+ val: 280
76
76
  },
77
77
  height: {
78
78
  title: '高度',
@@ -28,24 +28,24 @@ const t: IConfigItem = {
28
28
  type: EConfigItemPropsType.JsonEdit,
29
29
  val: [
30
30
  {
31
- value: 1048,
32
- name: '办公楼A'
31
+ value: 998,
32
+ name: '20岁以下'
33
33
  },
34
34
  {
35
- value: 735,
36
- name: '办公楼B'
35
+ value: 546,
36
+ name: '20-40岁'
37
37
  },
38
38
  {
39
- value: 580,
40
- name: '保安室'
39
+ value: 354,
40
+ name: '40-60岁'
41
41
  },
42
42
  {
43
- value: 484,
44
- name: '地下车库'
43
+ value: 421,
44
+ name: '60-70岁'
45
45
  },
46
46
  {
47
- value: 300,
48
- name: '食堂'
47
+ value: 607,
48
+ name: '70岁以上'
49
49
  }
50
50
  ]
51
51
  }
@@ -29,7 +29,6 @@ export const useEditPrivateStore = defineStore('edit-private-store', {
29
29
  },
30
30
  actions: {
31
31
  topUndoBtnClick() {
32
- console.log('撤销')
33
32
  if (this.history_now_index < 1) {
34
33
  return
35
34
  }
@@ -40,7 +39,6 @@ export const useEditPrivateStore = defineStore('edit-private-store', {
40
39
  global_store.setDoneJson(this.history_doneComponent[this.history_now_index])
41
40
  },
42
41
  topRedoBtnClick() {
43
- console.log('重做')
44
42
  if (this.history_now_index + 1 == this.history_doneComponent.length) {
45
43
  return
46
44
  }