cdk
2025-08-18 1f99c554ffc67f599fbce5981a3da584945b3b16
DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs
@@ -5,6 +5,7 @@
using DevExpress.XtraLayout;
using Gs.DevApp.DevFrm.Rpt;
using Gs.DevApp.DevFrm.Sys;
using Gs.DevApp.DevFrm.Work;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
@@ -59,12 +60,42 @@
            btnAll.ItemClick += BtnAll_ItemClick;
            btnGongZi.ItemClick += BtnGongZi_ItemClick;
            btnLianBan.ItemClick += BtnLianBan_ItemClick;
            btnGx.ItemClick += BtnGx_ItemClick;
            btnWeight.ItemClick += BtnWeight_ItemClick;
            btnBaoGao.ItemClick += BtnBaoGao_ItemClick;
            var lst = new List<string>();
            foreach (BarItem item in barManager1.Items)
                if (item is BarLargeButtonItem largeButtonItem)
                    if (!string.IsNullOrEmpty(item.Caption) && item.Caption != "保存" && item.Caption != "刷新" && item.Caption != "帮助" && item.Caption != "保存版面" && item.Caption != "取消")
                        lst.Add(item.Caption);
            actions = lst;
        }
        /// <summary>
        /// 启动称重
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <exception cref="NotImplementedException"></exception>
        private void BtnWeight_ItemClick(object sender, ItemClickEventArgs e)
        {
            bool isOpen = false;
            foreach (Form form in Application.OpenForms)
            {
                if (form is Frm_Work09)
                {
                    isOpen = true;
                    form.Activate(); // 激活已存在的窗体
                    break;
                }
            }
            if (!isOpen)
            {
                var form = new Frm_Work09(QcSeason.iqc称重.ToString());
                form.Show();
            }
        }
        /// <summary>
@@ -380,8 +411,16 @@
            if (btnGongZiClick != null)
                btnGongZiClick(this, e);
        }
        private void BtnGx_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (btnGxClick != null)
                btnGxClick(this, e);
        }
        private void BtnBaoGao_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (btnBaoGaoClick != null)
                btnBaoGaoClick(this, e);
        }
        /// <summary>
        /// 取消时,还原按钮可用性
        /// </summary>
@@ -421,6 +460,9 @@
                lst.Add(btnShouHouFchk.Name);
                lst.Add(btnGongZi.Name);
                lst.Add(btnLianBan.Name);
               // lst.Add(btnEsc.Name);
                lst.Add(btnGx.Name);
                lst.Add(btnWeight.Name);
                _enabledBtn(lst);
                this.currentAction = "esc";
                if (btnEscClick != null) btnEscClick(this, e);
@@ -471,6 +513,9 @@
                    lst.Add(btnOut.Name);
                    lst.Add(btnGongZi.Name);
                    lst.Add(btnLianBan.Name);
                   // lst.Add(btnEsc.Name);
                    lst.Add(btnGx.Name);
                    lst.Add(btnWeight.Name);
                    _enabledBtn(lst);
                }
            }
@@ -495,8 +540,8 @@
            lst.Add(btnHelp.Name);
            lst.Add(btnLayout.Name);
            lst.Add(btnFont.Name);
            lst.Add(btnFont.Name);
            lst.Add(btnLog.Name);
            lst.Add(btnWeight.Name);
            _enabledBtn(lst);
            this.currentAction = "edit";
            if (btnEdtClick != null) btnEdtClick(this, e);
@@ -524,6 +569,7 @@
            lst.Add(btnHelp.Name);
            lst.Add(btnLayout.Name);
            lst.Add(btnFont.Name);
            lst.Add(btnWeight.Name);
            _enabledBtn(lst);
            this.currentAction = "add";
            if (btnAddClick != null) btnAddClick(this, e);
@@ -996,6 +1042,15 @@
        /// </summary>
        public event EventHandler btnGongZiClick;
        /// <summary>
        /// 工序变更
        /// </summary>
        public event EventHandler btnGxClick;
        /// <summary>
        /// 生成报告
        /// </summary>
        public event EventHandler btnBaoGaoClick;
        #endregion
        #region 公共属性