Explorar o código

添加流程及栏位设定界面
测试使用SVG画流程图

luocaiyang %!s(int64=3) %!d(string=hai) anos
pai
achega
fb2d77fc1d

+ 8 - 0
wispro.sp.api/Job/UpdateJXDataFromIPEasyJob.cs

@@ -27,8 +27,11 @@ namespace wispro.sp.api.Job
                 foreach(var Item in lstItem)
                 {
                     System.Diagnostics.Debug.WriteLine($"{DateTime.Now}\t{++i}\t{Item.CaseNo}");
+                    int iTryCount = 0;    
+                TryAgain:
                     try
                     {
+                        iTryCount++;
                         dynamic retObj = utility.IPEasyUtility.GetPerformanceRecord(Item.CaseNo, Item.DoItem,string.IsNullOrEmpty(Item.CaseStage)?null: Item.CaseStage);
 
 
@@ -191,6 +194,11 @@ namespace wispro.sp.api.Job
                     }
                     catch(Exception ex)
                     {
+                        if(iTryCount <= 3)
+                        {
+                            goto TryAgain;
+                        }
+
                         System.Diagnostics.Debug.WriteLine(ex.ToString());
                     }
                 }

+ 202 - 0
wispro.sp.web/Components/InputValueSetting.razor

@@ -0,0 +1,202 @@
+<Card Title="栏位设定" Style="width:100%;">
+    <Extra>
+        <Button Type="@ButtonType.Primary" OnClick="() => AddNew(null)">添加</Button>
+    </Extra>
+    <Body>
+        <AntDesign.Table @ref="table"
+                         TItem="wispro.sp.entity.workflowDefine.InputValueSetting"
+                         DataSource="@GetChildItem(null)"
+                         Total="@GetChildItem(null).Count()"
+                         Bordered=@true
+                         Size=@TableSize.Middle
+                         HidePagination
+                         >
+            <RowTemplate>
+
+                <AntDesign.Column Title="栏位名称" TData="string">
+                    @if (context == EditObj)
+                    {
+                        <Input @bind-Value="context.DisplayName" />
+
+                    }
+                    else
+                    {
+                        @context.DisplayName
+                    }
+                </AntDesign.Column>
+                <AntDesign.Column Title="栏位类型" TData="string">
+                    @if (context == EditObj)
+                    {
+                        <Select DataSource="@FieldTypes"
+                                @bind-Value="@context.valueType"
+                                LabelName="@nameof(wispro.sp.entity.EnumnDescription<wispro.sp.entity.workflowDefine.FieldType>.Description)"
+                                ValueName="@nameof(wispro.sp.entity.EnumnDescription<wispro.sp.entity.workflowDefine.FieldType>.Value)"
+                                Placeholder="请选项一项"
+                                DefaultActiveFirstItem="false"
+                                EnableSearch="true"
+                                AllowClear="true"
+                                Style="width:100px;">
+                        </Select>
+                    }
+                    else
+                    {
+                        <span>@wispro.sp.entity.EnumHelper.GetDescription(context.valueType)</span>
+                    }
+                </AntDesign.Column>
+                <AntDesign.Column Title="可选值" TData="string">
+                    @if (context == EditObj)
+                    {
+                        <Input @bind-Value="context.Options" />
+                    }
+                    else
+                    {
+                        @context.Options
+                    }
+                </AntDesign.Column>
+                <AntDesign.Column Title="绑定栏位" @bind-Field="@context.bindField">
+                    @if (context == EditObj)
+                    {
+                        <Input @bind-Value="context.bindField" />
+                    }
+                    else
+                    {
+                        @context.bindField
+                    }
+                </AntDesign.Column>
+                <ActionColumn Style="float:right">
+                    @if (context == EditObj)
+                    {
+                        <Space>
+                            <SpaceItem><Button Type="@ButtonType.Text" OnClick="() => Save(context)">保存</Button></SpaceItem>
+                        </Space>
+                        <Space>
+                            <Popconfirm Title="确定要忽略当前修改?"
+                                        OnConfirm="() => OnCancel(context)"
+                                        OkText="Yes"
+                                        CancelText="No">
+                                <a>取消</a>
+                            </Popconfirm>
+                        </Space>
+                    }
+                    else
+                    {
+                        <Space>
+                            <SpaceItem><Button Type="@ButtonType.Text" OnClick="() => Edit(context)">编辑</Button></SpaceItem>
+                        </Space>
+                        <Space>
+                            <Popconfirm Title="确定要删除当前栏位?"
+                                        OnConfirm="() => Delete(context)"
+                                        OkText="Yes"
+                                        CancelText="No">
+                                <a>删除</a>
+                            </Popconfirm>
+                        </Space>
+
+                        if (context.valueType == entity.workflowDefine.EnumFieldType.List)
+                        {
+                            <Space>
+                                <SpaceItem><Button Type="@ButtonType.Text" OnClick="() => AddNew(context)">添加子栏位</Button></SpaceItem>
+                            </Space>
+                        }
+                    }
+                </ActionColumn>
+            </RowTemplate>
+            
+            <ExpandTemplate  Context="rowData" >
+                @if (rowData.Data.valueType == entity.workflowDefine.EnumFieldType.List)
+                {
+                <AntDesign.Table @ref="table"
+                                 TItem="wispro.sp.entity.workflowDefine.InputValueSetting"
+                                 DataSource="@GetChildItem(rowData.Data)"
+                                 Total="@GetChildItem(null).Count()"
+                                 Bordered=@true
+                                 Size=@TableSize.Middle
+                                 HidePagination>
+                    <AntDesign.Column Title="栏位名称" TData="string">
+                        @if (context == EditObj)
+                        {
+                            <Input @bind-Value="context.DisplayName" />
+
+                        }
+                        else
+                        {
+                            @context.DisplayName
+                        }
+                    </AntDesign.Column>
+                    <AntDesign.Column Title="栏位类型" TData="string">
+                        @if (context == EditObj)
+                        {
+                            <Select DataSource="@FieldTypes"
+                                    @bind-Value="@context.valueType"
+                                    LabelName="@nameof(wispro.sp.entity.EnumnDescription<wispro.sp.entity.workflowDefine.FieldType>.Description)"
+                                    ValueName="@nameof(wispro.sp.entity.EnumnDescription<wispro.sp.entity.workflowDefine.FieldType>.Value)"
+                                    Placeholder="请选项一项"
+                                    DefaultActiveFirstItem="false"
+                                    EnableSearch="true"
+                                    AllowClear="true"
+                                    Style="width:220px;">
+                            </Select>
+                        }
+                        else
+                        {
+                            <span>@wispro.sp.entity.EnumHelper.GetDescription(context.valueType)</span>
+                        }
+                    </AntDesign.Column>
+                    <AntDesign.Column Title="可选值" TData="string">
+                        @if (context == EditObj)
+                        {
+                            <Input @bind-Value="context.Options" />
+                        }
+                        else
+                        {
+                            @context.Options
+                        }
+                    </AntDesign.Column>
+                    <AntDesign.Column Title="绑定栏位" @bind-Field="@context.bindField">
+                        @if (context == EditObj)
+                        {
+                            <Input @bind-Value="context.bindField" />
+                        }
+                        else
+                        {
+                            @context.bindField
+                        }
+                    </AntDesign.Column>
+
+                    <ActionColumn>
+                        @if (context == EditObj)
+                        {
+                            <Space>
+                                <SpaceItem><Button Type="@ButtonType.Text" OnClick="() => Save(context)">保存</Button></SpaceItem>
+                            </Space>
+                            <Space>
+                                <Popconfirm Title="确定要忽略当前修改?"
+                                            OnConfirm="() => OnCancel(context)"
+                                            OkText="Yes"
+                                            CancelText="No">
+                                    <a>取消</a>
+                                </Popconfirm>
+                            </Space>
+                        }
+                        else
+                        {
+                            <Space>
+                                <SpaceItem><Button Type="@ButtonType.Text" OnClick="() => Edit(context)">编辑</Button></SpaceItem>
+                            </Space>
+                            <Space>
+                                <Popconfirm Title="确定要删除当前栏位?"
+                                            OnConfirm="() => Delete(context)"
+                                            OkText="Yes"
+                                            CancelText="No">
+                                    <a>删除</a>
+                                </Popconfirm>
+                            </Space>
+                        }
+                    </ActionColumn>
+                </AntDesign.Table>
+                }
+            </ExpandTemplate>
+
+</AntDesign.Table>
+    </Body>
+</Card>

