* add account center

* add account settins

* add RightContent

* update right content

* add step form

* add AdvancedForm

* add basic profile

* add Advanced profile

* add list pages

* fix card list style bug

* refactor account-center, advanced-profile

* add list pages

* update to 2009161213

* fix ListItem error after updating to latest lib

* refactor pages, move code into cs file, fix binding errors

* format code

* adjust namespace

* add missing using for template

* update template

* update README

* fix template error
This commit is contained in:
chaldea 2020-09-20 14:21:34 +08:00 коммит произвёл GitHub
Родитель 239d9a3bbe
Коммит 31120a92ce
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
200 изменённых файлов: 4637 добавлений и 809 удалений

Просмотреть файл

@ -1,7 +1,9 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "AntDesign Blazor Team",
"classifications": ["Ant Design Pro"],
"classifications": [
"Ant Design Pro"
],
"name": "Ant Design Pro Blazor App",
"identity": "AntDesign.Pro",
"groupIdentity": "AntDesign.Pro",
@ -10,7 +12,7 @@
"language": "C#",
"type": "project"
},
"sourceName": "AntDesign.Pro",
"sourceName": "AntDesign.Pro.Template",
"preferNameDirectory": true,
"symbols": {
"full": {
@ -22,7 +24,8 @@
"type": "parameter",
"datatype": "choice",
"defaultValue": "wasm",
"choices": [{
"choices": [
{
"choice": "wasm",
"description": "WebAssembly"
},
@ -60,100 +63,194 @@
"replaces": "<SolutionDir>./</SolutionDir>"
}
},
"primaryOutputs": [{
"condition": "(host != 'hosted')",
"path": "AntDesign.Pro.csproj"
}, {
"condition": "(host == 'hosted')",
"path": "AntDesign.Pro.sln"
}],
"sources": [{
"source": "./.template.config/templates/assets",
"target": "./"
"primaryOutputs": [
{
"condition": "(host != 'hosted')",
"path": "AntDesign.Pro.csproj"
},
{
"condition": "(host == 'hosted')",
"path": "AntDesign.Pro.sln"
}
],
"sources": [
{
"condition": "(host != 'hosted')",
"source": "./src/AntDesign.Pro",
"target": "./",
"modifiers": [{
"condition": "(!full)",
"exclude": ["Pages/**/*", "Services/**/*"]
}]
"modifiers": [
{
"exclude": [
"AntDesign.Pro.csproj",
"AntDesign.Pro.csproj.DotSettings"
]
},
{
"condition": "(!full)",
"exclude": [
"Components/**/*",
"Extensions/**/*",
"Layouts/**/*",
"Models/**/*",
"Pages/**/*",
"Services/**/*",
"Utils/**/*",
"wwwroot/**/*"
]
}
]
},
{
"source": "./.template.config/templates/assets",
"target": "./"
},
{
"condition": "(host == 'wasm')",
"source": "./.template.config/templates/wasm",
"target": "./"
"target": "./",
"modifiers": [
{
"condition": "(full)",
"exclude": [
"Pages/Welcome.razor",
"Pages/Welcome.razor.less"
]
}
]
},
{
"condition": "(host == 'server')",
"source": "./.template.config/templates/server",
"target": "./"
"target": "./",
"modifiers": [
{
"condition": "(full)",
"exclude": [
"Pages/Welcome.razor",
"Pages/Welcome.razor.less"
]
}
]
},
{
"condition": "(host == 'hosted')",
"source": "./src/AntDesign.Pro",
"target": "./src/Client/",
"modifiers": [{
"exclude": [
"AntDesign.Pro.csproj"
]
}, {
"condition": "(!full)",
"exclude": ["Pages/**/*"]
}]
"modifiers": [
{
"exclude": [
"AntDesign.Pro.csproj",
"AntDesign.Pro.csproj.DotSettings"
]
},
{
"condition": "(!full)",
"exclude": [
"Components/**/*",
"Extensions/**/*",
"Layouts/**/*",
"Models/**/*",
"Pages/**/*",
"Services/**/*",
"Utils/**/*",
"wwwroot/**/*"
]
}
]
},
{
"condition": "(host == 'hosted')",
"source": "./.template.config/templates/wasm",
"target": "./src/Client/",
"rename": {
"AntDesign.Pro": "AntDesign.Pro.Client"
}
"AntDesign.Pro.Template": "AntDesign.Pro.Template.Client"
},
"modifiers": [
{
"condition": "(full)",
"exclude": [
"Pages/Welcome.razor",
"Pages/Welcome.razor.less"
]
}
]
},
{
"condition": "(host == 'hosted')",
"source": "./.template.config/templates/hosted",
"target": "./"
"target": "./",
"modifiers": [
{
"condition": "(full)",
"exclude": [
"src/Client/Pages/Welcome.razor",
"src/Client/Pages/Welcome.razor.less"
]
}
]
}
],
"SpecialCustomOperations": {
"**/*.less": {
"operations": [{
"type": "conditional",
"configuration": {
"if": ["//#if"],
"else": ["//#else"],
"elseif": ["//#elseif"],
"endif": ["//#endif"],
"trim": true,
"wholeLine": true,
"evaluator": "C++"
"operations": [
{
"type": "conditional",
"configuration": {
"if": [
"//#if"
],
"else": [
"//#else"
],
"elseif": [
"//#elseif"
],
"endif": [
"//#endif"
],
"trim": true,
"wholeLine": true,
"evaluator": "C++"
}
}
}]
]
},
"**/*.razor": {
"operations": [{
"type": "conditional",
"configuration": {
"if": ["//#if"],
"else": ["//#else"],
"elseif": ["//#elseif"],
"endif": ["//#endif"],
"trim": true,
"wholeLine": true,
"evaluator": "C++"
"operations": [
{
"type": "conditional",
"configuration": {
"if": [
"//#if"
],
"else": [
"//#else"
],
"elseif": [
"//#elseif"
],
"endif": [
"//#endif"
],
"trim": true,
"wholeLine": true,
"evaluator": "C++"
}
}
}]
]
}
},
"postActions": [{
"condition": "(!skipRestore)",
"description": "Restore NuGet packages required by this project.",
"manualInstructions": [{
"text": "Run 'dotnet restore'"
}],
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
"continueOnError": true
}]
"postActions": [
{
"condition": "(!skipRestore)",
"description": "Restore NuGet packages required by this project.",
"manualInstructions": [
{
"text": "Run 'dotnet restore'"
}
],
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
"continueOnError": true
}
]
}

Просмотреть файл

@ -2,9 +2,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.0.0
MinimumVisualStudioVersion = 16.0.0.0
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AntDesign.Pro.Server", "src\Server\AntDesign.Pro.Server.csproj", "{7A8C458A-DF0B-4B20-BCBF-A433B6F6046A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AntDesign.Pro.Template.Server", "src\Server\AntDesign.Pro.Template.Server.csproj", "{7A8C458A-DF0B-4B20-BCBF-A433B6F6046A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AntDesign.Pro.Client", "src\Client\AntDesign.Pro.Client.csproj", "{AB1EB396-ABBE-4CEA-A650-950A68440391}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AntDesign.Pro.Template.Client", "src\Client\AntDesign.Pro.Template.Client.csproj", "{AB1EB396-ABBE-4CEA-A650-950A68440391}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

Просмотреть файл

@ -1,5 +1,5 @@
{
"name": "AntDesign.Pro",
"name": "AntDesign.Pro.Template",
"version": "1.0.0",
"description": "An out-of-box UI solution for enterprise applications as a Blazor boilerplate.",
"scripts": {

Просмотреть файл

@ -1,4 +1,4 @@
@using BasicLayout = AntDesign.Pro.BasicLayout
@using BasicLayout = AntDesign.Pro.Template.BasicLayout
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(BasicLayout)" />

Просмотреть файл

@ -0,0 +1,41 @@
@page "/"
<PageContainer Title="欢迎">
<Card>
<Alert
Message="AntDesign.Templates 已经发布到nuget可以直接下载使用"
Type="success"
ShowIcon
Banner
Style="margin: -12px; margin-bottom: 24px"/>
<Text Strong>
<a target="_blank" rel="noopener noreferrer" href="https://www.nuget.org/packages/AntDesign.Templates">
使用dotnet快速安装最新模板
</a>
</Text>
<pre class="pre"><code><Text Copyable> dotnet new --install AntDesign.Templates::0.1.0-*</Text></code></pre>
<Text
Strong
Style="margin-bottom: 12px">
<a target="_blank" rel="noopener noreferrer" href="https://github.com/ant-design-blazor/ant-design-pro-blazor">
创建hosted空项目
</a>
</Text>
<pre class="pre"><code><Text Copyable> dotnet new antdesign --host=hosted</Text></code></pre>
<Text
Strong
Style="margin-bottom: 12px">
<a target="_blank" rel="noopener noreferrer" href="https://github.com/ant-design-blazor/ant-design-pro-blazor">
创建包含所有页面的hosted项目
</a>
</Text>
<pre class="pre"><code><Text Copyable> dotnet new antdesign --host=hosted --full</Text></code></pre>
</Card>
<p style="text-align: center; margin-top: 24px;">
Want to add more pages? Please refer to
<a href="https://github.com/ant-design-blazor/ant-design-pro-blazor" target="_blank" rel="noopener noreferrer">
ant-design-pro-blazor project
</a>
</p>
</PageContainer>

Просмотреть файл

@ -0,0 +1,8 @@
@import '~antd/es/style/themes/default.less';
.pre {
margin: 12px 0;
padding: 12px 20px;
background: @input-bg;
box-shadow: @card-shadow;
}

Просмотреть файл

@ -1,12 +1,14 @@
using System;
using System.Net.Http;
using System.Threading.Tasks;
using {pro-layout};
using AntDesign.Pro.Services;
using AntDesign.Pro.Layout;
//#if (full)
using AntDesign.Pro.Template.Services;
//#endif
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace AntDesign.Pro.Client
namespace AntDesign.Pro.Template.Client
{
public class Program
{
@ -18,7 +20,13 @@ namespace AntDesign.Pro.Client
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddAntDesign();
builder.Services.Configure<ProSettings>(builder.Configuration.GetSection("ProSettings"));
builder.Services.AddScoped<ChartService>();
//#if (full)
builder.Services.AddScoped<IChartService, ChartService>();
builder.Services.AddScoped<IProjectService, ProjectService>();
builder.Services.AddScoped<IUserService, UserService>();
builder.Services.AddScoped<IAccountService, AccountService>();
builder.Services.AddScoped<IProfileService, ProfileService>();
//#endif
await builder.Build().RunAsync();
}

Просмотреть файл

@ -9,7 +9,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Client\AntDesign.Pro.Client.csproj" />
<ProjectReference Include="..\Client\AntDesign.Pro.Template.Client.csproj" />
</ItemGroup>

Просмотреть файл

@ -1,5 +1,5 @@
@page
@model AntDesign.Pro.Server.Pages.ErrorModel
@model AntDesign.Pro.Template.Server.Pages.ErrorModel
@{
Layout = "_Layout";
ViewData["Title"] = "Error";

Просмотреть файл

@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace AntDesign.Pro.Server.Pages
namespace AntDesign.Pro.Template.Server.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public class ErrorModel : PageModel

Просмотреть файл

@ -7,7 +7,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace AntDesign.Pro.Server
namespace AntDesign.Pro.Template.Server
{
public class Program
{

Просмотреть файл

@ -7,7 +7,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System.Linq;
namespace AntDesign.Pro.Server
namespace AntDesign.Pro.Template.Server
{
public class Startup
{

Просмотреть файл

@ -5,9 +5,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AntDesign" Version="0.3.0-*" />
<PackageReference Include="AntDesign" Version="0.4.0-*" />
<PackageReference Include="AntDesign.Charts" Version="0.2.0-*" />
<PackageReference Include="{pro-layout}" Version="0.1.0-*" />
<PackageReference Include="AntDesign.Pro.Layout" Version="0.1.0-*" />
<PackageReference Include="System.Net.Http.Json" Version="3.2.0" />
</ItemGroup>

Просмотреть файл

@ -1,23 +1,40 @@
@namespace AntDesign.Pro
@namespace AntDesign.Pro.Template
@inherits LayoutComponentBase
<{pro-layout}.BasicLayout
<AntDesign.Pro.Layout.BasicLayout
Logo="@("https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg")"
MenuData="MenuData">
MenuData="_menuData">
<RightContentRender>
<RightContent />
</RightContentRender>
<ChildContent>
@Body
</ChildContent>
</{pro-layout}.BasicLayout>
</AntDesign.Pro.Layout.BasicLayout>
<SettingDrawer />
@inject HttpClient HttpClient
@code
{
private MenuDataItem[] MenuData { get; set; } = {};
//#if (full)
private MenuDataItem[] _menuData = {};
[Inject] public HttpClient HttpClient { get; set; }
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
MenuData = await HttpClient.GetFromJsonAsync<MenuDataItem[]>("data/menu.json");
_menuData = await HttpClient.GetFromJsonAsync<MenuDataItem[]>("data/menu.json");
}
//#else
private readonly MenuDataItem[] _menuData =
{
new MenuDataItem
{
Path = "/",
Name = "welcome",
Key = "welcome",
Icon = "smile",
}
};
//#endif
}

Просмотреть файл

@ -0,0 +1,41 @@
@page "/"
<PageContainer Title="欢迎">
<Card>
<Alert
Message="AntDesign.Templates 已经发布到nuget可以直接下载使用"
Type="success"
ShowIcon
Banner
Style="margin: -12px; margin-bottom: 24px"/>
<Text Strong>
<a target="_blank" rel="noopener noreferrer" href="https://www.nuget.org/packages/AntDesign.Templates">
使用dotnet快速安装最新模板
</a>
</Text>
<pre class="pre"><code><Text Copyable> dotnet new --install AntDesign.Templates::0.1.0-*</Text></code></pre>
<Text
Strong
Style="margin-bottom: 12px">
<a target="_blank" rel="noopener noreferrer" href="https://github.com/ant-design-blazor/ant-design-pro-blazor">
创建server空项目
</a>
</Text>
<pre class="pre"><code><Text Copyable> dotnet new antdesign --host=server</Text></code></pre>
<Text
Strong
Style="margin-bottom: 12px">
<a target="_blank" rel="noopener noreferrer" href="https://github.com/ant-design-blazor/ant-design-pro-blazor">
创建包含所有页面的server项目
</a>
</Text>
<pre class="pre"><code><Text Copyable> dotnet new antdesign --host=server --full</Text></code></pre>
</Card>
<p style="text-align: center; margin-top: 24px;">
Want to add more pages? Please refer to
<a href="https://github.com/ant-design-blazor/ant-design-pro-blazor" target="_blank" rel="noopener noreferrer">
ant-design-pro-blazor project
</a>
</p>
</PageContainer>

Просмотреть файл

@ -0,0 +1,8 @@
@import '~antd/es/style/themes/default.less';
.pre {
margin: 12px 0;
padding: 12px 20px;
background: @input-bg;
box-shadow: @card-shadow;
}

Просмотреть файл

@ -1,5 +1,5 @@
@page "/"
@namespace AntDesign.Pro.Server.Pages
@namespace AntDesign.Pro.Template.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = null;
@ -10,10 +10,10 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AntDesign.Pro</title>
<title>AntDesign.Pro.Template</title>
<base href="~/" />
<link href="_content/AntDesign/css/ant-design-blazor.css" rel="stylesheet" />
<link href="_content/{pro-layout}/css/ant-design-pro-layout-blazor.css" rel="stylesheet" />
<link href="_content/AntDesign.Pro.Layout/css/ant-design-pro-layout-blazor.css" rel="stylesheet" />
<link href="./css/site.css" rel="stylesheet" />
</head>
<body>
@ -24,7 +24,6 @@
<script src="_content/AntDesign.Charts/g2plot.js"></script>
<script src="_content/AntDesign/js/ant-design-blazor.js"></script>
<script src="_content/AntDesign.Charts/ant-design-charts-blazor.js"></script>
<script src="_framework/blazor.server.js"></script>
</body>
</html>

Просмотреть файл

@ -9,7 +9,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace AntDesign.Pro
namespace AntDesign.Pro.Template
{
public class Program
{

Просмотреть файл

@ -10,11 +10,12 @@ using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using AntDesign.Pro.Layout;
//#if (full)
using AntDesign.Pro.Services;
using AntDesign.Pro.Template.Services;
//#endif
namespace AntDesign.Pro
namespace AntDesign.Pro.Template
{
public class Startup
{
@ -36,9 +37,13 @@ namespace AntDesign.Pro
{
BaseAddress = new Uri(sp.GetService<NavigationManager>().BaseUri)
});
services.Configure<ProSettings>(Configuration.GetSection("ProSettings"));
//#if (full)
services.AddScoped<ChartService>();
services.AddScoped<ProjectService>();
services.AddScoped<IChartService, ChartService>();
services.AddScoped<IProjectService, ProjectService>();
services.AddScoped<IUserService, UserService>();
services.AddScoped<IAccountService, AccountService>();
services.AddScoped<IProfileService, ProfileService>();
//#endif
}

Просмотреть файл

@ -1,13 +1,14 @@
@using System.Net.Http
@using AntDesign
@using AntDesign.Charts
@using AntDesign.Pro.Layout
@using System.Net.Http
@using System.Net.Http.Json
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.JSInterop
@using AntDesign
@using AntDesign.Charts
@using {pro-layout}
@using AntDesign.Pro
@using AntDesign.Pro.Template
//#if (full)
@using AntDesign.Pro.Services;
@using AntDesign.Pro.Template.Models
@using AntDesign.Pro.Template.Services
//#endif

Просмотреть файл

@ -6,5 +6,21 @@
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"ProSettings": {
"NavTheme": "dark",
"Layout": "side",
"ContentWidth": "Fluid",
"FixedHeader": false,
"FixSiderbar": true,
"Title": "Ant Design Pro",
"PrimaryColor": "daybreak",
"ColorWeak": false,
"SplitMenus": false,
"HeaderRender": true,
"FooterRender": true,
"MenuRender": true,
"MenuHeaderRender": true,
"HeaderHeight": 48
}
}

Просмотреть файл

@ -6,5 +6,21 @@
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
"AllowedHosts": "*",
"ProSettings": {
"NavTheme": "dark",
"Layout": "side",
"ContentWidth": "Fluid",
"FixedHeader": false,
"FixSiderbar": true,
"Title": "Ant Design Pro",
"PrimaryColor": "daybreak",
"ColorWeak": false,
"SplitMenus": false,
"HeaderRender": true,
"FooterRender": true,
"MenuRender": true,
"MenuHeaderRender": true,
"HeaderHeight": 48
}
}

Двоичные данные
.template.config/templates/server/wwwroot/favicon.ico Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 15 KiB

Просмотреть файл

@ -6,9 +6,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AntDesign" Version="0.3.0-*" />
<PackageReference Include="AntDesign" Version="0.4.0-*" />
<PackageReference Include="AntDesign.Charts" Version="0.2.0-*" />
<PackageReference Include="{pro-layout}" Version="0.1.0-*" />
<PackageReference Include="AntDesign.Pro.Layout" Version="0.1.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="3.2.0" PrivateAssets="all" />

Просмотреть файл

@ -1,23 +1,40 @@
@namespace AntDesign.Pro
@namespace AntDesign.Pro.Template
@inherits LayoutComponentBase
<{pro-layout}.BasicLayout
<AntDesign.Pro.Layout.BasicLayout
Logo="@("https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg")"
MenuData="MenuData">
MenuData="_menuData">
<RightContentRender>
<RightContent />
</RightContentRender>
<ChildContent>
@Body
</ChildContent>
</{pro-layout}.BasicLayout>
</AntDesign.Pro.Layout.BasicLayout>
<SettingDrawer />
@inject HttpClient HttpClient
@code
{
private MenuDataItem[] MenuData { get; set; } = {};
//#if (full)
private MenuDataItem[] _menuData = {};
[Inject] public HttpClient HttpClient { get; set; }
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
MenuData = await HttpClient.GetFromJsonAsync<MenuDataItem[]>("data/menu.json");
_menuData = await HttpClient.GetFromJsonAsync<MenuDataItem[]>("data/menu.json");
}
//#else
private readonly MenuDataItem[] _menuData =
{
new MenuDataItem
{
Path = "/",
Name = "welcome",
Key = "welcome",
Icon = "smile",
}
};
//#endif
}

Просмотреть файл

@ -0,0 +1,41 @@
@page "/"
<PageContainer Title="欢迎">
<Card>
<Alert
Message="AntDesign.Templates 已经发布到nuget可以直接下载使用"
Type="success"
ShowIcon
Banner
Style="margin: -12px; margin-bottom: 24px"/>
<Text Strong>
<a target="_blank" rel="noopener noreferrer" href="https://www.nuget.org/packages/AntDesign.Templates">
使用dotnet快速安装最新模板
</a>
</Text>
<pre class="pre"><code><Text Copyable> dotnet new --install AntDesign.Templates::0.1.0-*</Text></code></pre>
<Text
Strong
Style="margin-bottom: 12px">
<a target="_blank" rel="noopener noreferrer" href="https://github.com/ant-design-blazor/ant-design-pro-blazor">
创建wasm空项目
</a>
</Text>
<pre class="pre"><code><Text Copyable> dotnet new antdesign --host=wasm</Text></code></pre>
<Text
Strong
Style="margin-bottom: 12px">
<a target="_blank" rel="noopener noreferrer" href="https://github.com/ant-design-blazor/ant-design-pro-blazor">
创建包含所有页面的wasm项目
</a>
</Text>
<pre class="pre"><code><Text Copyable> dotnet new antdesign --host=wasm --full</Text></code></pre>
</Card>
<p style="text-align: center; margin-top: 24px;">
Want to add more pages? Please refer to
<a href="https://github.com/ant-design-blazor/ant-design-pro-blazor" target="_blank" rel="noopener noreferrer">
ant-design-pro-blazor project
</a>
</p>
</PageContainer>

Просмотреть файл

@ -0,0 +1,8 @@
@import '~antd/es/style/themes/default.less';
.pre {
margin: 12px 0;
padding: 12px 20px;
background: @input-bg;
box-shadow: @card-shadow;
}

Просмотреть файл

@ -1,14 +1,14 @@
using AntDesign.Pro.Layout;
//#if (full)
using AntDesign.Pro.Template.Services;
//#endif
using System;
using System.Net.Http;
using System.Threading.Tasks;
using {pro-layout};
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
//#if (full)
using AntDesign.Pro.Services;
//#endif
namespace AntDesign.Pro
namespace AntDesign.Pro.Template
{
public class Program
{
@ -21,8 +21,11 @@ namespace AntDesign.Pro
builder.Services.AddAntDesign();
builder.Services.Configure<ProSettings>(builder.Configuration.GetSection("ProSettings"));
//#if (full)
builder.Services.AddScoped<ChartService>();
builder.Services.AddScoped<ProjectService>();
builder.Services.AddScoped<IChartService, ChartService>();
builder.Services.AddScoped<IProjectService, ProjectService>();
builder.Services.AddScoped<IUserService, UserService>();
builder.Services.AddScoped<IAccountService, AccountService>();
builder.Services.AddScoped<IProfileService, ProfileService>();
//#endif
await builder.Build().RunAsync();

Просмотреть файл

@ -1,14 +1,15 @@
@using System.Net.Http
@using AntDesign
@using AntDesign.Charts
@using AntDesign.Pro.Layout
@using System.Net.Http
@using System.Net.Http.Json
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.WebAssembly.Http
@using Microsoft.JSInterop
@using AntDesign
@using AntDesign.Charts
@using {pro-layout}
@using AntDesign.Pro
@using AntDesign.Pro.Template
//#if (full)
@using AntDesign.Pro.Services;
@using AntDesign.Pro.Template.Models
@using AntDesign.Pro.Template.Services
//#endif

Просмотреть файл

@ -0,0 +1,18 @@
{
"ProSettings": {
"NavTheme": "dark",
"Layout": "side",
"ContentWidth": "Fluid",
"FixedHeader": false,
"FixSiderbar": true,
"Title": "Ant Design Pro",
"PrimaryColor": "daybreak",
"ColorWeak": false,
"SplitMenus": false,
"HeaderRender": true,
"FooterRender": true,
"MenuRender": true,
"MenuHeaderRender": true,
"HeaderHeight": 48
}
}

Двоичные данные
.template.config/templates/wasm/wwwroot/favicon.ico Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 15 KiB

Просмотреть файл

@ -7,7 +7,7 @@
<title>Ant Design Pro Blazor</title>
<base href="/" />
<link href="_content/AntDesign/css/ant-design-blazor.css" rel="stylesheet" />
<link href="_content/{pro-layout}/css/ant-design-pro-layout-blazor.css" rel="stylesheet" />
<link href="_content/AntDesign.Pro.Layout/css/ant-design-pro-layout-blazor.css" rel="stylesheet" />
<link href="./css/site.css" rel="stylesheet" />
</head>

Просмотреть файл

@ -44,4 +44,42 @@ An out-of-box UI solution for enterprise applications as a Blazor boilerplate.
- Login
- Register
- Register Result
```
## Usage
### Install Template
```bash
dotnet new -i AntDesign.Templates::0.1.0-*
```
### Uninstall Template
```bash
dotnet new -u AntDesign.Templates
```
### Create New Project
```bash
# Create an empty wasm project
dotnet new antdesign --host=wasm
# Create wasm project with full pages
dotnet new antdesign --host=wasm --full
# Create an empty server-side project
dotnet new antdesign --host=server
# Create server-side project with full pages
dotnet new antdesign --host=server --full
# Create an empty hosted project
dotnet new antdesign --host=hosted
# Create hosted project with full pages
dotnet new antdesign --host=hosted --full
```
### Override Existing Project
```bash
## You can override an existing project with the --force
dotnet new antdesign --host=wasm --force
```

Просмотреть файл

@ -43,4 +43,42 @@
- 登录
- 注册
- 注册成功
```
## 使用
### 安装模板
```bash
dotnet new -i AntDesign.Templates::0.1.0-*
```
### 卸载模板
```bash
dotnet new -u AntDesign.Templates
```
### 新建项目
```bash
# Create an empty wasm project
dotnet new antdesign --host=wasm
# Create wasm project with full pages
dotnet new antdesign --host=wasm --full
# Create an empty server-side project
dotnet new antdesign --host=server
# Create server-side project with full pages
dotnet new antdesign --host=server --full
# Create an empty hosted project
dotnet new antdesign --host=hosted
# Create hosted project with full pages
dotnet new antdesign --host=hosted --full
```
### 覆盖项目
```bash
## You can override an existing project with the --force
dotnet new antdesign --host=wasm --force
```

Двоичные данные
logo.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 7.7 KiB

Просмотреть файл

@ -3,12 +3,14 @@
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion>
<AssemblyName>AntDesign.Pro.Template</AssemblyName>
<RootNamespace>AntDesign.Pro.Template</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AntDesign" Version="0.3.0-*" />
<PackageReference Include="AntDesign" Version="0.4.0-*" />
<PackageReference Include="AntDesign.Charts" Version="0.2.0-*" />
<PackageReference Include="AntDesign.Pro.Layout" Version="0.1.0-nightly-200824114222" />
<PackageReference Include="AntDesign.Pro.Layout" Version="0.1.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="3.2.0" PrivateAssets="all" />
@ -43,4 +45,8 @@
<Watch Include="**\*.razor" />
<Watch Include="**\*.less" />
</ItemGroup>
<ItemGroup>
<None Remove="AntDesign.Pro.csproj.DotSettings" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,50 @@
@namespace AntDesign.Pro.Template.Components
@inherits AntDomComponentBase
<Space Class="@ClassMapper.Class">
<SpaceItem>
<HeaderSearch Class="action search"
Placeholder="站内搜索"
DefaultValue="umi ui"
Options="DefaultOptions" />
</SpaceItem>
<SpaceItem>
<Tooltip Title="@("Help")" Placement="@PlacementType.Bottom">
<span class="action">
<Icon Type="question-circle" Theme="outline" />
</span>
</Tooltip>
</SpaceItem>
<SpaceItem>
<NoticeIcon ClearText="清空"
ViewMoreText="查看更多"
Count="_count"
OnClear="HandleClear"
OnViewMore="HandleViewMore">
<NoticeList TabKey="notification"
Title="通知"
EmptyText="你已查看所有通知"
ShowViewMore
Data="_notifications"/>
<NoticeList TabKey="message"
Title="消息"
EmptyText="您已读完所有消息"
ShowViewMore
Data="_messages"/>
<NoticeList TabKey="event"
Title="待办"
EmptyText="你已完成所有待办"
ShowViewMore
Data="_events"/>
</NoticeIcon>
</SpaceItem>
<SpaceItem>
<AvatarDropdown Name="@_currentUser.Name"
Avatar="@_currentUser.Avatar"
OnItemSelected="HandleSelectUser" />
</SpaceItem>
<SpaceItem>
<SelectLang OnItemSelected="HandleSelectLang" />
</SpaceItem>
</Space>
<Message/>

Просмотреть файл

@ -0,0 +1,106 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AntDesign.Pro.Layout;
using AntDesign.Pro.Template.Models;
using AntDesign.Pro.Template.Services;
using Microsoft.AspNetCore.Components;
using AntDesign;
namespace AntDesign.Pro.Template.Components
{
public partial class RightContent
{
private CurrentUser _currentUser = new CurrentUser();
private NoticeIconData[] _notifications = { };
private NoticeIconData[] _messages = { };
private NoticeIconData[] _events = { };
private int _count = 0;
private List<AutoCompleteDataItem> DefaultOptions { get; set; } = new List<AutoCompleteDataItem>
{
new AutoCompleteDataItem
{
Label = "umi ui",
Value = "umi ui"
},
new AutoCompleteDataItem
{
Label = "Pro Table",
Value = "Pro Table"
},
new AutoCompleteDataItem
{
Label = "Pro Layout",
Value = "Pro Layout"
}
};
[Inject] protected NavigationManager NavigationManager { get; set; }
[Inject] protected IUserService UserService { get; set; }
[Inject] protected IProjectService ProjectService { get; set; }
[Inject] protected MessageService MessageService { get; set; }
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
SetClassMap();
_currentUser = await UserService.GetCurrentUserAsync();
var notices = await ProjectService.GetNoticesAsync();
_notifications = notices.Where(x => x.Type == "notification").Cast<NoticeIconData>().ToArray();
_messages = notices.Where(x => x.Type == "message").Cast<NoticeIconData>().ToArray();
_events = notices.Where(x => x.Type == "event").Cast<NoticeIconData>().ToArray();
_count = notices.Length;
}
protected void SetClassMap()
{
ClassMapper
.Clear()
.Add("right");
}
public void HandleSelectUser(MenuItem item)
{
switch (item.Key)
{
case "center":
NavigationManager.NavigateTo("/account/center");
break;
case "setting":
NavigationManager.NavigateTo("/account/settings");
break;
case "logout":
NavigationManager.NavigateTo("/user/login");
break;
}
}
public void HandleSelectLang(MenuItem item)
{
}
public async Task HandleClear(string key)
{
switch (key)
{
case "notification":
_notifications = new NoticeIconData[] { };
break;
case "message":
_messages = new NoticeIconData[] { };
break;
case "event":
_events = new NoticeIconData[] { };
break;
}
await MessageService.Success($"清空了{key}");
}
public async Task HandleViewMore(string key)
{
await MessageService.Info("Click on view more");
}
}
}

Просмотреть файл

@ -0,0 +1,62 @@
using System;
namespace AntDesign.Pro.Template
{
public static class DateTimeExtension
{
private const int Second = 1;
private const int Minute = 60 * Second;
private const int Hour = 60 * Minute;
private const int Day = 24 * Hour;
private const int Month = 30 * Day;
// todo: Need to be localized
public static string ToFriendlyDisplay(this DateTime dateTime)
{
var ts = DateTime.Now - dateTime;
var delta = ts.TotalSeconds;
if (delta < 0)
{
return "not yet";
}
if (delta < 1 * Minute)
{
return ts.Seconds == 1 ? "1秒前" : ts.Seconds + "秒前";
}
if (delta < 2 * Minute)
{
return "1分钟之前";
}
if (delta < 45 * Minute)
{
return ts.Minutes + "分钟";
}
if (delta < 90 * Minute)
{
return "1小时前";
}
if (delta < 24 * Hour)
{
return ts.Hours + "小时前";
}
if (delta < 48 * Hour)
{
return "昨天";
}
if (delta < 30 * Day)
{
return ts.Days + " 天之前";
}
if (delta < 12 * Month)
{
var months = Convert.ToInt32(Math.Floor((double)ts.Days / 30));
return months <= 1 ? "一个月之前" : months + "月之前";
}
else
{
var years = Convert.ToInt32(Math.Floor((double)ts.Days / 365));
return years <= 1 ? "一年前" : years + "年前";
}
}
}
}

Просмотреть файл

@ -1,9 +1,12 @@
@namespace AntDesign.Pro
@namespace AntDesign.Pro.Template
@inherits LayoutComponentBase
<AntDesign.Pro.Layout.BasicLayout
Logo="@("https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg")"
MenuData="MenuData">
<RightContentRender>
<AntDesign.Pro.Template.Components.RightContent />
</RightContentRender>
<ChildContent>
@Body
</ChildContent>

Просмотреть файл

@ -1,8 +1,8 @@
@namespace AntDesign.Pro
@namespace AntDesign.Pro.Template
@using OneOf
@inherits LayoutComponentBase
<div class="container">
<div class="container__b__0">
<div class="lang">
<!--todo: selectLang-->
</div>
@ -27,10 +27,10 @@
@code
{
private readonly LinkItem[] _links = new LinkItem[]
private readonly LinkItem[] _links =
{
new LinkItem{ Key = "", BlankTarget = true, Title = "Ant Design Pro"},
new LinkItem{ Key = "", BlankTarget = true, Title = OneOf<string, RenderFragment>.FromT1(@<Icon Type="github" />)},
new LinkItem{ Key = "", BlankTarget = true, Title = "Ant Design"},
new LinkItem{ Key = "", BlankTarget = true, Title = "Ant Design Pro"},
new LinkItem{ Key = "", BlankTarget = true, Title = OneOf<string, RenderFragment>.FromT1(@<Icon Type="github" />)},
new LinkItem{ Key = "", BlankTarget = true, Title = "Ant Design"},
};
}

Просмотреть файл

@ -1,6 +1,6 @@
@import '~antd/es/style/themes/default.less';
.container {
.container__b__0 {
display: flex;
flex-direction: column;
height: 100vh;
@ -58,7 +58,7 @@
}
@media (min-width: @screen-md-min) {
.container {
.container__b__0 {
background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg');
background-repeat: no-repeat;
background-position: center 110px;

Просмотреть файл

@ -0,0 +1,14 @@
using System;
namespace AntDesign.Pro.Template.Models
{
public class ActivitiesType
{
public string Id { get; set; }
public DateTime UpdatedAt { get; set; }
public ActivityUser User { get; set; }
public ActivityGroup Group { get; set; }
public ActivityProject Project { get; set; }
public string Template { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,8 @@
namespace AntDesign.Pro.Template.Models
{
public class ActivityGroup
{
public string Name { get; set; }
public string Link { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,8 @@
namespace AntDesign.Pro.Template.Models
{
public class ActivityProject
{
public string Name { get; set; }
public string Link { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,8 @@
namespace AntDesign.Pro.Template.Models
{
public class ActivityUser
{
public string Name { get; set; }
public string Avatar { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,12 @@
namespace AntDesign.Pro.Template.Models
{
public class AdvancedOperation
{
public string Key { get; set; }
public string Type { get; set; }
public string Name { get; set; }
public string Status { get; set; }
public string UpdatedAt { get; set; }
public string Memo { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,9 @@
namespace AntDesign.Pro.Template.Models
{
public class AdvancedProfileData
{
public AdvancedOperation[] AdvancedOperation1 { get; set; }
public AdvancedOperation[] AdvancedOperation2 { get; set; }
public AdvancedOperation[] AdvancedOperation3 { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,12 @@
namespace AntDesign.Pro.Template.Models
{
public class BasicGood
{
public string Id { get; set; }
public string Name { get; set; }
public string Barcode { get; set; }
public string Price { get; set; }
public string Num { get; set; }
public string Amount { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,8 @@
namespace AntDesign.Pro.Template.Models
{
public class BasicProfileDataType
{
public BasicGood[] BasicGoods { get; set; }
public BasicProgress[] BasicProgress { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,12 @@
namespace AntDesign.Pro.Template.Models
{
public class BasicProgress
{
public string Key { get; set; }
public string Time { get; set; }
public string Rate { get; set; }
public string Status { get; set; }
public string Operator { get; set; }
public string Cost { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,16 @@
namespace AntDesign.Pro.Template.Models
{
public class ChartData
{
public ChartDataItem[] VisitData { get; set; }
public ChartDataItem[] VisitData2 { get; set; }
public ChartDataItem[] SalesData { get; set; }
public SearchDataItem[] SearchData { get; set; }
public OfflineDataItem[] OfflineData { get; set; }
public OfflineChartDataItem[] OfflineChartData { get; set; }
public ChartDataItem[] SalesTypeData { get; set; }
public ChartDataItem[] SalesTypeDataOnline { get; set; }
public ChartDataItem[] SalesTypeDataOffline { get; set; }
public RadarDataItem[] RadarData { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,8 @@
namespace AntDesign.Pro.Template.Models
{
public class ChartDataItem
{
public string X { get; set; }
public int Y { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,40 @@
namespace AntDesign.Pro.Template.Models
{
public class TagType
{
public string Key { get; set; }
public string Label { get; set; }
}
public class GeographicType
{
public TagType Province { get; set; }
public TagType City { get; set; }
}
public class CurrentUser
{
public string Name { get; set; }
public string Avatar { get; set; }
public string Userid { get; set; }
public NoticeType[] Notice { get; set; } = { };
public string Email { get; set; }
public string Signature { get; set; }
public string Title { get; set; }
public string Group { get; set; }
public TagType[] Tags { get; set; } = { };
public int NotifyCount { get; set; }
public int UnreadCount { get; set; }
public string Country { get; set; }
public GeographicType Geographic { get; set; }
public string Address { get; set; }
public string Phone { get; set; }
}
public class UserLiteItem
{
public string Avater { get; set; }
public string Title { get; set; }
public string Description { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,48 @@
using System;
namespace AntDesign.Pro.Template.Models
{
public class StepFormModel
{
public string ReceiverAccountType { get; set; } = "ant-design@alipay.com";
public string ReceiverAccount { get; set; } = "test@example.com";
public string ReceiverName { get; set; } = "Alex";
public string PayAccount { get; set; }
public string Password { get; set; } = "500";
public string Amount { get; set; } = "12345678";
}
public class AdvancedFormModel
{
public string Name { get; set; }
public string Url { get; set; }
public string Owner { get; set; }
public string Approver { get; set; }
public DateTime?[] DateRange { get; set; }
public string Type { get; set; }
public string Name2 { get; set; }
public string Url2 { get; set; }
public string Owner2 { get; set; }
public string Approver2 { get; set; }
public DateTime? DateRange2 { get; set; }
public string Type2 { get; set; }
}
public class BasicFormModel
{
public string Title { get; set; }
public string Client { get; set; }
public string Invites { get; set; }
public int Disclosure { get; set; }
public int Weight { get; set; }
public string Standard { get; set; }
public string Goal { get; set; }
public DateTime?[] DateRange { get; set; }
}
public class Owner
{
public string Id { get; set; }
public string Name { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,17 @@
namespace AntDesign.Pro.Template.Models
{
public class ListFormModel
{
public string Owner { get; set; } = "wzj";
public string ActiveUser { get; set; }
public string Satisfaction { get; set; }
}
public class BasicListFormModel
{
public string Status { get; set; } = "all";
public string SearchKeyword { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,42 @@
using System;
using System.Text.Json.Serialization;
using AntDesign.Pro.Template.Utils;
namespace AntDesign.Pro.Template.Models
{
public class Member
{
public string Avatar { get; set; }
public string Name { get; set; }
public string Id { get; set; }
}
public class ListItemDataType
{
public string Id { get; set; }
public string Owner { get; set; }
public string Title { get; set; }
public string Avatar { get; set; }
public string Cover { get; set; }
public string Status { get; set; }
public int Percent { get; set; }
public string Logo { get; set; }
public string Href { get; set; }
public string Body { get; set; }
public string SubDescription { get; set; }
public string Description { get; set; }
public int ActiveUser { get; set; }
public int NewUser { get; set; }
public int Star { get; set; }
public int Like { get; set; }
public int Message { get; set; }
public string Content { get; set; }
public Member[] Members { get; set; }
[JsonConverter(typeof(LongToDateTimeConverter))]
public DateTime UpdatedAt { get; set; }
[JsonConverter(typeof(LongToDateTimeConverter))]
public DateTime CreatedAt { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
namespace AntDesign.Pro.Template.Models
{
public class LoginParamsType
{
[Required] public string UserName { get; set; }
[Required] public string Password { get; set; }
public string Mobile { get; set; }
public string Captcha { get; set; }
public string LoginType { get; set; }
public bool AutoLogin { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,11 @@
using AntDesign.Pro.Layout;
namespace AntDesign.Pro.Template.Models
{
public class NoticeItem : NoticeIconData
{
public string Id { get; set; }
public string Type { get; set; }
public string Status { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,14 @@
namespace AntDesign.Pro.Template.Models
{
public class NoticeType
{
public string Id { get; set; }
public string Title { get; set; }
public string Logo { get; set; }
public string Description { get; set; }
public string UpdatedAt { get; set; }
public string Member { get; set; }
public string Href { get; set; }
public string MemberLink { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,9 @@
namespace AntDesign.Pro.Template.Models
{
public class OfflineChartDataItem
{
public long X { get; set; }
public int Y1 { get; set; }
public int Y2 { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,8 @@
namespace AntDesign.Pro.Template.Models
{
public class OfflineDataItem
{
public string Name { get; set; }
public float Cvr { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,9 @@
namespace AntDesign.Pro.Template.Models
{
public class RadarDataItem
{
public string Name { get; set; }
public string Label { get; set; }
public int Value { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,11 @@
namespace AntDesign.Pro.Template.Models
{
public class SearchDataItem
{
public int Index { get; set; }
public string Keywod { get; set; }
public int Count { get; set; }
public int Range { get; set; }
public int Status { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,62 @@
@namespace AntDesign.Pro.Template.Pages.Account.Center
<AntList
TItem="ListItemDataType"
Class="filterCardList"
Grid="_listGridType"
DataSource="List">
<ListItem NoFlex Grid="_listGridType">
<Card
Bordered
Hoverable
BodyStyle="padding-bottom: 20px;"
Actions="Actions">
<CardMeta>
<AvatarTemplate>
<Avatar Size="small" Src="@context.Avatar" />
</AvatarTemplate>
<TitleTemplate>@context.Title</TitleTemplate>
</CardMeta>
<div class="cardItemContent">
<div class="cardInfo">
<div>
<p>活跃用户</p>
<p>@FormatWan(context.ActiveUser)</p>
</div>
<div>
<p>新增用户</p>
<p>@context.NewUser.ToString("0,0")</p>
</div>
</div>
</div>
</Card>
</ListItem>
</AntList>
@code
{
private static readonly RenderFragment Download = @<Tooltip Title="@("下载")">
<Icon Type="download" Theme="outline"/>
</Tooltip>;
private static readonly IList<RenderFragment> Actions = new List<RenderFragment>
{
Download,
@<Tooltip Title="@("编辑")"><Icon Type="edit" Theme="outline"/></Tooltip>,
@<Tooltip Title="@("分享")"><Icon Type="share-alt" Theme="outline"/></Tooltip>,
@<Dropdown><Icon Type="ellipsis" Theme="outline"/></Dropdown>
};
private static RenderFragment FormatWan(int val)
{
if (val > 10000)
{
val = (int)Math.Floor((double)val / 10000);
}
return @<span>
@val
<span style="position: relative; top: -2px; font-size: 14px; font-style: normal; margin-left: 2px;">万</span>
</span>;
}
}

Просмотреть файл

@ -0,0 +1,18 @@
using System.Collections.Generic;
using AntDesign.Pro.Template.Models;
using Microsoft.AspNetCore.Components;
using AntDesign;
namespace AntDesign.Pro.Template.Pages.Account.Center
{
public partial class Applications
{
private readonly ListGridType _listGridType = new ListGridType
{
Gutter = 24,
Column = 4
};
[Parameter] public IList<ListItemDataType> List { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,16 @@
@using AntDesign.Pro.Template.Models
@namespace AntDesign.Pro.Template.Pages.Account.Center
<div class="listContent">
<div class="description">@Data.Content</div>
<div class="extra">
<Avatar Src="@Data.Avatar" Size="small" />
<a href="@Data.Href">@Data.Owner</a> 发布在 <a href="@Data.Href">@Data.Href</a>
<em>@Data.UpdatedAt.ToString("yyyy-MM-dd HH:mm:ss")</em>
</div>
</div>
@code
{
[Parameter] public ListItemDataType Data { get; set; }
}

Просмотреть файл

@ -1,27 +1,16 @@
@namespace AntDesign.Pro.Pages.Account.Center
@namespace AntDesign.Pro.Template.Pages.Account.Center
<AntList DataSource="@data" TItem="BasicItem">
<Item Context="item">
<AntListItemMeta Avatar="@("https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png")" Description="Ant Design, a design language for background applications, is refined by Ant UED Team">
<Title>
<a href="https://ng.ant.design">@item.Title</a>
</Title>
</AntListItemMeta>
</Item>
</AntList>
@code
{
public class BasicItem
{
public string Title { get; set; }
}
public List<BasicItem> data = new List<BasicItem>
{
new BasicItem { Title = "Ant Design Title 1"},
new BasicItem { Title = "Ant Design Title 2"},
new BasicItem { Title = "Ant Design Title 3"},
new BasicItem { Title = "Ant Design Title 4"},
};
}
<AntList
TItem="ListItemDataType"
Size="large"
Class="articleList"
DataSource="List">
<ListItem NoFlex>
<ListItemMeta Description="">
<TitleTemplate>
<a href="https://ng.ant.design">@context.Title</a>
</TitleTemplate>
</ListItemMeta>
<ArticleListContent Data="@context" />
</ListItem>
</AntList>

Просмотреть файл

@ -0,0 +1,11 @@
using System.Collections.Generic;
using AntDesign.Pro.Template.Models;
using Microsoft.AspNetCore.Components;
namespace AntDesign.Pro.Template.Pages.Account.Center
{
public partial class Articles
{
[Parameter] public IList<ListItemDataType> List { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,7 @@
@namespace AntDesign.Pro.Template.Pages.Account.Center
<div class="avatarList">
<ul>
@ChildContent
</ul>
</div>

Просмотреть файл

@ -0,0 +1,9 @@
using Microsoft.AspNetCore.Components;
namespace AntDesign.Pro.Template.Pages.Account.Center
{
public partial class AvatarList
{
[Parameter] public RenderFragment ChildContent { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,15 @@
@namespace AntDesign.Pro.Template.Pages.Account.Center
@inherits AntDomComponentBase
<li class="@ClassMapper.Class" @onclick="OnClick">
@if (string.IsNullOrEmpty(Tips))
{
<Tooltip Title="@Tips">
<Avatar Src="@Src" Size="@Size" Style="cursor: pointer;" />
</Tooltip>
}
else
{
<Avatar Src="@Src" Size="@Size" />
}
</li>

Просмотреть файл

@ -0,0 +1,28 @@
using Microsoft.AspNetCore.Components;
namespace AntDesign.Pro.Template.Pages.Account.Center
{
public partial class AvatarListItem
{
[Parameter] public string Size { get; set; }
[Parameter] public string Tips { get; set; }
[Parameter] public string Src { get; set; }
[Parameter] public EventCallback OnClick { get; set; }
protected override void OnInitialized()
{
base.OnInitialized();
SetClassMap();
}
protected void SetClassMap()
{
ClassMapper
.Clear()
.Add("avatarItem")
.If("avatarItemLarge", () => Size == "large")
.If("avatarItemSmall", () => Size == "small")
.If("avatarItemMini", () => Size == "mini");
}
}
}

Просмотреть файл

@ -0,0 +1,35 @@
@namespace AntDesign.Pro.Template.Pages.Account.Center
<AntList
TItem="ListItemDataType"
Class="coverCardList"
Grid="_listGridType"
DataSource="List">
<ListItem NoFlex Grid="_listGridType">
<Card Class="card" Hoverable Bordered>
<Cover>
<img alt="@context.Title" src="@context.Cover"/>
</Cover>
<ChildContent>
<CardMeta>
<DescriptionTemplate>@context.SubDescription</DescriptionTemplate>
<TitleTemplate><a>@context.Title</a></TitleTemplate>
</CardMeta>
<div class="cardItemContent">
<span>@context.UpdatedAt.ToFriendlyDisplay()</span>
<div class="avatarList">
<AvatarList>
@foreach (var member in context.Members)
{
<AvatarListItem
Size="small"
Src="@member.Avatar"
Tips="@member.Name"/>
}
</AvatarList>
</div>
</div>
</ChildContent>
</Card>
</ListItem>
</AntList>

Просмотреть файл

@ -0,0 +1,19 @@
using System.Collections.Generic;
using AntDesign.Pro.Template.Models;
using Microsoft.AspNetCore.Components;
using AntDesign;
namespace AntDesign.Pro.Template.Pages.Account.Center
{
public partial class Projects
{
private readonly ListGridType _listGridType = new ListGridType
{
Gutter = 24,
Column = 4
};
[Parameter]
public IList<ListItemDataType> List { get; set; }
}
}

Просмотреть файл

@ -2,7 +2,8 @@
.coverCardList {
.card {
:global {
//todo: global break style
//:global {
.ant-card-meta-title {
margin-bottom: 4px;
& > a {
@ -16,14 +17,14 @@
overflow: hidden;
line-height: 22px;
}
}
//}
&:hover {
:global {
//:global {
.ant-card-meta-title > a {
color: @primary-color;
}
}
//}
}
}
@ -46,9 +47,9 @@
margin-top: 24px;
}
:global {
//:global {
.ant-list .ant-list-item-content-single {
max-width: 100%;
}
}
//}
}

Просмотреть файл

@ -1,4 +1,4 @@
@namespace AntDesign.Pro.Pages.Account.Center
@namespace AntDesign.Pro.Template.Pages.Account.Center
@page "/account/center"
<GridContent>
@ -6,24 +6,25 @@
<AntDesign.Col Span="7">
<Card Style="margin-bottom: 24px;">
<div class="avatarHolder">
<img alt="" src="@currentUser.Avatar" />
<div className="name">@currentUser.Name</div>
<div>@currentUser.Signature</div>
<img alt="" src="@_currentUser.Avatar" />
<div className="name">@_currentUser.Name</div>
<div>@_currentUser.Signature</div>
</div>
<div className={styles.detail}>
<div class="detail">
<p>
<Icon Type="contacts" Theme="outline" Style="margin-right:8px;" />
@currentUser.Title
@_currentUser.Title
</p>
<p>
<Icon Type="cluster" Theme="outline" Style="margin-right:8px;" />
@currentUser.Group
@_currentUser.Group
</p>
<p>
<Icon Type="home" Theme="outline" Style="margin-right:8px;" />
<!--todo: add userinfo-->
@currentUser.Geographic
@_currentUser.Geographic.Province.Label
@_currentUser.Geographic.City.Label
</p>
</div>
@ -31,11 +32,26 @@
<div class="tags">
<div class="tagsTitle">标签</div>
@foreach (var item in lstTags)
@foreach (var tag in _currentUser.Tags)
{
<Tag>@item</Tag>
<Tag>@tag.Label</Tag>
}
@if (_inputVisible)
{
<AntDesign.Input
Type="text"
Size="small"
Style="width: 78px"
@bind-Value="InputValue"
OnBlur="HandleInputConfirm"/>
}
else
{
<Tag OnClick="ShowInput" Style="border-style: dashed">
<Icon Type="plus" Theme="outline" />
</Tag>
}
</div>
<Divider Dashed Style="margin-top: 16px;" />
@ -48,63 +64,29 @@
</AntDesign.Col>
<AntDesign.Col Span="17">
<Card Class="tabsCard">
<Body>
<CardTabs>
<Tabs DefaultActiveKey="1">
<TabPane Key="1">
<Tab>文章</Tab>
<ChildContent><Articles /></ChildContent>
<Tab>文章 (@_fakeList.Count)</Tab>
<ChildContent>
<Articles List="_fakeList"/>
</ChildContent>
</TabPane>
<TabPane Key="2">
<Tab>应用</Tab>
<ChildContent>Content of Tab Pane 2</ChildContent>
<Tab>应用 (@_fakeList.Count)</Tab>
<ChildContent>
<Applications List="_fakeList"/>
</ChildContent>
</TabPane>
<TabPane Key="3">
<Tab>项目</Tab>
<ChildContent>Content of Tab Pane 3</ChildContent>
<Tab>项目 (@_fakeList.Count)</Tab>
<ChildContent>
<Projects List="_fakeList"/>
</ChildContent>
</TabPane>
</Tabs>
</Body>
</CardTabs>
</Card>
</AntDesign.Col>
</Row>
</GridContent>
@code
{
public class CurrentUser
{
public string Name { get; set; }
public string Avatar { get; set; }
public string Signature { get; set; }
public string Title { get; set; }
public string Group { get; set; }
public string Geographic { get; set; }
}
private CurrentUser currentUser = new CurrentUser
{
Avatar = "https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png",
Name = "Serati Ma",
Signature = "海纳百川,有容乃大",
Title = "交互专家",
Group = "蚂蚁金服某某某事业群某某平台部某某技术部UED",
Geographic = "浙江省杭州市"
};
private bool inputVisible = false;
private string inputValue = string.Empty;
private string[] lstTags = new string[]
{
"很有想法的",
"专注设计",
"辣~",
"大长腿",
"川妹子",
"海纳百川"
};
private void ShowInput()
{
}
}

Просмотреть файл

@ -0,0 +1,40 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using AntDesign.Pro.Template.Models;
using AntDesign.Pro.Template.Services;
using Microsoft.AspNetCore.Components;
namespace AntDesign.Pro.Template.Pages.Account.Center
{
public partial class Index
{
private CurrentUser _currentUser = new CurrentUser
{
Geographic = new GeographicType {City = new TagType(), Province = new TagType()}
};
private IList<ListItemDataType> _fakeList = new List<ListItemDataType>();
private bool _inputVisible;
public string InputValue { get; set; }
[Inject] public IProjectService ProjectService { get; set; }
[Inject] public IUserService UserService { get; set; }
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
_currentUser = await UserService.GetCurrentUserAsync();
_fakeList = await ProjectService.GetFakeListAsync();
}
protected void ShowInput()
{
_inputVisible = true;
}
protected void HandleInputConfirm()
{
_inputVisible = false;
}
}
}

Просмотреть файл

@ -47,19 +47,19 @@
}
.tags {
:global {
//:global {
.ant-tag {
margin-bottom: 8px;
}
}
//}
}
.team {
:global {
//:global {
.ant-avatar {
margin-right: 12px;
}
}
//}
a {
display: block;
@ -78,9 +78,9 @@
}
.tabsCard {
:global {
//:global {
.ant-card-head {
padding: 0 16px;
}
}
//}
}

Просмотреть файл

@ -0,0 +1,54 @@
@namespace AntDesign.Pro.Template.Pages.Account.Settings
<div class="baseView">
<div class="left" style="min-width: 310px;">
<Form
Layout="vertical"
OnFinish="HandleFinish"
Model="@_currentUser">
<FormItem Label="Email">
<AntDesign.Input @bind-Value="@context.Email" />
</FormItem>
<FormItem Label="Nickname">
<AntDesign.Input @bind-Value="@context.Name" />
</FormItem>
<FormItem Label="Personal profile">
<AntDesign.TextArea @bind-Value="@context.Signature" />
</FormItem>
<FormItem Label="Country/Region">
<Select Style="max-width: 220px;" @bind-Value="@context.Country">
<SelectOption Value="China">中国</SelectOption>
</Select>
</FormItem>
<FormItem Label="Province or city">
<GeographicView />
</FormItem>
<FormItem Label="Street Address">
<AntDesign.Input @bind-Value="@context.Address" />
</FormItem>
<FormItem Label="Phone Number">
<PhoneView />
</FormItem>
<FormItem>
<Button HtmlType="submit" Type="primary">
Update Information
</Button>
</FormItem>
</Form>
</div>
<div class="right__b__1">
<div class="avatar_title">
Avatar
</div>
<div class="avatar">
<img src="@_currentUser.Avatar" alt="avatar" />
</div>
<Upload ShowUploadList="false">
<div class="button_view">
<Button Icon="upload">
Change avatar
</Button>
</div>
</Upload>
</div>
</div>

Просмотреть файл

@ -0,0 +1,24 @@
using System.Threading.Tasks;
using AntDesign.Pro.Template.Models;
using AntDesign.Pro.Template.Services;
using Microsoft.AspNetCore.Components;
namespace AntDesign.Pro.Template.Pages.Account.Settings
{
public partial class BaseView
{
private CurrentUser _currentUser = new CurrentUser();
[Inject] protected IUserService UserService { get; set; }
private void HandleFinish()
{
}
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
_currentUser = await UserService.GetCurrentUserAsync();
}
}
}

Просмотреть файл

@ -14,7 +14,7 @@
min-width: 224px;
max-width: 448px;
}
.right {
.right__b__1 {
flex: 1;
padding-left: 104px;
.avatar_title {
@ -44,7 +44,7 @@
.baseView {
flex-direction: column-reverse;
.right {
.right__b__1 {
display: flex;
flex-direction: column;
align-items: center;

Просмотреть файл

@ -0,0 +1,21 @@
@namespace AntDesign.Pro.Template.Pages.Account.Settings
<AntList
TItem="UserLiteItem"
ItemLayout="ListItemLayout.Horizontal"
DataSource="_data">
<ListItem Actions="_actions">
<ListItemMeta Title="@context.Title" Description="@context.Description">
<AvatarTemplate>
<Icon Type="@context.Avater" Theme="outline" Class="@context.Avater" />
</AvatarTemplate>
</ListItemMeta>
</ListItem>
</AntList>
@code
{
private static RenderFragment _modify = @<a key="bind">Bind</a>;
private readonly RenderFragment[] _actions = {_modify};
}

Просмотреть файл

@ -0,0 +1,29 @@
using AntDesign.Pro.Template.Models;
namespace AntDesign.Pro.Template.Pages.Account.Settings
{
public partial class BindingView
{
private readonly UserLiteItem[] _data =
{
new UserLiteItem
{
Avater = "taobao",
Title = "Binding Taobao",
Description = "Currently unbound Taobao account"
},
new UserLiteItem
{
Avater = "alipay",
Title = "Binding Alipay",
Description = "Currently unbound Alipay account"
},
new UserLiteItem
{
Avater = "dingding",
Title = "Binding DingTalk",
Description = "Currently unbound DingTalk account"
}
};
}
}

Просмотреть файл

@ -0,0 +1,5 @@
@namespace AntDesign.Pro.Template.Pages.Account.Settings
<h1>
GeographicView
</h1>

Просмотреть файл

@ -0,0 +1,18 @@
@namespace AntDesign.Pro.Template.Pages.Account.Settings
<AntList
TItem="UserLiteItem"
ItemLayout="ListItemLayout.Horizontal"
DataSource="_data">
<ListItem Actions="_actions">
<ListItemMeta Avatar="" Description="@context.Description">
<TitleTemplate>@context.Title</TitleTemplate>
</ListItemMeta>
</ListItem>
</AntList>
@code
{
private static RenderFragment _switch = @<Switch CheckedChildren="@("Open")" UnCheckedChildren="@("Close")" Checked="true"/>;
private readonly RenderFragment[] _actions = {_switch};
}

Просмотреть файл

@ -0,0 +1,26 @@
using AntDesign.Pro.Template.Models;
namespace AntDesign.Pro.Template.Pages.Account.Settings
{
public partial class NotificationView
{
private readonly UserLiteItem[] _data =
{
new UserLiteItem
{
Title = "Account Password",
Description = "Messages from other users will be notified in the form of a station letter"
},
new UserLiteItem
{
Title = "System Messages",
Description = "System messages will be notified in the form of a station letter"
},
new UserLiteItem
{
Title = "To-do Notification",
Description = "The to-do list will be notified in the form of a letter from the station"
}
};
}
}

Просмотреть файл

@ -0,0 +1,5 @@
@namespace AntDesign.Pro.Template.Pages.Account.Settings
<h1>
PhoneView
</h1>

Просмотреть файл

@ -0,0 +1,18 @@
@namespace AntDesign.Pro.Template.Pages.Account.Settings
<AntList
TItem="UserLiteItem"
ItemLayout="ListItemLayout.Horizontal"
DataSource="_data">
<ListItem Actions="_actions">
<ListItemMeta Avatar="" Description="@context.Description">
<TitleTemplate>@context.Title</TitleTemplate>
</ListItemMeta>
</ListItem>
</AntList>
@code
{
private static RenderFragment _modify = @<a key="modify">Modify</a>;
private readonly RenderFragment[] _actions = {_modify};
}

Просмотреть файл

@ -0,0 +1,37 @@
using AntDesign.Pro.Template.Models;
namespace AntDesign.Pro.Template.Pages.Account.Settings
{
public partial class SecurityView
{
private readonly UserLiteItem[] _data =
{
new UserLiteItem
{
Title = "Account Password",
Description = "Current password strength: : Strong"
},
new UserLiteItem
{
Title = "Security Phone",
Description = "Bound phone: : 138****8293"
},
new UserLiteItem
{
Title = "Security Question",
Description =
"The security question is not set, and the security policy can effectively protect the account security"
},
new UserLiteItem
{
Title = "Backup Email",
Description = "Bound Email: : ant***sign.com"
},
new UserLiteItem
{
Title = "MFA Device",
Description = "Unbound MFA device, after binding, can be confirmed twice"
}
};
}
}

Просмотреть файл

@ -1,2 +1,36 @@
@namespace AntDesign.Pro.Pages.Account.Settings
@page "/account/settings"
@namespace AntDesign.Pro.Template.Pages.Account.Settings
@page "/account/settings"
<GridContent>
<div class="main__b__2">
<div class="leftMenu">
<Menu
Mode="MenuMode.Inline"
SelectedKeys="new []{_selectKey}"
OnMenuItemClicked="SelectKey">
@foreach (var item in _menuMap)
{
<MenuItem Key="@item.Key">@item.Value</MenuItem>
}
</Menu>
</div>
<div class="right__b__0">
<div class="title">@_menuMap[_selectKey]</div>
@switch (_selectKey)
{
case "base":
<BaseView />
break;
case "security":
<SecurityView />
break;
case "binding":
<BindingView />
break;
case "notification":
<NotificationView />
break;
}
</div>
</div>
</GridContent>

Просмотреть файл

@ -0,0 +1,23 @@
using System.Collections.Generic;
using AntDesign;
namespace AntDesign.Pro.Template.Pages.Account.Settings
{
public partial class Index
{
private readonly Dictionary<string, string> _menuMap = new Dictionary<string, string>
{
{"base", "Basic Settings"},
{"security", "Security Settings"},
{"binding", "Account Binding"},
{"notification", "New Message Notification"},
};
private string _selectKey = "base";
private void SelectKey(MenuItem item)
{
_selectKey = item.Key;
}
}
}

Просмотреть файл

@ -1,6 +1,6 @@
@import '~antd/es/style/themes/default.less';
.main {
.main__b__2 {
display: flex;
width: 100%;
height: 100%;
@ -20,7 +20,7 @@
}
}
}
.right {
.right__b__0 {
flex: 1;
padding-top: 8px;
padding-right: 40px;
@ -34,7 +34,7 @@
line-height: 28px;
}
}
:global {
//:global {
.ant-list-split .ant-list-item:last-child {
border-bottom: 1px solid @border-color-split;
}
@ -42,9 +42,9 @@
padding-top: 14px;
padding-bottom: 14px;
}
}
//}
}
:global {
//:global {
.ant-list-item-meta {
// 账号绑定图标
.taobao {
@ -81,16 +81,16 @@
font.weak {
color: @error-color;
}
}
//}
@media screen and (max-width: @screen-md) {
.main {
.main__b__2 {
flex-direction: column;
.leftMenu {
width: 100%;
border: none;
}
.right {
.right__b__0 {
padding: 40px;
}
}

Просмотреть файл

@ -1 +1 @@
@namespace AntDesign.Pro.Pages.Analysis
@namespace AntDesign.Pro.Template.Pages.Dashboard.Analysis.Bar

Просмотреть файл

@ -1,4 +1,4 @@
@namespace AntDesign.Pro.Pages.Analysis
@namespace AntDesign.Pro.Template.Pages.Dashboard.Analysis
@inherits AntDomComponentBase
<Card>

Просмотреть файл

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components;
namespace AntDesign.Pro.Pages.Analysis
namespace AntDesign.Pro.Template.Pages.Dashboard.Analysis
{
public partial class ChartCard
{

Просмотреть файл

@ -1,4 +1,4 @@
@namespace AntDesign.Pro.Pages.Analysis
@namespace AntDesign.Pro.Template.Pages.Dashboard.Analysis
@inherits AntDomComponentBase
<div class="field">

Просмотреть файл

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components;
namespace AntDesign.Pro.Pages.Analysis
namespace AntDesign.Pro.Template.Pages.Dashboard.Analysis
{
public partial class Field
{

Просмотреть файл

@ -1,5 +1,6 @@
@namespace AntDesign.Pro.Pages.Analysis
@inject ChartService ChartService
@using AntDesign.Pro.Template.Services
@namespace AntDesign.Pro.Template.Pages.Dashboard.Analysis
@inject IChartService ChartService
<Area @ref="_visitChart" TItem="ChartDataItem" Config="_visitChartConfig" />

Просмотреть файл

@ -1,5 +1,6 @@
@namespace AntDesign.Pro.Pages.Analysis
@inject ChartService ChartService
@using AntDesign.Pro.Template.Services
@namespace AntDesign.Pro.Template.Pages.Dashboard.Analysis
@inject IChartService ChartService
<AntDesign.Charts.Column @ref="_chart" TItem="ChartDataItem" Config="_chartConfig" />
@code

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше