mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-17 13:26:34 +08:00
修复了无法创建连线
This commit is contained in:
@@ -41,7 +41,7 @@ namespace Serein.NodeFlow.Base
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 节点guid
|
/// 节点guid
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Guid { get; set; } = string.Empty;
|
public string Guid { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 显示名称
|
/// 显示名称
|
||||||
|
|||||||
@@ -2199,7 +2199,10 @@ namespace Serein.WorkBench
|
|||||||
{
|
{
|
||||||
throw new Exception("无法创建节点控件");
|
throw new Exception("无法创建节点控件");
|
||||||
}
|
}
|
||||||
|
if (string.IsNullOrEmpty(model.Guid))
|
||||||
|
{
|
||||||
|
model.Guid = Guid.NewGuid().ToString();
|
||||||
|
}
|
||||||
var viewModel = Activator.CreateInstance(typeof(TViewModel), [model]);
|
var viewModel = Activator.CreateInstance(typeof(TViewModel), [model]);
|
||||||
var controlObj = Activator.CreateInstance(typeof(TControl), [viewModel]);
|
var controlObj = Activator.CreateInstance(typeof(TControl), [viewModel]);
|
||||||
if (controlObj is TControl control)
|
if (controlObj is TControl control)
|
||||||
@@ -2219,15 +2222,13 @@ namespace Serein.WorkBench
|
|||||||
{
|
{
|
||||||
|
|
||||||
var nodeObj = Activator.CreateInstance(typeof(TNode));
|
var nodeObj = Activator.CreateInstance(typeof(TNode));
|
||||||
var nodeBase = nodeObj as NodeModelBase;
|
var nodeBase = nodeObj as NodeModelBase ?? throw new Exception("无法创建节点控件");
|
||||||
if (nodeBase is null)
|
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(nodeBase.Guid))
|
||||||
{
|
{
|
||||||
throw new Exception("无法创建节点控件");
|
nodeBase.Guid = Guid.NewGuid().ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
nodeBase.Guid = Guid.NewGuid().ToString();
|
|
||||||
|
|
||||||
if (methodDetails != null)
|
if (methodDetails != null)
|
||||||
{
|
{
|
||||||
var md = methodDetails.Clone();
|
var md = methodDetails.Clone();
|
||||||
|
|||||||
Reference in New Issue
Block a user