bug
lu
3 天以前 af4607584464f3be49bca542d09f761ca9eb6329
DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs
@@ -6,6 +6,7 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
@@ -16,18 +17,35 @@
        private List<dynamic> lstCheckedKeyID = new List<dynamic>();//选择集合
        string strTitle = "";
        string strWhere = "";
        public UcDictionarySelect(string _strTitle, string _strWhere)
        public UcDictionarySelect(string _strTitle, string _strWhere, string _strMsg = "")
        {
            InitializeComponent();
            lbMsg.Text = _strMsg;
            this.strTitle = _strTitle;
            this.strWhere = _strWhere;
            this.Text = _strTitle;
            tlMenu.MouseDown += (s, e) =>
            {
                TreeListHitInfo hitInfo = tlMenu.CalcHitInfo(new Point(e.X, e.Y));
                if (hitInfo.HitInfoType == HitInfoType.Cell)
                {
                    TreeListNode node = hitInfo.Node;
                    if (node != null)
                    {
                        if (node.HasChildren) // 只有当节点有子节点时才考虑展开或折叠
                        {
                            if (node.Expanded)
                                node.Collapse();
                            else
                                node.Expand();
                        }
                    }
                }
            };
            getTree();
            tlMenu.CustomDrawNodeCheckBox += TreeList1_CustomDrawNodeCheckBox;
            //  tlMenu.OptionsBehavior.Editable = true;
            tlMenu.OptionsSelection.EnableAppearanceFocusedCell = false;
            //  tlMenu.OptionsSelection.MultiSelect = true;
            // tlMenu.OptionsSelection.MultiSelectMode = TreeListMultiSelectMode.CellSelect;
            btnIn.Click += (s, e) =>
            {
                findOrigin(tlMenu);
@@ -39,7 +57,8 @@
                        dicCode = key.dicCode,
                        dicTxt = key.dicTxt
                    });
                };
                }
                ;
                UpdateParent?.Invoke(this, new UpdateParentEventArgs { DynamicList = list });
                Close();
            };
@@ -83,7 +102,7 @@
        /// </summary>
        private void getTree()
        {
            string _where = " and 1=1 and " + this.strWhere;
            string _where = " and 1=1 and a.type1=1 and " + this.strWhere;
            var pgq = new PageQueryModel(1, 999999, "a.defect_name", "asc", "", _where);
            var json = JsonConvert.SerializeObject(pgq);
            try
@@ -97,11 +116,11 @@
                tlMenu.ParentFieldName = "pid";
                tlMenu.Tag = "defectName";
                tlMenu.EndUpdate();
                this.tlMenu.CollapseAll();
                //  tlMenu.OptionsBehavior.Editable = true;
                tlMenu.OptionsBehavior.AllowRecursiveNodeChecking = false;
                tlMenu.BestFitColumns();
                tlMenu.ExpandAll();
                tlMenu.CollapseAll();
            }
            catch (Exception ex)
            {