From 3a986da7b0e385cb5d8101d3bf1e8c5f4acc9553 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期二, 18 二月 2025 15:03:43 +0800
Subject: [PATCH] 版面

---
 DevApp/Gs.DevApp/UserControl/UcToolBarMenu.Designer.cs |    5 +-
 DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs          |   18 +-------
 DevApp/Gs.DevApp/UserControl/showLayOut.cs             |   55 ++++++++++++++++++++++-----
 DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs               |   21 ++++++++--
 DevApp/Gs.DevApp/UserControl/showLayOut.Designer.cs    |    2 
 5 files changed, 69 insertions(+), 32 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs b/DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs
index a33b101..e488fdd 100644
--- a/DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs
@@ -4,8 +4,10 @@
 using System.Windows.Forms;
 using DevExpress.XtraEditors;
 using DevExpress.XtraEditors.Controls;
+using DevExpress.XtraGrid.Columns;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
+using Gs.DevApp.UserControl;
 using Newtonsoft.Json;
 
 namespace Gs.DevApp.DevFrm.Sys
@@ -23,6 +25,7 @@
             toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
             toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
             toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
+            toolBarMenu1.btnLayoutClick += ToolBarMenu1_btnLayoutClick;
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "checkStatus", "", (value) =>
             {
                 Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
@@ -48,6 +51,8 @@
             txt_isSpilit.CheckedChanged += (s, e) => { DoPreviewCode(); };
         }
 
+      
+
         /// <summary>
         ///     鍒嗛〉浜嬩欢
         /// </summary>
@@ -57,7 +62,14 @@
         {
             getPageList(1);
         }
-
+        private void ToolBarMenu1_btnLayoutClick(object sender, EventArgs e)
+        {
+            string _formNamespace=this.GetType().FullName;
+            List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+            gvList.Add(gridView1);
+            Gs.DevApp.UserControl.showLayOut DevFrm = new showLayOut(_formNamespace, gvList);
+            DevFrm.ShowDialog();
+        }
         /// <summary>
         ///     鍙嶅鏍�
         /// </summary>
@@ -171,7 +183,7 @@
                 return;
             }
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
-           if (xtraTabControl1.SelectedTabPageIndex == 1)
+            if (xtraTabControl1.SelectedTabPageIndex == 1)
             {
                 getModel(lbGuid.Text.Trim());
             }
@@ -330,7 +342,7 @@
                         txxtItem3.Text = "<" + _ary[2];
                     if (_ary.Length > 3)
                         txxtItem4.Text = "<" + _ary[3];
-                    if (_ary.Length >4)
+                    if (_ary.Length > 4)
                         txxtItem5.Text = "<" + _ary[4];
                     txxtItem1.Enabled = txxtItem2.Enabled = txxtItem3.Enabled = txxtItem4.Enabled = panelControl1.Enabled = false;
                 }
@@ -396,7 +408,7 @@
             txt_docCode.Properties.ValueMember = "docCode"; // 瀹為檯鍊肩殑鍒�
             txt_docCode.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
         }
-    
+
         private void DoPreviewCode()
         {
             if (txt_docCode.Enabled == false
@@ -484,5 +496,6 @@
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
         }
+ 
     }
 }
\ No newline at end of file
diff --git a/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.Designer.cs b/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.Designer.cs
index 202cd40..2a95032 100644
--- a/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.Designer.cs
+++ b/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.Designer.cs
@@ -461,6 +461,7 @@
             this.btnLayout.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.globalcolorscheme_16x16;
             this.btnLayout.ImageOptions.LargeImage = global::Gs.DevApp.Properties.Resources.globalcolorscheme_32x32;
             this.btnLayout.Name = "btnLayout";
+            this.btnLayout.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
             // 
             // barDockControlTop
             // 
@@ -474,7 +475,7 @@
             // 
             this.barDockControlBottom.CausesValidation = false;
             this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.barDockControlBottom.Location = new System.Drawing.Point(0, 70);
+            this.barDockControlBottom.Location = new System.Drawing.Point(0, 66);
             this.barDockControlBottom.Manager = this.barManager1;
             this.barDockControlBottom.Size = new System.Drawing.Size(1543, 0);
             // 
@@ -503,7 +504,7 @@
             this.Controls.Add(this.barDockControlBottom);
             this.Controls.Add(this.barDockControlTop);
             this.Name = "UcToolBarMenu";