+ 70 - 0
wispro.sp.web/Components/InputValueSetting.razor.cs

@@ -0,0 +1,70 @@
+using AntDesign;
+using Microsoft.AspNetCore.Components;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using wispro.sp.entity;
+
+namespace wispro.sp.web.Components
+{
+    public partial class InputValueSetting
+    {
+        List<wispro.sp.entity.EnumnDescription<wispro.sp.entity.workflowDefine.EnumFieldType>> FieldTypes
+            = entity.EnumHelper.getEnumDescriptionDic<wispro.sp.entity.workflowDefine.EnumFieldType>();
+
+        ITable table;
+        entity.workflowDefine.InputValueSetting EditObj;
+
+        [Parameter]
+        public List<entity.workflowDefine.InputValueSetting> DataSource { get; set; }
+
+        IDictionary<string, (bool edit, entity.workflowDefine.InputValueSetting data)> editCache = new Dictionary<string, (bool edit, entity.workflowDefine.InputValueSetting data)>();
+
+        private List<entity.workflowDefine.InputValueSetting> GetChildItem(entity.workflowDefine.InputValueSetting setting)
+        {
+            return DataSource.Where<entity.workflowDefine.InputValueSetting>(p => p.ParentSetting == setting).ToList();
+        }
+
+        void AddNew(entity.workflowDefine.InputValueSetting setting)
+        {
+            var newObj = new entity.workflowDefine.InputValueSetting()
+            {
+                valueType = entity.workflowDefine.EnumFieldType.Text,
+                DisplayName = "新添栏位",
+                ParentSetting = setting
+                
+            };
+            EditObj = newObj;
+
+            DataSource.Add(newObj);
+        }
+
+        void Delete(entity.workflowDefine.InputValueSetting setting)
+        {
+            //此处添加删除代码
+
+            DataSource.Remove(setting);
+            StateHasChanged();
+        }
+
+        void Edit(entity.workflowDefine.InputValueSetting setting)
+        {
+            EditObj = setting;
+        }
+
+        void Save(entity.workflowDefine.InputValueSetting setting)
+        {
+            //此处添加保存代码
+
+            EditObj = null;
+            StateHasChanged();
+        }
+
+        void OnCancel(entity.workflowDefine.InputValueSetting setting)
+        {
+
+            EditObj = null;
+        }
+    }
+}

