调整UI布局,消息模版新增语言字段

This commit is contained in:
yxw
2025-12-15 18:28:17 +08:00
parent 9b8bf43eb6
commit 98e3f7ab73
11 changed files with 510 additions and 328 deletions

View File

@@ -47,6 +47,9 @@
<ChildContent>
@Body
</ChildContent>
<FooterRender>
<FooterView Copyright="2025 Atomlust.com"></FooterView>
</FooterRender>
</AntDesign.ProLayout.BasicLayout>
</ChildContent>
<ErrorContent Context="ex">

View File

@@ -1,7 +1,9 @@
@page "/"
@page "/{locale}/"
@attribute [Authorize]
<PageContainer Title="控制台首页">
<PageTitle>Home</PageTitle>
<h1>Hello, world!</h1>
@@ -22,3 +24,9 @@ Welcome to your new app.
<li>
<a href="/system/role/list">角色管理</a>
</li>
</PageContainer>
@code {
[Parameter]
public string Locale { get; set; } = string.Empty;
}

View File

@@ -1,9 +1,25 @@
@page "/system/app/version/list"
@page "/{locale}/system/app/version/list"
@inject ILogger<AppVersionList> Logger
@attribute [Authorize]
<div>
<PageContainer Title="App版本管理">
<Breadcrumb>
<Breadcrumb>
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
<BreadcrumbItem Href="/settings">系统配置</BreadcrumbItem>
<BreadcrumbItem>版本管理</BreadcrumbItem>
</Breadcrumb>
</Breadcrumb>
<ChildContent>
<h3>App Version List</h3>
</ChildContent>
</PageContainer>
</div>
@code {
[Parameter]
public string Locale { get; set; } = string.Empty;
}

View File

@@ -1,11 +1,18 @@
@page "/admin/list"
@page "/{locale}/admin/list"
@inject ILogger<AdminList> Logger
@attribute [Authorize]
<PageTitle>管理员账号管理</PageTitle>
<Title Level="4">管理员帐号</Title>
<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">
@@ -31,7 +38,7 @@
<Flex Justify="FlexJustify.SpaceBetween">
帐号列表
<div>
<AuthorizeCheck Permission="@Permissions.Admin.Create">\
<AuthorizeCheck Permission="@Permissions.Admin.Create">
<Button Class="me-3" OnClick="OnCreateClick" Type="ButtonType.Primary">新增</Button>
</AuthorizeCheck>
</div>
@@ -55,7 +62,7 @@
<Icon Type="close" Theme="IconThemeType.Outline" Width="1.3em" Height="1.3em" />
}
</PropertyColumn>
<PropertyColumn Property="c => c.LastLogin" Title="最后登录" Width="120px" />
<PropertyColumn Property="c => c.LastLogin" Title="最后登录" />
<PropertyColumn Property="c => c.UpdateTime" Title="最后更新" />
<ActionColumn Title="操作" Align="ColumnAlign.Right" Width="160px">
<Space>
@@ -89,6 +96,10 @@
</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()">
@@ -142,8 +153,13 @@
</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();

View File

@@ -0,0 +1,8 @@
@page "/system/info"
@page "/{locale}/system/info"
<h3>Info</h3>
@code {
[Parameter]
public string Locale { get; set; } = string.Empty;
}

View File

@@ -1,10 +1,18 @@
@page "/system/role/permission/{RoleId:long}"
@page "/{locale}/system/role/permission/{RoleId:long}"
@attribute [Authorize]
@inject ILogger<RoleList> Logger
<PageTitle>权限设置</PageTitle>
<PageContainer Title="权限角色设置">
<Breadcrumb>
<Breadcrumb>
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
<BreadcrumbItem>权限编辑</BreadcrumbItem>
</Breadcrumb>
</Breadcrumb>
<ChildContent>
<Spin Spinning="loading">
<Title Level="4">编辑角色权限</Title>
<Card>
<Form @ref="editForm" Model="model" LabelColSpan="2" WrapperColSpan="22" Class="search-form" OnFinish="OnFormFinishAsync">
<FormItem Label="角色">
@@ -84,7 +92,12 @@
</Card>
</Spin>
</ChildContent>
</PageContainer>
@code {
[Parameter]
public string Locale { get; set; } = string.Empty;
[Parameter]
public long RoleId { get; set; }

View File

@@ -1,11 +1,17 @@
@page "/system/role/list"
@page "/{locale}/system/role/list"
@attribute [Authorize]
@inject ILogger<RoleList> Logger
<PageTitle>角色管理</PageTitle>
<Title Level="4">角色管理</Title>
<PageContainer Title="角色管理">
<Breadcrumb>
<Breadcrumb>
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
<BreadcrumbItem>角色管理</BreadcrumbItem>
</Breadcrumb>
</Breadcrumb>
<ChildContent>
<Card Class="mt-3">
<Table DataSource="PagingList.Items" PageSize="100" HidePagination="true" Resizable>
<TitleTemplate>
@@ -105,8 +111,13 @@
</FormItem>
</Form>
</Drawer>
</ChildContent>
</PageContainer>
@code {
[Parameter]
public string Locale { get; set; } = string.Empty;
[SupplyParameterFromQuery]
int? Page { get; set; }

View File

@@ -0,0 +1,9 @@
@page "/system/tools"
@page "/{locale}/system/tools"
<h3>Tools</h3>
@code {
[Parameter]
public string Locale { get; set; } = string.Empty;
}

View File

@@ -7,6 +7,7 @@ using Atomx.Data;
using Atomx.Data.Services;
using Atomx.Utils.Extension;
using MapsterMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
@@ -14,6 +15,7 @@ namespace Atomx.Admin.Controllers
{
[Route("api/[controller]")]
[ApiController]
[Authorize]
public class AppVersionController : ControllerBase
{
readonly ILogger<AppVersionController> _logger;

View File

@@ -75,3 +75,89 @@ h1:focus {
.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
text-align: start;
}
html,
body,
#root,
#app,
app {
height: 100%;
}
.colorWeak {
filter: invert(80%);
}
.ant-layout {
min-height: 100vh;
}
canvas {
display: block;
}
body {
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
ul,
ol {
list-style: none;
}
.action {
cursor: pointer;
}
.ant-page-header {
background: #f0f2f5;
padding: 12px 24px 12px;
}
.ant-breadcrumb + .ant-page-header-heading {
padding: 0px;
margin: 0px;
}
.ant-pro-page-container-children-content {
margin: 0 24px 0;
}
.ant-page-header-heading-extra {
margin: 0px;
}
.ant-page-header-content {
padding: 0px;
}
@media (max-width: 480px) {
.ant-table {
width: 100%;
overflow-x: auto;
}
.ant-table-thead > tr > th,
.ant-table-tbody > tr > th,
.ant-table-thead > tr > td,
.ant-table-tbody > tr > td {
white-space: pre;
}
.ant-table-thead > tr > th > span,
.ant-table-tbody > tr > th > span,
.ant-table-thead > tr > td > span,
.ant-table-tbody > tr > td > span {
display: block;
}
}
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
body .ant-design-pro > .ant-layout {
min-height: 100vh;
}
}

View File

@@ -16,6 +16,11 @@ namespace Atomx.Common.Entities
[Key]
public long Id { get; set; }
/// <summary>
/// 语言编码
/// </summary>
public int LanguageId { get; set; }
/// <summary>
/// 消息模板类型
/// </summary>