diff --git a/CHANGELOG.md b/CHANGELOG.md index 862229abf..2a9069db1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## v8.x.x -##8.0.5(2024-3-18) +##8.0.6(2024-3-18) * **修改:** 更新Elsa工作流到2.14.1,更好的支持.net8 * **修改:** 更新验证码的处理,避免linux缺少字体的问题,感谢DUWENINK提供 diff --git a/demo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo.Client/WalkingTec.Mvvm.BlazorDemo.Client.csproj b/demo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo.Client/WalkingTec.Mvvm.BlazorDemo.Client.csproj index 27bec7890..76d0e1c4f 100644 --- a/demo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo.Client/WalkingTec.Mvvm.BlazorDemo.Client.csproj +++ b/demo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo.Client/WalkingTec.Mvvm.BlazorDemo.Client.csproj @@ -1,33 +1,33 @@ - - - - net8.0 - service-worker-assets.js - true - - + + + + net8.0 + service-worker-assets.js + true + + 1701;1702;NU1608 - - + + 1701;1702;NU1608 - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/demo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo.Shared/Shared/MainLayout.razor b/demo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo.Shared/Shared/MainLayout.razor index 69118c6cd..6f06c73da 100644 --- a/demo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo.Shared/Shared/MainLayout.razor +++ b/demo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo.Shared/Shared/MainLayout.razor @@ -1,343 +1,343 @@ -@inherits LayoutComponentBase -@using System.Reflection -@using System.Globalization -@inject WtmBlazorContext wtmblazor; -@inject IJSRuntime JSRuntime; - -@inject NavigationManager NavigationManager; - - - - -
- -
- -
- @if (tenants.Count() >0) - { - - } - - -
-
- -
- -
- WTM -
-
-
-
- - @Body - -
-
- - -
-
@wtmblazor.Localizer["Sys.Close"]
- -
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
- -
- - -
-
- -
-
- @(UseTabSet ? @wtmblazor.Localizer["Sys.Tabs"] : @wtmblazor.Localizer["Sys.SinglePage"]) -
-
-
-
-
-
-@code -{ - - private bool UseTabSet { get; set; } = false; - - private bool IsOpen { get; set; } - - private bool IsFixedHeader { get; set; } = true; - - private bool IsFixedFooter { get; set; } = true; - - private bool IsFullSide { get; set; } = true; - - private bool ShowFooter { get; set; } = false; - - private List Menus { get; set; } - - private List tenants = new List(); - private string SelectedCulture - { - get - { - if (CultureInfo.CurrentUICulture.Name.Contains("zh")) - { - return "简体中文"; - } - if (CultureInfo.CurrentUICulture.Name.Contains("en")) - { - return "English"; - } - return CultureInfo.CurrentUICulture.Name; - } - } - - [CascadingParameter] - public LoginUserInfo UserInfo - { - get; - set; - } - - public async Task DeleteToken() - { - var dir = await wtmblazor.Api.CallAPI("/api/_account/logout"); - await JSRuntime.InvokeAsync("localStorageFuncs.remove", "wtmtoken"); - await JSRuntime.InvokeAsync("localStorageFuncs.remove", "wtmrefreshtoken"); - await JSRuntime.InvokeVoidAsync("urlFuncs.redirect", dir.Data); - } - - - private async Task Show() - { - await wtmblazor.OpenDialog(wtmblazor.Localizer["Login.ChangePassword"], size: Size.Small, userinfo: UserInfo); - } - - protected override async Task OnInitializedAsync() - { - List menus = null; - menus = new List { }; - menus.Add(new BootstrapBlazor.Components.MenuItem() { Text = wtmblazor.Localizer["Sys.Home"], Icon = "fa fa-fw fa-home", Url = "/", Match = NavLinkMatch.All }); - if (wtmblazor.ConfigInfo.IsQuickDebug == true) - { - var pages = wtmblazor.GetAllPages(); - foreach (var item in pages) - { - BootstrapBlazor.Components.MenuItem m = new BootstrapBlazor.Components.MenuItem - { - Text = item.PageName, - Icon = item.Icon, - Url = item.Url, - Match = NavLinkMatch.All - }; - if (item.Children != null) - { - var items = new List(); - - foreach (var child in item.Children) - { - items.Add(new BootstrapBlazor.Components.MenuItem - { - Text = child.PageName, - Icon = child.Icon, +@inherits LayoutComponentBase +@using System.Reflection +@using System.Globalization +@inject WtmBlazorContext wtmblazor; +@inject IJSRuntime JSRuntime; + +@inject NavigationManager NavigationManager; + + + + +
+ +
+ +
+ @if (tenants.Count() >0) + { + + } + + +
+
+ +
+ +
+ WTM +
+
+
+
+ + @Body + +
+
+ + +
+
@wtmblazor.Localizer["Sys.Close"]
+ +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+ +
+ + +
+
+ +
+
+ @(UseTabSet ? @wtmblazor.Localizer["Sys.Tabs"] : @wtmblazor.Localizer["Sys.SinglePage"]) +
+
+
+
+
+
+@code +{ + + private bool UseTabSet { get; set; } = false; + + private bool IsOpen { get; set; } + + private bool IsFixedHeader { get; set; } = true; + + private bool IsFixedFooter { get; set; } = true; + + private bool IsFullSide { get; set; } = true; + + private bool ShowFooter { get; set; } = false; + + private List Menus { get; set; } + + private List tenants = new List(); + private string SelectedCulture + { + get + { + if (CultureInfo.CurrentUICulture.Name.Contains("zh")) + { + return "简体中文"; + } + if (CultureInfo.CurrentUICulture.Name.Contains("en")) + { + return "English"; + } + return CultureInfo.CurrentUICulture.Name; + } + } + + [CascadingParameter] + public LoginUserInfo UserInfo + { + get; + set; + } + + public async Task DeleteToken() + { + var dir = await wtmblazor.Api.CallAPI("/api/_account/logout"); + await JSRuntime.InvokeAsync("localStorageFuncs.remove", "wtmtoken"); + await JSRuntime.InvokeAsync("localStorageFuncs.remove", "wtmrefreshtoken"); + await JSRuntime.InvokeVoidAsync("urlFuncs.redirect", dir.Data); + } + + + private async Task Show() + { + await wtmblazor.OpenDialog(wtmblazor.Localizer["Login.ChangePassword"], size: Size.Small, userinfo: UserInfo); + } + + protected override async Task OnInitializedAsync() + { + List menus = null; + menus = new List { }; + menus.Add(new BootstrapBlazor.Components.MenuItem() { Text = wtmblazor.Localizer["Sys.Home"], Icon = "fa fa-fw fa-home", Url = "/", Match = NavLinkMatch.All }); + if (wtmblazor.ConfigInfo.IsQuickDebug == true) + { + var pages = wtmblazor.GetAllPages(); + foreach (var item in pages) + { + BootstrapBlazor.Components.MenuItem m = new BootstrapBlazor.Components.MenuItem + { + Text = item.PageName, + Icon = item.Icon, + Url = item.Url, + Match = NavLinkMatch.All + }; + if (item.Children != null) + { + var items = new List(); + + foreach (var child in item.Children) + { + items.Add(new BootstrapBlazor.Components.MenuItem + { + Text = child.PageName, + Icon = child.Icon, Url = child.Url, - Match = NavLinkMatch.All - }); - } - m.Items = items; - } - menus.Add(m); - } - } - else - { - var usermenu = UserInfo.Attributes["Menus"] as WalkingTec.Mvvm.Core.Support.Json.SimpleMenuApi[]; - - var formatedmenu = new List(); - formatedmenu.AddRange(toMenuTree(usermenu.AsQueryable())); - GetMenuFromFrameworkMenu(formatedmenu).ForEach(x => menus.Add(x)); - } - Menus = menus; - - tenants = await wtmblazor.Api.CallItemsApi($"/api/_frameworktenant/GetFrameworkTenants?parent={UserInfo.TenantCode}"); - bool tab=false; - var test = await JSRuntime.InvokeAsync("localStorageFuncs.get", "wtmtab"); - bool suc = bool.TryParse(test, out tab); - if(suc == false){ - tab = wtmblazor.ConfigInfo.PageMode == PageModeEnum.Tab ? true : false; - } - UseTabSet = tab; - await base.OnInitializedAsync(); - } - - /// - /// 整理为树形 - /// - /// 来源列表 - /// 当前级的父ID - /// - private List toMenuTree(IQueryable origs,string parentID=null) - { - var rets = new List(); - var _thisList = origs.Where(t => t.ParentId==parentID); - foreach (var item in _thisList) - { - var _item = new FrameworkMenu - { - ID = new Guid(item.Id), - PageName = item.Text, - Icon = item.Icon, - Url = item.Url, - Children = new List() - }; - _item.Children.AddRange(toMenuTree(origs, item.Id)); - rets.Add(_item); - } - return rets; - } - - private List GetMenuFromFrameworkMenu(List input) - { - List rv = new List(); - foreach (var item in input) - { - var m = new BootstrapBlazor.Components.MenuItem - { - Text = wtmblazor.Localizer[item.PageName], - Icon = item.Icon, + Match = NavLinkMatch.All + }); + } + m.Items = items; + } + menus.Add(m); + } + } + else + { + var usermenu = UserInfo.Attributes["Menus"] as WalkingTec.Mvvm.Core.Support.Json.SimpleMenuApi[]; + + var formatedmenu = new List(); + formatedmenu.AddRange(toMenuTree(usermenu.AsQueryable())); + GetMenuFromFrameworkMenu(formatedmenu).ForEach(x => menus.Add(x)); + } + Menus = menus; + + tenants = await wtmblazor.Api.CallItemsApi($"/api/_frameworktenant/GetFrameworkTenants?parent={UserInfo.TenantCode}"); + bool tab=false; + var test = await JSRuntime.InvokeAsync("localStorageFuncs.get", "wtmtab"); + bool suc = bool.TryParse(test, out tab); + if(suc == false){ + tab = wtmblazor.ConfigInfo.PageMode == PageModeEnum.Tab ? true : false; + } + UseTabSet = tab; + await base.OnInitializedAsync(); + } + + /// + /// 整理为树形 + /// + /// 来源列表 + /// 当前级的父ID + /// + private List toMenuTree(IQueryable origs,string parentID=null) + { + var rets = new List(); + var _thisList = origs.Where(t => t.ParentId==parentID); + foreach (var item in _thisList) + { + var _item = new FrameworkMenu + { + ID = new Guid(item.Id), + PageName = item.Text, + Icon = item.Icon, Url = item.Url, - Match = NavLinkMatch.All - }; - if (m.Url != null) - { - if (m.Url.ToLower().StartsWith("http://") || m.Url.ToLower().StartsWith("https://")) - { - m.Url = "/Outside/" + System.Web.HttpUtility.UrlEncode(m.Url); - m.Match = NavLinkMatch.All; - } - } - if (item.Children?.Any() == true) - { - m.Items = GetMenuFromFrameworkMenu(item.Children); - } - rv.Add(m); - } - return rv; - } - - private async Task SetCulture(string Value) - { - var cultureName = Value; - if (cultureName != CultureInfo.CurrentUICulture.Name) - { - await JSRuntime.InvokeAsync("localStorageFuncs.set", "wtmculture", Value); - var culture = new CultureInfo(cultureName); - CultureInfo.CurrentCulture = culture; - CultureInfo.CurrentUICulture = culture; - var uri = await JSRuntime.InvokeAsync("urlFuncs.getCurrentUrl"); - var query = $"?culture={Uri.EscapeDataString(Value)}&" + - $"redirect={Uri.EscapeDataString(uri)}"; - NavigationManager.NavigateTo(wtmblazor.GetServerUrl() + "/_framework/SetLanguageForBlazor" + query, forceLoad: true); - } - } - - private async Task SetTenant(string Value) - { - _ = await wtmblazor.Api.CallAPI("/api/_account/SetTenant?tenant=" + Value); - _ = await JSRuntime.InvokeAsync("urlFuncs.refresh"); - } - - private async Task TabChanged(bool v) - { - await JSRuntime.InvokeAsync("localStorageFuncs.set", "wtmtab",v); - } -} + Children = new List() + }; + _item.Children.AddRange(toMenuTree(origs, item.Id)); + rets.Add(_item); + } + return rets; + } + + private List GetMenuFromFrameworkMenu(List input) + { + List rv = new List(); + foreach (var item in input) + { + var m = new BootstrapBlazor.Components.MenuItem + { + Text = wtmblazor.Localizer[item.PageName], + Icon = item.Icon, + Url = item.Url, + Match = NavLinkMatch.All + }; + if (m.Url != null) + { + if (m.Url.ToLower().StartsWith("http://") || m.Url.ToLower().StartsWith("https://")) + { + m.Url = "/Outside/" + System.Web.HttpUtility.UrlEncode(m.Url); + m.Match = NavLinkMatch.All; + } + } + if (item.Children?.Any() == true) + { + m.Items = GetMenuFromFrameworkMenu(item.Children); + } + rv.Add(m); + } + return rv; + } + + private async Task SetCulture(string Value) + { + var cultureName = Value; + if (cultureName != CultureInfo.CurrentUICulture.Name) + { + await JSRuntime.InvokeAsync("localStorageFuncs.set", "wtmculture", Value); + var culture = new CultureInfo(cultureName); + CultureInfo.CurrentCulture = culture; + CultureInfo.CurrentUICulture = culture; + var uri = await JSRuntime.InvokeAsync("urlFuncs.getCurrentUrl"); + var query = $"?culture={Uri.EscapeDataString(Value)}&" + + $"redirect={Uri.EscapeDataString(uri)}"; + NavigationManager.NavigateTo(wtmblazor.GetServerUrl() + "/_framework/SetLanguageForBlazor" + query, forceLoad: true); + } + } + + private async Task SetTenant(string Value) + { + _ = await wtmblazor.Api.CallAPI("/api/_account/SetTenant?tenant=" + Value); + _ = await JSRuntime.InvokeAsync("urlFuncs.refresh"); + } + + private async Task TabChanged(bool v) + { + await JSRuntime.InvokeAsync("localStorageFuncs.set", "wtmtab",v); + } +} diff --git a/demo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo.csproj b/demo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo.csproj index 137d53a07..1be4705cf 100644 --- a/demo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo.csproj +++ b/demo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo.csproj @@ -14,7 +14,7 @@ - + diff --git a/demo/WalkingTec.Mvvm.ReactDemo/WalkingTec.Mvvm.ReactDemo.csproj b/demo/WalkingTec.Mvvm.ReactDemo/WalkingTec.Mvvm.ReactDemo.csproj index 556cf31c7..615af8daa 100644 --- a/demo/WalkingTec.Mvvm.ReactDemo/WalkingTec.Mvvm.ReactDemo.csproj +++ b/demo/WalkingTec.Mvvm.ReactDemo/WalkingTec.Mvvm.ReactDemo.csproj @@ -44,7 +44,7 @@ - + diff --git a/demo/WalkingTec.Mvvm.Vue3Demo/WalkingTec.Mvvm.Vue3Demo.csproj b/demo/WalkingTec.Mvvm.Vue3Demo/WalkingTec.Mvvm.Vue3Demo.csproj index 5fba00a82..6c40204b3 100644 --- a/demo/WalkingTec.Mvvm.Vue3Demo/WalkingTec.Mvvm.Vue3Demo.csproj +++ b/demo/WalkingTec.Mvvm.Vue3Demo/WalkingTec.Mvvm.Vue3Demo.csproj @@ -39,8 +39,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/demo/WalkingTec.Mvvm.VueDemo/WalkingTec.Mvvm.VueDemo.csproj b/demo/WalkingTec.Mvvm.VueDemo/WalkingTec.Mvvm.VueDemo.csproj index 1b7fa5961..254007842 100644 --- a/demo/WalkingTec.Mvvm.VueDemo/WalkingTec.Mvvm.VueDemo.csproj +++ b/demo/WalkingTec.Mvvm.VueDemo/WalkingTec.Mvvm.VueDemo.csproj @@ -38,8 +38,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/WalkingTec.Mvvm.Core/WalkingTec.Mvvm.Core.csproj b/src/WalkingTec.Mvvm.Core/WalkingTec.Mvvm.Core.csproj index 6e5291e18..22497ee58 100644 --- a/src/WalkingTec.Mvvm.Core/WalkingTec.Mvvm.Core.csproj +++ b/src/WalkingTec.Mvvm.Core/WalkingTec.Mvvm.Core.csproj @@ -12,27 +12,27 @@ - + - - - - + + + + - + - + - - + + - + diff --git a/src/WalkingTec.Mvvm.Mvc/WalkingTec.Mvvm.Mvc.csproj b/src/WalkingTec.Mvvm.Mvc/WalkingTec.Mvvm.Mvc.csproj index 2ba6e0ef6..c69f38393 100644 --- a/src/WalkingTec.Mvvm.Mvc/WalkingTec.Mvvm.Mvc.csproj +++ b/src/WalkingTec.Mvvm.Mvc/WalkingTec.Mvvm.Mvc.csproj @@ -91,10 +91,10 @@ - - - - + + + + diff --git a/test/WalkingTec.Mvvm.Admin.Test/WalkingTec.Mvvm.Admin.Test.csproj b/test/WalkingTec.Mvvm.Admin.Test/WalkingTec.Mvvm.Admin.Test.csproj index 668d9d39a..b4134483d 100644 --- a/test/WalkingTec.Mvvm.Admin.Test/WalkingTec.Mvvm.Admin.Test.csproj +++ b/test/WalkingTec.Mvvm.Admin.Test/WalkingTec.Mvvm.Admin.Test.csproj @@ -7,10 +7,10 @@ - + - - + + diff --git a/test/WalkingTec.Mvvm.Core.Test/WalkingTec.Mvvm.Core.Test.csproj b/test/WalkingTec.Mvvm.Core.Test/WalkingTec.Mvvm.Core.Test.csproj index d02e1ea4b..49a13e7e0 100644 --- a/test/WalkingTec.Mvvm.Core.Test/WalkingTec.Mvvm.Core.Test.csproj +++ b/test/WalkingTec.Mvvm.Core.Test/WalkingTec.Mvvm.Core.Test.csproj @@ -7,10 +7,10 @@ - + - - + + diff --git a/version.props b/version.props index 6a674f42f..770cff406 100644 --- a/version.props +++ b/version.props @@ -1,6 +1,6 @@ - 8.0.5 + 8.0.6