From d3dd87dbb75c485ca1c9431faffe2d9cae786e97 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期一, 19 五月 2025 09:44:09 +0800
Subject: [PATCH] 其它入库

---
 DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectCode.cs |   45 +++++++++++++++++++++++++++------------------
 1 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectCode.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectCode.cs
index d57dee4..98e7f07 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectCode.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectCode.cs
@@ -18,7 +18,6 @@
         public Frm_MesDefectCode()
         {
             InitializeComponent();
-            tlMenu.ContextMenuStrip = contextMenuStrip1;
             toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             this.toolBarMenu1.getXmlConfig();
@@ -41,18 +40,18 @@
                 {
                     strUpGuid = tlMenu.FocusedNode.GetValue("guid").ToString();
                 }
-                Frm_MesDefectCodeShow frm = new Frm_MesDefectCodeShow(strGuid,strUpGuid);
+                Frm_MesDefectCodeShow frm = new Frm_MesDefectCodeShow(strGuid, strUpGuid);
                 frm.UpdateParent += (s2, ee2) =>
                 {
                     getPageList(1);
                 };
-                frm.ShowDialog(); 
+                frm.ShowDialog();
             };
             this.toolStripMenuItemRoot.Click += (s, ee) =>
             {
                 string strGuid = "";
                 string strUpGuid = "";
-                Frm_MesDefectCodeShow frm = new Frm_MesDefectCodeShow(strGuid,strUpGuid);
+                Frm_MesDefectCodeShow frm = new Frm_MesDefectCodeShow(strGuid, strUpGuid);
                 frm.UpdateParent += (s2, ee2) =>
                 {
                     getPageList(1);
@@ -103,7 +102,7 @@
                     strGuid = tlMenu.FocusedNode.GetValue("guid").ToString();
                     strUpGuid = tlMenu.FocusedNode.GetValue("pid").ToString();
                 }
-                Frm_MesDefectCodeShow frm = new Frm_MesDefectCodeShow(strGuid,strUpGuid);
+                Frm_MesDefectCodeShow frm = new Frm_MesDefectCodeShow(strGuid, strUpGuid);
                 frm.UpdateParent += (s2, ee2) =>
                 {
                     getPageList(1);
@@ -111,29 +110,40 @@
                 frm.ShowDialog();
             };
         }
-
+        /// <summary>
+        /// 鍙抽敭寮瑰嚭鑿滃崟,濡傛灉鏄锛屽鍔犲瓙椤圭洰锛屽惁鍒欏鍔犱富椤�
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void TlMenu_MouseDown(object sender, MouseEventArgs e)
         {
             if (e.Button == MouseButtons.Right)
             {
-                tlMenu.ContextMenuStrip = null;
                 TreeListHitInfo hInfo = tlMenu.CalcHitInfo(new Point(e.X, e.Y));
                 TreeListNode node = hInfo.Node;
                 tlMenu.FocusedNode = node;
-                if (node != null)
+                if (hInfo.HitInfoType == HitInfoType.Cell ||
+                    hInfo.HitInfoType ==HitInfoType.Row||
+                    hInfo.HitInfoType==HitInfoType.RowIndent ||
+                    hInfo.HitInfoType == HitInfoType.RowIndicator
+                    )
                 {
-                    toolStripMenuItemAdd.Visible = true;
-                    toolStripMenuItemEdt.Visible = true;
-                    toolStripMenuItemDel.Visible = true;
-                    toolStripMenuItemRoot.Visible = false;
-                    tlMenu.ContextMenuStrip = contextMenuStrip1;
+                    if (node != null)
+                    {
+                        toolStripMenuItemAdd.Visible = true;
+                        toolStripMenuItemEdt.Visible = true;
+                        toolStripMenuItemDel.Visible = true;
+                        toolStripMenuItemRoot.Visible = false;
+                        cms1.Show(tlMenu, e.Location);
+                    }
                 }
-                else {
+                else
+                {
                     toolStripMenuItemAdd.Visible = false;
                     toolStripMenuItemEdt.Visible = false;
                     toolStripMenuItemDel.Visible = false;
                     toolStripMenuItemRoot.Visible = true;
-                    tlMenu.ContextMenuStrip = contextMenuStrip1;
+                    cms1.Show(tlMenu, e.Location);
                 }
             }
         }
@@ -166,12 +176,12 @@
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
         private void getPageList(int curPage)
         {
-            var pgq = new PageQueryModel(1, 999999, "a.defect_name");
+            var pgq = new PageQueryModel(1, 999999, "a.defect_code ", "asc");
             var json = JsonConvert.SerializeObject(pgq);
             try
             {
                 var strReturn =
-                    UtilityHelper.HttpPost("", _webServiceName+"GetListPage", json);
+                    UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json);
                 var dd = UtilityHelper.ReturnToTablePage(strReturn);
                 var dt = dd.rtnData.list;
                 tlMenu.DataSource = dt;
@@ -184,7 +194,6 @@
             {
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
-
         }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3