|
@@ -4,6 +4,7 @@ using Microsoft.Extensions.Configuration;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
+using System.Text.Json;
|
|
|
using System.Threading.Tasks;
|
|
|
using wispro.sp.entity.workflowDefine;
|
|
|
using wispro.sp.web.Services;
|
|
@@ -21,6 +22,14 @@ namespace wispro.sp.web.Pages.Workflow
|
|
|
List<InputValueSetting> inputValueSettings;
|
|
|
|
|
|
|
|
|
+ internal class StepItem
|
|
|
+ {
|
|
|
+ public string Name { get; set; }
|
|
|
+
|
|
|
+ public int? StepId { get; set; }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
UserField userField = new UserField();
|
|
|
|
|
|
[Parameter]
|
|
@@ -33,6 +42,7 @@ namespace wispro.sp.web.Pages.Workflow
|
|
|
[Inject] protected IConfiguration _configuration { get; set; }
|
|
|
|
|
|
string DownloadUrl;
|
|
|
+ List<StepItem> stepItems;
|
|
|
async Task InitData()
|
|
|
{
|
|
|
|
|
@@ -44,7 +54,18 @@ namespace wispro.sp.web.Pages.Workflow
|
|
|
|
|
|
DownloadUrl = $"{_configuration.GetValue<string>("APIUrl")}WorkflowEngine/ExportToImage?workflowId={workflow.Id}";
|
|
|
|
|
|
+ stepItems = new List<StepItem>();
|
|
|
+ stepItems.Add(new StepItem() { Name = "开始",StepId = 0});
|
|
|
+
|
|
|
+ foreach(var step in Steps)
|
|
|
+ {
|
|
|
+ if (step.Id != workflow.EndStepId)
|
|
|
+ {
|
|
|
+ stepItems.Add(new StepItem() { Name = step.Name, StepId = step.Id });
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ stepItems.Add(new StepItem() { Name = "结束", StepId = workflow.EndStepId });
|
|
|
}
|
|
|
|
|
|
protected async override Task OnInitializedAsync()
|
|
@@ -70,7 +91,9 @@ namespace wispro.sp.web.Pages.Workflow
|
|
|
EditStep = new share.NewStepObject() { Step = step, isLastStep = b };
|
|
|
try
|
|
|
{
|
|
|
+ Console.WriteLine(step.defaultResponseSetting);
|
|
|
userField = System.Text.Json.JsonSerializer.Deserialize<UserField>(step.defaultResponseSetting);
|
|
|
+ Console.WriteLine($"Deserialize Result:{System.Text.Json.JsonSerializer.Serialize(userField)}" );
|
|
|
}
|
|
|
catch {
|
|
|
userField = new UserField();
|
|
@@ -184,9 +207,11 @@ namespace wispro.sp.web.Pages.Workflow
|
|
|
|
|
|
async Task EditStepOK()
|
|
|
{
|
|
|
- //Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(userField));
|
|
|
- EditStep.Step.defaultResponseSetting = System.Text.Json.JsonSerializer.Serialize(userField);
|
|
|
-
|
|
|
+ JsonSerializerOptions options = new() { IgnoreNullValues = true };
|
|
|
+ EditStep.Step.defaultResponseSetting = System.Text.Json.JsonSerializer.Serialize(userField,options);
|
|
|
+ Console.WriteLine($"UsrValue={userField.UserValue},UserConditionType={userField.UserConditionType},UserType={userField.UserType}");
|
|
|
+ Console.WriteLine(EditStep.Step.defaultResponseSetting);
|
|
|
+
|
|
|
var ret = await _wfService.SaveStep(EditStep);
|
|
|
if (ret.Success)
|
|
|
{
|