+ 142 - 58
wispro.sp.web/Pages/Workflow/WorkflowDefine.razor

@@ -1,6 +1,6 @@
 @page "/Workflow/Manage"
 @using wispro.sp.entity
- 
+
 <PageContainer>
     <Breadcrumb>
         <Breadcrumb>
@@ -13,74 +13,110 @@
         </Breadcrumb>
     </Breadcrumb>
     <Content>
-        <Select DataSource="@FieldTypes"
-                @bind-Value="@fieldType"
-                LabelName="@nameof(wispro.sp.entity.EnumnDescription<wispro.sp.entity.workflowDefine.FieldType>.Description)"
-                ValueName="@nameof(wispro.sp.entity.EnumnDescription<wispro.sp.entity.workflowDefine.FieldType>.Value)"
-                Placeholder="请选项一项"
-                DefaultActiveFirstItem="false"
-                EnableSearch="true"
-                AllowClear="true"
-                Style="width:220px;"
-                >
-        </Select>
         <Button Type="primary" Icon="plus" OnClick="AddNew" Style="float:right">添加新流程</Button>
+        <Button Type="primary" Icon="plus" OnClick="ChangeRectSize" Style="float:right">改变流程框大小</Button>
     </Content>
     <ChildContent>
-        @if (workflows == null) { 
-            <Spin/>
+        @if (workflows == null)
+        {
+            <Spin />
         }
         else
         {
-        <AntDesign.Table @ref="table" @bind-PageIndex="_pageIndex" @bind-PageSize="_pageSize"
-                         TItem="wispro.sp.entity.workflowDefine.Workflow"
-                         Loading="_loading"
-                         DataSource="@workflows"
-                         Total="_total"
-                         Bordered=@true
-                         Size=@TableSize.Middle
-                         >
-            <ChildContent>
-                <Selection Key="@(context.Id.ToString())" />
-                <AntDesign.Column Title="序号" TData="int">
-                    @serialNumber(_pageIndex, _pageSize, context.Id)
-                </AntDesign.Column>
-                <AntDesign.Column Title="流程名称" @bind-Field="@context.Name" Sortable Filterable />
-                <AntDesign.Column Title="创建日期" @bind-Field="@context.CreateTime" Format="yyyy-MM-dd" Sortable Filterable />
-
-                <AntDesign.Column Title="生效日期" @bind-Field="@context.EffectivrDate" Format="yyyy-MM-dd" Sortable Filterable />
-                <AntDesign.Column Title="失效日期" @bind-Field="@context.ExpirationDate" Format="yyyy-MM-dd" Sortable Filterable />
-                <AntDesign.Column Title="说明" @bind-Field="@context.Memo" Filterable />
-                <AntDesign.Column Title="创建人" TData="string">
-                    
+            <AntDesign.Table @ref="table" @bind-PageIndex="_pageIndex" @bind-PageSize="_pageSize"
+                             TItem="wispro.sp.entity.workflowDefine.Workflow"
+                             Loading="_loading"
+                             DataSource="@workflows"
+                             Total="_total"
+                             Bordered=@true
+                             Size=@TableSize.Middle
+                             HidePagination>
+                <ChildContent>
+                    <Selection Key="@(context.Id.ToString())" />
+                    <AntDesign.Column Title="序号" TData="int">
+                        @serialNumber(_pageIndex, _pageSize, context.Id)
+                    </AntDesign.Column>
+                    <AntDesign.Column Title="流程名称" @bind-Field="@context.Name" Sortable Filterable />
+                    <AntDesign.Column Title="创建日期" @bind-Field="@context.CreateTime" Format="yyyy-MM-dd" Sortable Filterable />
+                    <AntDesign.Column Title="生效日期" @bind-Field="@context.EffectivrDate" Format="yyyy-MM-dd" Sortable Filterable />
+                    <AntDesign.Column Title="失效日期" @bind-Field="@context.ExpirationDate" Format="yyyy-MM-dd" Sortable Filterable />
+                    <AntDesign.Column Title="绑定对象" TData="string">
+
+                        @workflowService.GetBindObjectName(context.ContentObjectType)
+
+                    </AntDesign.Column>
+                    <AntDesign.Column Title="说明" @bind-Field="@context.Memo" Filterable />
+                    <AntDesign.Column Title="创建人" TData="string">
+
                         @if (context.CreateUser != null)
                         {
                             <span>@context.CreateUser.Name</span>
                         }
-                    
-                </AntDesign.Column>
-                <ActionColumn>
-                    <Space>
-                        <SpaceItem><Button OnClick="()=>Detail(context.Id)">详情</Button></SpaceItem>
-                    </Space>
-                    <Space>
-                        <SpaceItem><Button Danger OnClick="()=>Delete(context.Id)">删除</Button></SpaceItem>
-                    </Space>
-                </ActionColumn>
-            </ChildContent>
-            <PaginationTemplate>
-                <div style="display: flex; align-items: center">
-                    <Pagination Class="my-custom-pagination"
-                                Total="@_total"
-                                PageSize="@_pageSize"
-                                Current="@_pageIndex"
-                                ShowSizeChanger="@true"
-                                
-                                    />
-                </div>
-            </PaginationTemplate>
-        </AntDesign.Table>
+
+                    </AntDesign.Column>
+                    <ActionColumn>
+                        <Space>
+                            <SpaceItem><Button OnClick="()=>InitFieldSetting(context)">初始化栏位</Button></SpaceItem>
+                        </Space>
+                        <Space>
+                            <SpaceItem><Button OnClick="()=>Detail(context.Id)">详情</Button></SpaceItem>
+                        </Space>
+                        <Space>
+                            <SpaceItem><Button Danger OnClick="()=>Delete(context)">删除</Button></SpaceItem>
+                        </Space>
+                    </ActionColumn>
+                </ChildContent>
+                <PaginationTemplate>
+                    <div style="display: flex; align-items: center">
+                        <Pagination Class="my-custom-pagination"
+                                    Total="@_total"
+                                    PageSize="@_pageSize"
+                                    Current="@_pageIndex"
+                                    ShowSizeChanger="@true" />
+                    </div>
+                </PaginationTemplate>
+            </AntDesign.Table>
         }
+        
+        <Divider />
+        
+        <div style="height:400px;width:100%;overflow:auto;background:#FFFFFF;">
+            
+            <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="@ChartWidth" height="800">
+                <text x="@(ChartWidth/2)" y="50" fill="black" alignment-baseline="middle" text-anchor="middle" font-size="30" font-weight="800">案件系数申核流程</text>
+
+                <circle cx="@(ChartWidth/5)" cy="200" r="25" stroke="black" stroke-width="2" fill="white" />
+                <a @onclick="() => ClickStep(false)">
+                    <text x="@(ChartWidth/5)" y="200" fill="black" alignment-baseline="middle" text-anchor="middle" font-size="16">开始</text>
+                </a>
+
+                <rect x="@(2*ChartWidth/5-rectWidth/2)" y="@(200-rectHeight/2)" rx="10" ry="10" width="@rectWidth" height="@rectHeight" style="fill:green;stroke:black;stroke-width:3;opacity:0.5" />
+                <a @onclick="() => ClickStep(false)">
+                    <text x="@(2*ChartWidth/5)" y="200" fill="black" alignment-baseline="middle" text-anchor="middle" font-size="@rectFontSize" font-weight="700">提出申诉</text>
+                </a>
+
+                <rect x="@(3*ChartWidth/5-rectWidth/2)" y="@(200-rectHeight/2)" rx="10" ry="10" width="@rectWidth" height="@rectHeight" style="fill:green;stroke:black;stroke-width:3;opacity:0.5" />
+                <a @onclick="() => ClickStep(false)">
+                    <text x="@(3*ChartWidth/5)" y="200" fill="black" alignment-baseline="middle" text-anchor="middle" font-size="@rectFontSize" font-weight="700">主管申核</text>
+                </a>
+
+                <circle cx="@(4*ChartWidth/5)" cy="200" r="25" stroke="black" stroke-width="2" fill="gray" />
+                <a @onclick="() => ClickStep(true)">
+                    <text x="@(4*ChartWidth/5)" y="200" fill="black" alignment-baseline="middle" text-anchor="middle">结束</text>
+                </a>
+
+                <path d="M@(ChartWidth/5+25) 200 H@(2*ChartWidth/5-rectWidth/2)" stroke="black" />
+                <path d="M@(2*ChartWidth/5-rectWidth/2) 200 L@(2*ChartWidth/5-rectWidth/2-8) 205 L@(2*ChartWidth/5-rectWidth/2-8) 195 Z" stroke="black" />
+
+                <path d="M@(2*ChartWidth/5+rectWidth/2) 200 H@(3*ChartWidth/5-rectWidth/2)" stroke="black" />
+                <path d="M@(3*ChartWidth/5-rectWidth/2) 200 L@(3*ChartWidth/5-rectWidth/2-8) 205 L@(3*ChartWidth/5-rectWidth/2-8) 195 Z" stroke="black" />
+
+                <path d="M@(3*ChartWidth/5+rectWidth/2) 200 H@(4*ChartWidth/5-25)" stroke="black" />
+                <path d="M@(4*ChartWidth/5-25) 200 L@(4*ChartWidth/5-25-8) 205 L@(4*ChartWidth/5-25-8) 195 Z" stroke="black" />
+
+            </svg>
+            
+        </div>
     </ChildContent>
 </PageContainer>
 
@@ -94,3 +130,51 @@
             border-radius: 100%;
         }
 </style>
