We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function confirmDialog() { const _node = lf.value.getNodeModelById(jobNodeEditId.value); const _jobInfo = jobInfoList.value.find( (e: any) => e.id === jobSelectId.value ) as any; // const position = const nodeInfo = { width: _node.width, height: _node.height, x: _node.x, y: _node.y, }; console.log(nodeInfo); const graphModel = lf.value.graphModel; if (_jobInfo.jobType === 2) { //新增任务组 let data = {} as any; await JobInfoAPI.getJobCompose(jobSelectId.value, 1).then( (res) => (data = res) ); // 后端返回的代码 const jobNode = data.jobNode; const newNodes = data.nodes; const newEdges = data.edges; newNodes.push(jobNode); // await addJobNodes(newNodes, graphModel, newEdges); newNodes.forEach((node) => { // 直接新增节点,dynamic-group中的child节点是空的??? graphModel.addNode(generateNode(node)); }); // 重新设置任务组的孩子节点 newNodes.forEach((n) => { const node = lf.value.getNodeModelById(n.id); if (n.nodeType === "dynamic-group") { JSON.parse(n.children).forEach((id: any) => node.addChild(id)); } }); // 添加新边 newEdges.forEach((e) => { graphModel.addEdge(generateEdge(e)); }); const pNode = lf.value.getNodeModelById(jobNode.id); graphModel.moveNode2Coordinate( [jobNode.id], nodeInfo.x - nodeInfo.width / 2 + pNode.width / 2, nodeInfo.y - nodeInfo.height / 2 + pNode.height / 2 ); graphModel.deleteNode(_node.id); } else { _node.setProperty("jobId", jobSelectId.value); _node.updateText(_jobInfo.jobDesc); } cancelDialog(); } function generateNode(node: any) { return { id: node.id, text: node.jobName, type: node.nodeType, x: node.nodePositionX, y: node.nodePositionY, properties: JSON.parse(node.properties), children: node.children != null ? JSON.parse(node.children) : [], }; } function generateEdge(edge: any) { return { sourceNodeId: edge.fromNodeId, targetNodeId: edge.endNodeId, type: "polyline", }; }
2.0.10
2.0.14
No response
The text was updated successfully, but these errors were encountered:
用 lf.addelements 替换 graphModel.addNode 试试呢,不行的话最好弄个完整的可复现示例出来
lf.addelements
graphModel.addNode
Sorry, something went wrong.
No branches or pull requests
发生了什么?
logicflow/core版本
2.0.10
logicflow/extension版本
2.0.14
logicflow/engine版本
No response
浏览器&环境
No response
The text was updated successfully, but these errors were encountered: