diff --git a/src/utils/flow.js b/src/utils/flow.js index 10187e6..ff5f46b 100644 --- a/src/utils/flow.js +++ b/src/utils/flow.js @@ -172,6 +172,22 @@ export const newEdge = (nodeId) => { }) } +export const initNodeZoom = (modelId, nodeZoom, className, init=false) => { + const nodes = document.getElementsByClassName(modelId) + if (nodes.length > 0) { + const node = nodes[0] + const parent = node.closest(className); + if (nodeZoom) { + parent.style.width = '680px' + } else { + parent.style.width = '300px' + } + if (!init) { + addNewEdge(modelId) + } + } +} + export const getInputNumber = (nodeId) => { const data = lf.getGraphData(); let flag = false diff --git a/src/views/flow/index.vue b/src/views/flow/index.vue index df850c9..7c44aa6 100644 --- a/src/views/flow/index.vue +++ b/src/views/flow/index.vue @@ -572,6 +572,7 @@ const handleTreeNodeClick = (node) => { lf.focusOn({ id: node.id }) + lf.selectElementById(node.id) } const fitView = () => { diff --git a/src/views/flow/nodes/common/serviceNode.vue b/src/views/flow/nodes/common/serviceNode.vue index b92ac7c..d907976 100644 --- a/src/views/flow/nodes/common/serviceNode.vue +++ b/src/views/flow/nodes/common/serviceNode.vue @@ -210,8 +210,8 @@