调整UI布局,消息模版新增语言字段
This commit is contained in:
@@ -1,149 +1,165 @@
|
||||
@page "/admin/list"
|
||||
@page "/{locale}/admin/list"
|
||||
@inject ILogger<AdminList> Logger
|
||||
@attribute [Authorize]
|
||||
|
||||
|
||||
<PageTitle>管理员账号管理</PageTitle>
|
||||
<PageContainer Title="管理员帐号">
|
||||
<Breadcrumb>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
|
||||
<BreadcrumbItem>版本管理</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
</Breadcrumb>
|
||||
<ChildContent>
|
||||
<Card Class="">
|
||||
<Form @ref="searchForm" Model="search" Layout="FormLayout.Inline" Class="search-form" OnFinish="OnSearchFinish">
|
||||
<Row Justify="RowJustify.Start" Gutter="16">
|
||||
<Col>
|
||||
<FormItem Label="帐号">
|
||||
<Input @bind-Value="search.Username" Placeholder="帐号" AllowClear />
|
||||
</FormItem>
|
||||
</Col>
|
||||
|
||||
<Title Level="4">管理员帐号</Title>
|
||||
<Card Class="">
|
||||
<Form @ref="searchForm" Model="search" Layout="FormLayout.Inline" Class="search-form" OnFinish="OnSearchFinish">
|
||||
<Row Justify="RowJustify.Start" Gutter="16">
|
||||
<Col>
|
||||
<FormItem Label="帐号">
|
||||
<Input @bind-Value="search.Username" Placeholder="帐号" AllowClear />
|
||||
</FormItem>
|
||||
</Col>
|
||||
<Col>
|
||||
<div class="ant-form-item" style="width:200px;display:flex;">
|
||||
<Button Type="ButtonType.Primary" HtmlType="submit">查询</Button>
|
||||
<Button Style="margin: 0 8px;" OnClick="OnSearchReset">重置</Button>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
</Card>
|
||||
<br />
|
||||
<Card Class="mt-3">
|
||||
<Table DataSource="PagingList.Items" PageSize="100" HidePagination="true" Resizable>
|
||||
<TitleTemplate>
|
||||
<Flex Justify="FlexJustify.SpaceBetween">
|
||||
帐号列表
|
||||
<div>
|
||||
<AuthorizeCheck Permission="@Permissions.Admin.Create">
|
||||
<Button Class="me-3" OnClick="OnCreateClick" Type="ButtonType.Primary">新增</Button>
|
||||
</AuthorizeCheck>
|
||||
</div>
|
||||
</Flex>
|
||||
</TitleTemplate>
|
||||
<ColumnDefinitions>
|
||||
<PropertyColumn Property="c => c.Username" Title="帐号">
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Email" Title="邮件">
|
||||
|
||||
<Col>
|
||||
<div class="ant-form-item" style="width:200px;display:flex;">
|
||||
<Button Type="ButtonType.Primary" HtmlType="submit">查询</Button>
|
||||
<Button Style="margin: 0 8px;" OnClick="OnSearchReset">重置</Button>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
</Card>
|
||||
<br />
|
||||
<Card Class="mt-3">
|
||||
<Table DataSource="PagingList.Items" PageSize="100" HidePagination="true" Resizable>
|
||||
<TitleTemplate>
|
||||
<Flex Justify="FlexJustify.SpaceBetween">
|
||||
帐号列表
|
||||
<div>
|
||||
<AuthorizeCheck Permission="@Permissions.Admin.Create">\
|
||||
<Button Class="me-3" OnClick="OnCreateClick" Type="ButtonType.Primary">新增</Button>
|
||||
</AuthorizeCheck>
|
||||
</div>
|
||||
</Flex>
|
||||
</TitleTemplate>
|
||||
<ColumnDefinitions>
|
||||
<PropertyColumn Property="c => c.Username" Title="帐号">
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Email" Title="邮件">
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Mobile" Title="手机号" />
|
||||
<PropertyColumn Property="c => c.Status" Title="状态" Width="80px" Align="ColumnAlign.Center">
|
||||
@if (context.Status == 1)
|
||||
{
|
||||
<AntDesign.Text Type="TextElementType.Success"><Icon Type="check" Theme=" IconThemeType.Outline" Width="1.3em" Height="1.3em" /></AntDesign.Text>
|
||||
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Mobile" Title="手机号" />
|
||||
<PropertyColumn Property="c => c.Status" Title="状态" Width="80px" Align="ColumnAlign.Center">
|
||||
@if (context.Status == 1)
|
||||
}
|
||||
else
|
||||
{
|
||||
<Icon Type="close" Theme="IconThemeType.Outline" Width="1.3em" Height="1.3em" />
|
||||
}
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.LastLogin" Title="最后登录" />
|
||||
<PropertyColumn Property="c => c.UpdateTime" Title="最后更新" />
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right" Width="160px">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
<Dropdown Trigger="@(new Trigger[] { Trigger.Click })">
|
||||
<Overlay>
|
||||
<Menu>
|
||||
|
||||
<MenuItem>
|
||||
<a @onclick="(e) => OnEditClick(context)"> <Icon Type="@IconType.Outline.Edit" /> 编辑</a>
|
||||
</MenuItem>
|
||||
<MenuDivider />
|
||||
<MenuItem>
|
||||
<Popconfirm Placement="@Placement.Left" Title="@("删除这条数据无法恢复,您确定要删除吗?")"
|
||||
OnConfirm="@(e=>HandleDeleteConfirmAsync(e,context.Id))"
|
||||
OkText="确定"
|
||||
CancelText="取消">
|
||||
<a> <Icon Type="@IconType.Outline.Delete" /> 删除</a>
|
||||
</Popconfirm>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</Overlay>
|
||||
<ChildContent>
|
||||
<a class="ant-dropdown-link" @onclick:preventDefault>
|
||||
<Icon Type="@IconType.Outline.Menu" />
|
||||
</a>
|
||||
</ChildContent>
|
||||
</Dropdown>
|
||||
</SpaceItem>
|
||||
</Space>
|
||||
</ActionColumn>
|
||||
</ColumnDefinitions>
|
||||
</Table>
|
||||
<br />
|
||||
<Row Justify="RowJustify.End">
|
||||
<Pagination PageIndex="pager.Index" Total="PagingList.Count" PageSize="PagingList.Size" ShowSizeChanger="false" OnChange="OnPageChanged"></Pagination>
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
<Drawer Closable="true" Width="520" Visible="drawerVisible" Title='(model.Id == 0 ? "新增帐号" : "编辑帐号")' OnClose="_ => CloseDrawer()">
|
||||
<Form LabelColSpan="5" @ref="@editform" Model="@model" OnFinish="OnFormFinish">
|
||||
<FluentValidationValidator />
|
||||
<FormItem Label="帐号名称">
|
||||
<Input @bind-Value="model.Username" For="(()=>model.Username)" Placeholder="帐号名称" />
|
||||
</FormItem>
|
||||
<FormItem Label="电子邮件">
|
||||
<Input @bind-Value="model.Email" For="(()=>model.Email)" Placeholder="电子邮件" />
|
||||
</FormItem>
|
||||
<FormItem Label="手机号码">
|
||||
<Input @bind-Value="model.Mobile" For="(()=>model.Mobile)" Placeholder="手机号码" />
|
||||
</FormItem>
|
||||
@if (context.Id > 0)
|
||||
{
|
||||
<AntDesign.Text Type="TextElementType.Success"><Icon Type="check" Theme=" IconThemeType.Outline" Width="1.3em" Height="1.3em" /></AntDesign.Text>
|
||||
|
||||
<FormItem Label="密码设置">
|
||||
<Checkbox @bind-Value="@context.SetPassword" Disabled=false>
|
||||
重置密码
|
||||
</Checkbox>
|
||||
</FormItem>
|
||||
}
|
||||
else
|
||||
@if (context.Id == 0)
|
||||
{
|
||||
<Icon Type="close" Theme="IconThemeType.Outline" Width="1.3em" Height="1.3em" />
|
||||
<FormItem Label="登录密码">
|
||||
<Input @bind-Value="@context.Password" Placeholder="登录密码" />
|
||||
</FormItem>
|
||||
}
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.LastLogin" Title="最后登录" Width="120px" />
|
||||
<PropertyColumn Property="c => c.UpdateTime" Title="最后更新" />
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right" Width="160px">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
<Dropdown Trigger="@(new Trigger[] { Trigger.Click })">
|
||||
<Overlay>
|
||||
<Menu>
|
||||
@if ((context.Id > 0 && context.SetPassword) || context.Id == 0)
|
||||
{
|
||||
|
||||
<MenuItem>
|
||||
<a @onclick="(e) => OnEditClick(context)"> <Icon Type="@IconType.Outline.Edit" /> 编辑</a>
|
||||
</MenuItem>
|
||||
<MenuDivider />
|
||||
<MenuItem>
|
||||
<Popconfirm Placement="@Placement.Left" Title="@("删除这条数据无法恢复,您确定要删除吗?")"
|
||||
OnConfirm="@(e=>HandleDeleteConfirmAsync(e,context.Id))"
|
||||
OkText="确定"
|
||||
CancelText="取消">
|
||||
<a> <Icon Type="@IconType.Outline.Delete" /> 删除</a>
|
||||
</Popconfirm>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</Overlay>
|
||||
<ChildContent>
|
||||
<a class="ant-dropdown-link" @onclick:preventDefault>
|
||||
<Icon Type="@IconType.Outline.Menu" />
|
||||
</a>
|
||||
</ChildContent>
|
||||
</Dropdown>
|
||||
</SpaceItem>
|
||||
</Space>
|
||||
</ActionColumn>
|
||||
</ColumnDefinitions>
|
||||
</Table>
|
||||
</Card>
|
||||
<FormItem Label="新密码">
|
||||
<Input @bind-Value="@context.NewPassword" Placeholder="新登录密码" />
|
||||
</FormItem>
|
||||
}
|
||||
@if ((context.Id > 0 && context.SetPassword) || context.Id == 0)
|
||||
{
|
||||
|
||||
<Drawer Closable="true" Width="520" Visible="drawerVisible" Title='(model.Id == 0 ? "新增帐号" : "编辑帐号")' OnClose="_ => CloseDrawer()">
|
||||
<Form LabelColSpan="5" @ref="@editform" Model="@model" OnFinish="OnFormFinish">
|
||||
<FluentValidationValidator />
|
||||
<FormItem Label="帐号名称">
|
||||
<Input @bind-Value="model.Username" For="(()=>model.Username)" Placeholder="帐号名称" />
|
||||
</FormItem>
|
||||
<FormItem Label="电子邮件">
|
||||
<Input @bind-Value="model.Email" For="(()=>model.Email)" Placeholder="电子邮件" />
|
||||
</FormItem>
|
||||
<FormItem Label="手机号码">
|
||||
<Input @bind-Value="model.Mobile" For="(()=>model.Mobile)" Placeholder="手机号码" />
|
||||
</FormItem>
|
||||
@if (context.Id > 0)
|
||||
{
|
||||
<FormItem Label="密码设置">
|
||||
<Checkbox @bind-Value="@context.SetPassword" Disabled=false>
|
||||
重置密码
|
||||
</Checkbox>
|
||||
</FormItem>
|
||||
}
|
||||
@if (context.Id == 0)
|
||||
{
|
||||
<FormItem Label="登录密码">
|
||||
<Input @bind-Value="@context.Password" Placeholder="登录密码" />
|
||||
</FormItem>
|
||||
}
|
||||
@if ((context.Id > 0 && context.SetPassword) || context.Id == 0)
|
||||
{
|
||||
|
||||
<FormItem Label="新密码">
|
||||
<Input @bind-Value="@context.NewPassword" Placeholder="新登录密码" />
|
||||
</FormItem>
|
||||
}
|
||||
@if ((context.Id > 0 && context.SetPassword) || context.Id == 0)
|
||||
{
|
||||
|
||||
<FormItem Label="确认密码">
|
||||
<Input @bind-Value="@context.RePassword" Placeholder="确认密码" />
|
||||
</FormItem>
|
||||
}
|
||||
<FormItem Label="可用状态">
|
||||
<RadioGroup @bind-Value="@context.Status">
|
||||
<Radio RadioButton Value=0>禁用</Radio>
|
||||
<Radio RadioButton Value=1>启用</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem WrapperColOffset="4">
|
||||
<Button Type="ButtonType.Primary" HtmlType="submit" Style="width: 100%;">保存</Button>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Drawer>
|
||||
<FormItem Label="确认密码">
|
||||
<Input @bind-Value="@context.RePassword" Placeholder="确认密码" />
|
||||
</FormItem>
|
||||
}
|
||||
<FormItem Label="可用状态">
|
||||
<RadioGroup @bind-Value="@context.Status">
|
||||
<Radio RadioButton Value=0>禁用</Radio>
|
||||
<Radio RadioButton Value=1>启用</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem WrapperColOffset="4">
|
||||
<Button Type="ButtonType.Primary" HtmlType="submit" Style="width: 100%;">保存</Button>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Drawer>
|
||||
</ChildContent>
|
||||
</PageContainer>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public string Locale { get; set; } = string.Empty;
|
||||
|
||||
[SupplyParameterFromQuery]
|
||||
int? Page { get; set; }
|
||||
|
||||
@@ -276,6 +292,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPageChanged(PaginationEventArgs args)
|
||||
{
|
||||
OnSearch(args.Page);
|
||||
}
|
||||
|
||||
void OnCreateClick()
|
||||
{
|
||||
model = new();
|
||||
@@ -325,7 +346,7 @@
|
||||
{
|
||||
|
||||
CloseDrawer();
|
||||
_= LoadList();
|
||||
_ = LoadList();
|
||||
await ModalService.InfoAsync(new ConfirmOptions() { Title = "提示", Content = "数据提交成功!" });
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user