vue-wiring-diagram 1.0.10 → 1.0.12
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.
- package/dist/style.css +1 -1
- package/dist/vue-wiring-diagram.es.js +2779 -2791
- package/dist/vue-wiring-diagram.umd.js +29 -29
- package/package.json +1 -1
- package/packages/components/editor/index.vue +10 -12
- package/packages/components/image-control/image-management.vue +17 -29
- package/packages/components/preview/index.vue +1 -1
- package/packages/components/settings.js +3 -2
package/package.json
CHANGED
|
@@ -306,8 +306,8 @@ const initStencil = () => {
|
|
|
306
306
|
placeholder: '搜索',
|
|
307
307
|
notFoundText: '未找到匹配项',
|
|
308
308
|
getDragNode: (node) => {
|
|
309
|
-
const copyNode = node.clone({
|
|
310
|
-
if(copyNode.label !== '文本') {
|
|
309
|
+
const copyNode = node.clone({keepId: true})
|
|
310
|
+
if (copyNode.label !== '文本') {
|
|
311
311
|
copyNode.label = ''
|
|
312
312
|
}
|
|
313
313
|
return copyNode
|
|
@@ -349,33 +349,31 @@ const initStencil = () => {
|
|
|
349
349
|
// 添加 hover 事件监听器
|
|
350
350
|
setTimeout(() => {
|
|
351
351
|
const nodes = stencil.value.container.querySelectorAll('.x6-node');
|
|
352
|
-
nodes.forEach((node,index) => {
|
|
353
|
-
if(index > baseShape.length) {
|
|
352
|
+
nodes.forEach((node, index) => {
|
|
353
|
+
if (index > baseShape.length) {
|
|
354
354
|
const text = node.querySelector('text');
|
|
355
355
|
node.style.position = 'relative';
|
|
356
|
-
if(text) {
|
|
356
|
+
if (text) {
|
|
357
357
|
text.style.display = 'none';
|
|
358
|
-
// text 为 svg 控制位置
|
|
359
358
|
text.setAttribute('x', '0%');
|
|
360
|
-
text.setAttribute('y', '
|
|
359
|
+
text.setAttribute('y', '40');
|
|
361
360
|
text.style.fontSize = '12px';
|
|
362
|
-
text.style.fontWeight = 'bold';
|
|
363
361
|
text.style.fill = '#ffffff';
|
|
364
362
|
}
|
|
365
363
|
}
|
|
366
364
|
// 添加 hover 事件监听器
|
|
367
365
|
node.addEventListener('mouseenter', (e) => {
|
|
368
|
-
if(index > baseShape.length) {
|
|
366
|
+
if (index > baseShape.length) {
|
|
369
367
|
const text = node.querySelector('text');
|
|
370
|
-
if(text) {
|
|
368
|
+
if (text) {
|
|
371
369
|
text.style.display = 'block';
|
|
372
370
|
}
|
|
373
371
|
}
|
|
374
372
|
})
|
|
375
373
|
node.addEventListener('mouseleave', (e) => {
|
|
376
|
-
if(index > baseShape.length) {
|
|
374
|
+
if (index > baseShape.length) {
|
|
377
375
|
const text = node.querySelector('text');
|
|
378
|
-
if(text) {
|
|
376
|
+
if (text) {
|
|
379
377
|
text.style.display = 'none';
|
|
380
378
|
}
|
|
381
379
|
}
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
</el-table-column>
|
|
49
49
|
</el-table>
|
|
50
50
|
<el-dialog v-model="groupDialog.show" :title="groupDialog.title" width="300" :close-on-click-modal="false" :close-on-press-escape="false"
|
|
51
|
-
|
|
51
|
+
>
|
|
52
52
|
<group-form v-if="groupDialog.show" :payload="groupDialog.payload" @close="closeDialog"/>
|
|
53
53
|
</el-dialog>
|
|
54
54
|
<el-dialog v-model="imageDialog.show" :title="imageDialog.title" width="300" :close-on-click-modal="false" :close-on-press-escape="false"
|
|
55
|
-
|
|
55
|
+
>
|
|
56
56
|
<image-form v-if="imageDialog.show" :payload="imageDialog.payload" @close="closeDialog"/>
|
|
57
57
|
</el-dialog>
|
|
58
58
|
</div>
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
import {onMounted, reactive} from "vue";
|
|
63
63
|
import groupForm from "./group-form.vue";
|
|
64
64
|
import imageForm from "./image-form.vue";
|
|
65
|
-
import {get, del
|
|
65
|
+
import {get, del} from "../../http.js";
|
|
66
66
|
import {ElMessage, ElMessageBox} from "element-plus";
|
|
67
67
|
|
|
68
68
|
// 数据集
|
|
@@ -115,19 +115,13 @@ const editGroup = (row) => {
|
|
|
115
115
|
* @param id
|
|
116
116
|
*/
|
|
117
117
|
const deleteGroup = (id) => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
ElMessage.success('删除成功')
|
|
126
|
-
loadImageRecord()
|
|
127
|
-
} else {
|
|
128
|
-
ElMessage.error(res.msg || '删除失败')
|
|
129
|
-
}
|
|
130
|
-
})
|
|
118
|
+
del('/cny/custom/removeGroup/' + id).then(res => {
|
|
119
|
+
if (res.code === 200) {
|
|
120
|
+
ElMessage.success('删除成功')
|
|
121
|
+
loadImageRecord()
|
|
122
|
+
} else {
|
|
123
|
+
ElMessage.error(res.msg || '删除失败')
|
|
124
|
+
}
|
|
131
125
|
})
|
|
132
126
|
}
|
|
133
127
|
|
|
@@ -172,19 +166,13 @@ const editPicture = (row) => {
|
|
|
172
166
|
* @param id
|
|
173
167
|
*/
|
|
174
168
|
const deletePicture = (id) => {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
ElMessage.success('删除成功')
|
|
183
|
-
loadImageRecord()
|
|
184
|
-
} else {
|
|
185
|
-
ElMessage.error(res.msg || '删除失败')
|
|
186
|
-
}
|
|
187
|
-
})
|
|
169
|
+
del('/cny/custom/removePicture/' + id).then(res => {
|
|
170
|
+
if (res.code === 200) {
|
|
171
|
+
ElMessage.success('删除成功')
|
|
172
|
+
loadImageRecord()
|
|
173
|
+
} else {
|
|
174
|
+
ElMessage.error(res.msg || '删除失败')
|
|
175
|
+
}
|
|
188
176
|
})
|
|
189
177
|
}
|
|
190
178
|
|
|
@@ -214,7 +214,7 @@ const replaceAllTemplateLiteralsWithArray = (str, replacements) => {
|
|
|
214
214
|
* \@description 画布自适应
|
|
215
215
|
*/
|
|
216
216
|
const zoomToFit = () => {
|
|
217
|
-
graph.value.zoomToFit({maxScale:
|
|
217
|
+
graph.value.zoomToFit({maxScale: 10, padding: 20})
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
const previewRef = shallowRef()
|