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