+    <Modal Title="初始化栏位"
+       Visible="@_initModalVisible"
+       OnOk="@InitOk"
+       OnCancel="@InitCancel"
+        OkText="@("确认")"
+        CancelText="@("取消")"
+       Width="900">
+        <wispro.sp.web.Components.InputValueSetting DataSource="@InitInputValues"/>
+    </Modal>
+
+    <Modal Title="修改"
+           Visible="@_visible"
+           OnOk="@HandleOk"
+           OnCancel="@HandleCancel">
+
+        <Form Model="EditingObj" LabelColSpan="6"
+              WrapperColSpan="16">
+            <FormItem Label="流程名称">
+                <Input @bind-Value="@context.Name" />
+            </FormItem>
+            <FormItem Label="生效日期">
+                <DatePicker TValue="DateTime" Picker="@DatePickerType.Date" @bind-Value="@context.EffectivrDate" />
+            </FormItem>
+
+            <FormItem Label="失效日期">
+                <DatePicker TValue="DateTime?" Picker="@DatePickerType.Date" @bind-Value="@context.ExpirationDate" />
+            </FormItem>
+
+            <FormItem Label="启动时绑定对象">
+                <Select DataSource="@workflowService.GetBindObjects()"
+                        @bind-Value="@context.ContentObjectType"
+                        LabelName="@nameof(wispro.sp.entity.workflowDefine.BindObjectType.Name)"
+                        ValueName="@nameof(wispro.sp.entity.workflowDefine.BindObjectType.ObjectTypeFullName)"
+                        Placeholder="请选项一项"
+                        DefaultActiveFirstItem="false"
+                        EnableSearch="true"
+                        AllowClear="true"
+                        Style="width:220px;">
+                </Select>
+            </FormItem>
+
+            <FormItem Label="说明">
+                <TextArea @bind-Value="@context.Memo" MinRows="4" />
+            </FormItem>
+
+        </Form>
+
+    </Modal>

