From 200b60701072ff421156d7fd3c4fecf1a3b5bdb3 Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期日, 07 九月 2025 10:58:58 +0800
Subject: [PATCH] Merge branch 'master' of http://git.gs-mes.com:8080/r/~tjx/GsMesClient

---
 DevApp/Gs.DevApp/DevFrm/QC/DefectCode.cs |   78 +++++++++++++++++++++-----------------
 1 files changed, 43 insertions(+), 35 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QC/DefectCode.cs b/DevApp/Gs.DevApp/DevFrm/QC/DefectCode.cs
index 8ae7cc6..ee98b78 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/DefectCode.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/DefectCode.cs
@@ -1,17 +1,12 @@
-锘縰sing DevExpress.XtraEditors;
-using DevExpress.XtraTreeList.Nodes;
+锘縰sing DevExpress.XtraTreeList.Nodes;
 using DevExpress.XtraTreeList;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Newtonsoft.Json;
 using System;
 using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
 using System.Drawing;
-using System.Linq;
 using System.Text;
-using System.Threading.Tasks;
 using System.Windows.Forms;
 
 namespace Gs.DevApp.DevFrm.QC
@@ -25,10 +20,9 @@
         public DefectCode(string _strType)
         {
             InitializeComponent();
-            strType = _strType;
             toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
-
+            strType = _strType;
             tlMenu.IndicatorWidth = 50;
             tlMenu.CustomDrawNodeIndicator += (s, ee) =>
             {
@@ -52,6 +46,13 @@
                 frm.UpdateParent += (s2, ee2) =>
                 {
                     getPageList(1);
+                    // 渚嬪锛岄�氳繃ID鏌ユ壘鑺傜偣锛�
+                    TreeListNode node = tlMenu.FindNodeByKeyID(strUpGuid);
+                    if (node != null)
+                    {
+                        node.Expanded = true; // 灞曞紑鑺傜偣
+                        tlMenu.MakeNodeVisible(node); // 纭繚鍙
+                    }
                 };
                 frm.ShowDialog();
             };
@@ -93,11 +94,11 @@
                             tlMenu.DeleteNode(tlMenu.FocusedNode);
                         }
                         else
-                            ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                            ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
                     }
                     catch (Exception ex)
                     {
-                        ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                        ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
                     }
                 }
             };
@@ -114,11 +115,36 @@
                 frm.UpdateParent += (s2, ee2) =>
                 {
                     getPageList(1);
+                    // 渚嬪锛岄�氳繃ID鏌ユ壘鑺傜偣锛�
+                    TreeListNode node = tlMenu.FindNodeByKeyID(strGuid);
+                    if (node !=null)
+                    {
+                        node.Expanded = true; // 灞曞紑鑺傜偣
+                        tlMenu.MakeNodeVisible(node); // 纭繚鍙
+                    }
                 };
                 frm.ShowDialog();
             };
         }
-
+        /// <summary>
+        /// 鏌ヨ浜嬩欢
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e)
+        {
+            Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇ョ獥浣撲笉鏀寔鏌ヨ锛岃嫢鎯虫洿鏂伴〉闈紝璇风偣鍑� 鍒锋柊");
+        }
+        /// <summary>
+        ///     鍒锋柊浜嬩欢
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
+        {
+            _filterList.Clear();
+            getPageList(1);
+        }
         /// <summary>
         /// 鍙抽敭寮瑰嚭鑿滃崟,濡傛灉鏄锛屽鍔犲瓙椤圭洰锛屽惁鍒欏鍔犱富椤�
         /// </summary>
@@ -151,32 +177,10 @@
                     toolStripMenuItemAdd.Visible = false;
                     toolStripMenuItemEdt.Visible = false;
                     toolStripMenuItemDel.Visible = false;
-                    toolStripMenuItemRoot.Visible = true;
+                    toolStripMenuItemRoot.Visible = false;//2025/07//11鏀逛负涓嶅鍔犱富椤圭洰浜�
                     cms1.Show(tlMenu, e.Location);
                 }
             }
-        }
-
-
-        /// <summary>
-        /// 鏌ヨ浜嬩欢
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e)
-        {
-            Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇ョ獥浣撲笉鏀寔鏌ヨ锛岃嫢鎯虫洿鏂伴〉闈紝璇风偣鍑� 鍒锋柊");
-        }
-
-        /// <summary>
-        /// 鍒锋柊浜嬩欢
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
-        {
-            _filterList.Clear();
-            getPageList(1);
         }
         /// <summary>
         /// 
@@ -199,12 +203,16 @@
                 tlMenu.KeyFieldName = "guid";
                 tlMenu.ParentFieldName = "pid";
                 tlMenu.EndUpdate();
-                this.tlMenu.CollapseAll();
+               this.tlMenu.CollapseAll();
+                // this.tlMenu.ExpandAll();
+                // this.tlMenu.ExpandToLevel(0);
             }
             catch (Exception ex)
             {
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
         }
+
+       
     }
 }

--
Gitblit v1.9.3