lu
2025-09-22 3f08b93ffba05c8a12d6a013303e372442854f5f
DevApp/Gs.DevApp/UserControl/ShowLogcs.cs
@@ -1,15 +1,9 @@
using DevExpress.XtraEditors;
using Gs.DevApp.Entity;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Gs.DevApp.UserControl
@@ -18,29 +12,36 @@
    {
        public string guidKey;
        public ShowLogcs(string _guidKey)
        public bool isLog;
        public ShowLogcs(string _guidKey, bool _isLog = false)
        {
            this.guidKey = _guidKey;
            this.isLog = _isLog;
            InitializeComponent();
            getPageList(1, UtilityHelper.GetPageSize());
            pageBar1.PagerEvent += PageBar1_PagerEvent;
            gridView1.IndicatorWidth = 50;
            gridView1.CustomDrawRowIndicator += (s, e) =>
            if (isLog == true)
            {
                if (e.Info.IsRowIndicator && e.RowHandle >= 0)
                    e.Info.DisplayText = (e.RowHandle + 1).ToString();
            };
                gridColumn1.Visible = true;
                gridColumn2.Visible = true;
                gridColumn1.VisibleIndex = 99;
                gridColumn2.VisibleIndex = 100;
                this.gridView1.RowHeight = 150;
                gv_msg.Visible = false;
                gv_userName.Visible = false;
                gridView1.OptionsView.ShowAutoFilterRow = false;
            }
            else
            {
                gv_msg.Visible = true;
                gv_userName.Visible = true;
                this.gridView1.RowHeight = -1;
                gridView1.OptionsView.ShowAutoFilterRow = true;
            }
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, null, "", (value) =>
            {
            }, null, false);
            getPageList(1, 999999);
        }
        /// <summary>
        ///     分页事件
        /// </summary>
        /// <param name="curPage"></param>
        /// <param name="pageSize"></param>
        private void PageBar1_PagerEvent(int curPage, int pageSize)
        {
            getPageList(curPage, pageSize);
        }
        /// <summary>
        /// </summary>
@@ -49,8 +50,8 @@
        private void getPageList(int curPage, int pageSize)
        {
            var _sbSqlWhere = new StringBuilder();
            _sbSqlWhere.Append(" and ABT_GUID='"+this.guidKey + "'");
            var pgq = new PageQueryModel(curPage, pageSize, "OPERATION_TIME",
            _sbSqlWhere.Append(" and ABT_GUID='" + this.guidKey + "'");
            var pgq = new PageQueryModel(curPage, 999999, "OPERATION_TIME",
                "desc", "", _sbSqlWhere.ToString());
            var json = JsonConvert.SerializeObject(pgq);
            try
@@ -64,11 +65,7 @@
                    gcMain.BindingContext = new BindingContext();
                    gcMain.DataSource = dt;
                    gcMain.ForceInitialize();
                    gridView1.BestFitColumns();
                    int dddd = dd.rtnData.pages;//总页
                    pageBar1.TotalPages = dddd;
                    pageBar1.RecordCount = dd.rtnData.total;//记录总数
                    pageBar1.CurrentPage = curPage;//当前页
                    gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
                }
                else
                {