vue-wiring-diagram 1.1.21 → 1.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +93 -93
  2. package/dist/style.css +1 -1
  3. package/dist/vue-wiring-diagram.es.js +6235 -5903
  4. package/dist/vue-wiring-diagram.umd.js +29 -29
  5. package/package.json +1 -1
  6. package/packages/components/Shortcuts.vue +31 -31
  7. package/packages/components/baseShape.js +62 -62
  8. package/packages/components/common.js +105 -105
  9. package/packages/components/edge-control/arrow-line.vue +292 -292
  10. package/packages/components/edge-control/condition.vue +110 -110
  11. package/packages/components/edge-control/default-line.vue +156 -156
  12. package/packages/components/edge-control/index.vue +94 -94
  13. package/packages/components/edge-control/pipe-line.vue +354 -354
  14. package/packages/components/editor/index.vue +590 -590
  15. package/packages/components/enums.js +80 -80
  16. package/packages/components/graph-control/index.vue +121 -121
  17. package/packages/components/image-control/group-form.vue +114 -114
  18. package/packages/components/image-control/image-condition.vue +117 -0
  19. package/packages/components/image-control/image-form.vue +184 -184
  20. package/packages/components/image-control/image-management.vue +213 -213
  21. package/packages/components/image-control/index.vue +290 -124
  22. package/packages/components/portsOptions.js +21 -21
  23. package/packages/components/preview/index.vue +399 -347
  24. package/packages/components/settings.js +262 -262
  25. package/packages/components/text-control/index.vue +457 -457
  26. package/packages/components/tools.js +256 -256
  27. package/packages/http.js +104 -104
  28. package/packages/index.js +43 -43
  29. package/packages/styles/animation.scss +27 -27
  30. package/packages/styles/dialog.scss +4 -4
  31. package/packages/styles/editor.scss +165 -165
  32. package/packages/styles/elPath.scss +257 -257
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-wiring-diagram",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "description": "A Vue 3.x component for wiring diagram",
5
5
  "type": "module",
6
6
  "main": "dist/vue-wiring-diagram.umd.js",