+ 106 - 4
wispro.sp.web/Pages/Workflow/WorkflowDefine.razor.cs

@@ -1,29 +1,46 @@
 using AntDesign;
 using AntDesign.TableModels;
+using Microsoft.AspNetCore.Components;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
+using wispro.sp.web.Services;
 
 namespace wispro.sp.web.Pages.Workflow
 {
     public partial class WorkflowDefine
     {
+
         private List<wispro.sp.entity.workflowDefine.Workflow> workflows = new List<wispro.sp.entity.workflowDefine.Workflow>();
         ITable table;
 
+        double ChartWidth = 1000;
+        double  rectWidth = 120;
+        double rectHeight = 60;
+        int rectFontSize = 26;
         int _pageIndex = 1;
         int _pageSize = 10;
         int _total = 0;
         bool _loading = false;
+        bool isAdd = false;
+
+        entity.workflowDefine.Workflow EditingObj = null;
+        List<entity.workflowDefine.InputValueSetting> InitInputValues;
 
-        wispro.sp.entity.workflowDefine.Workflow EditingObj = null;
         bool _visible = false;
+        bool _initModalVisible = false;
 
         List<wispro.sp.entity.EnumnDescription<wispro.sp.entity.workflowDefine.FieldType>> FieldTypes
             = entity.EnumHelper.getEnumDescriptionDic<wispro.sp.entity.workflowDefine.FieldType>();
 
         entity.workflowDefine.FieldType fieldType = entity.workflowDefine.FieldType.ActionInputValue;
+
+        [Inject] protected IUserService UserService { get; set; }
+        [Inject] protected WorkflowService workflowService { get; set; }
+
+        [Inject] protected MessageService _msgService { get; set; }
+
         protected override async System.Threading.Tasks.Task OnInitializedAsync()
         {
             await base.OnInitializedAsync();
@@ -31,7 +48,39 @@ namespace wispro.sp.web.Pages.Workflow
 
         private void AddNew()
         {
-            
+            isAdd = true;
+            EditingObj = new entity.workflowDefine.Workflow();
+            _visible = true;
+        }
+
+        async void HandleOk()
+        {
+            if (EditingObj.Id ==0)
+            {
+                int maxId = 0;
+                foreach(var wf in workflows)
+                {
+                    if(wf.Id > maxId)
+                    {
+                        maxId = wf.Id;
+                    }
+                }
+
+                EditingObj.Id = maxId + 1;
+                EditingObj.CreateTime = DateTime.Now;
+                EditingObj.CreateUser = new entity.Staff() { Name = (await UserService.GetUser()).Name };
+                workflows.Add(EditingObj);
+                _total = workflows.Count;
+            }
+
+            _visible = false;
+            StateHasChanged();
+        }
+    
+
+        void HandleCancel()
+        {
+            _visible = false;
         }
 
         public int serialNumber(int pageIndex, int pageSize, int Id)
@@ -60,9 +109,11 @@ namespace wispro.sp.web.Pages.Workflow
             })
         };
 
