mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
设计了流程接口节点,能够切换本节点数据、目标节点数据,目前还有数据来源相关操作没有实现
This commit is contained in:
@@ -1,17 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Serein.Library;
|
||||
using Serein.Library.Api;
|
||||
using Serein.NodeFlow.Model;
|
||||
using Serein.Workbench.Node.ViewModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Serein.Workbench.Node.View
|
||||
{
|
||||
@@ -20,17 +12,79 @@ namespace Serein.Workbench.Node.View
|
||||
/// </summary>
|
||||
public partial class FlowCallNodeControl : NodeControlBase, INodeJunction
|
||||
{
|
||||
private new FlowCallNodeControlViewModel ViewModel { get; set; }
|
||||
public FlowCallNodeControl()
|
||||
{
|
||||
var env = App.GetService<IFlowEnvironment>();
|
||||
base.ViewModel = new FlowCallNodeControlViewModel(new SingleFlowCallNode(env));
|
||||
base.ViewModel.IsEnabledOnView = false;
|
||||
DataContext = base.ViewModel;
|
||||
InitializeComponent();
|
||||
}
|
||||
public FlowCallNodeControl(FlowCallNodeControlViewModel viewModel) : base(viewModel)
|
||||
{
|
||||
DataContext = viewModel;
|
||||
ViewModel = viewModel;
|
||||
InitializeComponent();
|
||||
ViewModel.UploadMethodDetailsControl = UploadMethodDetailsControl;
|
||||
|
||||
public JunctionControlBase ExecuteJunction => throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public JunctionControlBase NextStepJunction => throw new NotImplementedException();
|
||||
private void UploadMethodDetailsControl(MethodDetails methodDetails)
|
||||
{
|
||||
//MethodDetailsControl.MethodDetails = methodDetails;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 入参控制点(可能有,可能没)
|
||||
/// </summary>
|
||||
JunctionControlBase INodeJunction.ExecuteJunction => this.ExecuteJunctionControl;
|
||||
|
||||
/// <summary>
|
||||
/// 下一个调用方法控制点(可能有,可能没)
|
||||
/// </summary>
|
||||
JunctionControlBase INodeJunction.NextStepJunction => throw new NotImplementedException("不存在下一个调用控制点");
|
||||
|
||||
/// <summary>
|
||||
/// 返回值控制点(可能有,可能没)
|
||||
/// </summary>
|
||||
JunctionControlBase INodeJunction.ReturnDataJunction => throw new NotImplementedException("不存在返回值控制点");
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 方法入参控制点(可能有,可能没)
|
||||
/// </summary>
|
||||
JunctionControlBase[] INodeJunction.ArgDataJunction => GetArgJunction();
|
||||
|
||||
private JunctionControlBase[] GetArgJunction()
|
||||
{
|
||||
// 获取 MethodDetailsControl 实例
|
||||
//var methodDetailsControl = ViewModel.NodeModel.IsShareParam ? this.SelectMethodDetailsControl : this.MyMethodDetailsControl;
|
||||
var methodDetailsControl = this.MethodDetailsControl;
|
||||
var itemsControl = FindVisualChild<ItemsControl>(methodDetailsControl); // 查找 ItemsControl
|
||||
if (itemsControl != null)
|
||||
{
|
||||
var argDataJunction = new JunctionControlBase[base.ViewModel.NodeModel.MethodDetails.ParameterDetailss.Length];
|
||||
var controls = new List<JunctionControlBase>();
|
||||
|
||||
for (int i = 0; i < itemsControl.Items.Count; i++)
|
||||
{
|
||||
var container = itemsControl.ItemContainerGenerator.ContainerFromIndex(i) as FrameworkElement;
|
||||
if (container != null)
|
||||
{
|
||||
var argControl = FindVisualChild<ArgJunctionControl>(container);
|
||||
if (argControl != null)
|
||||
{
|
||||
controls.Add(argControl); // 收集 ArgJunctionControl 实例
|
||||
}
|
||||
}
|
||||
}
|
||||
return argDataJunction = controls.ToArray();
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
public JunctionControlBase[] ArgDataJunction => throw new NotImplementedException();
|
||||
|
||||
public JunctionControlBase ReturnDataJunction => throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user