调整数据库结构,实现消息模板管理
This commit is contained in:
@@ -24,6 +24,9 @@
|
||||
<li>
|
||||
<a href="/system/role/list">角色管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/currency/list">货币设置</a>
|
||||
</li>
|
||||
</PageContainer>
|
||||
|
||||
@code {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<h3>CountryEdit</h3>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<h3>CountryList</h3>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
@page "/currency/list"
|
||||
@page "/{locale}/currency/list"
|
||||
@inject ILogger<CurrencyList> Logger
|
||||
@attribute [Authorize]
|
||||
|
||||
<PageContainer Title="货币管理">
|
||||
<Breadcrumb>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
|
||||
<BreadcrumbItem>货币管理</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
</Breadcrumb>
|
||||
<ChildContent>
|
||||
<h3>Tools</h3>
|
||||
</ChildContent>
|
||||
</PageContainer>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public string Locale { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -1,144 +1,162 @@
|
||||
@page "/setting/messagetemplate/list"
|
||||
|
||||
@page "/{locale}/setting/messagetemplate/list"
|
||||
@inject ILogger<MessageTemplateList> Logger
|
||||
@attribute [Authorize]
|
||||
|
||||
<PageTitle>消息模板</PageTitle>
|
||||
<Title Level="4">消息模版管理</Title>
|
||||
<Card>
|
||||
<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.Key" 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>
|
||||
<PageContainer Title="消息模板">
|
||||
<Breadcrumb>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
|
||||
<BreadcrumbItem>系统设置</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
</Breadcrumb>
|
||||
<ChildContent>
|
||||
<Card>
|
||||
<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.Key" 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>
|
||||
<Button Class="me-3" OnClick="OnCreateClick" Type="ButtonType.Primary">新增</Button>
|
||||
</div>
|
||||
</Flex>
|
||||
</TitleTemplate>
|
||||
<ColumnDefinitions>
|
||||
<PropertyColumn Property="c => c.Type" Title="模版类型" Width="150px">
|
||||
@if (context.Type == (int)MessageTemplateType.Message)
|
||||
{
|
||||
<AntDesign.Text>站内信</AntDesign.Text>
|
||||
}
|
||||
else if (context.Type == (int)MessageTemplateType.Email)
|
||||
{
|
||||
<AntDesign.Text>邮件</AntDesign.Text>
|
||||
}
|
||||
else if (context.Type == (int)MessageTemplateType.Sms)
|
||||
{
|
||||
<AntDesign.Text>短信</AntDesign.Text>
|
||||
}
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Name" Title="模版名称" />
|
||||
<PropertyColumn Property="c => c.LanguageId" Title="语言">
|
||||
@GetLanuageName(context.LanguageId)
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Key" Title="模版Code" Width="100px" />
|
||||
<PropertyColumn Property="c => c.Title" Title="模版标题" />
|
||||
<PropertyColumn Property="c => c.Enabled" Title="状态" Width="80px" Align="ColumnAlign.Center">
|
||||
@if (context.Enabled)
|
||||
{
|
||||
<AntDesign.Text Type="TextElementType.Success"><Icon Type="check" Theme=" IconThemeType.Outline" Width="1.3em" Height="1.3em" /></AntDesign.Text>
|
||||
|
||||
<Card Class="mt-3">
|
||||
<Table DataSource="PagingList.Items" PageSize="100" HidePagination="true" Resizable>
|
||||
<TitleTemplate>
|
||||
<Flex Justify="FlexJustify.SpaceBetween">
|
||||
菜单列表
|
||||
<div>
|
||||
<Button Class="me-3" OnClick="OnCreateClick" Type="ButtonType.Primary">新增</Button>
|
||||
</div>
|
||||
</Flex>
|
||||
</TitleTemplate>
|
||||
<ColumnDefinitions>
|
||||
<PropertyColumn Property="c => c.Type" Title="模版类型" Width="150px">
|
||||
@if (context.Type == (int)MessageTemplateType.Message)
|
||||
{
|
||||
<AntDesign.Text>站内信</AntDesign.Text>
|
||||
}
|
||||
else if (context.Type == (int)MessageTemplateType.Email)
|
||||
{
|
||||
<AntDesign.Text>邮件</AntDesign.Text>
|
||||
}
|
||||
else if (context.Type == (int)MessageTemplateType.Sms)
|
||||
{
|
||||
<AntDesign.Text>短信</AntDesign.Text>
|
||||
}
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Name" Title="模版名称" />
|
||||
<PropertyColumn Property="c => c.Key" Title="模版Code" Width="100px" />
|
||||
<PropertyColumn Property="c => c.Title" Title="模版标题" />
|
||||
<PropertyColumn Property="c => c.Enabled" Title="状态" Width="80px" Align="ColumnAlign.Center">
|
||||
@if (context.Enabled)
|
||||
{
|
||||
<AntDesign.Text Type="TextElementType.Success"><Icon Type="check" Theme=" IconThemeType.Outline" Width="1.3em" Height="1.3em" /></AntDesign.Text>
|
||||
}
|
||||
else
|
||||
{
|
||||
<Icon Type="close" Theme="IconThemeType.Outline" Width="1.3em" Height="1.3em" />
|
||||
}
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.CreateTime" Title="时间" Width="190px" />
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right" Width="160px">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
<Dropdown Trigger="@(new Trigger[] { Trigger.Click })">
|
||||
<Overlay>
|
||||
<Menu>
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
<Icon Type="close" Theme="IconThemeType.Outline" Width="1.3em" Height="1.3em" />
|
||||
}
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.CreateTime" Title="时间" Width="190px" />
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right" Width="160px">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
<Dropdown Trigger="@(new Trigger[] { Trigger.Click })">
|
||||
<Overlay>
|
||||
<Menu>
|
||||
|
||||
<MenuItem>
|
||||
<a @onclick="(e) => HandleEdit(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>
|
||||
<Row Justify="RowJustify.End">
|
||||
<Pagination PageIndex="PagingList.Index" Total="PagingList.Count" PageSize="PagingList.Size" ShowSizeChanger="false" OnChange="OnPageChanged"></Pagination>
|
||||
</Row>
|
||||
</Card>
|
||||
<MenuItem>
|
||||
<a @onclick="(e) => HandleEdit(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="PagingList.Index" Total="PagingList.Count" PageSize="PagingList.Size" ShowSizeChanger="false" OnChange="OnPageChanged"></Pagination>
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
|
||||
|
||||
<Modal Title="@("消息模版设置")" Visible="@modalVisible" Width="700" MaskClosable="true" OkText="@("保存")" CancelText="@("取消")" OnOk="@HandleModalOk" OnCancel="@HandleCancel">
|
||||
<Form Model="@template" @ref="@editForm" LabelCol="new ColLayoutParam { Span = 5 }" WrapperCol="new ColLayoutParam { Span = 15 }" Name="modalForm" OnFinish="OnFormFinish">
|
||||
<FluentValidationValidator />
|
||||
<FormItem Label="消息模版类型">
|
||||
<SimpleSelect DefaultValue="" Style="width:120px;" @bind-Value="@context.Type">
|
||||
<SelectOptions>
|
||||
<SimpleSelectOption Value="" Label="请选择消息模版类型"></SimpleSelectOption>
|
||||
<SimpleSelectOption Value="@(((int)MessageTemplateType.Message).ToString())" Label="站内信"></SimpleSelectOption>
|
||||
<SimpleSelectOption Value="@(((int)MessageTemplateType.Email).ToString())" Label="邮件模版"></SimpleSelectOption>
|
||||
<SimpleSelectOption Value="@(((int)MessageTemplateType.Sms).ToString())" Label="短信模版"></SimpleSelectOption>
|
||||
</SelectOptions>
|
||||
</SimpleSelect>
|
||||
</FormItem>
|
||||
<FormItem Label="消息模版名称">
|
||||
<Input Placeholder="消息模版名称" @bind-Value="@context.Name" />
|
||||
</FormItem>
|
||||
|
||||
<FormItem Label="模版Code">
|
||||
<Input Placeholder="模版Code" @bind-Value="@context.Key" Disabled="@(context.Id > 0)" />
|
||||
</FormItem>
|
||||
<FormItem Label="消息标题">
|
||||
<Input Placeholder="消息标题" @bind-Value="@context.Title" />
|
||||
</FormItem>
|
||||
<FormItem Label="消息内容">
|
||||
<TextArea Placeholder="消息内容" @bind-Value="@context.Body" />
|
||||
</FormItem>
|
||||
<FormItem Label="状态">
|
||||
<Checkbox @bind-Value="@context.Enabled" Disabled=false>
|
||||
启用
|
||||
</Checkbox>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Modal>
|
||||
|
||||
<Modal Title="@("消息模版设置")" Visible="@modalVisible" Width="700" MaskClosable="true" OkText="@("保存")" CancelText="@("取消")" OnOk="@HandleModalOk" OnCancel="@HandleCancel">
|
||||
<Form Model="@model" @ref="@editForm" LabelCol="new ColLayoutParam { Span = 5 }" WrapperCol="new ColLayoutParam { Span = 15 }" Name="modalForm" OnFinish="OnFormFinish">
|
||||
<FluentValidationValidator />
|
||||
<FormItem Label="消息模版类型">
|
||||
<SimpleSelect DefaultValue="" Style="width:120px;" @bind-Value="@context.Type">
|
||||
<SelectOptions>
|
||||
<SimpleSelectOption Value="" Label="请选择消息模版类型"></SimpleSelectOption>
|
||||
<SimpleSelectOption Value="@(((int)MessageTemplateType.Message).ToString())" Label="站内信"></SimpleSelectOption>
|
||||
<SimpleSelectOption Value="@(((int)MessageTemplateType.Email).ToString())" Label="邮件模版"></SimpleSelectOption>
|
||||
<SimpleSelectOption Value="@(((int)MessageTemplateType.Sms).ToString())" Label="短信模版"></SimpleSelectOption>
|
||||
</SelectOptions>
|
||||
</SimpleSelect>
|
||||
</FormItem>
|
||||
<FormItem Label="消息模版名称">
|
||||
<Input Placeholder="消息模版名称" @bind-Value="@context.Name" />
|
||||
</FormItem>
|
||||
<FormItem Label="语言">
|
||||
<Select DataSource="@languages" @bind-Value="@context.LanguageId" ItemValue="p => p.Id" ItemLabel="p => p.Title" Disabled="@(context.Id > 0)">
|
||||
</Select>
|
||||
</FormItem>
|
||||
<FormItem Label="模版Code">
|
||||
<Input Placeholder="模版Code" @bind-Value="@context.Key" Disabled="@(context.Id > 0)" />
|
||||
</FormItem>
|
||||
<FormItem Label="消息标题">
|
||||
<Input Placeholder="消息标题" @bind-Value="@context.Title" />
|
||||
</FormItem>
|
||||
<FormItem Label="消息内容">
|
||||
<TextArea Placeholder="消息内容" @bind-Value="@context.Body" />
|
||||
</FormItem>
|
||||
<FormItem Label="状态">
|
||||
<Checkbox @bind-Value="@context.Enabled" Disabled=false>
|
||||
启用
|
||||
</Checkbox>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Modal>
|
||||
</ChildContent>
|
||||
</PageContainer>
|
||||
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public string Locale { get; set; } = string.Empty;
|
||||
|
||||
[SupplyParameterFromQuery]
|
||||
int? Page { get; set; }
|
||||
|
||||
@@ -147,10 +165,10 @@
|
||||
Form<MessageTemplateSearch> searchForm = null!;
|
||||
|
||||
[SupplyParameterFromForm]
|
||||
MessageTemplateModel template { get; set; } = new();
|
||||
MessageTemplateModel model { get; set; } = new();
|
||||
Form<MessageTemplateModel> editForm = null!;
|
||||
|
||||
|
||||
List<Language> languages = new();
|
||||
PagingList<MessageTemplate> PagingList = new();
|
||||
bool loading { get; set; } = true;
|
||||
bool searchExpand { get; set; } = false;
|
||||
@@ -166,7 +184,7 @@
|
||||
{
|
||||
loadQueryString();
|
||||
LoadList();
|
||||
|
||||
_ = LoadLanguages();
|
||||
base.OnParametersSet();
|
||||
}
|
||||
|
||||
@@ -177,6 +195,20 @@
|
||||
search.Key = query.GetQueryString("Key");
|
||||
}
|
||||
|
||||
private async Task LoadLanguages()
|
||||
{
|
||||
var url = $"/api/language/enabled";
|
||||
var apiResult = await HttpService.Get<ApiResult<List<Language>>>(url);
|
||||
if (apiResult.Success)
|
||||
{
|
||||
if (apiResult.Data != null)
|
||||
{
|
||||
languages = apiResult.Data;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async void LoadList()
|
||||
{
|
||||
|
||||
@@ -265,13 +297,13 @@
|
||||
|
||||
void OnCreateClick()
|
||||
{
|
||||
template = new();
|
||||
model = new();
|
||||
modalVisible = true;
|
||||
}
|
||||
|
||||
void HandleEdit(MessageTemplate model)
|
||||
void HandleEdit(MessageTemplate data)
|
||||
{
|
||||
template = model.Adapt<MessageTemplateModel>();
|
||||
model = data.Adapt<MessageTemplateModel>();
|
||||
modalVisible = true;
|
||||
}
|
||||
|
||||
@@ -285,18 +317,8 @@
|
||||
if (editForm.Validate())
|
||||
{
|
||||
var result = new ApiResult<string>();
|
||||
var data = template.Adapt<MessageTemplate>();
|
||||
|
||||
if (template.Id > 0)
|
||||
{
|
||||
var url = $"api/messagetemplate/edit";
|
||||
result = await HttpService.Post<ApiResult<string>>(url, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
var url = $"api/messagetemplate/add";
|
||||
result = await HttpService.Post<ApiResult<string>>(url, data);
|
||||
}
|
||||
var url = $"api/messagetemplate/save";
|
||||
result = await HttpService.Post<ApiResult<string>>(url, model);
|
||||
|
||||
if (result.Code == (int)ResultCode.Success)
|
||||
{
|
||||
@@ -314,4 +336,14 @@
|
||||
{
|
||||
modalVisible = false;
|
||||
}
|
||||
|
||||
string GetLanuageName(int languageId)
|
||||
{
|
||||
var language = languages.FirstOrDefault(l => l.Id == languageId);
|
||||
if (language != null)
|
||||
{
|
||||
return language.Title;
|
||||
}
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,22 @@
|
||||
@page "/settings"
|
||||
@page "/{locale}/settings"
|
||||
@attribute [Authorize]
|
||||
@inject ILogger<Settings> Logger
|
||||
|
||||
@code {
|
||||
<PageContainer Title="系统设置">
|
||||
<Breadcrumb>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
|
||||
<BreadcrumbItem>系统设置</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
</Breadcrumb>
|
||||
<ChildContent>
|
||||
<h3>Tools</h3>
|
||||
</ChildContent>
|
||||
</PageContainer>
|
||||
|
||||
}
|
||||
@code {
|
||||
[Parameter]
|
||||
public string Locale { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -3,20 +3,19 @@
|
||||
|
||||
@inject ILogger<AppVersionList> Logger
|
||||
@attribute [Authorize]
|
||||
<div>
|
||||
<PageContainer Title="App版本管理">
|
||||
|
||||
<PageContainer Title="App版本管理">
|
||||
<Breadcrumb>
|
||||
<Breadcrumb>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="/settings">系统配置</BreadcrumbItem>
|
||||
<BreadcrumbItem>版本管理</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="/settings">系统配置</BreadcrumbItem>
|
||||
<BreadcrumbItem>版本管理</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
<ChildContent>
|
||||
<h3>App Version List</h3>
|
||||
</ChildContent>
|
||||
</PageContainer>
|
||||
</div>
|
||||
</Breadcrumb>
|
||||
<ChildContent>
|
||||
<h3>App Version List</h3>
|
||||
</ChildContent>
|
||||
</PageContainer>
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
@@ -1,7 +1,22 @@
|
||||
@page "/system/app/list"
|
||||
@page "/{locale}/system/app/list"
|
||||
@inject ILogger<SiteAppList> Logger
|
||||
@attribute [Authorize]
|
||||
|
||||
@code {
|
||||
<PageContainer Title="系统工具">
|
||||
<Breadcrumb>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
|
||||
<BreadcrumbItem>系统工具</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
</Breadcrumb>
|
||||
<ChildContent>
|
||||
<h3>Tools</h3>
|
||||
</ChildContent>
|
||||
</PageContainer>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public string Locale { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
@@ -1,103 +1,113 @@
|
||||
@page "/system/file/list"
|
||||
@page "/{locale}/system/file/list"
|
||||
@inject ILogger<UploadList> Logger
|
||||
@attribute [Authorize]
|
||||
|
||||
<PageTitle>上传文件</PageTitle>
|
||||
<Title Level="4">上传文件</Title>
|
||||
<Card>
|
||||
<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.Name" Placeholder="文件名" AllowClear />
|
||||
</FormItem>
|
||||
</Col>
|
||||
<PageContainer Title="上传文件">
|
||||
<Breadcrumb>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
|
||||
<BreadcrumbItem>上传文件</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
</Breadcrumb>
|
||||
<ChildContent>
|
||||
<Card>
|
||||
<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.Name" 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>
|
||||
<Card Class="mt-3">
|
||||
<Table DataSource="PagingList.Items" PageSize="100" HidePagination="true" Resizable>
|
||||
<TitleTemplate>
|
||||
<Flex Justify="FlexJustify.SpaceBetween">
|
||||
文件列表
|
||||
<div>
|
||||
<Button Class="me-3" OnClick="OnCreateClick" Type="ButtonType.Primary">上传新文件</Button>
|
||||
</div>
|
||||
</Flex>
|
||||
</TitleTemplate>
|
||||
<ColumnDefinitions>
|
||||
<PropertyColumn Property="c => c.Name" Title="文件">
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.ContentType" Title="类型" Width="80px" Align="ColumnAlign.Center">
|
||||
<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>
|
||||
<Card Class="mt-3">
|
||||
<Table DataSource="PagingList.Items" PageSize="100" HidePagination="true" Resizable>
|
||||
<TitleTemplate>
|
||||
<Flex Justify="FlexJustify.SpaceBetween">
|
||||
文件列表
|
||||
<div>
|
||||
<Button Class="me-3" OnClick="OnCreateClick" Type="ButtonType.Primary">上传新文件</Button>
|
||||
</div>
|
||||
</Flex>
|
||||
</TitleTemplate>
|
||||
<ColumnDefinitions>
|
||||
<PropertyColumn Property="c => c.Name" Title="文件">
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.ContentType" Title="类型" Width="80px" Align="ColumnAlign.Center">
|
||||
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Size" Title="文件大小" Width="100px" />
|
||||
<PropertyColumn Property="c => c.Type" Title="状态" Width="80px" Align="ColumnAlign.Center">
|
||||
@if (context.Type == 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.Size" Title="文件大小" Width="100px" />
|
||||
<PropertyColumn Property="c => c.Type" Title="状态" Width="80px" Align="ColumnAlign.Center">
|
||||
@if (context.Type == 1)
|
||||
{
|
||||
<AntDesign.Text Type="TextElementType.Success"><Icon Type="check" Theme=" IconThemeType.Outline" Width="1.3em" Height="1.3em" /></AntDesign.Text>
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
<Icon Type="close" Theme="IconThemeType.Outline" Width="1.3em" Height="1.3em" />
|
||||
}
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.CreateTime" Title="最后登录" Width="190px" />
|
||||
<PropertyColumn Property="c => c.UpdateTime" Title="最后更新" Width="190px" />
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right" Width="160px">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
<Dropdown Trigger="@(new Trigger[] { Trigger.Click })">
|
||||
<Overlay>
|
||||
<Menu>
|
||||
}
|
||||
else
|
||||
{
|
||||
<Icon Type="close" Theme="IconThemeType.Outline" Width="1.3em" Height="1.3em" />
|
||||
}
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.CreateTime" Title="最后登录" Width="190px" />
|
||||
<PropertyColumn Property="c => c.UpdateTime" Title="最后更新" Width="190px" />
|
||||
<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>
|
||||
</Card>
|
||||
<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>
|
||||
|
||||
<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.Name" For="(()=>model.Name)" Placeholder="帐号名称" />
|
||||
</FormItem>
|
||||
<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.Name" For="(()=>model.Name)" Placeholder="帐号名称" />
|
||||
</FormItem>
|
||||
|
||||
<FormItem WrapperColOffset="4">
|
||||
<Button Type="ButtonType.Primary" HtmlType="submit" Style="width: 100%;">保存</Button>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Drawer>
|
||||
<FormItem WrapperColOffset="4">
|
||||
<Button Type="ButtonType.Primary" HtmlType="submit" Style="width: 100%;">保存</Button>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Drawer>
|
||||
</ChildContent>
|
||||
</PageContainer>
|
||||
|
||||
@code {
|
||||
[SupplyParameterFromQuery]
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
@page "/system/currency/list"
|
||||
@inject ILogger<CurrencyList> Logger
|
||||
@attribute [Authorize]
|
||||
|
||||
<h3>CurrencyList</h3>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
@@ -1,6 +1,17 @@
|
||||
@page "/system/info"
|
||||
@page "/{locale}/system/info"
|
||||
<h3>Info</h3>
|
||||
<PageContainer Title="系统信息">
|
||||
<Breadcrumb>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
|
||||
<BreadcrumbItem>系统信息</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
</Breadcrumb>
|
||||
<ChildContent>
|
||||
<h3>Tools</h3>
|
||||
</ChildContent>
|
||||
</PageContainer>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
|
||||
@@ -1,110 +1,121 @@
|
||||
@page "/system/language/list"
|
||||
@page "/{locale}/system/language/list"
|
||||
@inject ILogger<LanguageList> Logger
|
||||
@attribute [Authorize]
|
||||
|
||||
<PageTitle>语言管理</PageTitle>
|
||||
<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>
|
||||
<Flex Justify="FlexJustify.SpaceBetween">
|
||||
多语言列表
|
||||
<div>
|
||||
<Button Class="me-3" OnClick="OnCreateClick" Type="ButtonType.Primary">新增</Button>
|
||||
</div>
|
||||
</Flex>
|
||||
</TitleTemplate>
|
||||
<ColumnDefinitions>
|
||||
<PropertyColumn Property="c => c.Name" Title="语言名称">
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Title" Title="语言标题">
|
||||
|
||||
<Title Level="4">多语言</Title>
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Culture" Title="语言文化" Width="100px" />
|
||||
<PropertyColumn Property="c => c.Enabled" Title="状态" Width="80px" Align="ColumnAlign.Center">
|
||||
@if (context.Enabled)
|
||||
{
|
||||
<AntDesign.Text Type="TextElementType.Success"><Icon Type="check" Theme=" IconThemeType.Outline" Width="1.3em" Height="1.3em" /></AntDesign.Text>
|
||||
|
||||
<Card Class="mt-3">
|
||||
<Table DataSource="PagingList.Items" PageSize="100" HidePagination="true" Resizable>
|
||||
<TitleTemplate>
|
||||
<Flex Justify="FlexJustify.SpaceBetween">
|
||||
多语言列表
|
||||
<div>
|
||||
<Button Class="me-3" OnClick="OnCreateClick" Type="ButtonType.Primary">新增</Button>
|
||||
</div>
|
||||
</Flex>
|
||||
</TitleTemplate>
|
||||
<ColumnDefinitions>
|
||||
<PropertyColumn Property="c => c.Name" Title="语言名称">
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Title" Title="语言标题">
|
||||
}
|
||||
else
|
||||
{
|
||||
<Icon Type="close" Theme="IconThemeType.Outline" Width="1.3em" Height="1.3em" />
|
||||
}
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.ResourceVersion" Title="资源版本" />
|
||||
<PropertyColumn Property="c => c.UpdateTime" Title="最后更新" />
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
<a href="@($"/system/locale/resource/list/{context.Id}")"> <Icon Type="@IconType.Outline.Edit" /> 语言资源</a>
|
||||
</SpaceItem>
|
||||
<SpaceItem>
|
||||
<Dropdown Trigger="@(new Trigger[] { Trigger.Click })">
|
||||
<Overlay>
|
||||
<Menu>
|
||||
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Culture" Title="语言文化" Width="100px" />
|
||||
<PropertyColumn Property="c => c.Enabled" Title="状态" Width="80px" Align="ColumnAlign.Center">
|
||||
@if (context.Enabled)
|
||||
{
|
||||
<AntDesign.Text Type="TextElementType.Success"><Icon Type="check" Theme=" IconThemeType.Outline" Width="1.3em" Height="1.3em" /></AntDesign.Text>
|
||||
<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>
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
<Icon Type="close" Theme="IconThemeType.Outline" Width="1.3em" Height="1.3em" />
|
||||
}
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.ResourceVersion" Title="资源版本"/>
|
||||
<PropertyColumn Property="c => c.UpdateTime" Title="最后更新" />
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
<a href="@($"/system/locale/resource/list/{context.Id}")"> <Icon Type="@IconType.Outline.Edit" /> 语言资源</a>
|
||||
</SpaceItem>
|
||||
<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>
|
||||
</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.Title" For="(()=>model.Title)" Placeholder="语言标题" />
|
||||
</FormItem>
|
||||
<FormItem Label="语言名称">
|
||||
<Input @bind-Value="model.Name" For="(()=>model.Name)" Placeholder="语言名称" />
|
||||
</FormItem>
|
||||
<FormItem Label="语言文化">
|
||||
<SimpleSelect @bind-Value="model.Culture" For="(()=>model.Culture)" Placeholder="语言文化">
|
||||
<SelectOptions>
|
||||
@foreach (var item in LanguageCultures)
|
||||
{
|
||||
<SimpleSelectOption Value="@item.Key" Label="@($"{item.Value} - {item.Key}")"></SimpleSelectOption>
|
||||
}
|
||||
</SelectOptions>
|
||||
</SimpleSelect>
|
||||
</FormItem>
|
||||
<FormItem Label="显示排序">
|
||||
<AntDesign.InputNumber @bind-Value="model.DisplayOrder" For="(()=>model.DisplayOrder)" Placeholder="显示排序" />
|
||||
</FormItem>
|
||||
<FormItem Label="可用状态">
|
||||
<Checkbox T="bool" Label="启用" @bind-value="model.Enabled" Size="InputSize.Small" Class="ps-0" />
|
||||
</FormItem>
|
||||
<FormItem WrapperColOffset="4">
|
||||
<Button Type="ButtonType.Primary" HtmlType="submit" Style="width: 100%;">保存</Button>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Drawer>
|
||||
<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.Title" For="(()=>model.Title)" Placeholder="语言标题" />
|
||||
</FormItem>
|
||||
<FormItem Label="语言名称">
|
||||
<Input @bind-Value="model.Name" For="(()=>model.Name)" Placeholder="语言名称" />
|
||||
</FormItem>
|
||||
<FormItem Label="语言文化">
|
||||
<SimpleSelect @bind-Value="model.Culture" For="(()=>model.Culture)" Placeholder="语言文化">
|
||||
<SelectOptions>
|
||||
@foreach (var item in LanguageCultures)
|
||||
{
|
||||
<SimpleSelectOption Value="@item.Key" Label="@($"{item.Value} - {item.Key}")"></SimpleSelectOption>
|
||||
}
|
||||
</SelectOptions>
|
||||
</SimpleSelect>
|
||||
</FormItem>
|
||||
<FormItem Label="显示排序">
|
||||
<AntDesign.InputNumber @bind-Value="model.DisplayOrder" For="(()=>model.DisplayOrder)" Placeholder="显示排序" />
|
||||
</FormItem>
|
||||
<FormItem Label="可用状态">
|
||||
<Checkbox T="bool" Label="启用" @bind-value="model.Enabled" Size="InputSize.Small" Class="ps-0" />
|
||||
</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; }
|
||||
|
||||
|
||||
@@ -1,92 +1,103 @@
|
||||
@page "/system/locale/resource/detail/{Name}"
|
||||
@page "/{locale}/system/locale/resource/detail/{Name}"
|
||||
@inject ILogger<LocaleResourceList> Logger
|
||||
@attribute [Authorize]
|
||||
|
||||
<PageContainer Title="本地化语言资源">
|
||||
<Breadcrumb>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
|
||||
<BreadcrumbItem>本地化语言资源</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
</Breadcrumb>
|
||||
<ChildContent>
|
||||
<Spin Spinning="loading">
|
||||
<Card Class="mt-3">
|
||||
<Table DataSource="ResourceItems" PageSize="100" HidePagination="true" Resizable>
|
||||
<TitleTemplate>
|
||||
<Flex Justify="FlexJustify.SpaceBetween">
|
||||
@(@Name)多语言资源列表,可用语言@(@languages.Count)种
|
||||
<div>
|
||||
<Button Class="me-3" OnClick="OnCreateClick" Type="ButtonType.Primary">新增</Button>
|
||||
</div>
|
||||
</Flex>
|
||||
</TitleTemplate>
|
||||
<ColumnDefinitions>
|
||||
<PropertyColumn Property="c => c.Name" Title="资源Key">
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Title" Title="语言">
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Value" Title="内容">
|
||||
|
||||
<PageTitle>本地化语言资源</PageTitle>
|
||||
<Title Level="4">多语言本地资源管理</Title>
|
||||
<Spin Spinning="loading">
|
||||
<Card Class="mt-3">
|
||||
<Table DataSource="ResourceItems" PageSize="100" HidePagination="true" Resizable>
|
||||
<TitleTemplate>
|
||||
<Flex Justify="FlexJustify.SpaceBetween">
|
||||
@(@Name)多语言资源列表,可用语言@(@languages.Count)种
|
||||
<div>
|
||||
<Button Class="me-3" OnClick="OnCreateClick" Type="ButtonType.Primary">新增</Button>
|
||||
</div>
|
||||
</Flex>
|
||||
</TitleTemplate>
|
||||
<ColumnDefinitions>
|
||||
<PropertyColumn Property="c => c.Name" Title="资源Key">
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Title" Title="语言">
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Value" Title="内容">
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.UpdateTime" Title="最后更新" Width="120px" />
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right" Width="100px">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
<Dropdown Trigger="@(new Trigger[] { Trigger.Click })">
|
||||
<Overlay>
|
||||
<Menu>
|
||||
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.UpdateTime" Title="最后更新" Width="120px" />
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right" Width="100px">
|
||||
<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>
|
||||
</Card>
|
||||
</Spin>
|
||||
|
||||
<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>
|
||||
</Spin>
|
||||
<Modal Title="@("语言资源设置")" Visible="@modalVisible" Width="700" MaskClosable="true" OkText="@("保存")" CancelText="@("取消")" OnOk="@HandleModalOk" OnCancel="@HandleCancel">
|
||||
<Form Model="@model" @ref="@editform" LabelCol="new ColLayoutParam { Span = 5 }" WrapperCol="new ColLayoutParam { Span = 15 }" Name="modalForm" OnFinish="OnFormFinish">
|
||||
<FluentValidationValidator />
|
||||
<FormItem Label="语言文字">
|
||||
@if (context.Id == 0)
|
||||
{
|
||||
<Select DataSource="@languages" @bind-Value="@context.LanguageId" ItemValue="p => p.Id" ItemLabel="p => p.Title">
|
||||
</Select>
|
||||
}
|
||||
else
|
||||
{
|
||||
<Input Placeholder="资源名称" @bind-Value="@context.Title" Disabled />
|
||||
}
|
||||
|
||||
<Modal Title="@("语言资源设置")" Visible="@modalVisible" Width="700" MaskClosable="true" OkText="@("保存")" CancelText="@("取消")" OnOk="@HandleModalOk" OnCancel="@HandleCancel">
|
||||
<Form Model="@model" @ref="@editform" LabelCol="new ColLayoutParam { Span = 5 }" WrapperCol="new ColLayoutParam { Span = 15 }" Name="modalForm" OnFinish="OnFormFinish">
|
||||
<FluentValidationValidator />
|
||||
<FormItem Label="语言文字">
|
||||
@if (context.Id == 0)
|
||||
{
|
||||
<Select DataSource="@languages" @bind-Value="@context.LanguageId" ItemValue="p => p.Id" ItemLabel="p => p.Title">
|
||||
</Select>
|
||||
}
|
||||
else
|
||||
{
|
||||
<Input Placeholder="资源名称" @bind-Value="@context.Title" Disabled />
|
||||
}
|
||||
|
||||
</FormItem>
|
||||
<FormItem Label="资源名称">
|
||||
<Input Placeholder="资源名称" @bind-Value="@context.Name" Disabled />
|
||||
</FormItem>
|
||||
<FormItem Label="资源内容">
|
||||
<TextArea Placeholder="资源内容" @bind-Value="@context.Value" />
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Modal>
|
||||
</FormItem>
|
||||
<FormItem Label="资源名称">
|
||||
<Input Placeholder="资源名称" @bind-Value="@context.Name" Disabled />
|
||||
</FormItem>
|
||||
<FormItem Label="资源内容">
|
||||
<TextArea Placeholder="资源内容" @bind-Value="@context.Value" />
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Modal>
|
||||
</ChildContent>
|
||||
</PageContainer>
|
||||
|
||||
@code {
|
||||
|
||||
bool loading = false;
|
||||
[Parameter]
|
||||
public string Locale { get; set; } = string.Empty;
|
||||
|
||||
[Parameter]
|
||||
public string Name { get; set; }
|
||||
|
||||
@@ -1,111 +1,121 @@
|
||||
@page "/system/locale/resource/list/{Id:int}"
|
||||
@page "/{locale}/system/locale/resource/list/{Id:int}"
|
||||
@inject ILogger<LocaleResourceList> Logger
|
||||
@attribute [Authorize]
|
||||
|
||||
<PageContainer Title="多语言本地资源管理">
|
||||
<Breadcrumb>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
|
||||
<BreadcrumbItem>多语言本地资源管理</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
</Breadcrumb>
|
||||
<ChildContent>
|
||||
<Spin Spinning="loading">
|
||||
<Card>
|
||||
<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.Name" Placeholder="名称" AllowClear />
|
||||
</FormItem>
|
||||
</Col>
|
||||
<Col>
|
||||
<FormItem Label="内容">
|
||||
<Input @bind-Value="search.Value" 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">
|
||||
@(@language.Name)语言资源列表
|
||||
<div>
|
||||
<Button Class="me-3" OnClick="OnCreateClick" Type="ButtonType.Primary">新增</Button>
|
||||
</div>
|
||||
</Flex>
|
||||
</TitleTemplate>
|
||||
<ColumnDefinitions>
|
||||
<PropertyColumn Property="c => c.Name" Title="资源Key">
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Value" Title="内容">
|
||||
|
||||
<PageTitle>本地化语言资源</PageTitle>
|
||||
<Title Level="4">多语言本地资源管理</Title>
|
||||
<Spin Spinning="loading">
|
||||
<Card>
|
||||
<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.Name" Placeholder="名称" AllowClear />
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.UpdateTime" Title="最后更新" Width="120px" />
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right" Width="120px">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
<a @onclick="(e) => OnEditClick(context)"> <Icon Type="@IconType.Outline.Edit" /> 编辑</a>
|
||||
</SpaceItem>
|
||||
<SpaceItem>
|
||||
<Dropdown Trigger="@(new Trigger[] { Trigger.Click })">
|
||||
<Overlay>
|
||||
<Menu>
|
||||
|
||||
<MenuItem>
|
||||
<a href="@($"/system/locale/resource/detail/{context.Name}")"> <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>
|
||||
</Spin>
|
||||
|
||||
<Modal Title="@("语言资源设置")" Visible="@modalVisible" Width="700" MaskClosable="true" OkText="@("保存")" CancelText="@("取消")" OnOk="@HandleModalOk" OnCancel="@HandleCancel">
|
||||
<Form Model="@model" @ref="@editform" LabelCol="new ColLayoutParam { Span = 5 }" WrapperCol="new ColLayoutParam { Span = 15 }" Name="modalForm" OnFinish="OnFormFinish">
|
||||
<FluentValidationValidator />
|
||||
<FormItem Label="语言文字">
|
||||
@language.Name
|
||||
</FormItem>
|
||||
</Col>
|
||||
<Col>
|
||||
<FormItem Label="内容">
|
||||
<Input @bind-Value="search.Value" Placeholder="名称" AllowClear />
|
||||
<FormItem Label="资源名称">
|
||||
<Input Placeholder="资源名称" @bind-Value="@context.Name" />
|
||||
</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">
|
||||
@(@language.Name)语言资源列表
|
||||
<div>
|
||||
<Button Class="me-3" OnClick="OnCreateClick" Type="ButtonType.Primary">新增</Button>
|
||||
</div>
|
||||
</Flex>
|
||||
</TitleTemplate>
|
||||
<ColumnDefinitions>
|
||||
<PropertyColumn Property="c => c.Name" Title="资源Key">
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Value" Title="内容">
|
||||
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.UpdateTime" Title="最后更新" Width="120px" />
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right" Width="120px">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
<a @onclick="(e) => OnEditClick(context)"> <Icon Type="@IconType.Outline.Edit" /> 编辑</a>
|
||||
</SpaceItem>
|
||||
<SpaceItem>
|
||||
<Dropdown Trigger="@(new Trigger[] { Trigger.Click })">
|
||||
<Overlay>
|
||||
<Menu>
|
||||
|
||||
<MenuItem>
|
||||
<a href="@($"/system/locale/resource/detail/{context.Name}")"> <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>
|
||||
</Spin>
|
||||
|
||||
<Modal Title="@("语言资源设置")" Visible="@modalVisible" Width="700" MaskClosable="true" OkText="@("保存")" CancelText="@("取消")" OnOk="@HandleModalOk" OnCancel="@HandleCancel">
|
||||
<Form Model="@model" @ref="@editform" LabelCol="new ColLayoutParam { Span = 5 }" WrapperCol="new ColLayoutParam { Span = 15 }" Name="modalForm" OnFinish="OnFormFinish">
|
||||
<FluentValidationValidator />
|
||||
<FormItem Label="语言文字">
|
||||
@language.Name
|
||||
</FormItem>
|
||||
<FormItem Label="资源名称">
|
||||
<Input Placeholder="资源名称" @bind-Value="@context.Name" />
|
||||
</FormItem>
|
||||
<FormItem Label="资源内容">
|
||||
<TextArea Placeholder="资源内容" @bind-Value="@context.Value" />
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Modal>
|
||||
|
||||
<FormItem Label="资源内容">
|
||||
<TextArea Placeholder="资源内容" @bind-Value="@context.Value" />
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Modal>
|
||||
</ChildContent>
|
||||
</PageContainer>
|
||||
@code {
|
||||
|
||||
bool loading = false;
|
||||
[Parameter]
|
||||
public string Locale { get; set; } = string.Empty;
|
||||
|
||||
[Parameter]
|
||||
public int Id { get; set; }
|
||||
|
||||
@@ -1,142 +1,152 @@
|
||||
@page "/system/menu/list"
|
||||
|
||||
@page "/{locale}/system/menu/list"
|
||||
@inject ILogger<MenuList> Logger
|
||||
@using MenuItem = Atomx.Admin.Client.Models.MenuItem
|
||||
@using Menu = Atomx.Common.Entities.Menu
|
||||
@attribute [Authorize]
|
||||
|
||||
<PageTitle>菜单管理</PageTitle>
|
||||
<PageContainer Title="菜单管理">
|
||||
<Breadcrumb>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
|
||||
<BreadcrumbItem>菜单管理</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
</Breadcrumb>
|
||||
<ChildContent>
|
||||
<Card>
|
||||
<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.Name" Placeholder="名称" AllowClear />
|
||||
</FormItem>
|
||||
</Col>
|
||||
|
||||
<Title Level="4">菜单管理</Title>
|
||||
<Card>
|
||||
<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.Name" 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>
|
||||
<Card Class="mt-3">
|
||||
<Table DataSource="Menus" PageSize="100" HidePagination="true" Resizable>
|
||||
<TitleTemplate>
|
||||
<Flex Justify="FlexJustify.SpaceBetween">
|
||||
菜单列表
|
||||
<div>
|
||||
<Button Class="me-3" OnClick="OnCreateClick" Type="ButtonType.Primary">新增</Button>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<Card Class="mt-3">
|
||||
<Table DataSource="Menus" PageSize="100" HidePagination="true" Resizable>
|
||||
<TitleTemplate>
|
||||
<Flex Justify="FlexJustify.SpaceBetween">
|
||||
菜单列表
|
||||
<div>
|
||||
<Button Class="me-3" OnClick="OnCreateClick" Type="ButtonType.Primary">新增</Button>
|
||||
</div>
|
||||
|
||||
</Flex>
|
||||
</TitleTemplate>
|
||||
<ColumnDefinitions>
|
||||
<PropertyColumn Property="c=>c.Name" Title="名称">
|
||||
<AntDesign.Text>@GetName(context)</AntDesign.Text>
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c=>c.Icon" Title="图标" Width="60px" Align="ColumnAlign.Center">
|
||||
@if (!string.IsNullOrEmpty(context.Icon)) {
|
||||
<Icon Type="@context.Icon" Theme="IconThemeType.Outline" Width="1.3em" Height="1.3em" />
|
||||
}
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c=>c.Key" Title="分组标识" Ellipsis/>
|
||||
<PropertyColumn Property="c=>c.Url" Title="链接" />
|
||||
<PropertyColumn Property="c=>c.DisplayOrder" Title="排序" Width="80px" Align="ColumnAlign.Center" />
|
||||
<PropertyColumn Property="c=>c.Enabled" Title="状态" Width="80px" Align="ColumnAlign.Center">
|
||||
@if (context.Enabled)
|
||||
</Flex>
|
||||
</TitleTemplate>
|
||||
<ColumnDefinitions>
|
||||
<PropertyColumn Property="c => c.Name" Title="名称">
|
||||
<AntDesign.Text>@GetName(context)</AntDesign.Text>
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Icon" Title="图标" Width="60px" Align="ColumnAlign.Center">
|
||||
@if (!string.IsNullOrEmpty(context.Icon))
|
||||
{
|
||||
<Icon Type="@context.Icon" Theme="IconThemeType.Outline" Width="1.3em" Height="1.3em" />
|
||||
}
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.Key" Title="分组标识" Ellipsis />
|
||||
<PropertyColumn Property="c => c.Url" Title="链接" />
|
||||
<PropertyColumn Property="c => c.DisplayOrder" Title="排序" Width="80px" Align="ColumnAlign.Center" />
|
||||
<PropertyColumn Property="c => c.Enabled" Title="状态" Width="80px" Align="ColumnAlign.Center">
|
||||
@if (context.Enabled)
|
||||
{
|
||||
<AntDesign.Text Type="TextElementType.Success"><Icon Type="check" Theme=" IconThemeType.Outline" Width="1.3em" Height="1.3em" /></AntDesign.Text>
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
<Icon Type="close" Theme="IconThemeType.Outline" Width="1.3em" Height="1.3em" />
|
||||
}
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.CreateTime" Title="时间" Width="150px" />
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right" Width="120px">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
<a @onclick="(e) => OnEditClick(context)">编辑</a>
|
||||
</SpaceItem>
|
||||
<SpaceItem>
|
||||
<Popconfirm Placement="@Placement.Left" Title="@("删除这条数据无法恢复,您确定要删除吗?")"
|
||||
OnConfirm="@(e=>HandleDeleteConfirmAsync(e,context.Id))"
|
||||
OkText="确定"
|
||||
CancelText="取消">
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
</SpaceItem>
|
||||
</Space>
|
||||
</ActionColumn>
|
||||
</ColumnDefinitions>
|
||||
</Table>
|
||||
</Card>
|
||||
|
||||
<Drawer Closable="true" Width="520" Visible="drawerVisible" Title='("设置菜单")' OnClose="_ => CloseDrawer()">
|
||||
<Form LabelColSpan="4" @ref="@editform" Model="@menu" Class="px-5" OnFinish="OnFormFinish">
|
||||
<FluentValidationValidator />
|
||||
<FormItem Label="名称">
|
||||
<Input @bind-Value="menu.Name" For="(()=>menu.Name)" />
|
||||
</FormItem>
|
||||
<FormItem Label="分组标识">
|
||||
<Input @bind-Value="menu.Key" For="(()=>menu.Key)" />
|
||||
</FormItem>
|
||||
<FormItem Label="链接">
|
||||
<Input @bind-Value="menu.Url" For="(()=>menu.Url)" />
|
||||
</FormItem>
|
||||
<FormItem Label="上级分类">
|
||||
<Select @bind-Value="@menu.ParentId" TItemValue="long" TItem="string" Placeholder="请选择上级分类">
|
||||
<SelectOptions>
|
||||
<SelectOption Value="0L" Label="无" />
|
||||
@foreach (var item in Menus)
|
||||
{
|
||||
<SelectOption Value="@item.Id" Label="@GetName(item)" />
|
||||
}
|
||||
|
||||
</SelectOptions>
|
||||
</Select>
|
||||
</FormItem>
|
||||
@if (menu.ParentId == 0)
|
||||
{
|
||||
<AntDesign.Text Type="TextElementType.Success"><Icon Type="check" Theme=" IconThemeType.Outline" Width="1.3em" Height="1.3em" /></AntDesign.Text>
|
||||
|
||||
|
||||
<FormItem Label="图标">
|
||||
<Select ItemValue="c => c"
|
||||
ItemLabel="c => c"
|
||||
DataSource="IconsExtension.IconList()"
|
||||
@bind-Value="@menu.Icon">
|
||||
<ItemTemplate Context="Icon">
|
||||
<p class="mt-2"><Icon Type="@Icon" /> @Icon</p>
|
||||
</ItemTemplate>
|
||||
<LabelTemplate Context="Icon">
|
||||
<p class="mt-1"><Icon Type="@Icon" /> @Icon</p>
|
||||
</LabelTemplate>
|
||||
</Select>
|
||||
</FormItem>
|
||||
}
|
||||
else
|
||||
{
|
||||
<Icon Type="close" Theme="IconThemeType.Outline" Width="1.3em" Height="1.3em" />
|
||||
}
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c=>c.CreateTime" Title="时间" Width="150px" />
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right" Width="120px">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
<a @onclick="(e)=>OnEditClick(context)">编辑</a>
|
||||
</SpaceItem>
|
||||
<SpaceItem>
|
||||
<Popconfirm Placement="@Placement.Left" Title="@("删除这条数据无法恢复,您确定要删除吗?")"
|
||||
OnConfirm="@(e=>HandleDeleteConfirmAsync(e,context.Id))"
|
||||
OkText="确定"
|
||||
CancelText="取消">
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
</SpaceItem>
|
||||
</Space>
|
||||
</ActionColumn>
|
||||
</ColumnDefinitions>
|
||||
</Table>
|
||||
</Card>
|
||||
|
||||
<Drawer Closable="true" Width="520" Visible="drawerVisible" Title='("设置菜单")' OnClose="_=>CloseDrawer()">
|
||||
<Form LabelColSpan="4" @ref="@editform" Model="@menu" Class="px-5" OnFinish="OnFormFinish">
|
||||
<FluentValidationValidator />
|
||||
<FormItem Label="名称">
|
||||
<Input @bind-Value="menu.Name" For="(()=>menu.Name)" />
|
||||
</FormItem>
|
||||
<FormItem Label="分组标识">
|
||||
<Input @bind-Value="menu.Key" For="(()=>menu.Key)" />
|
||||
</FormItem>
|
||||
<FormItem Label="链接">
|
||||
<Input @bind-Value="menu.Url" For="(()=>menu.Url)" />
|
||||
</FormItem>
|
||||
<FormItem Label="上级分类">
|
||||
<Select @bind-Value="@menu.ParentId" TItemValue="long" TItem="string" Placeholder="请选择上级分类">
|
||||
<SelectOptions>
|
||||
<SelectOption Value="0L" Label="无" />
|
||||
@foreach(var item in Menus)
|
||||
{
|
||||
<SelectOption Value="@item.Id" Label="@GetName(item)" />
|
||||
}
|
||||
|
||||
</SelectOptions>
|
||||
</Select>
|
||||
</FormItem>
|
||||
@if (menu.ParentId == 0)
|
||||
{
|
||||
|
||||
<FormItem Label="图标">
|
||||
<Select ItemValue="c=>c"
|
||||
ItemLabel="c=>c"
|
||||
DataSource="IconsExtension.IconList()"
|
||||
@bind-Value="@menu.Icon">
|
||||
<ItemTemplate Context="Icon">
|
||||
<p class="mt-2"><Icon Type="@Icon" /> @Icon</p>
|
||||
</ItemTemplate>
|
||||
<LabelTemplate Context="Icon">
|
||||
<p class="mt-1"><Icon Type="@Icon" /> @Icon</p>
|
||||
</LabelTemplate>
|
||||
</Select>
|
||||
</FormItem>
|
||||
}
|
||||
<FormItem Label="显示排序">
|
||||
<Input @bind-Value="menu.DisplayOrder" For="(()=>menu.DisplayOrder)" />
|
||||
</FormItem>
|
||||
<FormItem Label="状态">
|
||||
<Checkbox T="bool" Label="启用" @bind-value="menu.Enabled" Size="InputSize.Small" Class="ps-0" />
|
||||
</FormItem>
|
||||
<FormItem WrapperColOffset="4">
|
||||
<Button Type="ButtonType.Primary" HtmlType="submit" Class="mt-5" Style="width: 100%;">保存</Button>
|
||||
</FormItem>
|
||||
</Form >
|
||||
</Drawer>
|
||||
<FormItem Label="显示排序">
|
||||
<Input @bind-Value="menu.DisplayOrder" For="(()=>menu.DisplayOrder)" />
|
||||
</FormItem>
|
||||
<FormItem Label="状态">
|
||||
<Checkbox T="bool" Label="启用" @bind-value="menu.Enabled" Size="InputSize.Small" Class="ps-0" />
|
||||
</FormItem>
|
||||
<FormItem WrapperColOffset="4">
|
||||
<Button Type="ButtonType.Primary" HtmlType="submit" Class="mt-5" Style="width: 100%;">保存</Button>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Drawer>
|
||||
</ChildContent>
|
||||
</PageContainer>
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
|
||||
[Parameter]
|
||||
public string Locale { get; set; } = string.Empty;
|
||||
|
||||
[SupplyParameterFromQuery]
|
||||
int? Page { get; set; }
|
||||
@@ -285,7 +295,7 @@
|
||||
|
||||
CloseDrawer();
|
||||
LoadList();
|
||||
await ModalService.InfoAsync(new ConfirmOptions() { Title="提示", Content="数据提交成功!" });
|
||||
await ModalService.InfoAsync(new ConfirmOptions() { Title = "提示", Content = "数据提交成功!" });
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -294,7 +304,7 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private string GetPath(string path)
|
||||
@@ -335,7 +345,7 @@
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void OpenDrawer()
|
||||
{
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
@page "/system/tools"
|
||||
@page "/{locale}/system/tools"
|
||||
|
||||
<h3>Tools</h3>
|
||||
<PageContainer Title="系统工具">
|
||||
<Breadcrumb>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
|
||||
<BreadcrumbItem>系统工具</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
</Breadcrumb>
|
||||
<ChildContent>
|
||||
<h3>Tools</h3>
|
||||
</ChildContent>
|
||||
</PageContainer>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
|
||||
Reference in New Issue
Block a user