From c0aa9538d0c080a0ede4fe80b61bb3901db82621 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期四, 13 二月 2025 09:45:35 +0800 Subject: [PATCH] 细节修改 --- DevApp/Gs.DevApp/DevFrm/Sys/Frm_MesSysPageview.cs | 113 +++++++++++++++++++++++++++++++------------------------- 1 files changed, 63 insertions(+), 50 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Sys/Frm_MesSysPageview.cs b/DevApp/Gs.DevApp/DevFrm/Sys/Frm_MesSysPageview.cs index e1f2047..b74ba3d 100644 --- a/DevApp/Gs.DevApp/DevFrm/Sys/Frm_MesSysPageview.cs +++ b/DevApp/Gs.DevApp/DevFrm/Sys/Frm_MesSysPageview.cs @@ -1,11 +1,9 @@ -using DevExpress.XtraBars.Docking2010.Views.WindowsUI; using Gs.DevApp.Entity; using Gs.DevApp.ToolBox; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Data; -using System.Drawing; using System.Windows.Forms; namespace Gs.DevApp.DevFrm @@ -23,36 +21,22 @@ this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; - gcMain.MouseDoubleClick += GcMain_MouseDoubleClick; - getPageList(1, UtilityHelper.GetPageSize()); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (value) => + { + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); + }); + Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) => + { + getModel(value); + }, (value) => + { + getPageList(this.pageBar1.CurrentPage); + }); + getPageList(1); pageBar1.PagerEvent += PageBar1_PagerEvent; - gridView1.CustomDrawRowIndicator += (s, e) => - { - if (e.Info.IsRowIndicator && e.RowHandle >= 0) - { - e.Info.DisplayText = (e.RowHandle + 1).ToString(); - } - }; - gridView1.CustomDrawEmptyForeground += (s, e) => - { - string str = "鏆傛湭鏌ユ壘鍒板尮閰嶇殑鏁版嵁!"; - Font f = new Font("寰蒋闆呴粦", 16); - Rectangle r = new Rectangle(gridView1.GridControl.Width / 2 - 100, e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5); - e.Graphics.DrawString(str, f, Brushes.Gray, r); - }; } - /// <summary> - /// 鍙屽嚮浜嬩欢 - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e) - { - string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid"); - if (!string.IsNullOrEmpty(rowGuid)) - getModel(rowGuid, false, 999); - } + /// <summary> /// 鍒嗛〉浜嬩欢 /// </summary> @@ -60,7 +44,7 @@ /// <param name="pageSize"></param> private void PageBar1_PagerEvent(int curPage, int pageSize) { - getPageList(curPage, pageSize); + getPageList(curPage); } /// <summary> /// 鍙栨秷浜嬩欢 @@ -69,7 +53,7 @@ /// <param name="e"></param> private void ToolBarMenu1_btnEscClick(object sender, EventArgs e) { - UtilityHelper.JumpToTab(xtraTabControl1, 0); + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1); } /// <summary> @@ -97,8 +81,11 @@ ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) { - UtilityHelper.JumpToTab(xtraTabControl1, 0); - getPageList(1, UtilityHelper.GetPageSize()); + if (xtraTabControl1.SelectedTabPageIndex == 0) + { } + else + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2); + getPageList(this.pageBar1.CurrentPage); } ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } @@ -116,9 +103,19 @@ private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e) { if (xtraTabControl1.SelectedTabPageIndex == 1) - getModel(lbGuid.Text.Trim(), false, 999); + getModel(lbGuid.Text.Trim()); else - getPageList(1, UtilityHelper.GetPageSize()); + { + //_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> /// 淇敼浜嬩欢 @@ -134,7 +131,8 @@ ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - getModel(rowGuid, true, 1); + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); + UtilityHelper.ChangeEnableByControl(panel1.Controls, true); } /// <summary> /// 鏂板浜嬩欢 @@ -143,10 +141,9 @@ /// <param name="e"></param> private void ToolBarMenu1_btnAddClick(object sender, EventArgs e) { - UtilityHelper.JumpToTab(xtraTabControl1, 1); lbGuid.Text = ""; - UtilityHelper.CleanValueByControl(this.panel1.Controls, true); - + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4); + UtilityHelper.CleanValueByControl(panel1.Controls, true); } /// <summary> /// 淇濆瓨浜嬩欢 @@ -180,7 +177,6 @@ guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓 PageView = txt_pageView.Text.Trim(), Path = txt_path.Text.Trim(), - Icoimg=txt_icoimg.Text.Trim(), PageGroup=txt_pageGroup.Text.Trim(), PageIdx=txt_pageIdx.Text.Trim(), PageStatus=txt_pageStatus.Checked @@ -208,14 +204,10 @@ /// </summary> /// <param name="curPage">绗嚑椤�</param> /// <param name="pageSize">姣忛〉鍑犳潯</param> - private void getPageList(int curPage, int pageSize) + private void getPageList(int curPage) { - System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); - foreach (FilterEntity itm in _filterList) - { - _sbSqlWhere.Append(" and " + itm.fileId + itm.fileOper + "'" + itm.fileValue + "'"); - } - PageQueryModel pgq = new PageQueryModel(curPage, pageSize, "PAGE_IDX", "asc", "", _sbSqlWhere.ToString()); + var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); + PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "a.PAGE_GROUP", "desc", "", _sbSqlWhere.ToString()); string json = JsonConvert.SerializeObject(pgq); try { @@ -231,7 +223,7 @@ pageBar1.TotalPages = dddd; pageBar1.RecordCount = dd.rtnData.total;//璁板綍鎬绘暟 pageBar1.CurrentPage = curPage;//褰撳墠椤� - pageBar1.setTxt(); + gridView1.BestFitColumns(); } else { @@ -249,14 +241,16 @@ /// <param name="strGuid">涓婚敭</param> /// <param name="isEdit">鏄惁鍙紪杈�</param> /// <param name="tabIdx">閫夐」鍗″簭鍙�</param> - private void getModel(string strGuid, bool isEdit, int tabIdx) + private void getModel(string strGuid) { + bool isEdit = false; + if (toolBarMenu1.currentAction == "add") return; + if (toolBarMenu1.currentAction == "edit") isEdit = true; if (string.IsNullOrEmpty(strGuid)) { ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - UtilityHelper.JumpToTab(xtraTabControl1, tabIdx); var _obj = new { guid = strGuid,//涓诲缓 @@ -279,5 +273,24 @@ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } } + + private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) + { + var rowhandle = gridView1.FocusedRowHandle; + if (rowhandle < 0) + return; + if (e.Button.Index == 0) + { + var dr = gridView1.GetDataRow(rowhandle); + var mxGuid = dr["guid"].ToString(); + Gs.DevApp.UserControl.ShowUp frm = new Gs.DevApp.UserControl.ShowUp(mxGuid); + frm.UpdateParent += (ss, ee) => + { + Gs.DevApp.ToolBox.MsgHelper.ShowInformation("涓婁紶鎴愬姛锛�"); + getPageList(this.pageBar1.CurrentPage); + }; + frm.ShowDialog(); + } + } } } \ No newline at end of file -- Gitblit v1.9.3