123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- @page "/gathercategories"
- @using aipmgr.Models
- @inject IJSRuntime JS
- <Table @ref="GatherCategoryTable" TItem="GatherCategoryModel" AllowResizing="true"
- IsPagination="true" PageItemsSource="@PageItemsSource" IsStriped="true" IsBordered="true" IsMultipleSelect="true"
- ShowToolbar="true" ShowSearch="true" ShowExtendButtons="true" ShowEmpty="true" ShowLoading="true"
- ShowDefaultButtons="false" EditDialogSize="Size.Large" ShowExtendEditButton="false" ShowExtendDeleteButton="false"
- ExtendButtonColumnWidth="200" SearchModel="@SearchModel" SearchMode="SearchMode.Top" ShowDeleteButton="false" ShowAddButton="false" ShowEditButton="false"
- OnQueryAsync="@OnSearchModelQueryAsync" OnResetSearchAsync="@OnResetSearchAsync">
- <TableToolbarTemplate>
- <TableToolbarButton TItem="GatherCategoryModel" Color="BootstrapBlazor.Components.Color.Success" Icon="fa fa-plus" Text="新建" TooltipText="新建采集分类" OnClick="@OnAddAsync" />
- </TableToolbarTemplate>
- <TableColumns>
- <TableColumn @bind-Field="@context.Name" TextWrap="false" Editable="true" TextEllipsis="true" Width="130" />
- <TableColumn @bind-Field="@context.OrganizationName" TextWrap="false" Width="50" IsReadonlyWhenEdit="true" TextEllipsis="true" />
- <TableColumn @bind-Field="@context.Gatherers" Width="120" TextWrap="false" IsReadonlyWhenEdit="true" TextEllipsis="true">
- <Template Context="value">
- @if (value != null)
- {
- @string.Join(", ", value.Value.Select(v => v.Name))
- }
- </Template>
- </TableColumn>
- <TableColumn @bind-Field="@context.CreateTime" TextWrap="false" IsReadonlyWhenEdit="true" Width="175" TextEllipsis="true" FormatString="yyyy-MM-dd HH:mm:ss" Sortable="true" />
- </TableColumns>
- <SearchTemplate>
- <div class="row g-3 form-inline">
- <div class="col-12 col-sm-4">
- <Select @bind-Value="@context.OrganizationId" Items="@_organizationItems" ShowLabel="true" />
- </div>
- <div class="col-12 col-sm-4">
- <BootstrapInput TValue="string" @bind-Value="@context.Name" ShowLabel="true" PlaceHolder="请输入..." />
- </div>
- <div class="col-12 col-sm-4">
- <BootstrapInput TValue="string" @bind-Value="@context.GathererName" ShowLabel="true" PlaceHolder="请输入..." />
- </div>
- </div>
- </SearchTemplate>
- <RowButtonTemplate Context="value">
- <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Primary" Icon="fa fa-edit" Text="编辑" OnClickWithoutRender="@(()=>OnEditAsync(value) )" />
- </RowButtonTemplate>
- </Table>
- <Modal @ref="_createOrEditModal" OnCloseAsync="OnCloseAsync">
- <ModalDialog ShowCloseButton="true" IsCentered="true" Size="Size.Medium" Title="@_title">
- <BodyTemplate>
- <ValidateForm Model="_currentGatherCategory">
- <div class="row g-3 form-inline">
- <div class="col-12 col-sm-12">
- <BootstrapInput TValue="string" @bind-Value="@_currentGatherCategory.Name" />
- </div>
- <div class="col-12 col-sm-12">
- @if (_changedType == ItemChangedType.Add)
- {
- <Select Items="@_organizationItems" @bind-Value="@_currentGatherCategory.OrganizationId" OnSelectedItemChanged="OnOrganizationChanged" />
- }
- else
- {
- <BootstrapInput TValue="string" @bind-Value="@_currentGatherCategory.OrganizationName" Readonly="true" />
- }
- </div>
- <div class="col-12 col-sm-12">
- <MultiSelect Items="@_gathererItems" @bind-Value="@_currentGatherCategory.GatherersValue" OnSelectedItemsChanged="OnGatherersChanged" />
- </div>
- </div>
- </ValidateForm>
- </BodyTemplate>
- <FooterTemplate>
- <Button Text="确定" Icon="fa fa-check" OnClick="@OnConfirmAsync" />
- </FooterTemplate>
- </ModalDialog>
- </Modal>
- <MessageBase @ref="_messageBaseRef"></MessageBase>
|