bug
lu
10 天以前 b5834262308402ea928355987b34d1a9a0011374
DevApp/Gs.DevApp/DevFrm/QC/DefectCode.cs
@@ -1,17 +1,12 @@
using DevExpress.XtraEditors;
using DevExpress.XtraTreeList.Nodes;
using DevExpress.XtraTreeList.Nodes;
using DevExpress.XtraTreeList;
using Gs.DevApp.Entity;
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.DevFrm.QC
@@ -25,10 +20,9 @@
        public DefectCode(string _strType)
        {
            InitializeComponent();
            strType = _strType;
            toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
            this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
            strType = _strType;
            tlMenu.IndicatorWidth = 50;
            tlMenu.CustomDrawNodeIndicator += (s, ee) =>
            {
@@ -52,6 +46,13 @@
                frm.UpdateParent += (s2, ee2) =>
                {
                    getPageList(1);
                    // 例如,通过ID查找节点:
                    TreeListNode node = tlMenu.FindNodeByKeyID(strUpGuid);
                    if (node != null)
                    {
                        node.Expanded = true; // 展开节点
                        tlMenu.MakeNodeVisible(node); // 确保可见
                    }
                };
                frm.ShowDialog();
            };
@@ -93,11 +94,11 @@
                            tlMenu.DeleteNode(tlMenu.FocusedNode);
                        }
                        else
                            ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                            ToolBox.MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
                    }
                    catch (Exception ex)
                    {
                        ToolBox.MsgHelper.Warning("提示:" + ex.Message);
                        ToolBox.MsgHelper.ShowError("提示:" + ex.Message);
                    }
                }
            };
@@ -114,11 +115,36 @@
                frm.UpdateParent += (s2, ee2) =>
                {
                    getPageList(1);
                    // 例如,通过ID查找节点:
                    TreeListNode node = tlMenu.FindNodeByKeyID(strGuid);
                    if (node !=null)
                    {
                        node.Expanded = true; // 展开节点
                        tlMenu.MakeNodeVisible(node); // 确保可见
                    }
                };
                frm.ShowDialog();
            };
        }
        /// <summary>
        /// 查询事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e)
        {
            Gs.DevApp.ToolBox.MsgHelper.ShowInformation("该窗体不支持查询,若想更新页面,请点击 刷新");
        }
        /// <summary>
        ///     刷新事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
        {
            _filterList.Clear();
            getPageList(1);
        }
        /// <summary>
        /// 右键弹出菜单,如果是行,增加子项目,否则增加主项
        /// </summary>
@@ -151,32 +177,10 @@
                    toolStripMenuItemAdd.Visible = false;
                    toolStripMenuItemEdt.Visible = false;
                    toolStripMenuItemDel.Visible = false;
                    toolStripMenuItemRoot.Visible = true;
                    toolStripMenuItemRoot.Visible = false;//2025/07//11改为不增加主项目了
                    cms1.Show(tlMenu, e.Location);
                }
            }
        }
        /// <summary>
        /// 查询事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e)
        {
            Gs.DevApp.ToolBox.MsgHelper.ShowInformation("该窗体不支持查询,若想更新页面,请点击 刷新");
        }
        /// <summary>
        /// 刷新事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
        {
            _filterList.Clear();
            getPageList(1);
        }
        /// <summary>
        /// 
@@ -199,12 +203,16 @@
                tlMenu.KeyFieldName = "guid";
                tlMenu.ParentFieldName = "pid";
                tlMenu.EndUpdate();
                this.tlMenu.CollapseAll();
               this.tlMenu.CollapseAll();
                // this.tlMenu.ExpandAll();
                // this.tlMenu.ExpandToLevel(0);
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
    }
}