From f02a4e20cb6effb2c7f5018b5b2e92b39a7f56f5 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期二, 18 二月 2025 13:36:42 +0800
Subject: [PATCH] 保存板面

---
 DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs |   98 ++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 84 insertions(+), 14 deletions(-)

diff --git a/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs b/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs
index b971c8b..d6c3dcf 100644
--- a/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs
+++ b/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs
@@ -49,6 +49,7 @@
             btnZhongTai.ItemClick += BtnbZhongTai_ItemClick;
             btnWg.ItemClick += BtnWg_ItemClick;
             btnHelp.ItemClick += BtnHelp_ItemClick;
+            btnLayout.ItemClick += BtnLayout_ItemClick;
             var lst = new List<string>();
             foreach (BarItem item in barManager1.Items)
                 if (item is BarLargeButtonItem largeButtonItem)
@@ -65,6 +66,42 @@
         {
             base.OnCreateControl();
             if (Parent != null) getNamespace();
+        }
+
+        private bool _isCk(int _type)
+        {
+            Form parentForm = this.FindForm();
+            if (parentForm != null)
+            {
+                PictureBox specificControl = (PictureBox)parentForm.Controls.Find("picCheckBox", true).FirstOrDefault();
+                if (specificControl== null)
+                    return false;
+                if (specificControl.Tag == null)
+                    return false;
+                if (_type == 1)
+                {
+                    if (specificControl != null)
+                    {
+                        if (specificControl.Tag.ToString() == "宸插鏍�")
+                        {
+                            Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇ュ崟鎹凡琚鏍革紝鏃犳硶杩涜鎿嶄綔锛�");
+                            return true;
+                        }
+                    }
+                }
+                if (_type == 0)
+                {
+                    if (specificControl != null)
+                    {
+                        if (specificControl.Tag.ToString() == "鏈鏍�")
+                        {
+                            Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇ュ崟鎹湭琚鏍革紝鏃犳硶杩涜鎿嶄綔锛�");
+                            return true;
+                        }
+                    }
+                }
+            }
+            return false;
         }
 
         private void BtnBoHui_ItemClick(object sender, ItemClickEventArgs e)
@@ -173,6 +210,8 @@
 
         private void BtnFchk_ItemClick(object sender, ItemClickEventArgs e)
         {
+            bool bl = _isCk(0);
+            if (bl) return;
             if (btnFChkClick != null)
             {
                 btnFChkClick(this, e);
@@ -182,6 +221,8 @@
 
         private void BtnChk_ItemClick(object sender, ItemClickEventArgs e)
         {
+            bool bl = _isCk(1);
+            if (bl) return;
             if (btnChkClick != null)
             {
                 btnChkClick(this, e);
@@ -226,6 +267,8 @@
 
         private void BtnFjianYan_ItemClick(object sender, ItemClickEventArgs e)
         {
+            bool bl = _isCk(0);
+            if (bl) return;
             if (btnFjianYanClick != null)
                 btnFjianYanClick(this, e);
             else
@@ -249,6 +292,8 @@
 
         private void BtnJianYan_ItemClick(object sender, ItemClickEventArgs e)
         {
+            bool bl = _isCk(1);
+            if (bl) return;
             if (btnJianYanClick != null)
                 btnJianYanClick(this, e);
             else
@@ -438,7 +483,12 @@
                 lst.Add(btnLog.Name);
                 lst.Add(btnPiZhun.Name);
                 lst.Add(btnHelp.Name);
+                lst.Add(btnLayout.Name);
                 lst.Add(btnBoHui.Name);
+                lst.Add(btnTzbl.Name);
+                lst.Add(btnKg.Name);
+                lst.Add(btnWg.Name);
+                lst.Add(btnZhongTai.Name);
                 _enabledBtn(lst);
                 this.currentAction = "esc";
                 if (btnEscClick != null) btnEscClick(this, e);
@@ -474,6 +524,10 @@
                     lst.Add(btnKg.Name);
                     lst.Add(btnWg.Name);
                     lst.Add(btnZhongTai.Name);
+                    lst.Add(btnHelp.Name);
+                    lst.Add(btnLayout.Name);
+                    lst.Add(btnLoad.Name);
+                    lst.Add(btnTzbl.Name);
                     _enabledBtn(lst);
                 }
             }
@@ -490,27 +544,26 @@
 
         private void BtnEdit_ItemClick(object sender, ItemClickEventArgs e)
         {
+            bool bl = _isCk(1);
+            if (bl) return;
             var lst = new List<string>();
             lst.Add(btnSave.Name);
             lst.Add(btnEsc.Name);
             lst.Add(btnHelp.Name);
+            lst.Add(btnLayout.Name);
             _enabledBtn(lst);
             this.currentAction = "edit";
             if (btnEdtClick != null) btnEdtClick(this, e);
-            Form parentForm = this.FindForm();
-            if (parentForm != null)
-            {
-                Control specificControl = parentForm.Controls.Find("picCheckBox", true).FirstOrDefault();
-                if (specificControl != null)
-                {
-                    specificControl.Visible = false;
-                }
-            }
         }
 
         private void BtnDel_ItemClick(object sender, ItemClickEventArgs e)
         {
+            bool bl = _isCk(1);
+            if (bl) return;
             if (btnDelClick != null) btnDelClick(this, e);
+
+            // btnEsc.Enabled = false;
+            this.currentAction = "";
         }
 
         /// <summary>
@@ -523,16 +576,18 @@
             lst.Add(btnSave.Name);
             lst.Add(btnEsc.Name);
             lst.Add(btnHelp.Name);
+            lst.Add(btnLayout.Name);
             _enabledBtn(lst);
             this.currentAction = "add";
             if (btnAddClick != null) btnAddClick(this, e);
             Form parentForm = this.FindForm();
             if (parentForm != null)
             {
-                Control specificControl = parentForm.Controls.Find("picCheckBox", true).FirstOrDefault();
+                PictureBox specificControl = (PictureBox)parentForm.Controls.Find("picCheckBox", true).FirstOrDefault();
                 if (specificControl != null)
                 {
-                    specificControl.Visible = false;
+                    specificControl.Image = global::Gs.DevApp.Properties.Resources.ico_noCheck;
+                    specificControl.Tag = "鏈鏍�";
                 }
             }
         }
@@ -594,10 +649,25 @@
                 return;
             }
             Gs.DevApp.ToolBox.MsgHelper.ShowInformation(_rtnJson.rtnMsg);
-
         }
 
-
+        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();
+        }
         private void _enabledBtn(List<string> lstBtn)
         {
             foreach (BarItem item in barManager1.Items)
@@ -631,7 +701,6 @@
             var _obj = new
             {
                 userGuid = LoginInfoModel.CurrentUser.LoginUserGuid,
-                orgGuid = LoginInfoModel.CurrentUser.LoginOrgGuid,
                 formNamespace = _formNamespace
             };
             var strReturn = "";
@@ -724,6 +793,7 @@
                 //榛樿鍚敤鐨勬寜閽�
                 _enabledList.Add(btnLoad.Name);
                 _enabledList.Add(btnHelp.Name);
+                _enabledList.Add(btnLayout.Name);
                 _enabledBtn(_enabledList);
             }
             catch (Exception ex)

--
Gitblit v1.9.3