lu
2025-01-08 07c98b01b357c37a75353370bc95430e814543f3
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像素
                    }