diff --git a/build/code.quality.props b/build/code.quality.props index 76ab7ea2..e41af6c4 100644 --- a/build/code.quality.props +++ b/build/code.quality.props @@ -15,7 +15,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/backend/NetAdmin/NetAdmin.Domain/Dto/DynamicFilterInfo.cs b/src/backend/NetAdmin/NetAdmin.Domain/Dto/DynamicFilterInfo.cs index 4742cdbb..60752861 100644 --- a/src/backend/NetAdmin/NetAdmin.Domain/Dto/DynamicFilterInfo.cs +++ b/src/backend/NetAdmin/NetAdmin.Domain/Dto/DynamicFilterInfo.cs @@ -38,7 +38,9 @@ public sealed record DynamicFilterInfo : DataAbstraction public static implicit operator FreeSql.Internal.Model.DynamicFilterInfo(DynamicFilterInfo d) { var ret = d.Adapt(); - ProcessDynamicFilter(ret); + #pragma warning disable VSTHRD002 + ProcessDynamicFilterAsync(ret).ConfigureAwait(false).GetAwaiter().GetResult(); + #pragma warning restore VSTHRD002 return ret; } @@ -79,35 +81,27 @@ public sealed record DynamicFilterInfo : DataAbstraction return !condition ? this : Add(df); } - private static void ParseDateExp(FreeSql.Internal.Model.DynamicFilterInfo d) + private static async Task ParseDateExpAsync(FreeSql.Internal.Model.DynamicFilterInfo d) { var values = ((JsonElement)d.Value).Deserialize(); if (!DateTime.TryParse(values[0], CultureInfo.InvariantCulture, out _)) { - var result = values[0] - .ExecuteCSharpCodeAsync([typeof(DateTime).Assembly], nameof(System)) - .ConfigureAwait(false) - .GetAwaiter() - .GetResult(); + var result = await values[0].ExecuteCSharpCodeAsync([typeof(DateTime).Assembly], nameof(System)).ConfigureAwait(false); values[0] = $"{result:yyyy-MM-dd HH:mm:ss}"; } if (!DateTime.TryParse(values[1], CultureInfo.InvariantCulture, out _)) { - var result = values[1] - .ExecuteCSharpCodeAsync([typeof(DateTime).Assembly], nameof(System)) - .ConfigureAwait(false) - .GetAwaiter() - .GetResult(); + var result = await values[1].ExecuteCSharpCodeAsync([typeof(DateTime).Assembly], nameof(System)).ConfigureAwait(false); values[1] = $"{result:yyyy-MM-dd HH:mm:ss}"; } d.Value = values; } - private static void ProcessDynamicFilter(FreeSql.Internal.Model.DynamicFilterInfo d) + private static async Task ProcessDynamicFilterAsync(FreeSql.Internal.Model.DynamicFilterInfo d) { if (d?.Filters != null) { foreach (var filterInfo in d.Filters) { - ProcessDynamicFilter(filterInfo); + await ProcessDynamicFilterAsync(filterInfo).ConfigureAwait(false); } } @@ -119,7 +113,7 @@ public sealed record DynamicFilterInfo : DataAbstraction } } else if (d?.Operator == DynamicFilterOperator.DateRange) { - ParseDateExp(d); + await ParseDateExpAsync(d).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/src/backend/NetAdmin/NetAdmin.Infrastructure/NetAdmin.Infrastructure.csproj b/src/backend/NetAdmin/NetAdmin.Infrastructure/NetAdmin.Infrastructure.csproj index 5e0c396a..4fd609a1 100644 --- a/src/backend/NetAdmin/NetAdmin.Infrastructure/NetAdmin.Infrastructure.csproj +++ b/src/backend/NetAdmin/NetAdmin.Infrastructure/NetAdmin.Infrastructure.csproj @@ -3,9 +3,9 @@ - - - + + + diff --git a/src/backend/NetAdmin/NetAdmin.SysComponent.Domain/Attributes/DataValidation/ApiIdAttribute.cs b/src/backend/NetAdmin/NetAdmin.SysComponent.Domain/Attributes/DataValidation/ApiIdAttribute.cs index b52b179d..c02c73ef 100644 --- a/src/backend/NetAdmin/NetAdmin.SysComponent.Domain/Attributes/DataValidation/ApiIdAttribute.cs +++ b/src/backend/NetAdmin/NetAdmin.SysComponent.Domain/Attributes/DataValidation/ApiIdAttribute.cs @@ -16,7 +16,9 @@ public sealed class ApiIdAttribute : ValidationAttribute var req = new QueryReq { Filter = new QueryApiReq { Id = value as string } }; var method = service.GetType().GetMethod("ExistAsync"); - var exist = ((Task)method!.Invoke(service, [req]))!.ConfigureAwait(false).GetAwaiter().GetResult(); + #pragma warning disable VSTHRD002 + var exist = ((Task)method!.Invoke(service, [req]))!.ConfigureAwait(false).GetAwaiter().GetResult(); + #pragma warning restore VSTHRD002 return !exist ? new ValidationResult(Ln.接口编码不存在) : ValidationResult.Success; } } \ No newline at end of file diff --git a/src/backend/NetAdmin/NetAdmin.SysComponent.Domain/Attributes/DataValidation/UserIdAttribute.cs b/src/backend/NetAdmin/NetAdmin.SysComponent.Domain/Attributes/DataValidation/UserIdAttribute.cs index 36229377..b394494a 100644 --- a/src/backend/NetAdmin/NetAdmin.SysComponent.Domain/Attributes/DataValidation/UserIdAttribute.cs +++ b/src/backend/NetAdmin/NetAdmin.SysComponent.Domain/Attributes/DataValidation/UserIdAttribute.cs @@ -16,7 +16,9 @@ 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(); + #pragma warning disable VSTHRD002 + var exist = ((Task)method!.Invoke(service, [req]))!.ConfigureAwait(false).GetAwaiter().GetResult(); + #pragma warning restore VSTHRD002 return !exist ? new ValidationResult(Ln.用户编号不存在) : ValidationResult.Success; } } \ 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 f2c807d4..61398108 100644 --- a/src/frontend/admin/src/views/home/index.vue +++ b/src/frontend/admin/src/views/home/index.vue @@ -1,7 +1,7 @@ @@ -20,6 +20,7 @@ export default { data() { return { loading: true, + mainHeight: 'auto', dashboard: false, } }, @@ -30,7 +31,11 @@ export default { this.loading = false }, mounted() {}, - methods: {}, + methods: { + onCustomizing(isCustomizing) { + this.mainHeight = isCustomizing ? '100%' : 'auto' + }, + }, } diff --git a/src/frontend/admin/src/views/home/widgets/components/components/layout.vue b/src/frontend/admin/src/views/home/widgets/components/components/layout.vue new file mode 100644 index 00000000..f0a49b4b --- /dev/null +++ b/src/frontend/admin/src/views/home/widgets/components/components/layout.vue @@ -0,0 +1,97 @@ + + + + \ No newline at end of file diff --git a/src/frontend/admin/src/views/home/widgets/dialog/custom-layout-dialog.vue b/src/frontend/admin/src/views/home/widgets/dialog/custom-layout-dialog.vue new file mode 100644 index 00000000..f3c27ae0 --- /dev/null +++ b/src/frontend/admin/src/views/home/widgets/dialog/custom-layout-dialog.vue @@ -0,0 +1,78 @@ + + + + + \ 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 d3719c74..763008a2 100644 --- a/src/frontend/admin/src/views/home/widgets/index.vue +++ b/src/frontend/admin/src/views/home/widgets/index.vue @@ -64,42 +64,21 @@
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
+ +
+ + 添加自定义布局 +
@@ -129,17 +108,30 @@
- + + +
+ +