-        void Delete(int Id)
+        void Delete(entity.workflowDefine.Workflow workflow)
         {
-
+            
+            workflows.Remove(workflow);
+            _total = workflows.Count;
         }
 
         void Detail(int Id)
@@ -70,6 +121,57 @@ namespace wispro.sp.web.Pages.Workflow
 
         }
 
+        IDictionary<entity.workflowDefine.Workflow, List<entity.workflowDefine.InputValueSetting>> dicFieldSettings
+            = new Dictionary<entity.workflowDefine.Workflow, List<entity.workflowDefine.InputValueSetting>>();
+        void InitFieldSetting(entity.workflowDefine.Workflow workflow)
+        {
+            if (dicFieldSettings.ContainsKey(workflow))
+            {
+                InitInputValues = dicFieldSettings[workflow];
+            }
+            else
+            {
+                InitInputValues = new List<entity.workflowDefine.InputValueSetting>();
+                dicFieldSettings.Add(workflow,InitInputValues);
+            }
+
+            _initModalVisible = true;
+        }
+
+        async void InitOk()
+        {
+            _initModalVisible  = false;
+        }
+
+
+        void InitCancel()
+        {
+            _initModalVisible = false;
+        }
 
+        void ClickStep(bool isEnd)
+        {
+            var msg = "您点击了开始步骤!";
+
+            if (isEnd)
+            {
+                msg = "您点击了结束步骤!";
+            }
+
+            _msgService.Info(msg);
+        }
+
+        void ChangeRectSize()
+        {
+            Random rd = new Random();
+
+            var s = 0.5 + rd.NextDouble();
+            rectWidth = s * rectWidth;
+            rectHeight = s * rectHeight;
+            rectFontSize =(int)(s * rectFontSize);
+
+            StateHasChanged();
+
+        }
     }
 }

