From 92c92d9bfb4431a8e2f4b8ac494547d50ea3a7f6 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期二, 18 二月 2025 17:25:06 +0800 Subject: [PATCH] 板面 --- DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl_RK.cs | 97 +++++++++++++++++++----------------------------- 1 files changed, 38 insertions(+), 59 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl_RK.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl_RK.cs index 50355b6..e740409 100644 --- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl_RK.cs +++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl_RK.cs @@ -20,11 +20,12 @@ InitializeComponent(); this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; - toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; - Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); - Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (value) => + toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick; + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(this.GetType().FullName, gvMx1); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(this.GetType().FullName,gvMx2); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(this.GetType().FullName,gridView1,picCheckBox, this, "checkStatus", "", (value) => { Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); }); @@ -40,9 +41,22 @@ } private void GridView1_ColumnFilterChanged(object sender, EventArgs e) { - _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns); + Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1); Task.Delay(100); getPageList(1); + } + /// <summary> + /// 鏃ュ織 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void ToolBarMenu1_btnLogClick(object sender, EventArgs e) + { + toolBarMenu1.guidKey = ""; + string rowGuid, rowName; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, + lbGuid, txt_billNo, gridView1); + toolBarMenu1.guidKey = rowGuid; } /// <summary> /// 鍒嗛〉浜嬩欢 @@ -77,48 +91,7 @@ _filterList = e.FilterList; getPageList(1); } - /// <summary> - /// 鍒犻櫎浜嬩欢 - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e) - { - string rowGuid, rowName; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, - lbGuid, txt_billNo, gridView1, "roleName"); - if (string.IsNullOrEmpty(rowGuid)) - { - MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); - return; - } - - if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵\n璇ユ搷浣滃皢浼氭竻绌虹浉搴旂殑鐢ㄦ埛鏉冮檺")) - return; - var lst = new List<string>(); - lst.Add(rowGuid); - var _obj = lst; - try - { - var strJson = UtilityHelper.HttpPost("", "Role/DeleteModel", - JsonConvert.SerializeObject(_obj)); - var _rtn = UtilityHelper.ReturnToDynamic(strJson); - if (_rtn.rtnCode > 0) - { - if (xtraTabControl1.SelectedTabPageIndex == 0) - getPageList(this.pageBar1.CurrentPage); - else - Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2); - } - - MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); - } - catch (Exception ex) - { - MsgHelper.Warning("鎻愮ず锛�" + ex.Message); - } - } - + /// <summary> /// 瀹℃牳浜嬩欢 /// </summary> @@ -150,14 +123,15 @@ getModel(lbGuid.Text.Trim()); else { - _filterList.Clear(); - if (gridView1.ActiveFilter.Count > 0) - { - gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; - gridView1.ActiveFilter.Clear(); - gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; - } - getPageList(1); + //_filterList.Clear(); + //if (gridView1.ActiveFilter.Count > 0) + //{ + // gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; + // gridView1.ActiveFilter.Clear(); + // gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; + //} + //getPageList(1); + getPageList(this.pageBar1.CurrentPage); } } /// <summary> @@ -184,6 +158,7 @@ { gcMain.DataSource = dt; gcMain.ForceInitialize(); + gridView1.BestFitColumns(); } else UtilityHelper.SetDefaultTable(gcMain, gridView1); @@ -226,8 +201,8 @@ dynamic dy = _rtn.rtnData; lbGuid.Text = strGuid; List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); - gvList.Add(gvMx1); gvList.Add(gvMx2); + gvList.Add(gvMx1); UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList); JObject _job = JObject.Parse(strJson); JArray array = new JArray(); @@ -241,6 +216,7 @@ gcMx1.BindingContext = new BindingContext(); gcMx1.DataSource = dt; gcMx1.ForceInitialize(); + gvMx1.BestFitColumns(); } else { @@ -257,6 +233,7 @@ gcMx2.BindingContext = new BindingContext(); gcMx2.DataSource = dt2; gcMx2.ForceInitialize(); + gvMx2.BestFitColumns(); } else { @@ -270,7 +247,6 @@ { ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } - } /// <summary> @@ -312,12 +288,15 @@ JsonConvert.SerializeObject(_obj)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); MsgHelper.Warning(_rtn.rtnData.outMsg.ToString()); - if (_rtn.rtnCode > 0) + if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0) { if (xtraTabControl1.SelectedTabPageIndex == 1) + { getModel(lbGuid.Text.Trim()); - else - getPageList(this.pageBar1.CurrentPage); + } + int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid); + gridView1.FocusedRowHandle = rowHandle; + UtilityHelper.SetCheckIco(gridView1, "checkStatus", "checkUser", "checkUser", picCheckBox, this, _inFieldValue.ToString()); } } catch (Exception ex) -- Gitblit v1.9.3