From f23d33d0cf77a73d449cd7c38effda9e50c8fda4 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 06 三月 2025 08:13:37 +0800
Subject: [PATCH] 版面

---
 DevApp/Gs.DevApp/DevFrm/Sys/SysHelp.cs |  106 +++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 86 insertions(+), 20 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Sys/SysHelp.cs b/DevApp/Gs.DevApp/DevFrm/Sys/SysHelp.cs
index 45c2b87..1781981 100644
--- a/DevApp/Gs.DevApp/DevFrm/Sys/SysHelp.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Sys/SysHelp.cs
@@ -1,10 +1,12 @@
 锘縰sing Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
+using Gs.DevApp.UserControl;
 using Newtonsoft.Json;
 using System;
 using System.Collections.Generic;
+using System.Configuration;
 using System.Data;
-using System.Drawing;
+using System.Net;
 using System.Windows.Forms;
 
 namespace Gs.DevApp.DevFrm.Sys
@@ -18,23 +20,13 @@
             InitializeComponent();
             this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
+            List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+            gvList.Add(gridView1);
+            Gs.DevApp.ToolBox.UtilityHelper.getGridViewConfig(this.GetType().FullName, gvList);
             getPageList(1, UtilityHelper.GetPageSize());
-            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);
-            };
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1);
         }
-       
+
         /// <summary>
         /// 鏌ヨ浜嬩欢
         /// </summary>
@@ -65,9 +57,9 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
         {
-           getPageList(1, UtilityHelper.GetPageSize());
+            getPageList(1, UtilityHelper.GetPageSize());
         }
-       
+
         /// <summary>
         /// 
         /// </summary>
@@ -76,12 +68,11 @@
         private void getPageList(int curPage, int pageSize)
         {
             System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
-            _sbSqlWhere.Append(" and a.CATEGORY=1 and a.UP_GUID is not null");
             PageQueryModel pgq = new PageQueryModel(curPage, pageSize, "a.idx", "asc", "", _sbSqlWhere.ToString());
             string json = JsonConvert.SerializeObject(pgq);
             try
             {
-                string strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json);
+                string strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPageHelp", json);
                 ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn);
                 if (dd.rtnCode > 0)
                 {
@@ -103,5 +94,80 @@
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
         }
+
+        private void repositoryItemButtonEdit3_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(1, UtilityHelper.GetPageSize());
+                };
+                frm.ShowDialog();
+            }
+        }
+
+        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
+        {
+            var rowhandle = gridView1.FocusedRowHandle;
+            if (rowhandle < 0)
+                return;
+            if (e.Button.Index == 0)
+            {
+                try
+                {
+                    var dr = gridView1.GetDataRow(rowhandle);
+                    var urlPath = dr["urlPath"].ToString();
+                    Gs.DevApp.UserControl.ShowFile frm = new ShowFile(urlPath);
+                    frm.ShowDialog();
+                }
+                catch (Exception ex)
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message);
+                }
+            }
+        }
+
+        private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
+        {
+            var rowhandle = gridView1.FocusedRowHandle;
+            if (rowhandle < 0)
+                return;
+            if (e.Button.Index == 0)
+            {
+                try
+                {
+                    var dr = gridView1.GetDataRow(rowhandle);
+                    var urlPath = dr["urlPath"].ToString();
+                    using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
+                    {
+                        folderBrowserDialog.Description = "閫夋嫨瀵煎嚭鏂囦欢鐨勪繚瀛樿矾寰�";
+                        DialogResult dialogResult = folderBrowserDialog.ShowDialog();
+                        if (dialogResult == DialogResult.OK)
+                        {
+                            string _folder = folderBrowserDialog.SelectedPath;
+                            string _folderName = _folder + "\\" + urlPath;
+                            string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + "upload/" + urlPath;
+                            using (WebClient client = new WebClient())
+                            {
+                                client.DownloadFile(_url, _folderName);
+                            }
+                            ToolBox.MsgHelper.ShowInformation("涓嬭浇鎴愬姛锛�");
+                        }
+                    }
+                }
+                catch (Exception ex)
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message);
+                }
+            }
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3