+ 1 - 0
wispro.sp.web/Program.cs

@@ -41,6 +41,7 @@ namespace wispro.sp.web
             builder.Services.AddScoped<AppealTypeService, AppealTypeService>();
             builder.Services.AddScoped<IHttpService, HttpService>();
             builder.Services.AddScoped<OrganizationService, OrganizationService>();
+            builder.Services.AddScoped<WorkflowService, WorkflowService>();
 
             builder.Services.AddBlazorContextMenu();
 

+ 36 - 0
wispro.sp.web/Services/WorkflowService.cs

@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using wispro.sp.entity.workflowDefine;
+
+namespace wispro.sp.web.Services
+{
+    public class WorkflowService
+    {
+        private List<BindObjectType> bindObjectTypes = new List<BindObjectType>()
+        {
+            new BindObjectType(){ Name ="绩效记录",ObjectTypeFullName = typeof(wispro.sp.entity.PerformanceItem).FullName},
+                new BindObjectType(){ Name ="人员",ObjectTypeFullName = typeof(wispro.sp.entity.Staff).FullName}
+        };
+
+        public List<BindObjectType> GetBindObjects()
+        {
+            return bindObjectTypes;
+        }
+
+        public string GetBindObjectName(string ObjectTypeFullName)
+        {
+            var retObj = bindObjectTypes.FirstOrDefault<BindObjectType>(b => b.ObjectTypeFullName == ObjectTypeFullName);
+
+            if(retObj != null)
+            {
+                return retObj.Name;
+            }
+            else
+            {
+                return "";
+            }
+        }
+    }
+}

