Files
aistudio-wpf-diagram/AIStudio.Wpf.Flowchart/ViewModels/MiddleFlowNode.cs

121 lines
3.0 KiB
C#
Raw Normal View History

2022-12-12 22:33:17 +08:00
using System.Collections.Generic;
2021-07-23 09:42:22 +08:00
using System.ComponentModel;
using System.Windows;
2022-10-28 22:45:39 +08:00
using AIStudio.Wpf.DiagramDesigner;
2022-12-12 22:33:17 +08:00
using AIStudio.Wpf.DiagramDesigner.Controls;
2023-01-25 11:11:27 +08:00
using AIStudio.Wpf.DiagramDesigner.Models;
2021-07-23 09:42:22 +08:00
2021-07-29 13:55:18 +08:00
namespace AIStudio.Wpf.Flowchart.ViewModels
2021-07-23 09:42:22 +08:00
{
public class MiddleFlowNode : FlowNode
{
2023-01-27 14:54:03 +08:00
public MiddleFlowNode() : this(null)
{
}
public MiddleFlowNode(IDiagramViewModel root) : base(root, NodeKinds.Middle)
2021-07-23 09:42:22 +08:00
{
}
2023-01-24 16:20:39 +08:00
public MiddleFlowNode(IDiagramViewModel root, DesignerItemBase designer) : base(root, designer)
2021-07-23 09:42:22 +08:00
{
}
2023-01-25 11:11:27 +08:00
public MiddleFlowNode(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType)
{
}
2021-07-23 09:42:22 +08:00
private List<string> _userIds = new List<string>();
[Browsable(true)]
[StyleName("UserIdsStyle")]
public List<string> UserIds
{
2022-12-01 23:12:13 +08:00
get
{
return _userIds;
}
2021-07-23 09:42:22 +08:00
set
{
SetProperty(ref _userIds, value);
}
}
private List<string> _roleIds = new List<string>();
[Browsable(true)]
[StyleName("RoleIdsStyle")]
public List<string> RoleIds
{
2022-12-01 23:12:13 +08:00
get
{
return _roleIds;
}
2021-07-23 09:42:22 +08:00
set
{
SetProperty(ref _roleIds, value);
}
}
private string _actType;
[Browsable(true)]
[StyleName("ActTypeStyle")]
public string ActType
{
2022-12-01 23:12:13 +08:00
get
{
return _actType;
}
2021-07-23 09:42:22 +08:00
set
{
SetProperty(ref _actType, value);
}
}
2023-04-16 12:21:51 +08:00
#region 使
public bool SimulateApprove
2023-02-12 15:46:44 +08:00
{
get;set;
}
2023-04-16 12:21:51 +08:00
#endregion
2023-02-12 15:46:44 +08:00
protected override void ExecuteEditCommand(object param)
{
if (IsReadOnly == true) return;
2023-04-16 12:21:51 +08:00
if (SimulateApprove)
{
2023-02-12 15:46:44 +08:00
if (Status == 1)
{
2023-02-12 15:46:44 +08:00
MiddleFlowNodeData data = new MiddleFlowNodeData();
if (visualiserService.ShowDialog(data) == true)
{
FlowchartService.Approve(this, data.Status, data.Remark);
}
}
else
{
MessageBox.Show("该节点不能进行审批!!!");
}
}
}
2022-12-01 23:12:13 +08:00
public override Dictionary<string, string> PropertiesSetting
{
get
{
return new Dictionary<string, string>()
{
2022-12-04 23:07:20 +08:00
{ "Name","名称" },
2022-12-01 23:12:13 +08:00
{ "Text","文本" },
{"UserIds", "用户" },
{"RoleIds", "角色" },
{"ActType", "or/and" }
};
}
}
2021-07-23 09:42:22 +08:00
}
}