ImageCategories.razor 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. @page "/imagecategories"
  2. @using AIPlatform.Protocol.Entities;
  3. @using aipmgr.Utilities
  4. @using aipmgr.Models
  5. <Table @ref="ImageCategoryTable" TItem="ImageCategoryModel" IsBordered="true" IsStriped="true" HeaderStyle="@TableHeaderStyle.Light"
  6. IsTree="true" TreeNodeConverter="@TreeNodeConverter" OnTreeExpand="@OnTreeExpand" IndentSize="8" ExtendButtonColumnWidth="340"
  7. IsPagination="true" PageItemsSource="@_pageItemsSource" ShowEmpty="true"
  8. ShowToolbar="true" ShowExtendButtons="true" IsFixedHeader="true" ShowDefaultButtons="false"
  9. ShowLoading="true" ShowSearch="true" ShowAdvancedSearch="false"
  10. ShowExtendEditButton="false" ShowExtendDeleteButton="false"
  11. OnQueryAsync="@OnQueryAsync" OnAddAsync="@OnAddAsync" OnDeleteAsync="@OnDeleteAsync">
  12. <TableColumns>
  13. <TableColumn @bind-Field="@context.Name" Width="200" TextWrap="true" />
  14. <TableColumn @bind-Field="@context.Level" Width="45" />
  15. <TableColumn @bind-Field="@context.Labelers" Width="110" TextWrap="true">
  16. <Template Context="value">
  17. @if (value != null)
  18. {
  19. @string.Join(", ", value.Value.Select(v => v.Name))
  20. }
  21. </Template>
  22. </TableColumn>
  23. <TableColumn @bind-Field="@context.Developers" Width="110" TextWrap="true">
  24. <Template Context="value">
  25. @if (value != null)
  26. {
  27. @string.Join(", ", value.Value.Select(v => v.Name))
  28. }
  29. </Template>
  30. </TableColumn>
  31. <TableColumn @bind-Field="@context.Sharers" Width="110" TextWrap="true">
  32. <Template Context="value">
  33. @if (value != null)
  34. {
  35. @string.Join(", ", value.Value.Select(v => v.Name))
  36. }
  37. </Template>
  38. </TableColumn>
  39. <TableColumn @bind-Field="@context.Gatherers" Width="110" TextWrap="true">
  40. <Template Context="value">
  41. @if (value != null)
  42. {
  43. @string.Join(", ", value.Value.Select(v => v.Name))
  44. }
  45. </Template>
  46. </TableColumn>
  47. @* <TableColumn @bind-Field="@context.GoldStandardQuantityItem" Width="90" TextWrap="true">
  48. <Template Context="value">
  49. <div class="row g-3 form-inline mt-0">
  50. @if (value != null && value.Row.Level == CategoryLevel.MainCategory)
  51. {
  52. <div class="col-12 m-0">
  53. 比例:@value.Value.Proportion
  54. </div>
  55. <div class="col-12 m-0">
  56. 达标人数:@value.Value.QualifiedPeople
  57. </div>
  58. }
  59. </div>
  60. </Template>
  61. </TableColumn> *@
  62. @* <TableColumn @bind-Field="@context.SelfCheckQuantityItem" Width="90" TextWrap="true">
  63. <Template Context="value">
  64. <div class="row g-3 form-inline mt-0">
  65. @if (value != null && value.Row.Level == CategoryLevel.MainCategory)
  66. {
  67. <div class="col-12 m-0">
  68. 比例:@value.Value.Proportion
  69. </div>
  70. }
  71. </div>
  72. </Template>
  73. </TableColumn> *@
  74. <TableColumn @bind-Field="@context.IsSupportedSkipFrame" Width="90">
  75. <Template Context="value">
  76. @if (value != null && value.Row.Level == CategoryLevel.MainCategory)
  77. {
  78. @if (value.Value)
  79. {
  80. <div class="col-12 m-0">
  81. 支持
  82. </div>
  83. }
  84. else
  85. {
  86. <div class="col-12 m-0">
  87. 不支持
  88. </div>
  89. }
  90. }
  91. </Template>
  92. </TableColumn>
  93. <TableColumn @bind-Field="@context.DifficultyLevel" Width="90">
  94. <Template Context="value">
  95. @if (value != null && value.Row.Level == CategoryLevel.MainCategory)
  96. {
  97. <div class="col-12 m-0">
  98. @value.Value.ToDisplayName()
  99. </div>
  100. }
  101. </Template>
  102. </TableColumn>
  103. @* <TableColumn @bind-Field="@context.CreateTime" Width="135" FormatString="yyyy-MM-dd HH:mm:ss" /> *@
  104. <TableColumn @bind-Field="@context.UpdateTime" Width="135" FormatString="yyyy-MM-dd HH:mm:ss" />
  105. @*<TableColumn @bind-Field="@context.Id" Width="250" Text="操作" TextWrap="true">
  106. <Template Context="value">
  107. @if (value.Row.Level == CategoryLevel.MainCategory)
  108. {
  109. <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Primary" style="color:white" Text="分配标注人员" OnClick="@(()=>OnAssignUserAsync(value.Row, AccountType.Labeler))" />
  110. <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Success" style="color:white" Text="分配开发人员" OnClick="@(()=>OnAssignUserAsync(value.Row, AccountType.Developer))" />
  111. <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Info" style="color:white" Text="分配共享开发人员" OnClick="@(()=>OnAssignUserAsync(value.Row, AccountType.Sharer))" />
  112. <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Warning" style="color:white" Text="设置金标准" OnClick="@(()=>OnSetGoldStandardAsync(value.Row))" />
  113. }
  114. </Template>
  115. </TableColumn>*@
  116. </TableColumns>
  117. <BeforeRowButtonTemplate Context="value">
  118. @if (value.Level == CategoryLevel.MainCategory)
  119. {
  120. <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Primary" Text="分配标注人员" OnClick="@(()=>OnAssignUserAsync(value, AccountType.Labeler))" />
  121. <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Success" Text="分配开发人员" OnClick="@(()=>OnAssignUserAsync(value, AccountType.Developer))" />
  122. <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Info" Text="分配共享开发人员" style="color:#ffffff" OnClick="@(()=>OnAssignUserAsync(value, AccountType.Sharer))" />
  123. <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Secondary" Text="分配采集人员" style="color:#ffffff" OnClick="@(()=>OnAssignUserAsync(value, AccountType.Gatherer))" />
  124. <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Warning" Text="设置" TooltipText="设置金标准、自校验及其他" OnClick="@(()=>OnSetGoldStandardAsync(value))" />
  125. }
  126. </BeforeRowButtonTemplate>
  127. </Table>
  128. <Modal @ref="_assignUserModal" OnCloseAsync="OnCloseUserAsync">
  129. <ModalDialog ShowCloseButton="true" IsCentered="true" Size="Size.Medium" Title="@_assignUserModalTitle">
  130. <BodyTemplate>
  131. <div class="row g-3">
  132. <div class="from-group">
  133. <BootstrapInput TValue="string" @bind-Value="@_currChild.Name" PlaceHolder="名称" Readonly="true" />
  134. </div>
  135. <MultiSelect Items="@_users" @bind-Value="@_selectedUserValues" ShowSearch="true"></MultiSelect>
  136. </div>
  137. </BodyTemplate>
  138. <FooterTemplate>
  139. <Button Text="确定" Icon="fa fa-check" OnClick="@OnConfirmUserAsync" />
  140. </FooterTemplate>
  141. </ModalDialog>
  142. </Modal>
  143. <Modal @ref="_setGoldStandardModal" OnCloseAsync="OnCloseGoldStandardAsync">
  144. <ModalDialog ShowCloseButton="true" IsCentered="true" Size="Size.Medium" Title="设置">
  145. <BodyTemplate>
  146. <div class="row g-3">
  147. <div class="col-12 col-sm-3 col-form-label">
  148. <span>名称</span>
  149. </div>
  150. <div class="col-12 col-sm-9">
  151. <BootstrapInput TValue="string" @bind-Value="@_currChild.Name" Readonly="true" />
  152. </div>
  153. <div class="col-12 col-sm-3 col-form-label">
  154. <span>金标准比例(0~1)</span>
  155. </div>
  156. <div class="col-12 col-sm-9">
  157. <BootstrapInputNumber @bind-Value="@_currChild.GoldStandardQuantityItem.Proportion" Min="0" Max="1" Step="0.1" />
  158. </div>
  159. <div class="col-12 col-sm-3 col-form-label">
  160. <span>金标准达标人数</span>
  161. </div>
  162. <div class="col-12 col-sm-9">
  163. <BootstrapInputNumber @bind-Value="@_currChild.GoldStandardQuantityItem.QualifiedPeople" Min="0" />
  164. </div>
  165. <div class="col-12 col-sm-3 col-form-label">
  166. <span>自校验比例(0~1)</span>
  167. </div>
  168. <div class="col-12 col-sm-9">
  169. <BootstrapInputNumber @bind-Value="@_currChild.SelfCheckQuantityItem.Proportion" Min="0" Max="1" Step="0.1" />
  170. </div>
  171. <div class="col-12 col-sm-3 col-form-label">
  172. <span>支持跳帧</span>
  173. </div>
  174. <div class="col-12 col-sm-9">
  175. <Switch ShowInnerText="true" OnInnerText="是" OffInnerText="否" @bind-Value="@_currChild.IsSupportedSkipFrame" />
  176. </div>
  177. <div class="col-12 col-sm-3 col-form-label">
  178. <span>视频标注帧模式</span>
  179. </div>
  180. <div class="col-12 col-sm-9">
  181. <Select @bind-Value="@_currChild.VideoItem.FrameMode" />
  182. </div>
  183. <div class="col-12 col-sm-3 col-form-label">
  184. <span>间隔帧数</span>
  185. </div>
  186. <div class="col-12 col-sm-9">
  187. <BootstrapInputNumber @bind-Value="@_currChild.VideoItem.IntervalFrame" Min="1" />
  188. </div>
  189. @if (_currChild.VideoItem.FrameMode == FrameMode.EqualInterval)
  190. {
  191. <div class="col-12 col-sm-3 col-form-label">
  192. <span>相似度阈值(0~1)</span>
  193. </div>
  194. <div class="col-12 col-sm-9">
  195. <BootstrapInputNumber @bind-Value="@_currChild.VideoItem.SimilarityThreshold" Min="0" Max="1" Step="0.01" />
  196. </div>
  197. }
  198. <div class="col-12 col-sm-3 col-form-label">
  199. <span>难度等级</span>
  200. </div>
  201. <div class="col-12 col-sm-9">
  202. <Select @bind-Value="@_currChild.DifficultyLevel" />
  203. </div>
  204. </div>
  205. </BodyTemplate>
  206. <FooterTemplate>
  207. <Button Text="确定" Icon="fa fa-check" OnClick="@OnConfirmGoldStandardAsync" />
  208. </FooterTemplate>
  209. </ModalDialog>
  210. </Modal>
  211. <MessageBase @ref="_messageBaseRef"></MessageBase>