超级用户管理 增加分页

This commit is contained in:
chfei committed 2026-09-22 18:43:07 +08:00
1 parent d9dd4dfaed
commit 16ed764447
2 files changed
+55 -16

No files matched your search

+34 -15
View File
@@ -30,9 +30,9 @@ namespace TemuKJD.WXForms.AdminForms
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer5 = new System.Windows.Forms.SplitContainer(); this.splitContainer5 = new System.Windows.Forms.SplitContainer();
this.pnlSuperManage = new System.Windows.Forms.Panel(); this.pnlSuperManage = new System.Windows.Forms.Panel();
this.label30 = new System.Windows.Forms.Label(); this.label30 = new System.Windows.Forms.Label();
@@ -169,6 +169,7 @@ namespace TemuKJD.WXForms.AdminForms
this.editColumn = new System.Windows.Forms.DataGridViewLinkColumn(); this.editColumn = new System.Windows.Forms.DataGridViewLinkColumn();
this.deleteColumn = new System.Windows.Forms.DataGridViewLinkColumn(); this.deleteColumn = new System.Windows.Forms.DataGridViewLinkColumn();
this.btnExportShopErp = new DevComponents.DotNetBar.PanelEx(); this.btnExportShopErp = new DevComponents.DotNetBar.PanelEx();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
((System.ComponentModel.ISupportInitialize)(this.splitContainer5)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer5)).BeginInit();
this.splitContainer5.Panel1.SuspendLayout(); this.splitContainer5.Panel1.SuspendLayout();
this.splitContainer5.Panel2.SuspendLayout(); this.splitContainer5.Panel2.SuspendLayout();
@@ -820,6 +821,7 @@ namespace TemuKJD.WXForms.AdminForms
// //
// splitContainer1.Panel2 // splitContainer1.Panel2
// //
this.splitContainer1.Panel2.Controls.Add(this.ucSplitPage1);
this.splitContainer1.Panel2.Controls.Add(this.btnExportShopErp); this.splitContainer1.Panel2.Controls.Add(this.btnExportShopErp);
this.splitContainer1.Size = new System.Drawing.Size(1172, 651); this.splitContainer1.Size = new System.Drawing.Size(1172, 651);
this.splitContainer1.SplitterDistance = 620; this.splitContainer1.SplitterDistance = 620;
@@ -1601,20 +1603,20 @@ namespace TemuKJD.WXForms.AdminForms
// //
this.dgvUser.AllowUserToAddRows = false; this.dgvUser.AllowUserToAddRows = false;
this.dgvUser.AllowUserToDeleteRows = false; this.dgvUser.AllowUserToDeleteRows = false;
dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249))))); dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249)))));
this.dgvUser.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; this.dgvUser.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dgvUser.AutoRowNumber = true; this.dgvUser.AutoRowNumber = true;
this.dgvUser.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dgvUser.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvUser.BackgroundColor = System.Drawing.Color.White; this.dgvUser.BackgroundColor = System.Drawing.Color.White;
this.dgvUser.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); this.dgvUser.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False; dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvUser.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5; this.dgvUser.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.dgvUser.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvUser.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvUser.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dgvUser.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colCheck, this.colCheck,
@@ -1763,8 +1765,8 @@ namespace TemuKJD.WXForms.AdminForms
// //
// colPlus // colPlus
// //
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.colPlus.DefaultCellStyle = dataGridViewCellStyle6; this.colPlus.DefaultCellStyle = dataGridViewCellStyle3;
this.colPlus.FillWeight = 22F; this.colPlus.FillWeight = 22F;
this.colPlus.HeaderText = "+"; this.colPlus.HeaderText = "+";
this.colPlus.Name = "colPlus"; this.colPlus.Name = "colPlus";
@@ -1890,6 +1892,22 @@ namespace TemuKJD.WXForms.AdminForms
this.btnExportShopErp.Visible = false; this.btnExportShopErp.Visible = false;
this.btnExportShopErp.Click += new System.EventHandler(this.btnExportShopErp_Click); this.btnExportShopErp.Click += new System.EventHandler(this.btnExportShopErp_Click);
// //
// ucSplitPage1
//
this.ucSplitPage1.CurrentPage = 1;
this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right;
this.ucSplitPage1.IsShowPageSize = true;
this.ucSplitPage1.IsShowTotalCount = false;
this.ucSplitPage1.Location = new System.Drawing.Point(783, 0);
this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0);
this.ucSplitPage1.MaxPageSizeValue = 5000;
this.ucSplitPage1.Name = "ucSplitPage1";
this.ucSplitPage1.PageSize = 50;
this.ucSplitPage1.Size = new System.Drawing.Size(389, 27);
this.ucSplitPage1.TabIndex = 443;
this.ucSplitPage1.TotalCount = ((long)(0));
this.ucSplitPage1.TotalPage = 1;
//
// WXAdminAccountForm // WXAdminAccountForm
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -2085,5 +2103,6 @@ namespace TemuKJD.WXForms.AdminForms
private System.Windows.Forms.DataGridViewLinkColumn colAddShop; private System.Windows.Forms.DataGridViewLinkColumn colAddShop;
private System.Windows.Forms.DataGridViewLinkColumn editColumn; private System.Windows.Forms.DataGridViewLinkColumn editColumn;
private System.Windows.Forms.DataGridViewLinkColumn deleteColumn; private System.Windows.Forms.DataGridViewLinkColumn deleteColumn;
private UserControls.UcSplitPage ucSplitPage1;
} }
} }
@@ -14,6 +14,7 @@ using System.Windows.Forms;
using TemuKJD.BaseForms; using TemuKJD.BaseForms;
using TemuKJD.BLL; using TemuKJD.BLL;
using TemuKJD.Extension; using TemuKJD.Extension;
using TemuKJD.UserControls;
using Work; using Work;
namespace TemuKJD.WXForms.AdminForms namespace TemuKJD.WXForms.AdminForms
@@ -28,8 +29,16 @@ namespace TemuKJD.WXForms.AdminForms
public WXAdminAccountForm() public WXAdminAccountForm()
{ {
InitializeComponent(); InitializeComponent();
this.Load += WXAdminAccountForm_Load;
} }
private void WXAdminAccountForm_Load(object sender, EventArgs e)
{
this.ucSplitPage1.PageChange += UcSplitPage1_PageChange;
}
private void btnOpUser_Click(object sender, EventArgs e) private void btnOpUser_Click(object sender, EventArgs e)
{ {
if (txtPassword.Text != txtRePass.Text) if (txtPassword.Text != txtRePass.Text)
@@ -140,6 +149,8 @@ namespace TemuKJD.WXForms.AdminForms
string url = BaseClass.BuildObjString("user/get_all_user"); string url = BaseClass.BuildObjString("user/get_all_user");
StringBuilder data = new StringBuilder(); StringBuilder data = new StringBuilder();
data.Append(UserLogin.GetSignaturex()); data.Append(UserLogin.GetSignaturex());
data.Append($"&page={ucSplitPage1.CurrentPage}");
data.Append($"&page_size={ucSplitPage1.PageSize}");
if (cmbSearchGroup.Text == "主账户") if (cmbSearchGroup.Text == "主账户")
{ {
data.Append("&group_id=3"); data.Append("&group_id=3");
@@ -212,8 +223,16 @@ namespace TemuKJD.WXForms.AdminForms
"删除"); "删除");
} }
} }
int count = BaseRegex.GetIntJson(ref html, "count");
Invoke(new Action(() =>
{
ucSplitPage1.TotalCount = count;
}));
}
private void UcSplitPage1_PageChange(object obj)
{
GetUser();
} }
private void btnCancel_Click(object sender, EventArgs e) private void btnCancel_Click(object sender, EventArgs e)
{ {
btnOpUser.Text = "添加用户"; btnOpUser.Text = "添加用户";
@@ -248,6 +267,7 @@ namespace TemuKJD.WXForms.AdminForms
private void btnRefresh_Click(object sender, EventArgs e) private void btnRefresh_Click(object sender, EventArgs e)
{ {
ucSplitPage1.CurrentPage = 1;
GetUser(); GetUser();
} }