WorkflowDefine.razor 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. @page "/Workflow/Manage"
  2. @using wispro.sp.entity
  3. @attribute [Authorize]
  4. <PageContainer>
  5. <Breadcrumb>
  6. <Breadcrumb>
  7. <BreadcrumbItem>
  8. <a href="/Home"><Icon Type="home"></Icon></a>
  9. </BreadcrumbItem>
  10. <BreadcrumbItem>
  11. <Icon Type="apartment" Theme="outline" /><span>流程管理</span>
  12. </BreadcrumbItem>
  13. </Breadcrumb>
  14. </Breadcrumb>
  15. <Content>
  16. <Button Type="primary" Icon="plus" OnClick="AddNew" Style="float:right">添加新流程</Button>
  17. </Content>
  18. <ChildContent>
  19. @if (workflows == null)
  20. {
  21. <Spin />
  22. }
  23. else
  24. {
  25. <AntDesign.Table @ref="table" @bind-PageIndex="_pageIndex" @bind-PageSize="_pageSize"
  26. TItem="wispro.sp.entity.workflowDefine.Workflow"
  27. Loading="_loading"
  28. DataSource="@workflows"
  29. Total="_total"
  30. Bordered=@true
  31. Size=@TableSize.Middle
  32. HidePagination>
  33. <ChildContent>
  34. <Selection Key="@(context.Id.ToString())" />
  35. <AntDesign.Column Title="序号" TData="int">
  36. @serialNumber(_pageIndex, _pageSize, context.Id)
  37. </AntDesign.Column>
  38. <AntDesign.Column Title="流程名称" @bind-Field="@context.Name" Sortable Filterable />
  39. <AntDesign.Column Title="创建日期" @bind-Field="@context.CreateTime" Format="yyyy-MM-dd" Sortable Filterable />
  40. <AntDesign.Column Title="生效日期" @bind-Field="@context.EffectivrDate" Format="yyyy-MM-dd" Sortable Filterable />
  41. <AntDesign.Column Title="失效日期" @bind-Field="@context.ExpirationDate" Format="yyyy-MM-dd" Sortable Filterable />
  42. <AntDesign.Column Title="绑定对象" TData="string">
  43. @workflowService.GetBindObjectName(context.ContentObjectType)
  44. </AntDesign.Column>
  45. <AntDesign.Column Title="说明" @bind-Field="@context.Memo" Filterable />
  46. <AntDesign.Column Title="创建人" TData="string">
  47. @if (context.CreateUser != null)
  48. {
  49. <span>@context.CreateUser.Name</span>
  50. }
  51. </AntDesign.Column>
  52. <ActionColumn>
  53. <Space>
  54. <SpaceItem><Button OnClick="()=>Detail(context.Id)">详情</Button></SpaceItem>
  55. </Space>
  56. <Space>
  57. <SpaceItem><Button Danger OnClick="()=>Delete(context)">删除</Button></SpaceItem>
  58. </Space>
  59. </ActionColumn>
  60. </ChildContent>
  61. <PaginationTemplate>
  62. <div style="display: flex; align-items: center">
  63. <Pagination Class="my-custom-pagination"
  64. Total="@_total"
  65. PageSize="@_pageSize"
  66. Current="@_pageIndex"
  67. ShowSizeChanger="@true" />
  68. </div>
  69. </PaginationTemplate>
  70. </AntDesign.Table>
  71. }
  72. </ChildContent>
  73. </PageContainer>
  74. <style>
  75. .my-custom-pagination {
  76. margin: 15px 0;
  77. }
  78. .my-custom-pagination .ant-pagination-item,
  79. .my-custom-pagination .ant-pagination-item-link {
  80. border-radius: 100%;
  81. }
  82. </style>
  83. <Modal Title="修改"
  84. Visible="@_visible"
  85. OnOk="@HandleOk"
  86. OnCancel="@HandleCancel"
  87. OkText="@("保存")"
  88. CancelText="@("取消")"
  89. Width="1000" MaskClosable="false">
  90. <Form Model="EditingObj" LabelColSpan="6"
  91. WrapperColSpan="16">
  92. <FormItem Label="流程名称">
  93. <Input @bind-Value="@context.Name" />
  94. </FormItem>
  95. <FormItem Label="生效日期">
  96. <DatePicker TValue="DateTime" Picker="@DatePickerType.Date" @bind-Value="@context.EffectivrDate" />
  97. </FormItem>
  98. <FormItem Label="失效日期">
  99. <DatePicker TValue="DateTime?" Picker="@DatePickerType.Date" @bind-Value="@context.ExpirationDate" />
  100. </FormItem>
  101. <FormItem Label="启动时绑定对象">
  102. <Select DataSource="@workflowService.GetBindObjects()"
  103. @bind-Value="@context.ContentObjectType"
  104. LabelName="@nameof(wispro.sp.entity.workflowDefine.BindObjectType.Name)"
  105. ValueName="@nameof(wispro.sp.entity.workflowDefine.BindObjectType.ObjectTypeFullName)"
  106. Placeholder="请选项一项"
  107. DefaultActiveFirstItem="false"
  108. EnableSearch="true"
  109. AllowClear="true"
  110. Style="width:220px;">
  111. </Select>
  112. </FormItem>
  113. <FormItem Label="说明">
  114. <TextArea @bind-Value="@context.Memo" MinRows="4" />
  115. </FormItem>
  116. <Divider />
  117. <FormItem Label="初始化操作名称">
  118. <Input @bind-Value="@InitAction.Action.Name" />
  119. </FormItem>
  120. <FormItem Label="初始化界面">
  121. <Input @bind-Value="@InitAction.Action.InputForm" />
  122. </FormItem>
  123. <wispro.sp.web.Components.InputValueSetting EditAction="InitAction" />
  124. </Form>
  125. </Modal>