From a37acc4b55c91d57d51c7fa079da8700530412a5 Mon Sep 17 00:00:00 2001 From: nsnail Date: Sat, 2 Mar 2024 23:06:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20=E7=89=88=E6=9C=AC=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=97=A5=E5=BF=97=E7=BB=84=E4=BB=B6=20(#96)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NetAdmin.sln.DotSettings | 106 ++-- assets/seed-data/Sys_Menu.json | 11 - scripts/2.git.release.ps1 | 4 +- scripts/code.clean.ps1 | 2 +- scripts/rename.csx | 2 +- scripts/resharper.full.ps1 | 2 +- scripts/switcher.nsext.json | 2 +- scripts/switcher.ps1 | 2 +- .../NetAdmin.BizServer.Host.csproj | 1 + .../NetAdmin.BizServer.Tests/AllTests.cs | 10 +- .../DataValidation/UserIdAttribute.cs | 2 +- .../Events/SqlCommandAfterEvent.cs | 3 +- .../NetAdmin.Domain/Events/SqlCommandEvent.cs | 26 +- .../Events/SyncStructureBeforeEvent.cs | 2 +- .../Events/Sys/RequestLogEvent.cs | 9 +- .../Events/Sys/UserUpdatedEvent.cs | 9 +- .../Events/Sys/VerifyCodeCreatedEvent.cs | 9 +- .../BackgroundRunning/WorkBase.cs | 2 +- .../Extensions/IMvcBuilderExtensions.cs | 2 +- .../Extensions/ServiceCollectionExtensions.cs | 4 +- src/backend/NetAdmin.Host/Utils/SqlAuditor.cs | 75 ++- .../Extensions/HttpRequestPartExtensions.cs | 10 +- .../NetAdmin.Infrastructure.csproj | 4 +- .../Utils/CaptchaImageHelper.cs | 39 +- .../Utils/UserAgentParser.cs | 52 +- .../Modules/Sys/IToolsModule.cs | 5 + .../Services/Sys/ConfigService.cs | 8 +- .../Services/Sys/DeptService.cs | 8 +- .../Services/Sys/DicCatalogService.cs | 8 +- .../Services/Sys/DicContentService.cs | 8 +- .../Services/Sys/JobRecordService.cs | 8 +- .../Services/Sys/JobService.cs | 53 +- .../Services/Sys/MenuService.cs | 17 +- .../Services/Sys/RequestLogService.cs | 8 +- .../Services/Sys/RoleService.cs | 8 +- .../Services/Sys/SiteMsgDeptService.cs | 8 +- .../Services/Sys/SiteMsgFlagService.cs | 8 +- .../Services/Sys/SiteMsgRoleService.cs | 8 +- .../Services/Sys/SiteMsgService.cs | 20 +- .../Services/Sys/SiteMsgUserService.cs | 8 +- .../Services/Sys/ToolsService.cs | 8 + .../Services/Sys/UserProfileService.cs | 8 +- .../Services/Sys/UserService.cs | 42 +- .../Services/Sys/VerifyCodeService.cs | 12 +- .../Services/Tpl/ExampleService.cs | 8 +- .../Sys/ToolsCache.cs | 6 + .../Controllers/Sys/ToolsController.cs | 9 + src/frontend/admin/index.html | 1 + src/frontend/admin/package.json | 2 + src/frontend/admin/src/api/sys/tools.js | 11 + .../admin/src/components/naArea/index.vue | 2 +- .../admin/src/components/naColUser/index.vue | 2 +- .../admin/src/components/naSearch/index.vue | 5 +- .../src/components/naUserSelect/index.vue | 2 +- .../src/components/naVerifition/index.vue | 14 +- .../src/components/scContextmenu/index.vue | 36 +- .../admin/src/components/scCron/index.vue | 12 +- .../admin/src/components/scCropper/index.vue | 2 +- .../admin/src/components/scDialog/index.vue | 6 +- .../admin/src/components/scEditor/index.vue | 6 +- .../src/components/scFileImport/index.vue | 2 +- .../src/components/scFileSelect/index.vue | 12 +- .../src/components/scFilterBar/index.vue | 6 +- .../admin/src/components/scFilterBar/my.vue | 4 +- .../admin/src/components/scForm/index.vue | 2 +- .../components/scForm/items/tableselect.vue | 2 +- .../src/components/scFormTable/index.vue | 4 +- .../src/components/scIconSelect/index.vue | 22 +- .../components/scMini/scStatusIndicator.vue | 4 +- .../admin/src/components/scMini/scTrend.vue | 6 +- .../src/components/scPageHeader/index.vue | 16 +- .../components/scPasswordStrength/index.vue | 2 +- .../admin/src/components/scSelect/index.vue | 6 +- .../src/components/scSelectFilter/index.vue | 22 +- .../src/components/scStatistic/index.vue | 18 +- .../src/components/scTable/columnSetting.vue | 32 +- .../admin/src/components/scTable/index.vue | 16 +- .../admin/src/components/scTitle/index.vue | 28 - .../admin/src/components/scUpload/index.vue | 24 +- .../src/components/scUpload/multiple.vue | 4 +- .../admin/src/components/scVideo/index.vue | 111 ---- .../admin/src/components/scWorkflow/index.vue | 572 ------------------ .../src/components/scWorkflow/nodeWrap.vue | 56 -- .../components/scWorkflow/nodes/addNode.vue | 104 ---- .../components/scWorkflow/nodes/approver.vue | 224 ------- .../components/scWorkflow/nodes/branch.vue | 242 -------- .../components/scWorkflow/nodes/promoter.vue | 127 ---- .../src/components/scWorkflow/nodes/send.vue | 135 ----- .../src/components/scWorkflow/select.vue | 414 ------------- src/frontend/admin/src/config/index.js | 4 +- src/frontend/admin/src/config/myConfig.js | 2 +- src/frontend/admin/src/global.js | 2 - .../admin/src/layout/components/search.vue | 16 +- .../admin/src/layout/components/sideM.vue | 26 +- .../admin/src/layout/components/tags.vue | 24 +- .../admin/src/layout/components/topbar.vue | 6 +- .../admin/src/layout/components/userbar.vue | 10 +- src/frontend/admin/src/layout/other/404.vue | 32 +- src/frontend/admin/src/style/app.scss | 122 ++-- src/frontend/admin/src/style/dark.scss | 2 +- src/frontend/admin/src/style/fix.scss | 90 ++- src/frontend/admin/src/style/media.scss | 10 +- src/frontend/admin/src/style/pages.scss | 86 +-- src/frontend/admin/src/utils/permission.js | 1 + .../admin/src/views/dev/code/index.vue | 28 +- .../views/guest/components/passwordForm.vue | 2 +- src/frontend/admin/src/views/guest/login.vue | 180 +----- src/frontend/admin/src/views/home/index.vue | 16 +- .../views/home/widgets/components/about.vue | 29 - .../home/widgets/components/change-log.vue | 53 ++ .../views/home/widgets/components/modules.vue | 61 ++ .../home/widgets/components/progress.vue | 38 -- .../views/home/widgets/components/time.vue | 8 +- .../src/views/home/widgets/components/ver.vue | 55 +- .../views/home/widgets/components/welcome.vue | 111 ---- .../admin/src/views/home/widgets/index.vue | 81 +-- .../src/views/home/work/components/myapp.vue | 43 +- .../admin/src/views/home/work/index.vue | 12 +- .../admin/src/views/profile/index.vue | 2 +- .../admin/src/views/profile/space.vue | 54 -- .../admin/src/views/sys/config/save.vue | 4 +- .../admin/src/views/sys/dept/save.vue | 4 +- .../admin/src/views/sys/dic/list/save.vue | 4 +- src/frontend/admin/src/views/sys/dic/save.vue | 2 +- .../admin/src/views/sys/job/record/save.vue | 2 +- src/frontend/admin/src/views/sys/job/save.vue | 2 +- .../admin/src/views/sys/menu/save.vue | 2 +- src/frontend/admin/src/views/sys/msg/save.vue | 4 +- .../admin/src/views/sys/role/save.vue | 8 +- .../admin/src/views/sys/user/save.vue | 2 +- 130 files changed, 978 insertions(+), 3246 deletions(-) delete mode 100644 src/frontend/admin/src/components/scTitle/index.vue delete mode 100644 src/frontend/admin/src/components/scVideo/index.vue delete mode 100644 src/frontend/admin/src/components/scWorkflow/index.vue delete mode 100644 src/frontend/admin/src/components/scWorkflow/nodeWrap.vue delete mode 100644 src/frontend/admin/src/components/scWorkflow/nodes/addNode.vue delete mode 100644 src/frontend/admin/src/components/scWorkflow/nodes/approver.vue delete mode 100644 src/frontend/admin/src/components/scWorkflow/nodes/branch.vue delete mode 100644 src/frontend/admin/src/components/scWorkflow/nodes/promoter.vue delete mode 100644 src/frontend/admin/src/components/scWorkflow/nodes/send.vue delete mode 100644 src/frontend/admin/src/components/scWorkflow/select.vue delete mode 100644 src/frontend/admin/src/views/home/widgets/components/about.vue create mode 100644 src/frontend/admin/src/views/home/widgets/components/change-log.vue create mode 100644 src/frontend/admin/src/views/home/widgets/components/modules.vue delete mode 100644 src/frontend/admin/src/views/home/widgets/components/progress.vue delete mode 100644 src/frontend/admin/src/views/home/widgets/components/welcome.vue delete mode 100644 src/frontend/admin/src/views/profile/space.vue diff --git a/NetAdmin.sln.DotSettings b/NetAdmin.sln.DotSettings index 7d7fc7a2..e6e49ef0 100644 --- a/NetAdmin.sln.DotSettings +++ b/NetAdmin.sln.DotSettings @@ -1,35 +1,83 @@ - Inherit True - DO_NOT_SHOW - DO_NOT_SHOW - DO_NOT_SHOW - NEVER - NEVER - NEVER - NEVER - ID - IOS - IP - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" /> - + True True True True True True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + 1 1 + + Inherit OFF + DO_NOT_SHOW + DO_NOT_SHOW + DO_NOT_SHOW + DO_NOT_SHOW + DO_NOT_SHOW + DO_NOT_SHOW HINT + DO_NOT_SHOW + DO_NOT_SHOW Required Required Required Required + NEVER <Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /> <Policy Inspect="True" Prefix="_" Suffix="" Style="AA_BB" /> <Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" /> + + <?xml version="1.0" encoding="utf-16"?> <Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"> <TypePattern> @@ -70,36 +118,4 @@ </Entry> </TypePattern> </Patterns> - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - \ No newline at end of file diff --git a/assets/seed-data/Sys_Menu.json b/assets/seed-data/Sys_Menu.json index 3111e3ff..210b0238 100644 --- a/assets/seed-data/Sys_Menu.json +++ b/assets/seed-data/Sys_Menu.json @@ -140,17 +140,6 @@ "Title": "缓存管理", "Type": 1 }, - { - "Component": "home/widgets/components/ver", - "Icon": "el-icon-pointer", - "Id": 480998862188554, - "Name": "sys-about", - "ParentId": 485278637670422, - "Path": "/sys/about", - "Sort": 94, - "Title": "版本信息", - "Type": 1, - }, // ------------------------------ 日志管理 ------------------------------ { "Icon": "el-icon-tickets", diff --git a/scripts/2.git.release.ps1 b/scripts/2.git.release.ps1 index b2b01293..d437a134 100644 --- a/scripts/2.git.release.ps1 +++ b/scripts/2.git.release.ps1 @@ -13,10 +13,8 @@ git checkout main git branch -D release git checkout -b release ./node_modules/.bin/standard-version -r $types[$prefix][0] -cd ./scripts -./code.clean.ps1 git commit --amend --no-edit -a -$tag = $(git describe --tags $(git rev-list --tags --max-count=1)) +$tag = $( git describe --tags $( git rev-list --tags --max-count = 1 ) ) git tag -d $tag git tag $tag git push --tags origin release diff --git a/scripts/code.clean.ps1 b/scripts/code.clean.ps1 index 99809c64..e7524814 100644 --- a/scripts/code.clean.ps1 +++ b/scripts/code.clean.ps1 @@ -1,5 +1,5 @@ npm --prefix ../src/frontend/admin run prettier -dotnet jb cleanupcode --no-build --include=$($(git status --porcelain | Where-Object { $_ -match "^\s*[MA]" } | ForEach-Object { $_.TrimStart(" M").TrimStart(" A") }) -join ";") ../NetAdmin.sln +jb cleanupcode --no-build --include=$($(git status --porcelain | Where-Object { $_ -match "^\s*[MA]" } | ForEach-Object { $_.TrimStart(" M").TrimStart(" A") }) -join ";") ../NetAdmin.sln dot rbom -w -e refs -e .git -e node_modules ../ dot trim -w -e refs -e .git -e node_modules ../ dot tolf -w -e refs -e .git -e node_modules ../ \ No newline at end of file diff --git a/scripts/rename.csx b/scripts/rename.csx index 825e62b4..83db1b63 100644 --- a/scripts/rename.csx +++ b/scripts/rename.csx @@ -1,4 +1,4 @@ -#r "nuget: NSExt, 1.1.0" +#r "nuget: NSExt, 2.1.0" using NSExt.Extensions; Console.WriteLine("请输入原始名称(NetAdmin):"); diff --git a/scripts/resharper.full.ps1 b/scripts/resharper.full.ps1 index 5e79a0a0..55b6f553 100644 --- a/scripts/resharper.full.ps1 +++ b/scripts/resharper.full.ps1 @@ -1 +1 @@ -dotnet jb cleanupcode --no-build ../NetAdmin.sln \ No newline at end of file +jb cleanupcode --no-build ../NetAdmin.sln \ No newline at end of file diff --git a/scripts/switcher.nsext.json b/scripts/switcher.nsext.json index e456c0c0..a861af95 100644 --- a/scripts/switcher.nsext.json +++ b/scripts/switcher.nsext.json @@ -9,7 +9,7 @@ "packages": [ { "packageName": "NSExt", - "version": "1.1.0" + "version": "2.1.0" } ] } diff --git a/scripts/switcher.ps1 b/scripts/switcher.ps1 index 1d569c04..b4f83e3e 100644 --- a/scripts/switcher.ps1 +++ b/scripts/switcher.ps1 @@ -23,5 +23,5 @@ while ($null -eq $files[[int]$file - 1]) } $file = [int]$file - 1 Copy-Item $files[$file] 'switcher.json' -Force -dotnet dnt $targets[$key] ../NetAdmin.sln +dnt $targets[$key] ../NetAdmin.sln Remove-Item switcher.json \ No newline at end of file diff --git a/src/backend/NetAdmin.BizServer.Host/NetAdmin.BizServer.Host.csproj b/src/backend/NetAdmin.BizServer.Host/NetAdmin.BizServer.Host.csproj index 18eb9b50..f8f04a4e 100644 --- a/src/backend/NetAdmin.BizServer.Host/NetAdmin.BizServer.Host.csproj +++ b/src/backend/NetAdmin.BizServer.Host/NetAdmin.BizServer.Host.csproj @@ -2,6 +2,7 @@ + diff --git a/src/backend/NetAdmin.BizServer.Tests/AllTests.cs b/src/backend/NetAdmin.BizServer.Tests/AllTests.cs index ad42c08d..00e0ec5a 100644 --- a/src/backend/NetAdmin.BizServer.Tests/AllTests.cs +++ b/src/backend/NetAdmin.BizServer.Tests/AllTests.cs @@ -19,8 +19,8 @@ namespace NetAdmin.BizServer.Tests; /// 所有测试 /// [SuppressMessage("Usage", "xUnit1028:Test method must have valid return type")] -public class AllTests(WebApplicationFactory factory, ITestOutputHelper testOutputHelper) - : WebApiTestBase(factory, testOutputHelper), IToolsModule, ICacheModule, IApiModule, IConfigModule +public class AllTests(WebApplicationFactory factory, ITestOutputHelper testOutputHelper) : + WebApiTestBase(factory, testOutputHelper), IToolsModule, ICacheModule, IApiModule, IConfigModule { /// @@ -92,6 +92,12 @@ public class AllTests(WebApplicationFactory factory, ITestOutputHelper throw new NotImplementedException(); } + /// + public Task GetChangeLogAsync() + { + throw new NotImplementedException(); + } + /// public Task GetLatestConfigAsync() { diff --git a/src/backend/NetAdmin.Domain/Attributes/DataValidation/UserIdAttribute.cs b/src/backend/NetAdmin.Domain/Attributes/DataValidation/UserIdAttribute.cs index 1e59fc1b..5716e212 100644 --- a/src/backend/NetAdmin.Domain/Attributes/DataValidation/UserIdAttribute.cs +++ b/src/backend/NetAdmin.Domain/Attributes/DataValidation/UserIdAttribute.cs @@ -18,7 +18,7 @@ public sealed class UserIdAttribute : ValidationAttribute var req = new QueryReq { Filter = new QueryUserReq { Id = (long)value! } }; var method = service.GetType().GetMethod("ExistAsync"); - var exist = ((Task)method!.Invoke(service, [req]))!.ConfigureAwait(false).GetAwaiter().GetResult(); + var exist = (Task)method!.Invoke(service, [req])!.ConfigureAwait(false).GetAwaiter().GetResult(); return !exist ? new ValidationResult(Ln.用户编号不存在) : ValidationResult.Success; } } \ No newline at end of file diff --git a/src/backend/NetAdmin.Domain/Events/SqlCommandAfterEvent.cs b/src/backend/NetAdmin.Domain/Events/SqlCommandAfterEvent.cs index 9c26ffc5..dbf65f6a 100644 --- a/src/backend/NetAdmin.Domain/Events/SqlCommandAfterEvent.cs +++ b/src/backend/NetAdmin.Domain/Events/SqlCommandAfterEvent.cs @@ -18,7 +18,8 @@ public sealed record SqlCommandAfterEvent : SqlCommandBeforeEvent /// /// 耗时(单位:微秒) /// - public long ElapsedMicroseconds { get; init; } + /// de + private long ElapsedMicroseconds { get; } /// public override string ToString() diff --git a/src/backend/NetAdmin.Domain/Events/SqlCommandEvent.cs b/src/backend/NetAdmin.Domain/Events/SqlCommandEvent.cs index a7328ffa..88a877a7 100644 --- a/src/backend/NetAdmin.Domain/Events/SqlCommandEvent.cs +++ b/src/backend/NetAdmin.Domain/Events/SqlCommandEvent.cs @@ -3,12 +3,15 @@ namespace NetAdmin.Domain.Events; /// /// Sql命令事件 /// -public record SqlCommandEvent : DataAbstraction, IEventSource +public abstract record SqlCommandEvent : DataAbstraction, IEventSource { /// - /// 标识符缩写 + /// Initializes a new instance of the class. /// - public string Id => Identifier.ToString()[..8].ToUpperInvariant(); + protected SqlCommandEvent(bool isConsumOnce = false) + { + IsConsumOnce = isConsumOnce; + } /// public bool IsConsumOnce { get; } @@ -22,16 +25,21 @@ public record SqlCommandEvent : DataAbstraction, IEventSource /// public string EventId { get; protected init; } - /// - /// 标识符,可将 CommandBefore 与 CommandAfter 进行匹配 - /// - public Guid Identifier { get; protected init; } - /// public object Payload { get; init; } + /// + /// 标识符缩写 + /// + protected string Id => Identifier.ToString()[..8].ToUpperInvariant(); + + /// + /// 标识符,可将 CommandBefore 与 CommandAfter 进行匹配 + /// + protected Guid Identifier { get; init; } + /// /// 关联的Sql语句 /// - public string Sql { get; protected init; } + protected string Sql { get; init; } } \ No newline at end of file diff --git a/src/backend/NetAdmin.Domain/Events/SyncStructureBeforeEvent.cs b/src/backend/NetAdmin.Domain/Events/SyncStructureBeforeEvent.cs index 8a1012af..a1327036 100644 --- a/src/backend/NetAdmin.Domain/Events/SyncStructureBeforeEvent.cs +++ b/src/backend/NetAdmin.Domain/Events/SyncStructureBeforeEvent.cs @@ -19,7 +19,7 @@ public record SyncStructureBeforeEvent : SqlCommandEvent /// /// 实体类型 /// - public Type[] EntityTypes { get; } + protected Type[] EntityTypes { get; } /// public override string ToString() diff --git a/src/backend/NetAdmin.Domain/Events/Sys/RequestLogEvent.cs b/src/backend/NetAdmin.Domain/Events/Sys/RequestLogEvent.cs index ba0dfdd5..5ea7e291 100644 --- a/src/backend/NetAdmin.Domain/Events/Sys/RequestLogEvent.cs +++ b/src/backend/NetAdmin.Domain/Events/Sys/RequestLogEvent.cs @@ -10,9 +10,14 @@ public sealed record RequestLogEvent : DataAbstraction, IEventSourceGeneric /// Initializes a new instance of the class. /// - public RequestLogEvent(CreateRequestLogReq data) + public RequestLogEvent(CreateRequestLogReq data, bool isConsumOnce = false, object payload = default + , DateTime createdTime = default, CancellationToken cancellationToken = default) { - Data = data; + Data = data; + IsConsumOnce = isConsumOnce; + Payload = payload; + CreatedTime = createdTime; + CancellationToken = cancellationToken; } /// diff --git a/src/backend/NetAdmin.Domain/Events/Sys/UserUpdatedEvent.cs b/src/backend/NetAdmin.Domain/Events/Sys/UserUpdatedEvent.cs index 5d1421f6..5d42fe0b 100644 --- a/src/backend/NetAdmin.Domain/Events/Sys/UserUpdatedEvent.cs +++ b/src/backend/NetAdmin.Domain/Events/Sys/UserUpdatedEvent.cs @@ -10,9 +10,14 @@ public sealed record UserUpdatedEvent : DataAbstraction, IEventSourceGeneric /// Initializes a new instance of the class. /// - public UserUpdatedEvent(UserInfoRsp data) + public UserUpdatedEvent(UserInfoRsp data, DateTime createdTime = default, bool isConsumOnce = false + , object payload = default, CancellationToken cancellationToken = default) { - Data = data; + Data = data; + CancellationToken = cancellationToken; + CreatedTime = createdTime; + IsConsumOnce = isConsumOnce; + Payload = payload; } /// diff --git a/src/backend/NetAdmin.Domain/Events/Sys/VerifyCodeCreatedEvent.cs b/src/backend/NetAdmin.Domain/Events/Sys/VerifyCodeCreatedEvent.cs index ba71bc7c..a68cd1b9 100644 --- a/src/backend/NetAdmin.Domain/Events/Sys/VerifyCodeCreatedEvent.cs +++ b/src/backend/NetAdmin.Domain/Events/Sys/VerifyCodeCreatedEvent.cs @@ -10,9 +10,14 @@ public sealed record VerifyCodeCreatedEvent : DataAbstraction, IEventSourceGener /// /// Initializes a new instance of the class. /// - public VerifyCodeCreatedEvent(QueryVerifyCodeRsp data) + public VerifyCodeCreatedEvent(QueryVerifyCodeRsp data, DateTime createdTime = default, bool isConsumOnce = false + , object payload = default, CancellationToken cancellationToken = default) { - Data = data; + Data = data; + CancellationToken = cancellationToken; + CreatedTime = createdTime; + IsConsumOnce = isConsumOnce; + Payload = payload; } /// diff --git a/src/backend/NetAdmin.Host/BackgroundRunning/WorkBase.cs b/src/backend/NetAdmin.Host/BackgroundRunning/WorkBase.cs index 3f67c9e4..0fddaeb2 100644 --- a/src/backend/NetAdmin.Host/BackgroundRunning/WorkBase.cs +++ b/src/backend/NetAdmin.Host/BackgroundRunning/WorkBase.cs @@ -54,7 +54,7 @@ public abstract class WorkBase /// 通用工作流 /// /// 加锁失败异常 - protected virtual async ValueTask WorkflowAsync(bool singleInstance, CancellationToken cancelToken) + protected async ValueTask WorkflowAsync(bool singleInstance, CancellationToken cancelToken) { if (singleInstance) { // 加锁 diff --git a/src/backend/NetAdmin.Host/Extensions/IMvcBuilderExtensions.cs b/src/backend/NetAdmin.Host/Extensions/IMvcBuilderExtensions.cs index e147bde5..a9e0c011 100644 --- a/src/backend/NetAdmin.Host/Extensions/IMvcBuilderExtensions.cs +++ b/src/backend/NetAdmin.Host/Extensions/IMvcBuilderExtensions.cs @@ -108,7 +108,7 @@ public static class IMvcBuilderExtensions options.JsonSerializerOptions.TypeInfoResolver = new CollectionJsonTypeInfoResolver(); // 日期格式 2023-01-18 20:02:12 - _ = options.JsonSerializerOptions.Converters.AddDateTimeTypeConverters(Chars.TPL_DATE_YYYY_MM_DD_HH_MM_SS); + _ = options.JsonSerializerOptions.Converters.AddDateTimeTypeConverters(); // object->json 枚举显名 而非数字 ,json->object 可以枚举名 也可以数值 if (enumToString) { diff --git a/src/backend/NetAdmin.Host/Extensions/ServiceCollectionExtensions.cs b/src/backend/NetAdmin.Host/Extensions/ServiceCollectionExtensions.cs index e427951c..24199d9d 100644 --- a/src/backend/NetAdmin.Host/Extensions/ServiceCollectionExtensions.cs +++ b/src/backend/NetAdmin.Host/Extensions/ServiceCollectionExtensions.cs @@ -159,9 +159,7 @@ public static class ServiceCollectionExtensions var freeSql = new FreeSqlBuilder(App.GetOptions()).Build(initMethods); _ = me.AddSingleton(freeSql); - var sqlAuditor = App.GetService(); - - freeSql.Aop.AuditValue += sqlAuditor.DataAuditHandler; // Insert/Update自动值处理 + freeSql.Aop.AuditValue += SqlAuditor.DataAuditHandler; // Insert/Update自动值处理 var eventPublisher = App.GetService(); #pragma warning disable VSTHRD110 diff --git a/src/backend/NetAdmin.Host/Utils/SqlAuditor.cs b/src/backend/NetAdmin.Host/Utils/SqlAuditor.cs index b25a3574..0468ce47 100644 --- a/src/backend/NetAdmin.Host/Utils/SqlAuditor.cs +++ b/src/backend/NetAdmin.Host/Utils/SqlAuditor.cs @@ -34,7 +34,7 @@ public sealed class SqlAuditor : ISingleton /// 对Insert/Update的数据加工 /// /// e - public void DataAuditHandler(object sender, AuditValueEventArgs e) + public static void DataAuditHandler(object sender, AuditValueEventArgs e) { // SetServerTime(e); SetSnowflake(e); @@ -56,6 +56,48 @@ public sealed class SqlAuditor : ISingleton } } + private static void SetCreatedClientIp(AuditValueEventArgs e) + { + if (e.Value is null or 0) { + e.Value = App.HttpContext?.GetRemoteIpAddressToIPv4().IpV4ToInt32(); + } + } + + private static void SetCreatedReferer(AuditValueEventArgs e) + { + if (e.Value is null or "") { + e.Value = App.HttpContext?.Request.GetRefererUrlAddress(); + } + } + + private static void SetCreatedTime(AuditValueEventArgs e) + { + if (e.Value == null || (e.Value is DateTime val && val == default)) { + e.Value = DateTime.Now; + } + } + + private static void SetCreatedUserAgent(AuditValueEventArgs e) + { + if (e.Value is null or "") { + e.Value = App.HttpContext?.Request.Headers[Chars.FLG_HTTP_HEADER_USER_AGENT].ToString(); + } + } + + private static void SetCreatedUserId(AuditValueEventArgs e, ContextUserInfo userInfo) + { + if (userInfo != null && e.Value is null or (long and 0)) { + e.Value = userInfo.Id; + } + } + + private static void SetCreatedUserName(AuditValueEventArgs e, ContextUserInfo userInfo) + { + if (userInfo != null && e.Value is null or "") { + e.Value = userInfo.UserName; + } + } + /// /// 设置创建者 /// @@ -63,41 +105,22 @@ public sealed class SqlAuditor : ISingleton { switch (e.Property.Name) { case nameof(IFieldCreatedTime.CreatedTime): - if (e.Value == null || (e.Value is DateTime val && val == default)) { - e.Value = DateTime.Now; - } - + SetCreatedTime(e); break; case nameof(IFieldCreatedUser.CreatedUserId): - if (userInfo != null && e.Value is null or (long and 0)) { - e.Value = userInfo.Id; - } - + SetCreatedUserId(e, userInfo); break; - case nameof(IFieldCreatedUser.CreatedUserName): - if (userInfo != null && e.Value is null or "") { - e.Value = userInfo.UserName; - } - + SetCreatedUserName(e, userInfo); break; case nameof(IFieldCreatedClient.CreatedClientIp): - if (e.Value is null or 0) { - e.Value = App.HttpContext?.GetRemoteIpAddressToIPv4().IpV4ToInt32(); - } - + SetCreatedClientIp(e); break; case nameof(IFieldCreatedClient.CreatedUserAgent): - if (e.Value is null or "") { - e.Value = App.HttpContext?.Request.Headers[Chars.FLG_HTTP_HEADER_USER_AGENT].ToString(); - } - + SetCreatedUserAgent(e); break; case nameof(IFieldCreatedClient.CreatedReferer): - if (e.Value is null or "") { - e.Value = App.HttpContext?.Request.GetRefererUrlAddress(); - } - + SetCreatedReferer(e); break; default: return; diff --git a/src/backend/NetAdmin.Infrastructure/Extensions/HttpRequestPartExtensions.cs b/src/backend/NetAdmin.Infrastructure/Extensions/HttpRequestPartExtensions.cs index 2419866d..257f3884 100644 --- a/src/backend/NetAdmin.Infrastructure/Extensions/HttpRequestPartExtensions.cs +++ b/src/backend/NetAdmin.Infrastructure/Extensions/HttpRequestPartExtensions.cs @@ -13,10 +13,7 @@ public static class HttpRequestPartExtensions public static HttpRequestPart SetLog(this HttpRequestPart me, ILogger logger , Func bodyHandle = null) { - Task RequestHandleAsync(HttpClient _, HttpRequestMessage req) - { - return req.LogAsync(logger); - } + return me.OnRequesting(RequestHandleAsync).OnResponsing(ResponseHandleAsync).OnException(ExceptionHandleAsync); Task ExceptionHandleAsync(HttpClient _, HttpResponseMessage rsp, string errors) { @@ -28,6 +25,9 @@ public static class HttpRequestPartExtensions return rsp.LogAsync(logger, bodyHandle); } - return me.OnRequesting(RequestHandleAsync).OnResponsing(ResponseHandleAsync).OnException(ExceptionHandleAsync); + Task RequestHandleAsync(HttpClient _, HttpRequestMessage req) + { + return req.LogAsync(logger); + } } } \ No newline at end of file diff --git a/src/backend/NetAdmin.Infrastructure/NetAdmin.Infrastructure.csproj b/src/backend/NetAdmin.Infrastructure/NetAdmin.Infrastructure.csproj index 83989f8e..32a60da1 100644 --- a/src/backend/NetAdmin.Infrastructure/NetAdmin.Infrastructure.csproj +++ b/src/backend/NetAdmin.Infrastructure/NetAdmin.Infrastructure.csproj @@ -6,7 +6,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/src/backend/NetAdmin.Infrastructure/Utils/CaptchaImageHelper.cs b/src/backend/NetAdmin.Infrastructure/Utils/CaptchaImageHelper.cs index 6db0b706..cf37e079 100644 --- a/src/backend/NetAdmin.Infrastructure/Utils/CaptchaImageHelper.cs +++ b/src/backend/NetAdmin.Infrastructure/Utils/CaptchaImageHelper.cs @@ -12,7 +12,7 @@ namespace NetAdmin.Infrastructure.Utils; /// public static class CaptchaImageHelper { - private static readonly int[] _randRange = [70, 100]; + private static readonly int[] _randRange = /// /// 创建一个缺口滑块验证码图片 @@ -96,6 +96,26 @@ public static class CaptchaImageHelper , offsetRand); } + private static int BuildPathList(Span rowSpan, int temp, List pathList, int y) + { + for (var x = 0; x < rowSpan.Length; x++) { + ref var pixel = ref rowSpan[x]; + if (pixel.A != 0) { + temp = temp switch { 0 => x, _ => temp }; + } + else { + if (temp == 0) { + continue; + } + + pathList.Add(new RectangularPolygon(temp, y, x - temp, 1)); + temp = 0; + } + } + + return temp; + } + private static ComplexPolygon CalcBlockShape(Image templateDarkImage) { var temp = 0; @@ -103,20 +123,7 @@ public static class CaptchaImageHelper templateDarkImage.ProcessPixelRows(accessor => { for (var y = 0; y < templateDarkImage.Height; y++) { var rowSpan = accessor.GetRowSpan(y); - for (var x = 0; x < rowSpan.Length; x++) { - ref var pixel = ref rowSpan[x]; - if (pixel.A != 0) { - temp = temp switch { 0 => x, _ => temp }; - } - else { - if (temp == 0) { - continue; - } - - pathList.Add(new RectangularPolygon(temp, y, x - temp, 1)); - temp = 0; - } - } + temp = BuildPathList(rowSpan, temp, pathList, y); } }); @@ -175,4 +182,6 @@ public static class CaptchaImageHelper { return (endNum > startNum ? new[] { 0, endNum - startNum }.Rand() : 0) + startNum; } + + [70, 100]; } \ No newline at end of file diff --git a/src/backend/NetAdmin.Infrastructure/Utils/UserAgentParser.cs b/src/backend/NetAdmin.Infrastructure/Utils/UserAgentParser.cs index a0db1d28..546c5e63 100644 --- a/src/backend/NetAdmin.Infrastructure/Utils/UserAgentParser.cs +++ b/src/backend/NetAdmin.Infrastructure/Utils/UserAgentParser.cs @@ -266,7 +266,7 @@ public sealed class UserAgentParser /// /// 平台 /// - public string Platform { get; set; } = string.Empty; + public string Platform { get; private set; } = string.Empty; /// /// 机器人 @@ -301,49 +301,43 @@ public sealed class UserAgentParser private bool SetMobile() { - #pragma warning disable S3267 - foreach (var item in _mobiles) { - #pragma warning restore S3267 - if (_agent.Contains(item.Key, StringComparison.OrdinalIgnoreCase)) { - IsMobile = true; - Mobile = item.Value; - return true; - } + var kv = _mobiles.FirstOrDefault(x => // + _agent.Contains(x.Key, StringComparison.OrdinalIgnoreCase)); + + if (kv.Key == null) { + return false; } + IsMobile = true; + Mobile = kv.Value; return false; } private bool SetPlatform() { - #pragma warning disable S3267 - foreach (var item in _platforms) { - #pragma warning restore S3267 - if (!Regex.IsMatch(_agent, $"{Regex.Escape(item.Key)}", RegexOptions.IgnoreCase)) { - continue; - } + var kv = _platforms.First(x => // + Regex.IsMatch(_agent, $"{Regex.Escape(x.Key)}", RegexOptions.IgnoreCase)); - Platform = item.Value; - return true; + if (kv.Key == null) { + Platform = "Unknown Platform"; + return false; } - Platform = "Unknown Platform"; - return false; + Platform = kv.Value; + return true; } private bool SetRobot() { - #pragma warning disable S3267 - foreach (var item in _robots) { - #pragma warning restore S3267 - if (Regex.IsMatch(_agent, $"{Regex.Escape(item.Key)}", RegexOptions.IgnoreCase)) { - IsRobot = true; - Robot = item.Value; - _ = SetMobile(); - return true; - } + var kv = _robots.FirstOrDefault(x => // + Regex.IsMatch(_agent, $"{Regex.Escape(x.Key)}", RegexOptions.IgnoreCase)); + if (kv.Key == null) { + return false; } - return false; + IsRobot = true; + Robot = kv.Value; + _ = SetMobile(); + return true; } } \ No newline at end of file diff --git a/src/backend/NetAdmin.SysComponent.Application/Modules/Sys/IToolsModule.cs b/src/backend/NetAdmin.SysComponent.Application/Modules/Sys/IToolsModule.cs index d370ba81..38628e34 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Modules/Sys/IToolsModule.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Modules/Sys/IToolsModule.cs @@ -7,6 +7,11 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys; /// public interface IToolsModule { + /// + /// 获取更新日志 + /// + Task GetChangeLogAsync(); + /// /// 获取模块信息 /// diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/ConfigService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/ConfigService.cs index 55c59d98..ff5d26e8 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/ConfigService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/ConfigService.cs @@ -16,12 +16,14 @@ public sealed class ConfigService(DefaultRepository rpo) // public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/DeptService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/DeptService.cs index dc9dad39..1b1df69b 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/DeptService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/DeptService.cs @@ -15,12 +15,14 @@ public sealed class DeptService(DefaultRepository rpo) // public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/DicCatalogService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/DicCatalogService.cs index 0e8b7624..98fb1298 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/DicCatalogService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/DicCatalogService.cs @@ -15,12 +15,14 @@ public sealed class DicCatalogService(DefaultRepository rpo) // public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/DicContentService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/DicContentService.cs index ce33f04d..bb16f0f7 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/DicContentService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/DicContentService.cs @@ -15,12 +15,14 @@ public sealed class DicContentService(DefaultRepository rpo) // public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/JobRecordService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/JobRecordService.cs index bd3b803b..2803d4c2 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/JobRecordService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/JobRecordService.cs @@ -16,12 +16,14 @@ public sealed class JobRecordService(DefaultRepository rpo) // public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/JobService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/JobService.cs index 9e3db3ae..c788aba1 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/JobService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/JobService.cs @@ -19,12 +19,14 @@ public sealed class JobService(DefaultRepository rpo, IJobRecordService public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// @@ -56,11 +58,12 @@ public sealed class JobService(DefaultRepository rpo, IJobRecordService var ret = await Rpo.UpdateDiy.Set(a => a.ExecutionCron == req.ExecutionCron) .Set(a => a.HttpMethod == req.HttpMethod) .Set(a => a.JobName == req.JobName) - .Set(a => a.RequestHeader == req.RequestHeader) - .Set(a => a.RequestBody == req.RequestBody) - .Set(a => a.RequestUrl == req.RequestUrl) - .Set(a => a.UserId == req.UserId) - .Where(a => a.Id == req.Id) + .SetIf(req.RequestHeaders == null, a => a.RequestHeader, null) + .SetIf(req.RequestHeaders != null, a => a.RequestHeader, req.RequestHeaders.Json()) + .Set(a => a.RequestBody == req.RequestBody) + .Set(a => a.RequestUrl == req.RequestUrl) + .Set(a => a.UserId == req.UserId) + .Where(a => a.Id == req.Id) .ExecuteUpdatedAsync() .ConfigureAwait(false); return ret[0].Adapt(); @@ -97,24 +100,22 @@ public sealed class JobService(DefaultRepository rpo, IJobRecordService public async Task GetNextJobAsync() { var df = new DynamicFilterInfo { - Filters = [ - new DynamicFilterInfo { - Field = nameof(QueryJobReq.NextExecTime) - , Value = DateTime.UtcNow - , Operator = DynamicFilterOperators.LessThan - } - , new DynamicFilterInfo { - Field = nameof(QueryJobReq.Status) - , Value = JobStatues.Idle - , Operator = DynamicFilterOperators.Eq - } - , new DynamicFilterInfo { - Field = nameof(QueryJobReq.Enabled) - , Value = true - , Operator = DynamicFilterOperators.Eq - } - ] - }; + Filters = [ new DynamicFilterInfo { Field = nameof(QueryJobReq.NextExecTime) + , Value = DateTime.UtcNow + , Operator = DynamicFilterOperators.LessThan + } + , new DynamicFilterInfo { + Field = nameof(QueryJobReq.Status) + , Value = JobStatues.Idle + , Operator = DynamicFilterOperators.Eq + } + , new DynamicFilterInfo { + Field = nameof(QueryJobReq.Enabled) + , Value = true + , Operator = DynamicFilterOperators.Eq + } + ] + }; var job = await QueryInternal(new QueryReq { DynamicFilter = df, Count = 1 }, true) .Where(a => !Rpo.Orm.Select() .As("b") diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/MenuService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/MenuService.cs index 41f45a81..272a1aba 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/MenuService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/MenuService.cs @@ -15,12 +15,14 @@ public sealed class MenuService(DefaultRepository rpo, IUserService us public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// @@ -32,10 +34,15 @@ public sealed class MenuService(DefaultRepository rpo, IUserService us } /// - public Task DeleteAsync(DelReq req) + public async Task DeleteAsync(DelReq req) { req.ThrowIfInvalid(); - return Rpo.DeleteAsync(a => a.Id == req.Id); + var effect = await Rpo.DeleteAsync(a => a.Id == req.Id).ConfigureAwait(false); + effect += await Rpo.Orm.Delete() + .Where(a => a.MenuId == req.Id) + .ExecuteAffrowsAsync() + .ConfigureAwait(false); + return effect; } /// diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/RequestLogService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/RequestLogService.cs index e8a047a1..77a138b4 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/RequestLogService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/RequestLogService.cs @@ -15,12 +15,14 @@ public sealed class RequestLogService(DefaultRepository rpo) // public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/RoleService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/RoleService.cs index 769587ff..2bd51353 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/RoleService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/RoleService.cs @@ -15,12 +15,14 @@ public sealed class RoleService(DefaultRepository rpo) // public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgDeptService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgDeptService.cs index 2f93ccc4..e306ddbc 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgDeptService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgDeptService.cs @@ -16,12 +16,14 @@ public sealed class SiteMsgDeptService(DefaultRepository rpo) / public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgFlagService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgFlagService.cs index 34a40023..b21d739e 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgFlagService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgFlagService.cs @@ -16,12 +16,14 @@ public sealed class SiteMsgFlagService(DefaultRepository rpo) / public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgRoleService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgRoleService.cs index df5e883a..e77d2094 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgRoleService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgRoleService.cs @@ -16,12 +16,14 @@ public sealed class SiteMsgRoleService(DefaultRepository rpo) / public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgService.cs index 65cd5d1a..d776ccd6 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgService.cs @@ -12,22 +12,22 @@ using NetAdmin.SysComponent.Application.Services.Sys.Dependency; namespace NetAdmin.SysComponent.Application.Services.Sys; /// -public sealed class SiteMsgService( - DefaultRepository rpo - , ContextUserInfo contextUserInfo - , ISiteMsgFlagService siteMsgFlagService) // +public sealed class SiteMsgService(DefaultRepository rpo, ContextUserInfo contextUserInfo + , ISiteMsgFlagService siteMsgFlagService) // : RepositoryService(rpo), ISiteMsgService { /// public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// @@ -300,9 +300,9 @@ public sealed class SiteMsgService( .WhereDynamicFilter(req.DynamicFilter) .Where((a, _, c, d, e, f) => (SqlExt.EqualIsNull(f.UserSiteMsgStatus) || - f.UserSiteMsgStatus != UserSiteMsgStatues.Deleted) && - (a.MsgType == SiteMsgTypes.Public || c.DeptId == contextUserInfo.DeptId || - roleIds.Contains(d.RoleId) || e.UserId == contextUserInfo.Id)) + f.UserSiteMsgStatus != UserSiteMsgStatues.Deleted) && (a.MsgType == SiteMsgTypes.Public || + c.DeptId == contextUserInfo.DeptId || roleIds.Contains(d.RoleId) || + e.UserId == contextUserInfo.Id)) .GroupBy((a, _, _, _, _, _) => a.Id); } } \ No newline at end of file diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgUserService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgUserService.cs index 7cf99d35..8afc49b1 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgUserService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/SiteMsgUserService.cs @@ -16,12 +16,14 @@ public sealed class SiteMsgUserService(DefaultRepository rpo) / public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/ToolsService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/ToolsService.cs index fb108967..fcbe441c 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/ToolsService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/ToolsService.cs @@ -7,6 +7,14 @@ namespace NetAdmin.SysComponent.Application.Services.Sys; /// public sealed class ToolsService : ServiceBase, IToolsService { + /// + public async Task GetChangeLogAsync() + { + await using var stream = Assembly.GetEntryAssembly()!.GetManifestResourceStream("CHANGELOG.md"); + using var streamReader = new StreamReader(stream!); + return await streamReader.ReadToEndAsync().ConfigureAwait(false); + } + /// public Task> GetModulesAsync() { diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/UserProfileService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/UserProfileService.cs index 5388ad64..a6aa349a 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/UserProfileService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/UserProfileService.cs @@ -17,12 +17,14 @@ public sealed class UserProfileService(DefaultRepository rpo) / public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/UserService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/UserService.cs index c5423dcb..ca5c3cfd 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/UserService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/UserService.cs @@ -13,11 +13,10 @@ using NetAdmin.SysComponent.Application.Services.Sys.Dependency; namespace NetAdmin.SysComponent.Application.Services.Sys; /// -public sealed class UserService( - DefaultRepository rpo // - , IUserProfileService userProfileService // - , IVerifyCodeService verifyCodeService // - , IEventPublisher eventPublisher) // +public sealed class UserService(DefaultRepository rpo // + , IUserProfileService userProfileService // + , IVerifyCodeService verifyCodeService // + , IEventPublisher eventPublisher) // : RepositoryService(rpo), IUserService { private readonly Expression> _selectUserFields = a => new Sys_User { @@ -38,12 +37,14 @@ public sealed class UserService( public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// @@ -358,21 +359,18 @@ public sealed class UserService( req.ThrowIfInvalid(); var version = await Rpo.Where(a => a.Id == UserToken.Id && a.Password == req.OldPassword.Pwd().Guid()) .ToOneAsync(a => new long?(a.Version)) - .ConfigureAwait(false); - if (version != null) { - var ret = await Rpo.UpdateDiy - .SetSource(new Sys_User { - Id = UserToken.Id - , Password = req.NewPassword.Pwd().Guid() - , Version = version.Value - }) - .UpdateColumns(a => a.Password) - .ExecuteAffrowsAsync() - .ConfigureAwait(false); - return ret <= 0 ? throw new NetAdminUnexpectedException() : (uint)ret; - } + .ConfigureAwait(false) ?? throw new NetAdminInvalidOperationException($"{Ln.旧密码不正确}"); - throw new NetAdminInvalidOperationException($"{Ln.旧密码不正确}"); + var ret = await Rpo.UpdateDiy + .SetSource(new Sys_User { + Id = UserToken.Id + , Password = req.NewPassword.Pwd().Guid() + , Version = version + }) + .UpdateColumns(a => a.Password) + .ExecuteAffrowsAsync() + .ConfigureAwait(false); + return ret <= 0 ? throw new NetAdminUnexpectedException() : (uint)ret; } /// diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/VerifyCodeService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/VerifyCodeService.cs index 943c5729..874d2558 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/VerifyCodeService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/VerifyCodeService.cs @@ -14,18 +14,20 @@ namespace NetAdmin.SysComponent.Application.Services.Sys; public sealed class VerifyCodeService(DefaultRepository rpo, IEventPublisher eventPublisher) // : RepositoryService(rpo), IVerifyCodeService { - private static readonly int[] _randRange = [0, 10000]; + private static readonly int[] _randRange = /// public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// @@ -161,6 +163,8 @@ public sealed class VerifyCodeService(DefaultRepository rpo, IEv : await GetAsync(new QueryVerifyCodeReq { Id = req.Id }).ConfigureAwait(false); } + [0, 10000]; + private Task GetLastSentAsync(string destDevice) { return QueryInternal(new QueryReq { diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Tpl/ExampleService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Tpl/ExampleService.cs index f2f511d6..a944b3d9 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Tpl/ExampleService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Tpl/ExampleService.cs @@ -16,12 +16,14 @@ public sealed class ExampleService(DefaultRepository rpo) // public async Task BulkDeleteAsync(BulkReq req) { req.ThrowIfInvalid(); - var sum = 0; + var ret = 0; + + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var item in req.Items) { - sum += await DeleteAsync(item).ConfigureAwait(false); + ret += await DeleteAsync(item).ConfigureAwait(false); } - return sum; + return ret; } /// diff --git a/src/backend/NetAdmin.SysComponent.Cache/Sys/ToolsCache.cs b/src/backend/NetAdmin.SysComponent.Cache/Sys/ToolsCache.cs index 9df1e4e0..bb329056 100644 --- a/src/backend/NetAdmin.SysComponent.Cache/Sys/ToolsCache.cs +++ b/src/backend/NetAdmin.SysComponent.Cache/Sys/ToolsCache.cs @@ -9,6 +9,12 @@ namespace NetAdmin.SysComponent.Cache.Sys; public sealed class ToolsCache(IDistributedCache cache, IToolsService service) // : DistributedCache(cache, service), IScoped, IToolsCache { + /// + public Task GetChangeLogAsync() + { + return Service.GetChangeLogAsync(); + } + /// public Task> GetModulesAsync() { diff --git a/src/backend/NetAdmin.SysComponent.Host/Controllers/Sys/ToolsController.cs b/src/backend/NetAdmin.SysComponent.Host/Controllers/Sys/ToolsController.cs index b90cc260..9a6e83ab 100644 --- a/src/backend/NetAdmin.SysComponent.Host/Controllers/Sys/ToolsController.cs +++ b/src/backend/NetAdmin.SysComponent.Host/Controllers/Sys/ToolsController.cs @@ -12,6 +12,15 @@ namespace NetAdmin.SysComponent.Host.Controllers.Sys; [ApiDescriptionSettings(nameof(Sys), Module = nameof(Sys))] public sealed class ToolsController(IToolsCache cache) : ControllerBase(cache), IToolsModule { + /// + /// 获取更新日志 + /// + [AllowAnonymous] + public Task GetChangeLogAsync() + { + return Cache.GetChangeLogAsync(); + } + /// /// 获取模块信息 /// diff --git a/src/frontend/admin/index.html b/src/frontend/admin/index.html index a2fa7363..1b589f6f 100644 --- a/src/frontend/admin/index.html +++ b/src/frontend/admin/index.html @@ -68,6 +68,7 @@ } .app-loading__title { + font-family: 'Lucida Console', 'Microsoft YaHei', 'monospace'; font-size: 24px; color: #333; margin-top: 30px; diff --git a/src/frontend/admin/package.json b/src/frontend/admin/package.json index dde1348f..d28a4906 100644 --- a/src/frontend/admin/package.json +++ b/src/frontend/admin/package.json @@ -20,6 +20,8 @@ "element-plus": "^2.5.6", "json-bigint": "^1.0.0", "json5-to-table": "^0.1.8", + "markdown-it": "^14.0.0", + "markdown-it-emoji": "^3.0.0", "nprogress": "^0.2.0", "pinyin-match": "^1.2.5", "qrcodejs2": "^0.0.2", diff --git a/src/frontend/admin/src/api/sys/tools.js b/src/frontend/admin/src/api/sys/tools.js index a7d9f1b7..2ba8adc0 100644 --- a/src/frontend/admin/src/api/sys/tools.js +++ b/src/frontend/admin/src/api/sys/tools.js @@ -5,6 +5,17 @@ import config from '@/config' import http from '@/utils/request' export default { + /** + * 获取更新日志 + */ + getChangeLog: { + url: `${config.API_URL}/api/sys/tools/get.change.log`, + name: `获取更新日志`, + post: async function (data = {}, config = {}) { + return await http.post(this.url, data, config) + }, + }, + /** * 获取模块信息 */ diff --git a/src/frontend/admin/src/components/naArea/index.vue b/src/frontend/admin/src/components/naArea/index.vue index a2083203..89fd59b8 100644 --- a/src/frontend/admin/src/components/naArea/index.vue +++ b/src/frontend/admin/src/components/naArea/index.vue @@ -4,7 +4,7 @@ :apiObj="$API.sys_dic.pagedQueryContent" :params="form" :props="{ label: 'key', value: 'value' }" - :table-width="600" + :table-width="60" clearable ref="area"> @@ -16,13 +16,13 @@ @@ -155,82 +129,6 @@ export default { display: flex; } -.login_adv { - width: 33.33333%; - background-color: #555; - background-size: cover; - background-position: center center; - background-repeat: no-repeat; - position: relative; -} - -.login_adv__title { - color: #fff; - padding: 40px; - position: absolute; - top: 0; - left: 0; - right: 0; - z-index: 2; -} - -.login_adv__title h2 { - font-size: 40px; -} - -.login_adv__title h4 { - font-size: 18px; - margin-top: 10px; - font-weight: normal; -} - -.login_adv__title p { - font-size: 14px; - margin-top: 10px; - line-height: 1.8; - color: rgba(255, 255, 255, 0.6); -} - -.login_adv__title div { - margin-top: 10px; - display: flex; - align-items: center; -} - -.login_adv__title div span { - margin-right: 1rem; -} - -.login_adv__title div i { - font-size: 40px; -} - -.login_adv__title div i.add { - font-size: 20px; - color: rgba(255, 255, 255, 0.6); -} - -.login_adv__bottom { - position: absolute; - left: 0; - right: 0; - bottom: 0; - color: #fff; - padding: 40px; - background-image: linear-gradient(transparent, #000); - z-index: 3; -} - -.login_adv__mask { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: rgba(0, 0, 0, 0.5); - z-index: 1; -} - .login_main { flex: 1; overflow: auto; @@ -238,13 +136,12 @@ export default { } .login-form { - width: 400px; + width: 30rem; margin: auto; - padding: 20px 0; } .login-header { - margin-bottom: 40px; + margin-bottom: 3rem; } .login-header .logo { @@ -253,34 +150,17 @@ export default { } .login-header .logo img { - width: 40px; - height: 40px; + width: 3rem; + height: 3rem; vertical-align: bottom; - margin-right: 10px; + margin-right: 1rem; } .login-header .logo label { - font-size: 26px; + font-size: 2rem; font-weight: bold; } -.login-oauth { - display: flex; - justify-content: space-around; -} - -.login-form .el-divider { - margin-top: 40px; -} - -.login-form:deep(.el-tabs) .el-tabs__header { - margin-bottom: 25px; -} - -.login-form:deep(.el-tabs) .el-tabs__header .el-tabs__item { - font-size: 14px; -} - .login-form:deep(.login-forgot) { text-align: right; } @@ -294,7 +174,7 @@ export default { } .login-form:deep(.login-reg) { - font-size: 14px; + font-size: 1.1rem; color: var(--el-text-color-primary); } @@ -308,60 +188,24 @@ export default { .login_config { position: absolute; - top: 20px; - right: 20px; + top: 1.5rem; + right: 1.5rem; } -.qrCodeLogin { - text-align: center; - position: relative; - padding: 20px 0; -} - -.qrCodeLogin img.qrCode { - background: #fff; - padding: 20px; - border-radius: 10px; -} - -.qrCodeLogin p.msg { - margin-top: 1rem; -} - -.qrCodeLogin .qrCodeLogin-result { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - text-align: center; - background: var(--el-mask-color); -} - -@media (max-width: 1200px) { - .login-form { - width: 340px; - } -} - -@media (max-width: 1000px) { +@media (max-width: 77rem) { .login_main { display: block; } .login_main .login_config { position: static; - padding: 20px 20px 0 20px; + padding: 1.5rem 1.5rem 0 1.5rem; text-align: right; } .login-form { width: 100%; - padding: 20px 40px; - } - - .login_adv { - display: none; + padding: 1.5rem 3rem; } } \ No newline at end of file diff --git a/src/frontend/admin/src/views/home/index.vue b/src/frontend/admin/src/views/home/index.vue index 7439a785..0df38fae 100644 --- a/src/frontend/admin/src/views/home/index.vue +++ b/src/frontend/admin/src/views/home/index.vue @@ -1,16 +1,8 @@ - - \ No newline at end of file diff --git a/src/frontend/admin/src/views/home/widgets/components/change-log.vue b/src/frontend/admin/src/views/home/widgets/components/change-log.vue new file mode 100644 index 00000000..a57063cf --- /dev/null +++ b/src/frontend/admin/src/views/home/widgets/components/change-log.vue @@ -0,0 +1,53 @@ + + + + + + \ No newline at end of file diff --git a/src/frontend/admin/src/views/home/widgets/components/modules.vue b/src/frontend/admin/src/views/home/widgets/components/modules.vue new file mode 100644 index 00000000..e3b0d699 --- /dev/null +++ b/src/frontend/admin/src/views/home/widgets/components/modules.vue @@ -0,0 +1,61 @@ + + + + + + \ No newline at end of file diff --git a/src/frontend/admin/src/views/home/widgets/components/progress.vue b/src/frontend/admin/src/views/home/widgets/components/progress.vue deleted file mode 100644 index 3dcd7110..00000000 --- a/src/frontend/admin/src/views/home/widgets/components/progress.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/frontend/admin/src/views/home/widgets/components/time.vue b/src/frontend/admin/src/views/home/widgets/components/time.vue index da694d44..6ec902ea 100644 --- a/src/frontend/admin/src/views/home/widgets/components/time.vue +++ b/src/frontend/admin/src/views/home/widgets/components/time.vue @@ -35,17 +35,17 @@ export default { \ No newline at end of file diff --git a/src/frontend/admin/src/views/home/widgets/components/ver.vue b/src/frontend/admin/src/views/home/widgets/components/ver.vue index 988d18c3..653e49bd 100644 --- a/src/frontend/admin/src/views/home/widgets/components/ver.vue +++ b/src/frontend/admin/src/views/home/widgets/components/ver.vue @@ -1,38 +1,15 @@ - - \ No newline at end of file diff --git a/src/frontend/admin/src/views/home/widgets/index.vue b/src/frontend/admin/src/views/home/widgets/index.vue index 9a50af6e..ce961fdc 100644 --- a/src/frontend/admin/src/views/home/widgets/index.vue +++ b/src/frontend/admin/src/views/home/widgets/index.vue @@ -71,6 +71,16 @@ +
+ + + + + +
- + 恢复默认 @@ -141,7 +151,7 @@ export default { } }, created() { - this.grid = this.$TOOL.data.get('grid') || JSON.parse(JSON.stringify(this.defaultGrid)) + this.loadGrid() }, mounted() { this.$emit('on-mounted') @@ -228,6 +238,10 @@ export default { close() { this.customizing = false this.$refs.widgets.style.removeProperty('transform') + this.loadGrid() + }, + loadGrid() { + this.grid = this.$TOOL.data.get('grid') || JSON.parse(JSON.stringify(this.defaultGrid)) }, }, } @@ -248,33 +262,32 @@ export default { } .widgets-aside { - width: 360px; + width: 25rem; background: #fff; - box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); position: relative; overflow: auto; } .widgets-aside-title { - font-size: 14px; + font-size: 1.1rem; display: flex; align-items: center; justify-content: center; } .widgets-aside-title i { - margin-right: 10px; - font-size: 18px; + margin-right: 0.8rem; + font-size: 1.4rem; } .widgets-aside-close { - font-size: 18px; - width: 30px; - height: 30px; + font-size: 1.4rem; + width: 2.5rem; + height: 2.5rem; display: flex; align-items: center; justify-content: center; - border-radius: 3px; + border-radius: 0.3rem; cursor: pointer; } @@ -290,7 +303,7 @@ export default { } .widgets-top-title { - font-size: 18px; + font-size: 1.4rem; font-weight: bold; } @@ -304,7 +317,7 @@ export default { } .customizing .widgets-wrapper { - margin-right: -360px; + margin-right: -25rem; } .customizing .widgets-wrapper .el-col { @@ -343,10 +356,10 @@ export default { .customize-overlay label { background: var(--el-color-primary); color: #fff; - height: 40px; - padding: 0 30px; - border-radius: 40px; - font-size: 18px; + height: 4rem; + padding: 0 3rem; + border-radius: 3rem; + font-size: 1.4rem; display: flex; align-items: center; justify-content: center; @@ -355,7 +368,7 @@ export default { .customize-overlay label i { margin-right: 1rem; - font-size: 24px; + font-size: 2rem; } .customize-overlay .close { @@ -377,14 +390,14 @@ export default { } .widgets-list-item .item-logo { - width: 40px; - height: 40px; + width: 3rem; + height: 3rem; border-radius: 50%; background: rgba(180, 180, 180, 0.1); display: flex; align-items: center; justify-content: center; - font-size: 18px; + font-size: 1.4rem; margin-right: 1rem; color: #6a8bad; } @@ -394,13 +407,13 @@ export default { } .widgets-list-item .item-info h2 { - font-size: 16px; + font-size: 1.2rem; font-weight: normal; cursor: default; } .widgets-list-item .item-info p { - font-size: 12px; + font-size: 0.9rem; color: #999; cursor: default; } @@ -419,10 +432,10 @@ export default { } .selectLayout-item { - width: 60px; - height: 60px; - border: 2px solid var(--el-border-color-light); - padding: 5px; + width: 5rem; + height: 5rem; + border: 0.2rem solid var(--el-border-color-light); + padding: 0.4rem; cursor: pointer; margin-right: 1rem; } @@ -430,21 +443,21 @@ export default { .selectLayout-item span { display: block; background: var(--el-border-color-light); - height: 46px; + height: 3.6rem; } .selectLayout-item.item02 span { - height: 30px; + height: 2.4rem; } .selectLayout-item.item02 .el-col:nth-child(1) span { - height: 14px; - margin-bottom: 2px; + height: 1.1rem; + margin-bottom: 0.2rem; } .selectLayout-item.item03 span { - height: 14px; - margin-bottom: 2px; + height: 1.1rem; + margin-bottom: 0.2rem; } .selectLayout-item:hover { @@ -469,7 +482,7 @@ export default { } } -@media (max-width: 992px) { +@media (max-width: 77rem) { .customizing .widgets { transform: scale(1) !important; } diff --git a/src/frontend/admin/src/views/home/work/components/myapp.vue b/src/frontend/admin/src/views/home/work/components/myapp.vue index f5f6d205..d624912f 100644 --- a/src/frontend/admin/src/views/home/work/components/myapp.vue +++ b/src/frontend/admin/src/views/home/work/components/myapp.vue @@ -123,17 +123,17 @@ export default { \ No newline at end of file diff --git a/src/frontend/admin/src/views/sys/config/save.vue b/src/frontend/admin/src/views/sys/config/save.vue index 6e71cff8..18b46d4e 100644 --- a/src/frontend/admin/src/views/sys/config/save.vue +++ b/src/frontend/admin/src/views/sys/config/save.vue @@ -3,7 +3,7 @@
- +
@@ -35,10 +35,10 @@ diff --git a/src/frontend/admin/src/views/sys/dept/save.vue b/src/frontend/admin/src/views/sys/dept/save.vue index 4d3556fa..4675c1d1 100644 --- a/src/frontend/admin/src/views/sys/dept/save.vue +++ b/src/frontend/admin/src/views/sys/dept/save.vue @@ -3,7 +3,7 @@
- + diff --git a/src/frontend/admin/src/views/sys/dic/list/save.vue b/src/frontend/admin/src/views/sys/dic/list/save.vue index 2b474c37..4c3a5dfc 100644 --- a/src/frontend/admin/src/views/sys/dic/list/save.vue +++ b/src/frontend/admin/src/views/sys/dic/list/save.vue @@ -3,7 +3,7 @@
- + @@ -18,10 +18,10 @@ diff --git a/src/frontend/admin/src/views/sys/dic/save.vue b/src/frontend/admin/src/views/sys/dic/save.vue index 005ca43c..d00a63fa 100644 --- a/src/frontend/admin/src/views/sys/dic/save.vue +++ b/src/frontend/admin/src/views/sys/dic/save.vue @@ -1,6 +1,6 @@