From f14d1fc28a8012035ee251fba71a0d048e9efd0d Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 16 一月 2025 09:10:48 +0800
Subject: [PATCH] 工具条切换状态

---
 DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesUnit.cs |   60 +++++++++++++++++++++++++++++++-----------------------------
 1 files changed, 31 insertions(+), 29 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesUnit.cs b/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesUnit.cs
index 660a506..604a0e5 100644
--- a/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesUnit.cs
+++ b/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesUnit.cs
@@ -9,6 +9,7 @@
 using Gs.DevApp.UserControl;
 using Newtonsoft.Json;
 
+
 namespace Gs.DevApp.DevFrm
 {
     public partial class Frm_MesUnit : XtraForm
@@ -20,28 +21,26 @@
             InitializeComponent();
             toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
             toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
-            gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
-            Gs.DevApp.ToolBox.UtilityHelper.SetGridSear(gridView1);
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (value) =>
+            {
+                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
+            });
+            Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
+            {
+                getModel(value);
+            }, (value) =>
+            {
+                getPageList(this.pageBar1.CurrentPage);
+            });
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
         }
-        private   void GridView1_ColumnFilterChanged(object sender, EventArgs e)
+
+        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
-            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
-           Task.Delay(100);
+            Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
+            Task.Delay(100);
             getPageList(1);
-        }
-        /// <summary>
-        ///     鍙屽嚮浜嬩欢
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
-        {
-            var rowGuid =
-                UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid");
-            if (!string.IsNullOrEmpty(rowGuid))
-                getModel(rowGuid, false, 999);
         }
 
         /// <summary>
@@ -88,17 +87,18 @@
         private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
         {
             if (xtraTabControl1.SelectedTabPageIndex == 1)
-                getModel(lbGuid.Text.Trim(), false, 999);
+                getModel(lbGuid.Text.Trim());
             else
             {
-                _filterList.Clear();
-                if (gridView1.ActiveFilter.Count > 0)
-                {
-                    gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
-                    gridView1.ActiveFilter.Clear();
-                    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
-                }
-                getPageList(1);
+                //_filterList.Clear();
+                //if (gridView1.ActiveFilter.Count > 0)
+                //{
+                //    gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
+                //    gridView1.ActiveFilter.Clear();
+                //    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+                //}
+                //getPageList(1);
+                getPageList(this.pageBar1.CurrentPage);
             }
         }
 
@@ -106,7 +106,7 @@
         /// </summary>
         /// <param name="curPage">绗嚑椤�</param>
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
-        private   void getPageList(int curPage)
+        private void getPageList(int curPage)
         {
             var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
             var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "fname", "asc", "",
@@ -150,14 +150,16 @@
         /// <param name="strGuid">涓婚敭</param>
         /// <param name="isEdit">鏄惁鍙紪杈�</param>
         /// <param name="tabIdx">閫夐」鍗″簭鍙�</param>
-        private void getModel(string strGuid, bool isEdit, int tabIdx)
+        private void getModel(string strGuid)
         {
+            bool isEdit = false;
+            if (toolBarMenu1.currentAction == "add") return;
+            if (toolBarMenu1.currentAction == "edit") isEdit = true;
             if (string.IsNullOrEmpty(strGuid))
             {
                 MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
-            UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
             var _obj = new
             {
                 guid = strGuid //涓诲缓

--
Gitblit v1.9.3