@@ -1,31 +1,31 @@
1
- /**
2
- * @Author: HuaYJ
3
- * @Date: 2024/10/24 10:23
4
- */
5
- <template>
6
- <div class="form-container">
7
- <el-table :data="data" size="small" border>
8
- <el-table-column prop="name" label="名称"/>
9
- <el-table-column prop="windowsKey" label="windows"/>
10
- <el-table-column prop="macKey" label="mac"/>
11
- </el-table>
12
- </div>
13
- </template>
14
-
15
- <script setup>
16
-
17
- import {ref} from "vue";
18
-
19
- const data = ref([
20
- {name: '复制', windowsKey: 'Ctrl + C', macKey: 'Command + C'},
21
- {name: '粘贴', windowsKey: 'Ctrl + V', macKey: 'Command + V'},
22
- {name: '撤销', windowsKey: 'Ctrl + Z', macKey: 'Command + Z'},
23
- {name: '重做', windowsKey: 'Ctrl + Y', macKey: 'Command + Y'},
24
- {name: '框选', windowsKey: 'Alt + LMB', macKey: 'option + LMB'},
25
- {name: '多选', windowsKey: 'Alt + LMB', macKey: 'Command + LMB'}
26
- ])
27
- </script>
28
-
29
- <style scoped lang="scss">
30
- @use '/packages/styles/elPath.scss';
31
- </style>
1
+ /**
2
+ * @Author: HuaYJ
3
+ * @Date: 2024/10/24 10:23
4
+ */
5
+ <template>
6
+ <div class="form-container">
7
+ <el-table :data="data" size="small" border>
8
+ <el-table-column prop="name" label="名称"/>
9
+ <el-table-column prop="windowsKey" label="windows"/>
10
+ <el-table-column prop="macKey" label="mac"/>
11
+ </el-table>
12
+ </div>
13
+ </template>
14
+
15
+ <script setup>
16
+
17
+ import {ref} from "vue";
18
+
19
+ const data = ref([
20
+ {name: '复制', windowsKey: 'Ctrl + C', macKey: 'Command + C'},
21
+ {name: '粘贴', windowsKey: 'Ctrl + V', macKey: 'Command + V'},
22
+ {name: '撤销', windowsKey: 'Ctrl + Z', macKey: 'Command + Z'},
23
+ {name: '重做', windowsKey: 'Ctrl + Y', macKey: 'Command + Y'},
24
+ {name: '框选', windowsKey: 'Alt + LMB', macKey: 'option + LMB'},
25
+ {name: '多选', windowsKey: 'Alt + LMB', macKey: 'Command + LMB'}
26
+ ])
27
+ </script>
28
+
29
+ <style scoped lang="scss">
30
+ @use '/packages/styles/elPath.scss';
31
+ </style>
@@ -1,62 +1,62 @@
1
- export const baseShape = [
2
- {
3
- shape: 'rect',
4
- width: 60,
5
- height: 5,
6
- attrs: {
7
- body: {
8
- fill: '#ffffff',
9
- stroke: '#ffffff',
10
- strokeWidth: 0,
11
- },
12
- },
13
- data: {
14
- type: 'base-shape'
15
- },
16
- },
17
- {
18
- shape: 'rect',
19
- width: 60,
20
- height: 20,
21
- attrs: {
22
- body: {
23
- fill: '#ffffff',
24
- stroke: '#ffffff',
25
- strokeWidth: 1,
26
- },
27
- },
28
- data: {
29
- type: 'base-shape',
30
- label: '母线'
31
- }
32
- },
33
- {
34
- shape: 'circle',
35
- width: 40,
36
- height: 40,
37
- attrs: {
38
- body: {
39
- fill: '#ffffff',
40
- stroke: '#ffffff',
41
- strokeWidth: 1,
42
- },
43
- },
44
- data: {
45
- type: 'base-shape'
46
- }
47
- },
48
- {
49
- shape: 'ellipse',
50
- width: 60,
51
- height: 40,
52
- attrs: {
53
- body: {
54
- fill: '#ffffff',
55
- stroke: '#ffffff',
56
- }
57
- },
58
- data: {
59
- type: 'base-shape'
60
- }
61
- },
62
- ]
1
+ export const baseShape = [
2
+ {
3
+ shape: 'rect',
4
+ width: 60,
5
+ height: 5,
6
+ attrs: {
7
+ body: {
8
+ fill: '#ffffff',
9
+ stroke: '#ffffff',
10
+ strokeWidth: 0,
11
+ },
12
+ },
13
+ data: {
14
+ type: 'base-shape'
15
+ },
16
+ },
17
+ {
18
+ shape: 'rect',
19
+ width: 60,
20
+ height: 20,
21
+ attrs: {
22
+ body: {
23
+ fill: '#ffffff',
24
+ stroke: '#ffffff',
25
+ strokeWidth: 1,
26
+ },
27
+ },
28
+ data: {
29
+ type: 'base-shape',
30
+ label: '母线'
31
+ }
32
+ },
33
+ {
34
+ shape: 'circle',
35
+ width: 40,
36
+ height: 40,
37
+ attrs: {
38
+ body: {
39
+ fill: '#ffffff',
40
+ stroke: '#ffffff',
41
+ strokeWidth: 1,
42
+ },
43
+ },
44
+ data: {
45
+ type: 'base-shape'
46
+ }
47
+ },
48
+ {
49
+ shape: 'ellipse',
50
+ width: 60,
51
+ height: 40,
52
+ attrs: {
53
+ body: {
54
+ fill: '#ffffff',
55
+ stroke: '#ffffff',
56
+ }
57
+ },
58
+ data: {
59
+ type: 'base-shape'
60
+ }
61
+ },
62
+ ]
@@ -1,105 +1,105 @@
1
- import {get, post} from "../http.js";
2
- import {ElMessage} from "element-plus";
3
-
4
-
5
- /**
6
- * 控制连接桩显示隐藏
7
- * @param show 是否显示
8
- * @param div 容器
9
- */
10
- export const showPorts = (div, show) => {
11
- const container = document.querySelector(div)
12
- const ports = container.querySelectorAll(
13
- '.x6-port-body',
14
- )
15
- const labels = container.querySelectorAll(
16
- '.x6-port-label',
17
- )
18
- for (let i = 0, len = ports.length; i < len; i += 1) {
19
- ports[i].style.visibility = show ? 'visible' : 'hidden'
20
- }
21
- for (let i = 0, len = labels.length; i < len; i += 1) {
22
- labels[i].style.visibility = show ? 'visible' : 'hidden'
23
- }
24
- }
25
-
26
- /**
27
- * 获取设备列表
28
- * @param itemId
29
- * @returns {Promise<unknown>}
30
- */
31
- export const getDeviceList = (itemId) => {
32
- return get('/custom/deviceList', {itemIds: itemId}).then(res => {
33
- if (res?.isOk) {
34
- return res.data
35
- }
36
- })
37
- }
38
-
39
- /**
40
- * 获取字段列表
41
- * @param deviceCode
42
- * @returns {Promise<*>}
43
- */
44
- export const getFieldList = (deviceCode) => {
45
- return get('/custom/monitorInfo', {
46
- deviceCode: deviceCode,
47
- fieldType: 1
48
- }).then(res => {
49
- if (res?.isOk) {
50
- return res.data
51
- }
52
- })
53
- }
54
-
55
- /**
56
- * 获取数据
57
- */
58
- export const getData = (id) => {
59
- return get('/template/selectOne', {id: id}).then(res => {
60
- if (res?.isOk) {
61
- const data = JSON.parse(res.data.remark)
62
- if(data === null) {
63
- return null
64
- }
65
- return {
66
- background: data.background,
67
- grid: data.grid,
68
- data: data.data,
69
- }
70
- } else {
71
- ElMessage.error(res?.msg || '获取失败')
72
- }
73
- })
74
- }
75
-
76
- /**
77
- * 保存数据
78
- * @param id
79
- * @param data
80
- */
81
- export const updateData = (id, data) => {
82
- post('/template/insert', {id: id, remark: JSON.stringify(data)}).then(res => {
83
- if (res?.isOk) {
84
- ElMessage.success('保存成功')
85
- } else {
86
- ElMessage.error(res?.msg || '保存失败')
87
- }
88
- })
89
- }
90
-
91
- /**
92
- * 获取实时数据
93
- * @param fields
94
- * @returns {Promise<*>}
95
- */
96
- export const getRealData = (fields) => {
97
- return post('/custom/arrRealData2', fields).then(res => {
98
- if (res?.isOk) {
99
- return res.data
100
- } else {
101
- ElMessage.error(res?.msg || '获取失败')
102
- }
103
- })
104
- }
105
-
1
+ import {get, post} from "../http.js";
2
+ import {ElMessage} from "element-plus";
3
+
4
+
5
+ /**
6
+ * 控制连接桩显示隐藏
7
+ * @param show 是否显示
8
+ * @param div 容器
9
+ */
10
+ export const showPorts = (div, show) => {
11
+ const container = document.querySelector(div)
12
+ const ports = container.querySelectorAll(
13
+ '.x6-port-body',
14
+ )
15
+ const labels = container.querySelectorAll(
16
+ '.x6-port-label',
17
+ )
18
+ for (let i = 0, len = ports.length; i < len; i += 1) {
19
+ ports[i].style.visibility = show ? 'visible' : 'hidden'
20
+ }
21
+ for (let i = 0, len = labels.length; i < len; i += 1) {
22
+ labels[i].style.visibility = show ? 'visible' : 'hidden'
23
+ }
24
+ }
25
+
26
+ /**
27
+ * 获取设备列表
28
+ * @param itemId
29
+ * @returns {Promise<unknown>}
30
+ */
31
+ export const getDeviceList = (itemId) => {
32
+ return get('/custom/deviceList', {itemIds: itemId}).then(res => {
33
+ if (res?.isOk) {
34
+ return res.data
35
+ }
36
+ })
37
+ }
38
+
39
+ /**
40
+ * 获取字段列表
41
+ * @param deviceCode
42
+ * @returns {Promise<*>}
43
+ */
44
+ export const getFieldList = (deviceCode) => {
45
+ return get('/custom/monitorInfo', {
46
+ deviceCode: deviceCode,
47
+ fieldType: 1
48
+ }).then(res => {
49
+ if (res?.isOk) {
50
+ return res.data
51
+ }
52
+ })
53
+ }
54
+
55
+ /**
56
+ * 获取数据
57
+ */
58
+ export const getData = (id) => {
59
+ return get('/template/selectOne', {id: id}).then(res => {
60
+ if (res?.isOk) {
61
+ const data = JSON.parse(res.data.remark)
62
+ if(data === null) {
63
+ return null
64
+ }
65
+ return {
66
+ background: data.background,
67
+ grid: data.grid,
68
+ data: data.data,
69
+ }
70
+ } else {
71
+ ElMessage.error(res?.msg || '获取失败')
72
+ }
73
+ })
74
+ }
75
+
76
+ /**
77
+ * 保存数据
78
+ * @param id
79
+ * @param data
80
+ */
81
+ export const updateData = (id, data) => {
82
+ post('/template/insert', {id: id, remark: JSON.stringify(data)}).then(res => {
83
+ if (res?.isOk) {
84
+ ElMessage.success('保存成功')
85
+ } else {
86
+ ElMessage.error(res?.msg || '保存失败')
87
+ }
88
+ })
89
+ }
90
+
91
+ /**
92
+ * 获取实时数据
93
+ * @param fields
94
+ * @returns {Promise<*>}
95
+ */
96
+ export const getRealData = (fields) => {
97
+ return post('/custom/arrRealData2', fields).then(res => {
98
+ if (res?.isOk) {
99
+ return res.data
100
+ } else {
101
+ ElMessage.error(res?.msg || '获取失败')
102
+ }
103
+ })
104
+ }
105
+