From 07c98b01b357c37a75353370bc95430e814543f3 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期三, 08 一月 2025 16:24:09 +0800
Subject: [PATCH] 细节

---
 DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs |   72 ++++++++++++++++++++++++++++-------
 1 files changed, 57 insertions(+), 15 deletions(-)

diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index 96ea59a..77cf2bd 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -80,7 +80,7 @@
                 request.ContentType = "application/json";
                 request.Headers.Add("token", GetBasicAuthTicket());
                 request.Accept = "*/*";
-                request.Timeout = 15000;
+                request.Timeout = 150000;
                 request.AllowAutoRedirect = false;
                 request.ServicePoint.Expect100Continue = false;
                 wdf.SetCaption(_caption + "锛�10/100锛�" + meth);
@@ -358,7 +358,6 @@
 
                                     txt.Text = strVal;
                                 }
-
                             else
                                 txt.Text = strVal;
                             txt.ReadOnly = isEdt;
@@ -391,7 +390,12 @@
                             var txt = colType as MemoEdit;
                             if (txt != null)
                                 txt.Text = strVal;
-                            txt.ReadOnly = isEdt;
+                            if (_isRead(txt.Tag))
+                            {
+                                txt.ReadOnly = true;
+                            }
+                            else
+                                txt.ReadOnly = isEdt;
                             continue;
                         }
                         //鏁板瓧鍗�
@@ -432,18 +436,32 @@
                         {
                             var txt = colType as CheckBox;
                             if (txt != null)
-                                txt.Checked = bool.Parse(strVal);
+                                switch (strVal)
+                                {
+                                    case "True":
+                                        txt.Checked = true;
+                                        break;
+                                    case "1":
+                                        txt.Checked = true;
+                                        break;
+                                    case "False":
+                                        txt.Checked = false;
+                                        break;
+                                    default:
+                                        txt.Checked = false;
+                                        break;
+                                }
                             txt.Enabled = !isEdt;
                             continue;
                         }
-                        if (colType is CheckEdit)
-                        {
-                            var txt = colType as CheckEdit;
-                            if (txt != null)
-                                txt.Checked = bool.Parse(strVal);
-                            txt.ReadOnly = isEdt;
-                            continue;
-                        }
+                        //if (colType is CheckEdit)
+                        //{
+                        //    var txt = colType as CheckEdit;
+                        //    if (txt != null)
+                        //        txt.Checked = bool.Parse(strVal);
+                        //    txt.ReadOnly = isEdt;
+                        //    continue;
+                        //}
                         //鏃堕棿
                         if (colType is DateTimePicker)
                         {
@@ -644,6 +662,18 @@
                 catch (Exception ex)
                 {
                     MessageBox.Show(ex.Message);
+                }
+            }
+
+            foreach (Control ctrl in controls)
+            {
+                if (ctrl is TextEdit)
+                {
+                    var txt = ctrl as TextEdit;
+                    bool _bl = _isRead(txt.Tag, isEdt);
+                    txt.ReadOnly = _bl;
+                    // txt.ReadOnly = isEdt;
+                    continue;
                 }
             }
         }
@@ -1137,13 +1167,19 @@
             }
         }
 
-        private static bool _isRead(object obj)
+        private static bool _isRead(object obj,bool isEdt=false)
         {
-            if (obj != null && obj.ToString().ToUpper().Contains("readOnly".ToUpper()))
+            ///姘歌繙鏄彧璇荤殑
+            if (obj != null && obj.ToString().ToUpper()==("readOnly".ToUpper()))
             {
                 return true;
             }
-            return false;
+            ///姘歌繙鏄彲鍐欑殑
+            if (obj != null && obj.ToString().ToUpper()==("readOnly-1".ToUpper()))
+            {
+                return false;
+            }
+            return isEdt;
         }
         /// <summary>
         ///     鍒囨崲閫夐」鍗�
@@ -1532,9 +1568,15 @@
                         btnChkIco.Text = checkStatus;
                         btnChkIco.Visible = true;
                         if (checkStatus == "1" || checkStatus.ToUpper() == true.ToString().ToUpper())
+                        {
                             btnChkIco.Image = global::Gs.DevApp.Properties.Resources.ico_check;
+                            btnChkIco.Tag = "宸插鏍�";
+                        }
                         else
+                        {
                             btnChkIco.Image = global::Gs.DevApp.Properties.Resources.ico_noCheck;
+                            btnChkIco.Tag = "鏈鏍�";
+                        }
                         btnChkIco.Anchor = AnchorStyles.Top | AnchorStyles.Right; // 闈犲彸
                         btnChkIco.Location = new Point(fm.ClientSize.Width - btnChkIco.Width - 20, 80); // 璺濈椤堕儴10鍍忕礌
                     }

--
Gitblit v1.9.3