lg
2025-12-01 fdd03a15cf958c62cedea4807da425c6ce3ccee6
DevApp/Gs.DevApp/DevFrm/Rk/SelectItemTbl.cs
@@ -12,9 +12,13 @@
    {
        private readonly string _webServiceName = "MesItemTblManager/";
        private string daaGuid = "";
        //勾选次序
        Dictionary<string, int> ageDict = new Dictionary<string, int>();
        public SelectItemTbl(string _daaGuid)
        {
            InitializeComponent();
            #region  勾选
            this.gridView1.CustomDrawColumnHeader += (s, e) => { Gs.DevApp.ToolBox.UtilityHelper.CustomDrawColumnHeader(s, e); };
            this.gridView1.MouseUp += (s, e) => { Gs.DevApp.ToolBox.UtilityHelper.CustomMouseUp(s, e, gcMain, gridView1); };
            this.colChkInt.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
@@ -23,6 +27,23 @@
            this.colChkInt.OptionsFilter.AllowInHeaderSearch = DevExpress.Utils.DefaultBoolean.False;
            this.colChkInt.Fixed = DevExpress.XtraGrid.Columns.FixedStyle.Left;
            this.colChkInt.VisibleIndex = 0;
            #endregion
            #region 勾选次序2025-11-24
            this.gridView1.CellValueChanged += (s, e) =>
            {
                var row = gridView1.GetDataRow(e.RowHandle);
                var mxGuid = row["guid"].ToString();
                bool isChecked = (bool)e.Value;
                int dicCount = ageDict.Count + 1;
                if (isChecked)
                {
                    ageDict.Add(mxGuid, dicCount); // 添加新键值对
                }
            };
            #endregion
            this.daaGuid = _daaGuid;
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, null, "", null, null, false);
            getPageList(1);
@@ -30,21 +51,31 @@
            {
                gridView1.PostEditor();
                gridView1.UpdateCurrentRow();
                var list = new List<string>();
                var list = new List<dynamic>();
                DataTable dt = this.gcMain.DataSource as DataTable;
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        string checkBox = dr["chkInt"].ToString();
                        string _guid = dr["dabGuid"].ToString();
                        string _guid = dr["guid"].ToString();
                        int _idx = 0;
                        // 安全获取(推荐)
                        if (ageDict.TryGetValue(_guid, out _idx))
                        {
                        }
                        else
                            _idx = 0;
                        if (Gs.DevApp.ToolBox.UtilityHelper.ToCheck(checkBox))
                        {
                            list.Add(_guid);
                            list.Add(new
                            {
                                guid = _guid,
                                index = _idx
                            });
                        }
                    }
                }
                UpdateParent?.Invoke(this, new UpdateParentEventArgs { StringList = list }); Close();
                UpdateParent?.Invoke(this, new UpdateParentEventArgs { DynamicList = list }); Close();
            };
        }