From 1fca2167068e9ef2c079ec742f20313fc6697ab1 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期一, 03 三月 2025 09:18:33 +0800
Subject: [PATCH] 完善代码;

---
 HMI.UI/DpUtil/FormGroupHelper.cs |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/HMI.UI/DpUtil/FormGroupHelper.cs b/HMI.UI/DpUtil/FormGroupHelper.cs
index 245a054..3447885 100644
--- a/HMI.UI/DpUtil/FormGroupHelper.cs
+++ b/HMI.UI/DpUtil/FormGroupHelper.cs
@@ -62,7 +62,7 @@
                 {
                     object content = fg.Content;
                     object value = GetValidateValue(content);
-                    if (GetIsRequired(fg) && string.IsNullOrEmpty(value.ToString()))
+                    if (value != null && GetIsRequired(fg) && string.IsNullOrEmpty(value.ToString()))
                     {
                         fg.ValidateResult = ValidateResult.Error;
                         fg.Message = $"{fg.Header}涓嶈兘涓虹┖";
@@ -93,6 +93,7 @@
             if (content is ComboBox cBox) return cBox.Text;
 
             if (content is Panel panel) return GetValidateValue(panel.Children);
+            if (content is NumberInput numberInput) return numberInput.Value;
             return null;
         }
     }

--
Gitblit v1.9.1