-            this.Size = new System.Drawing.Size(1543, 70);
+            this.Size = new System.Drawing.Size(1543, 66);
             ((System.ComponentModel.ISupportInitialize)(this.barManager1)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
diff --git a/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs b/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs
index d6c3dcf..773b32d 100644
--- a/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs
+++ b/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs
@@ -653,20 +653,7 @@
 
         private void BtnLayout_ItemClick(object sender, ItemClickEventArgs e)
         {
-            var _formNamespace = "";
-            Control parentControl = this;
-            while (parentControl.Parent != null)
-            {
-                if (parentControl.Parent is Form parentForm)
-                {
-                    var formType = parentForm.GetType();
-                    _formNamespace = formType.FullName;
-                    break;
-                }
-                parentControl = parentControl.Parent;
-            }
-            Gs.DevApp.UserControl.showLayOut DevFrm = new showLayOut(_formNamespace);
-            DevFrm.ShowDialog();
+            if (btnLayoutClick != null) btnLayoutClick(this, e);
         }
         private void _enabledBtn(List<string> lstBtn)
         {
@@ -793,7 +780,6 @@
                 //榛樿鍚敤鐨勬寜閽�
                 _enabledList.Add(btnLoad.Name);
                 _enabledList.Add(btnHelp.Name);
-                _enabledList.Add(btnLayout.Name);
                 _enabledBtn(_enabledList);
             }
             catch (Exception ex)
@@ -987,6 +973,8 @@
         public event EventHandler btnWgClick;
 
 
+        public event EventHandler btnLayoutClick;
+
         #endregion
 
         #region 鍏叡灞炴��
diff --git a/DevApp/Gs.DevApp/UserControl/showLayOut.Designer.cs b/DevApp/Gs.DevApp/UserControl/showLayOut.Designer.cs
index 20196f2..f854a8b 100644
--- a/DevApp/Gs.DevApp/UserControl/showLayOut.Designer.cs
+++ b/DevApp/Gs.DevApp/UserControl/showLayOut.Designer.cs
@@ -72,7 +72,7 @@
             this.btnSave.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.HotFlat;
             this.btnSave.Cursor = System.Windows.Forms.Cursors.Hand;
             this.btnSave.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.ImageOptions.Image")));
-            this.btnSave.Location = new System.Drawing.Point(25, 126);
+            this.btnSave.Location = new System.Drawing.Point(28, 126);
             this.btnSave.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.btnSave.Name = "btnSave";
             this.btnSave.Size = new System.Drawing.Size(98, 37);
diff --git a/DevApp/Gs.DevApp/UserControl/showLayOut.cs b/DevApp/Gs.DevApp/UserControl/showLayOut.cs
index 898e65b..c2924cd 100644
--- a/DevApp/Gs.DevApp/UserControl/showLayOut.cs
+++ b/DevApp/Gs.DevApp/UserControl/showLayOut.cs
@@ -1,14 +1,9 @@
-锘縰sing DevExpress.XtraEditors;
+锘縰sing DevExpress.XtraGrid.Columns;
+using DevExpress.XtraGrid.Views.Grid;
 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.UserControl
@@ -16,9 +11,11 @@
     public partial class showLayOut : DevExpress.XtraEditors.XtraForm
     {
         string formNamespace = "";
-        public showLayOut(string _formNamespace)
+        List<GridView> gridViews = new List<GridView>();
+        public showLayOut(string _formNamespace, List<GridView> _gridViews)
         {
-            formNamespace= _formNamespace;
+            formNamespace = _formNamespace;
+            gridViews = _gridViews;
             InitializeComponent();
             this.btnCancel.Click += BtnCancel_Click;
             this.btnSave.Click += BtnSave_Click;
@@ -26,15 +23,53 @@
 
         private void BtnSave_Click(object sender, EventArgs e)
         {
+            //  --col1,100,101,102,103,104,105,1,title&col2,100,101,102,103,104,105,1,title
             if (txt_layOut.SelectedIndex <= 0)
             {
                 MsgHelper.Warning("璇烽�夋嫨閫傜敤鑼冨洿锛�");
                 return;
             }
+            GridView gridView1 = gridViews[0];
+            System.Text.StringBuilder sb = new System.Text.StringBuilder();
+            foreach (GridColumn column in gridView1.Columns)
+            {
+                string controlId = column.Name;
+                int controlPosX = 0;
+                int controlPosY = 0;
+                int controlWidth = 0;
+                int controlMinWidth = column.MinWidth;
+                int controlMaxWidth = column.MaxWidth;
+                int controlHeight = 0;
+                int controlVisible = column.Visible == true ? 1 : 0;
+                string controlTitle = string.IsNullOrEmpty(column.Caption.Trim()) ? "鏈畾涔�" : column.Caption.Trim();
+                int controlIdx = column.VisibleIndex;
+                if (sb.Length > 0)
+                    sb.Append("&");
+                sb.Append(controlId);
+                sb.Append(",");
+                sb.Append(controlPosX);
+                sb.Append(",");
+                sb.Append(controlPosY);
+                sb.Append(",");
+                sb.Append(controlWidth);
+                sb.Append(",");
+                sb.Append(controlMinWidth);
+                sb.Append(",");
+                sb.Append(controlMaxWidth);
+                sb.Append(",");
+                sb.Append(controlHeight);
+                sb.Append(",");
+                sb.Append(controlVisible);
+                sb.Append(",");
+                sb.Append(controlTitle);
+                sb.Append(",");
+                sb.Append(controlIdx);
+            }
+            MessageBox.Show(sb.ToString());
             var _obj = new
             {
                 applyUserGuid = txt_layOut.SelectedIndex,
-                layoutLst= "col1,100,101,102,103,104,105,1,title&gridview1=col2,100,101,102,103,104,105,1,title",
+                layoutLst = sb.ToString(),
                 formPath = formNamespace
             };
             try

--
Gitblit v1.9.3