| | |
| | | }); |
| | | } else { |
| | | var hasError = false; |
| | | let msg = ''; |
| | | unref(lf) |
| | | .getGraphData() |
| | | .nodes.forEach((n) => { |
| | | /* 判断是否有Node未连接 */ |
| | | if ( |
| | | unref(lf).getNodeIncomingEdge(n.id).length == 0 && |
| | | unref(lf).getNodeOutgoingEdge(n.id).length == 0 |
| | | ) { |
| | | hasError = true; |
| | | msg = '有节点未连线,请重新设计工艺路线再保存数据!'; |
| | | } |
| | | if ( |
| | | unref(lf) |
| | | .getNodeOutgoingNode(n.id) |
| | | .some((q) => q.properties.operType == 'End') && |
| | | unref(lf) |
| | | .getNodeOutgoingNode(n.id) |
| | | .some((q) => q.properties.operType != 'End' && q.properties.operType != 'Action') |
| | | ) { |
| | | hasError = true; |
| | | msg = '完工节点不是唯一的最后节点,请重新设计工艺路线再保存数据!'; |
| | | } |
| | | }); |
| | | if (hasError) { |
| | | createErrorModal({ |
| | | title: t('警告'), |
| | | content: t('有节点未连线,请重新设计工艺路线再保存数据!'), |
| | | content: t(msg), |
| | | getContainer: () => document.body, |
| | | }); |
| | | } else { |
| | |
| | | getContainer: () => document.body, |
| | | }); |
| | | } else { |
| | | if (unref(lf).getNodeIncomingNode(data.nodeModel.id).length == 0) { |
| | | if ( |
| | | unref(lf).getNodeIncomingNode(data.nodeModel.id).length == 0 && |
| | | unref(lf) |
| | | .getNodeOutgoingNode(data.nodeModel.id) |
| | | .some((q) => q.properties.operType == 'Node') |
| | | ) { |
| | | lf.graphModel.deleteEdgeById(data.edgeModel.id); |
| | | createErrorModal({ |
| | | title: t('警告'), |