WorkflowDefine.razor 5.9 KB

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