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

105 lines
2.5 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;
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
{
public MiddleFlowNode() : base(NodeKinds.Middle)
{
}
public MiddleFlowNode(IDiagramViewModel parent, DesignerItemBase designer) : base(parent, designer)
{
}
public MiddleFlowNode(IDiagramViewModel parent, string json) : base(parent, json)
{
}
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);
}
}
protected override void ExecuteEditCommand(object param)
{
if (IsReadOnly == true) return;
if (Status == 1)
{
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
}
}