From 7c7e9cd7f055b3d54cb6c004dcba6c90c340979f Mon Sep 17 00:00:00 2001 From: liu liang Date: Fri, 16 Jun 2023 11:39:38 +0800 Subject: [PATCH 01/12] update datetimeconverter --- src/WalkingTec.Mvvm.Core/Json/DateTimeConverter.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/WalkingTec.Mvvm.Core/Json/DateTimeConverter.cs b/src/WalkingTec.Mvvm.Core/Json/DateTimeConverter.cs index 74628d4a5..1564a62cc 100644 --- a/src/WalkingTec.Mvvm.Core/Json/DateTimeConverter.cs +++ b/src/WalkingTec.Mvvm.Core/Json/DateTimeConverter.cs @@ -9,21 +9,26 @@ namespace WalkingTec.Mvvm.Core.Json { - public class DateTimeConverter : JsonConverter + public class DateTimeConverter : JsonConverter { - public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { if (reader.TokenType == JsonTokenType.String) { if (DateTime.TryParse(reader.GetString(), out DateTime date)) return date; + else + return null; } return reader.GetDateTime(); } - public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options) + public override void Write(Utf8JsonWriter writer, DateTime? value, JsonSerializerOptions options) { - writer.WriteStringValue(value.ToString("yyyy-MM-dd HH:mm:ss")); + if (value != null) + { + writer.WriteStringValue(value?.ToString("yyyy-MM-dd HH:mm:ss")); + } } } } From 9306c80c5e0259348659c59599542232e57e7634 Mon Sep 17 00:00:00 2001 From: liu liang Date: Fri, 16 Jun 2023 23:11:41 +0800 Subject: [PATCH 02/12] update vue --- .../ClientApp/src/components/table/index.vue | 4 +++- .../ClientApp/src/views/_admin/frameworkgroup/index.vue | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/demo/WalkingTec.Mvvm.Vue3Demo/ClientApp/src/components/table/index.vue b/demo/WalkingTec.Mvvm.Vue3Demo/ClientApp/src/components/table/index.vue index d2839c582..c8da0e9e6 100644 --- a/demo/WalkingTec.Mvvm.Vue3Demo/ClientApp/src/components/table/index.vue +++ b/demo/WalkingTec.Mvvm.Vue3Demo/ClientApp/src/components/table/index.vue @@ -13,7 +13,7 @@ + :prop="item.key" :width="item.colWidth" :label="item.title" :sortable="item.sortable" :align="item.align">