审批序列化

This commit is contained in:
艾竹
2023-04-16 12:21:51 +08:00
parent 5dee3a9907
commit 4b8a03afb6
9 changed files with 103 additions and 41 deletions

View File

@@ -69,7 +69,7 @@ namespace AIStudio.Wpf.Flowchart
/// <param name="json"></param>
/// <param name="id"></param>
/// <returns></returns>
public static void InitData(List<FlowNode> oASteps, List<ConnectionViewModel> connectors, IDiagramViewModel viewModel)
public static void InitData(List<FlowNode> oASteps, List<ConnectionViewModel> connectors, IDiagramViewModel viewModel, bool initNew)
{
foreach (var edge in connectors)
{
@@ -136,7 +136,10 @@ namespace AIStudio.Wpf.Flowchart
FlowNodes.Add(viewModel, nodes);
Approve(oAStartStep, 100);
if (initNew)
{
Approve(oAStartStep, 100);
}
}

View File

@@ -8,6 +8,8 @@ using System.Threading.Tasks;
using System.Windows.Media;
using System.Xml.Serialization;
using AIStudio.Wpf.DiagramDesigner;
using System.ComponentModel.Design;
using System.Reflection;
namespace AIStudio.Wpf.Flowchart.Models
{
@@ -24,28 +26,67 @@ namespace AIStudio.Wpf.Flowchart.Models
UserIds = middleFlow.UserIds;
RoleIds = middleFlow.RoleIds;
ActType = middleFlow.ActType;
SimulateApprove = middleFlow.SimulateApprove;
}
Color = item.StatusColor;
Kind = item.Kind;
StateImage = item.StateImage;
Status = item.Status;
Remark = item.Remark;
}
[XmlArray]
public List<string> UserIds { get; set; }
public List<string> UserIds
{
get; set;
}
[XmlArray]
public List<string> RoleIds { get; set; }
public List<string> RoleIds
{
get; set;
}
[XmlAttribute]
public string ActType { get; set; }
public string ActType
{
get; set;
}
[XmlAttribute]
public string Color { get; set; }
public bool SimulateApprove
{
get; set;
}
[XmlAttribute]
public NodeKinds Kind { get; set; }
public int Status
{
get; set;
}
[XmlAttribute]
public string StateImage { get; set; }
public string Remark
{
get; set;
}
[XmlAttribute]
public string Color
{
get; set;
}
[XmlAttribute]
public NodeKinds Kind
{
get; set;
}
[XmlAttribute]
public string StateImage
{
get; set;
}
}
}

View File

@@ -65,12 +65,15 @@ namespace AIStudio.Wpf.Flowchart.ViewModels
this.StatusColor = designer.Color;
this.Kind = designer.Kind;
this.StateImage = designer.StateImage;
this.Status = designer.Status;
this.Remark = designer.Remark;
if (this is MiddleFlowNode middle)
{
middle.UserIds = designer.UserIds;
middle.RoleIds = designer.RoleIds;
middle.ActType = designer.ActType;
middle.SimulateApprove = designer.SimulateApprove;
}
}
}
@@ -107,12 +110,15 @@ namespace AIStudio.Wpf.Flowchart.ViewModels
[Browsable(false)]
public string StateImage { get; set; }
#region 使,
#region 使
private int _status;
public int Status
{
get { return _status; }
get
{
return _status;
}
set
{
SetProperty(ref _status, value);
@@ -122,13 +128,18 @@ namespace AIStudio.Wpf.Flowchart.ViewModels
private string _remark;
public string Remark
{
get { return _remark; }
get
{
return _remark;
}
set
{
SetProperty(ref _remark, value);
}
}
#endregion
#region 使,
public List<string> PreStepId { get; set; }
public string NextStepId { get; set; }
public Dictionary<string, string> SelectNextStep { get; set; } = new Dictionary<string, string>();

View File

@@ -74,16 +74,18 @@ namespace AIStudio.Wpf.Flowchart.ViewModels
}
}
public bool DoubleApprove
#region 使
public bool SimulateApprove
{
get;set;
}
#endregion
protected override void ExecuteEditCommand(object param)
{
if (IsReadOnly == true) return;
if (DoubleApprove)
if (SimulateApprove)
{
if (Status == 1)
{