vue-wiring-diagram 1.0.8 → 1.0.10
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 +14 -12
- package/dist/vue-wiring-diagram.umd.js +2 -2
- package/package.json +1 -1
- package/packages/components/common.js +2 -2
- package/packages/components/editor/index.vue +3 -7
- package/packages/components/image-control/image-form.vue +3 -3
package/package.json
CHANGED
|
@@ -26,8 +26,8 @@ export const showPorts = (div, show) => {
|
|
|
26
26
|
/**
|
|
27
27
|
* 获取数据
|
|
28
28
|
*/
|
|
29
|
-
export const getData = () => {
|
|
30
|
-
return get('/cny/template/selectOne', {id:
|
|
29
|
+
export const getData = (id) => {
|
|
30
|
+
return get('/cny/template/selectOne', {id: id}).then(res => {
|
|
31
31
|
if (res?.isOk) {
|
|
32
32
|
const data = JSON.parse(res.data.remark)
|
|
33
33
|
return {
|
|
@@ -217,12 +217,6 @@ const initGraph = () => {
|
|
|
217
217
|
controlsKey.value = moment().valueOf()
|
|
218
218
|
})
|
|
219
219
|
|
|
220
|
-
// graph.value.on('node:added', ({node}) => {
|
|
221
|
-
// if(!node.label) {
|
|
222
|
-
// return
|
|
223
|
-
// }
|
|
224
|
-
// node.label = ''
|
|
225
|
-
// })
|
|
226
220
|
|
|
227
221
|
//选中节点
|
|
228
222
|
graph.value.on('cell:click', ({cell}) => {
|
|
@@ -313,7 +307,9 @@ const initStencil = () => {
|
|
|
313
307
|
notFoundText: '未找到匹配项',
|
|
314
308
|
getDragNode: (node) => {
|
|
315
309
|
const copyNode = node.clone({ keepId: true })
|
|
316
|
-
copyNode.label
|
|
310
|
+
if(copyNode.label !== '文本') {
|
|
311
|
+
copyNode.label = ''
|
|
312
|
+
}
|
|
317
313
|
return copyNode
|
|
318
314
|
},
|
|
319
315
|
getDropNode: (node) => {
|
|
@@ -79,9 +79,9 @@ const imageUrl = ref('')
|
|
|
79
79
|
* @param file
|
|
80
80
|
*/
|
|
81
81
|
const changeImage = (file) => {
|
|
82
|
-
if (file.raw.type
|
|
83
|
-
ElMessage.error('
|
|
84
|
-
return
|
|
82
|
+
if (file.raw.type.indexOf('image') === -1) {
|
|
83
|
+
ElMessage.error('请上传图片格式的文件')
|
|
84
|
+
return
|
|
85
85
|
}
|
|
86
86
|
const formData = new FormData();
|
|
87
87
|
formData.append('file', file.raw);
|