+ 29 - 30
wispro.sp.web/wwwroot/index.html

@@ -59,8 +59,7 @@
                 -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
                 transition: -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
                 transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
-                transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86),
-                    -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
+                transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86), -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
             }
 
             .ant-spin-spinning {
@@ -95,31 +94,31 @@
                 animation: antSpinMove 1s infinite linear alternate;
             }
 
-            .ant-spin-dot-item:nth-child(1) {
-                top: 0;
-                left: 0;
-            }
+                .ant-spin-dot-item:nth-child(1) {
+                    top: 0;
+                    left: 0;
+                }
 
-            .ant-spin-dot-item:nth-child(2) {
-                top: 0;
-                right: 0;
-                -webkit-animation-delay: 0.4s;
-                animation-delay: 0.4s;
-            }
+                .ant-spin-dot-item:nth-child(2) {
+                    top: 0;
+                    right: 0;
+                    -webkit-animation-delay: 0.4s;
+                    animation-delay: 0.4s;
+                }
 
-            .ant-spin-dot-item:nth-child(3) {
-                right: 0;
-                bottom: 0;
-                -webkit-animation-delay: 0.8s;
-                animation-delay: 0.8s;
-            }
+                .ant-spin-dot-item:nth-child(3) {
+                    right: 0;
+                    bottom: 0;
+                    -webkit-animation-delay: 0.8s;
+                    animation-delay: 0.8s;
+                }
 
-            .ant-spin-dot-item:nth-child(4) {
-                bottom: 0;
-                left: 0;
-                -webkit-animation-delay: 1.2s;
-                animation-delay: 1.2s;
-            }
+                .ant-spin-dot-item:nth-child(4) {
+                    bottom: 0;
+                    left: 0;
+                    -webkit-animation-delay: 1.2s;
+                    animation-delay: 1.2s;
+                }
 
             .ant-spin-dot-spin {
                 -webkit-transform: rotate(45deg);
@@ -135,13 +134,12 @@
                 height: 32px;
             }
 
-            .ant-spin-lg .ant-spin-dot i {
-                width: 14px;
-                height: 14px;
-            }
+                .ant-spin-lg .ant-spin-dot i {
+                    width: 14px;
+                    height: 14px;
+                }
 
-            @media all and (-ms-high-contrast: none),
-            (-ms-high-contrast: active) {
+            @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
                 .ant-spin-blur {
                     background: #fff;
                     opacity: 0.5;
@@ -227,6 +225,7 @@
     <script src="_content/AntDesign/js/ant-design-blazor.js"></script>
     <script src="_content/AntDesign.Charts/ant-design-charts-blazor.js"></script>
     <script src="_framework/blazor.webassembly.js"></script>
+    <script src="saveSvgAsPng.js"></script>
 </body>
 
 </html>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 3397 - 0
wispro.sp.web/wwwroot/saveSvgAsPng.js


+ 17 - 1
wospro.sp.entity/EmunHelper.cs

@@ -49,6 +49,22 @@ namespace wispro.sp.entity
             return resultList;
 
         }
-        
+
+        public static string GetDescription<T>(T obj)
+        {
+            Type type = typeof(T);
+            FieldInfo field = obj.GetType().GetField(obj.ToString());
+            DescriptionAttribute att = Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute), false) as DescriptionAttribute;
+
+            if (att == null)
+            {
+                return obj.ToString();
+            }
+            else
+            {
+                return att.Description;
+            }
+        }
+
     }
 }

+ 15 - 0
wospro.sp.entity/workflowDefine/BindObjectType.cs

@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace wispro.sp.entity.workflowDefine
+{
+    public class BindObjectType
+    {
+        public string Name { get; set; }
+
+        public string ObjectTypeFullName { get; set; }
+    }
+}