123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- @page "/imagecategories"
- @using AIPlatform.Protocol.Entities;
- @using aipmgr.Utilities
- @using aipmgr.Models
- <Table @ref="ImageCategoryTable" TItem="ImageCategoryModel" IsBordered="true" IsStriped="true" HeaderStyle="@TableHeaderStyle.Light"
- IsTree="true" TreeNodeConverter="@TreeNodeConverter" OnTreeExpand="@OnTreeExpand" IndentSize="8" ExtendButtonColumnWidth="340"
- IsPagination="true" PageItemsSource="@_pageItemsSource" ShowEmpty="true"
- ShowToolbar="true" ShowExtendButtons="true" IsFixedHeader="true" ShowDefaultButtons="false"
- ShowLoading="true" ShowSearch="true" ShowAdvancedSearch="false"
- ShowExtendEditButton="false" ShowExtendDeleteButton="false"
- OnQueryAsync="@OnQueryAsync" OnAddAsync="@OnAddAsync" OnDeleteAsync="@OnDeleteAsync">
- <TableColumns>
- <TableColumn @bind-Field="@context.Name" Width="200" TextWrap="true" />
- <TableColumn @bind-Field="@context.Level" Width="45" />
- <TableColumn @bind-Field="@context.Labelers" Width="110" TextWrap="true">
- <Template Context="value">
- @if (value != null)
- {
- @string.Join(", ", value.Value.Select(v => v.Name))
- }
- </Template>
- </TableColumn>
- <TableColumn @bind-Field="@context.Developers" Width="110" TextWrap="true">
- <Template Context="value">
- @if (value != null)
- {
- @string.Join(", ", value.Value.Select(v => v.Name))
- }
- </Template>
- </TableColumn>
- <TableColumn @bind-Field="@context.Sharers" Width="110" TextWrap="true">
- <Template Context="value">
- @if (value != null)
- {
- @string.Join(", ", value.Value.Select(v => v.Name))
- }
- </Template>
- </TableColumn>
- <TableColumn @bind-Field="@context.Gatherers" Width="110" TextWrap="true">
- <Template Context="value">
- @if (value != null)
- {
- @string.Join(", ", value.Value.Select(v => v.Name))
- }
- </Template>
- </TableColumn>
- @* <TableColumn @bind-Field="@context.GoldStandardQuantityItem" Width="90" TextWrap="true">
- <Template Context="value">
- <div class="row g-3 form-inline mt-0">
- @if (value != null && value.Row.Level == CategoryLevel.MainCategory)
- {
- <div class="col-12 m-0">
- 比例:@value.Value.Proportion
- </div>
- <div class="col-12 m-0">
- 达标人数:@value.Value.QualifiedPeople
- </div>
- }
- </div>
- </Template>
- </TableColumn> *@
- @* <TableColumn @bind-Field="@context.SelfCheckQuantityItem" Width="90" TextWrap="true">
- <Template Context="value">
- <div class="row g-3 form-inline mt-0">
- @if (value != null && value.Row.Level == CategoryLevel.MainCategory)
- {
- <div class="col-12 m-0">
- 比例:@value.Value.Proportion
- </div>
- }
- </div>
- </Template>
- </TableColumn> *@
- <TableColumn @bind-Field="@context.IsSupportedSkipFrame" Width="90">
- <Template Context="value">
- @if (value != null && value.Row.Level == CategoryLevel.MainCategory)
- {
- @if (value.Value)
- {
- <div class="col-12 m-0">
- 支持
- </div>
- }
- else
- {
- <div class="col-12 m-0">
- 不支持
- </div>
- }
- }
- </Template>
- </TableColumn>
- <TableColumn @bind-Field="@context.DifficultyLevel" Width="90">
- <Template Context="value">
- @if (value != null && value.Row.Level == CategoryLevel.MainCategory)
- {
- <div class="col-12 m-0">
- @value.Value.ToDisplayName()
- </div>
- }
- </Template>
- </TableColumn>
- @* <TableColumn @bind-Field="@context.CreateTime" Width="135" FormatString="yyyy-MM-dd HH:mm:ss" /> *@
- <TableColumn @bind-Field="@context.UpdateTime" Width="135" FormatString="yyyy-MM-dd HH:mm:ss" />
- @*<TableColumn @bind-Field="@context.Id" Width="250" Text="操作" TextWrap="true">
- <Template Context="value">
- @if (value.Row.Level == CategoryLevel.MainCategory)
- {
- <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Primary" style="color:white" Text="分配标注人员" OnClick="@(()=>OnAssignUserAsync(value.Row, AccountType.Labeler))" />
- <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Success" style="color:white" Text="分配开发人员" OnClick="@(()=>OnAssignUserAsync(value.Row, AccountType.Developer))" />
- <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Info" style="color:white" Text="分配共享开发人员" OnClick="@(()=>OnAssignUserAsync(value.Row, AccountType.Sharer))" />
- <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Warning" style="color:white" Text="设置金标准" OnClick="@(()=>OnSetGoldStandardAsync(value.Row))" />
- }
- </Template>
- </TableColumn>*@
- </TableColumns>
- <BeforeRowButtonTemplate Context="value">
- @if (value.Level == CategoryLevel.MainCategory)
- {
- <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Primary" Text="分配标注人员" OnClick="@(()=>OnAssignUserAsync(value, AccountType.Labeler))" />
- <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Success" Text="分配开发人员" OnClick="@(()=>OnAssignUserAsync(value, AccountType.Developer))" />
- <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Info" Text="分配共享开发人员" style="color:#ffffff" OnClick="@(()=>OnAssignUserAsync(value, AccountType.Sharer))" />
- <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Secondary" Text="分配采集人员" style="color:#ffffff" OnClick="@(()=>OnAssignUserAsync(value, AccountType.Gatherer))" />
- <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Warning" Text="设置" TooltipText="设置金标准、自校验及其他" OnClick="@(()=>OnSetGoldStandardAsync(value))" />
- }
- </BeforeRowButtonTemplate>
- </Table>
- <Modal @ref="_assignUserModal" OnCloseAsync="OnCloseUserAsync">
- <ModalDialog ShowCloseButton="true" IsCentered="true" Size="Size.Medium" Title="@_assignUserModalTitle">
- <BodyTemplate>
- <div class="row g-3">
- <div class="from-group">
- <BootstrapInput TValue="string" @bind-Value="@_currChild.Name" PlaceHolder="名称" Readonly="true" />
- </div>
- <MultiSelect Items="@_users" @bind-Value="@_selectedUserValues" ShowSearch="true"></MultiSelect>
- </div>
- </BodyTemplate>
- <FooterTemplate>
- <Button Text="确定" Icon="fa fa-check" OnClick="@OnConfirmUserAsync" />
- </FooterTemplate>
- </ModalDialog>
- </Modal>
- <Modal @ref="_setGoldStandardModal" OnCloseAsync="OnCloseGoldStandardAsync">
- <ModalDialog ShowCloseButton="true" IsCentered="true" Size="Size.Medium" Title="设置">
- <BodyTemplate>
- <div class="row g-3">
- <div class="col-12 col-sm-3 col-form-label">
- <span>名称</span>
- </div>
- <div class="col-12 col-sm-9">
- <BootstrapInput TValue="string" @bind-Value="@_currChild.Name" Readonly="true" />
- </div>
- <div class="col-12 col-sm-3 col-form-label">
- <span>金标准比例(0~1)</span>
- </div>
- <div class="col-12 col-sm-9">
- <BootstrapInputNumber @bind-Value="@_currChild.GoldStandardQuantityItem.Proportion" Min="0" Max="1" Step="0.1" />
- </div>
- <div class="col-12 col-sm-3 col-form-label">
- <span>金标准达标人数</span>
- </div>
- <div class="col-12 col-sm-9">
- <BootstrapInputNumber @bind-Value="@_currChild.GoldStandardQuantityItem.QualifiedPeople" Min="0" />
- </div>
- <div class="col-12 col-sm-3 col-form-label">
- <span>自校验比例(0~1)</span>
- </div>
- <div class="col-12 col-sm-9">
- <BootstrapInputNumber @bind-Value="@_currChild.SelfCheckQuantityItem.Proportion" Min="0" Max="1" Step="0.1" />
- </div>
- <div class="col-12 col-sm-3 col-form-label">
- <span>支持跳帧</span>
- </div>
- <div class="col-12 col-sm-9">
- <Switch ShowInnerText="true" OnInnerText="是" OffInnerText="否" @bind-Value="@_currChild.IsSupportedSkipFrame" />
- </div>
- <div class="col-12 col-sm-3 col-form-label">
- <span>视频标注帧模式</span>
- </div>
- <div class="col-12 col-sm-9">
- <Select @bind-Value="@_currChild.VideoItem.FrameMode" />
- </div>
- <div class="col-12 col-sm-3 col-form-label">
- <span>间隔帧数</span>
- </div>
- <div class="col-12 col-sm-9">
- <BootstrapInputNumber @bind-Value="@_currChild.VideoItem.IntervalFrame" Min="1" />
- </div>
- @if (_currChild.VideoItem.FrameMode == FrameMode.EqualInterval)
- {
- <div class="col-12 col-sm-3 col-form-label">
- <span>相似度阈值(0~1)</span>
- </div>
- <div class="col-12 col-sm-9">
- <BootstrapInputNumber @bind-Value="@_currChild.VideoItem.SimilarityThreshold" Min="0" Max="1" Step="0.01" />
- </div>
- }
- <div class="col-12 col-sm-3 col-form-label">
- <span>难度等级</span>
- </div>
- <div class="col-12 col-sm-9">
- <Select @bind-Value="@_currChild.DifficultyLevel" />
- </div>
- </div>
- </BodyTemplate>
- <FooterTemplate>
- <Button Text="确定" Icon="fa fa-check" OnClick="@OnConfirmGoldStandardAsync" />
- </FooterTemplate>
- </ModalDialog>
- </Modal>
- <MessageBase @ref="_messageBaseRef"></MessageBase>
|