子帐户界面访问权管理,主账户可以禁止子账户操作某些界面。

This commit is contained in:
wule committed 2026-06-13 19:12:26 +08:00
1 parent b1afcd2cd8
commit e7ece386e9
20 files changed
+364 -154

No files matched your search

+7 -2
View File
@@ -49,7 +49,7 @@ namespace TemuKJD
System.Threading.Thread.Sleep(100);
Invoke(new Action(() =>
{
panel2_Click(this.pnlUploadGoods, null);
pnlUpload_Click(this.pnlUploadGoods, null);
}));
});
}
@@ -57,6 +57,11 @@ namespace TemuKJD
{
label1.Visible = false;
pnlChat.Visible = pnlUploadGoods.Visible = true;
if (BaseClass.ForbiddenPage.Contains("客服"))
{
pnlChat.Visible = false;
//pnlUpload_Click(null, null);
}
}
this.pnlChat.StyleMouseOver.BorderColor.Color = GlobalConfig.BorderColor;
this.pnlUploadGoods.StyleMouseOver.BorderColor.Color = GlobalConfig.BorderColor;
@@ -73,7 +78,7 @@ namespace TemuKJD
Process.GetCurrentProcess().Kill();
}
private void panel2_Click(object sender, EventArgs e)
private void pnlUpload_Click(object sender, EventArgs e)
{
mf.WindowState = FormWindowState.Maximized;
mf.Show();
+1 -1
View File
@@ -89,7 +89,7 @@
this.pnlUploadGoods.StyleMouseOver.Border = DevComponents.DotNetBar.eBorderType.RaisedInner;
this.pnlUploadGoods.StyleMouseOver.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(7)))), ((int)(((byte)(157)))), ((int)(((byte)(235)))));
this.pnlUploadGoods.TabIndex = 1;
this.pnlUploadGoods.Click += new System.EventHandler(this.panel2_Click);
this.pnlUploadGoods.Click += new System.EventHandler(this.pnlUpload_Click);
//
// panel1
//
+1 -2
View File
@@ -178,12 +178,11 @@
}
#endregion
private UserComponent.UcTreeView tv;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label lblName;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.SplitContainer splitContainer1;
public UserComponent.UcTreeView tv;
}
}
+10 -10
View File
@@ -913,32 +913,32 @@ namespace TemuKJD
}
}
private object uploadForm;
public object ProductForm;
public void pnlUpload_Click(object sender, EventArgs e)
{
if (BaseClass.MainPath == "kuajingda")
{
if (uploadForm == null)
if (ProductForm == null)
{
uploadForm = new ProductForm();
ProductForm = new ProductForm();
}
ShowMainPanel(uploadForm as ProductForm, sender as Panel);
ShowMainPanel(ProductForm as ProductForm, sender as Panel);
}
else if (BaseClass.MainPath == "29pdd")
{
if (uploadForm == null)
if (ProductForm == null)
{
uploadForm = new PDDProductForm();
ProductForm = new PDDProductForm();
}
ShowMainPanel(uploadForm as PDDProductForm, sender as Panel);
ShowMainPanel(ProductForm as PDDProductForm, sender as Panel);
}
else if (BaseClass.MainPath == "29wx")
{
if (uploadForm == null)
if (ProductForm == null)
{
uploadForm = new WXProductForm();
ProductForm = new WXProductForm();
}
ShowMainPanel(uploadForm as WXProductForm, sender as Panel);
ShowMainPanel(ProductForm as WXProductForm, sender as Panel);
}
}
@@ -2164,7 +2164,7 @@ namespace TemuKJD.WXForms.OrderForms
}
catch (Exception ex)
{
BaseMsgForm.ShowError("读取打印单号失败" + ex.Message);
BaseMsgForm.ShowError("读取打印单号失败 " + ex.Message);
}
}
+1 -2
View File
@@ -198,12 +198,11 @@
}
#endregion
private UserComponent.UcTreeView tv;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label lblName;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.SplitContainer splitContainer1;
public UserComponent.UcTreeView tv;
}
}
+29 -23
View File
@@ -39,39 +39,45 @@ namespace TemuKJD.WXForms.ProductForms
try
{
tv.SelectedNode = tv.Nodes[0].Nodes[0];
tv.ExpandGroup(tv.Nodes[0].Name);
List<string> hideName = new List<string>() {"我的商品库", "1688商品采集", "多多商品采集", "商品列表", "爆单神器1", "商品同步1", "清理无流量1" };
var hideNames = getHideTreeNodes();
if (BaseClass.UserAuthority.Contains("商品采集"))
{
hideName.Remove("1688商品采集");
hideName.Remove("多多商品采集");
hideName.Remove("我的商品库");
}
if (BaseClass.ParentAuthority.Contains("商品采集"))
hideName.Remove("我的商品库");
if (BaseClass.GroupId == 3)
{
//hideName.Remove("设置进货价");
if (BaseClass.SaLevel == 1)
{
}
if (BaseClass.SaLevel == 2)
{
}
}
foreach (var item in hideName)
foreach (var item in hideNames)
{
var n = tv.Nodes[0].Nodes.Find(item, true);
if (n.Count() > 0)
n[0].Remove();
}
tv.SelectedNode = tv.Nodes[0].Nodes[0];
tv.ExpandGroup(tv.Nodes[0].Name);
}
catch { }
}
public List<string> getHideTreeNodes()
{
List<string> hideNames = new List<string>() { "我的商品库", "1688商品采集", "多多商品采集", "爆单神器1", "商品同步1", "清理无流量1" };
if (BaseClass.UserAuthority.Contains("商品采集"))
{
hideNames.Remove("1688商品采集");
hideNames.Remove("多多商品采集");
hideNames.Remove("我的商品库");
}
if (BaseClass.ParentAuthority.Contains("商品采集"))
{
hideNames.Remove("我的商品库");
}
foreach (var forbiddenPage in BaseClass.ForbiddenPage.Split(','))
{
hideNames.Add(forbiddenPage);
}
return hideNames;
}
private void tv_AfterSelect(object sender, TreeViewEventArgs e)
{
instance = this;
+29 -30
View File
@@ -28,19 +28,19 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("店铺列表");
System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("子账号管理");
System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("店铺地址管理");
System.Windows.Forms.TreeNode treeNode11 = new System.Windows.Forms.TreeNode("店铺经营统计");
System.Windows.Forms.TreeNode treeNode12 = new System.Windows.Forms.TreeNode("评分考核");
System.Windows.Forms.TreeNode treeNode13 = new System.Windows.Forms.TreeNode("充值二维码");
System.Windows.Forms.TreeNode treeNode14 = new System.Windows.Forms.TreeNode("店铺管理", new System.Windows.Forms.TreeNode[] {
treeNode8,
treeNode9,
treeNode10,
treeNode11,
treeNode12,
treeNode13});
System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("店铺列表");
System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("子账号管理");
System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("店铺地址管理");
System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("店铺经营统计");
System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("评分考核");
System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("充值二维码");
System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("店铺管理", new System.Windows.Forms.TreeNode[] {
treeNode1,
treeNode2,
treeNode3,
treeNode4,
treeNode5,
treeNode6});
this.panel1 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
@@ -132,22 +132,22 @@
this.tv.Location = new System.Drawing.Point(0, 0);
this.tv.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tv.Name = "tv";
treeNode8.Name = "店铺列表";
treeNode8.Text = "店铺列表";
treeNode9.Name = "子账号管理";
treeNode9.Text = "子账号管理";
treeNode10.Name = "店铺地址管理";
treeNode10.Text = "店铺地址管理";
treeNode11.Name = "店铺经营统计";
treeNode11.Text = "店铺经营统计";
treeNode12.Name = "评分考核";
treeNode12.Text = "评分考核";
treeNode13.Name = "充值二维码";
treeNode13.Text = "充值二维码";
treeNode14.Name = "店铺管理";
treeNode14.Text = "店铺管理";
treeNode1.Name = "店铺列表";
treeNode1.Text = "店铺列表";
treeNode2.Name = "子账号管理";
treeNode2.Text = "子账号管理";
treeNode3.Name = "店铺地址管理";
treeNode3.Text = "店铺地址管理";
treeNode4.Name = "店铺经营统计";
treeNode4.Text = "店铺经营统计";
treeNode5.Name = "评分考核";
treeNode5.Text = "评分考核";
treeNode6.Name = "充值二维码";
treeNode6.Text = "充值二维码";
treeNode7.Name = "店铺管理";
treeNode7.Text = "店铺管理";
this.tv.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
treeNode14});
treeNode7});
this.tv.OverForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.tv.Size = new System.Drawing.Size(140, 461);
this.tv.TabIndex = 1;
@@ -175,12 +175,11 @@
}
#endregion
private UserComponent.UcTreeView tv;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label lblName;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.SplitContainer splitContainer1;
public UserComponent.UcTreeView tv;
}
}
+36 -24
View File
@@ -37,40 +37,52 @@ namespace TemuKJD.WXForms.ShopForms
try
{
tv.SelectedNode = tv.Nodes[0].Nodes[0];
tv.ExpandGroup(tv.Nodes[0].Name);
var hideNames = getHideTreeNodes();
List<string> hideName = new List<string>() { "充值二维码", "店铺地址管理", "评分考核", "子账号管理", "高级运费模板", "运费模板", "素材库管理", "订单金额统计", "工作明细统计", "店铺经营统计1" };
if (BaseClass.SaLevel == 1)
{
//hideName.Remove("店铺地址管理");
}
if (BaseClass.GroupId == 3)
{
hideName.Remove("店铺地址管理");
hideName.Remove("子账号管理");
hideName.Remove("评分考核");
}
if (BaseClass.UserAuthority.Contains("评分考核"))
{
hideName.Remove("评分考核");
}
if (BaseClass.UserAuthority.Contains("充值用户") && BaseClass.GroupId == 3)
{
hideName.Remove("充值二维码");
}
foreach (var item in hideName)
foreach (var item in hideNames)
{
var n = tv.Nodes[0].Nodes.Find(item, true);
if (n.Count() > 0)
n[0].Remove();
}
tv.SelectedNode = tv.Nodes[0].Nodes[0];
tv.ExpandGroup(tv.Nodes[0].Name);
}
catch { }
}
public List<string> getHideTreeNodes()
{
List<string> hideNames = new List<string>() { "充值二维码", "店铺地址管理", "评分考核", "子账号管理", "高级运费模板", "运费模板", "素材库管理", "订单金额统计", "工作明细统计", "店铺经营统计1" };
if (BaseClass.SaLevel == 1)
{
//hideName.Remove("店铺地址管理");
}
if (BaseClass.GroupId == 3)
{
hideNames.Remove("店铺地址管理");
hideNames.Remove("子账号管理");
hideNames.Remove("评分考核");
}
if (BaseClass.UserAuthority.Contains("评分考核"))
{
hideNames.Remove("评分考核");
}
if (BaseClass.UserAuthority.Contains("充值用户") && BaseClass.GroupId == 3)
{
hideNames.Remove("充值二维码");
}
foreach (var forbiddenPage in BaseClass.ForbiddenPage.Split(','))
{
hideNames.Add(forbiddenPage);
}
return hideNames;
}
public void ClickShopAddress()
{
var node = tv.Nodes[0].Nodes.Find("店铺地址管理", true).FirstOrDefault();
+92 -22
View File
@@ -28,9 +28,14 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer5 = new System.Windows.Forms.SplitContainer();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.ucCheckBox1 = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.ucCheckBox2 = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.lblForbiddenPage = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.btnRefresh = new TemuKJD.UserControls.ButtonEx();
this.btnCancel = new TemuKJD.UserControls.ButtonEx();
@@ -57,6 +62,7 @@
this.mobileColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.groupIdColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.groupNameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.forbiddenPageColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.shopCountColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.editColumn = new System.Windows.Forms.DataGridViewLinkColumn();
this.deleteColumn = new System.Windows.Forms.DataGridViewLinkColumn();
@@ -64,6 +70,7 @@
this.splitContainer5.Panel1.SuspendLayout();
this.splitContainer5.Panel2.SuspendLayout();
this.splitContainer5.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvUser)).BeginInit();
this.SuspendLayout();
//
@@ -77,6 +84,8 @@
//
// splitContainer5.Panel1
//
this.splitContainer5.Panel1.Controls.Add(this.flowLayoutPanel1);
this.splitContainer5.Panel1.Controls.Add(this.lblForbiddenPage);
this.splitContainer5.Panel1.Controls.Add(this.label1);
this.splitContainer5.Panel1.Controls.Add(this.btnRefresh);
this.splitContainer5.Panel1.Controls.Add(this.btnCancel);
@@ -102,16 +111,58 @@
//
this.splitContainer5.Panel2.Controls.Add(this.dgvUser);
this.splitContainer5.Panel2.Padding = new System.Windows.Forms.Padding(0, 5, 5, 5);
this.splitContainer5.Size = new System.Drawing.Size(933, 445);
this.splitContainer5.Size = new System.Drawing.Size(933, 613);
this.splitContainer5.SplitterDistance = 357;
this.splitContainer5.SplitterWidth = 1;
this.splitContainer5.TabIndex = 2;
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.flowLayoutPanel1.Controls.Add(this.ucCheckBox1);
this.flowLayoutPanel1.Controls.Add(this.ucCheckBox2);
this.flowLayoutPanel1.Location = new System.Drawing.Point(59, 263);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(220, 218);
this.flowLayoutPanel1.TabIndex = 40;
//
// ucCheckBox1
//
this.ucCheckBox1.AutoSize = true;
this.ucCheckBox1.Location = new System.Drawing.Point(3, 3);
this.ucCheckBox1.Name = "ucCheckBox1";
this.ucCheckBox1.Size = new System.Drawing.Size(51, 21);
this.ucCheckBox1.TabIndex = 0;
this.ucCheckBox1.Text = "客服";
this.ucCheckBox1.UseVisualStyleBackColor = true;
//
// ucCheckBox2
//
this.ucCheckBox2.AutoSize = true;
this.ucCheckBox2.Location = new System.Drawing.Point(60, 3);
this.ucCheckBox2.Name = "ucCheckBox2";
this.ucCheckBox2.Size = new System.Drawing.Size(51, 21);
this.ucCheckBox2.TabIndex = 1;
this.ucCheckBox2.Text = "采购";
this.ucCheckBox2.UseVisualStyleBackColor = true;
//
// lblForbiddenPage
//
this.lblForbiddenPage.AutoSize = true;
this.lblForbiddenPage.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblForbiddenPage.Location = new System.Drawing.Point(27, 234);
this.lblForbiddenPage.Name = "lblForbiddenPage";
this.lblForbiddenPage.Size = new System.Drawing.Size(121, 20);
this.lblForbiddenPage.TabIndex = 39;
this.lblForbiddenPage.Text = "禁止访问的页面:";
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.SystemColors.ButtonShadow;
this.label1.Location = new System.Drawing.Point(56, 378);
this.label1.Location = new System.Drawing.Point(56, 546);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(212, 17);
this.label1.TabIndex = 37;
@@ -136,11 +187,12 @@
// btnCancel
//
this.btnCancel.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnCancel.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCancel.ForeColor = System.Drawing.Color.White;
this.btnCancel.Location = new System.Drawing.Point(59, 328);
this.btnCancel.Location = new System.Drawing.Point(59, 496);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(86, 25);
this.btnCancel.TabIndex = 35;
@@ -152,11 +204,12 @@
// btnOpUser
//
this.btnOpUser.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnOpUser.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnOpUser.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnOpUser.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnOpUser.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOpUser.ForeColor = System.Drawing.Color.White;
this.btnOpUser.Location = new System.Drawing.Point(174, 328);
this.btnOpUser.Location = new System.Drawing.Point(174, 496);
this.btnOpUser.Name = "btnOpUser";
this.btnOpUser.Size = new System.Drawing.Size(86, 25);
this.btnOpUser.TabIndex = 34;
@@ -168,7 +221,7 @@
//
this.label30.AutoSize = true;
this.label30.ForeColor = System.Drawing.SystemColors.ButtonShadow;
this.label30.Location = new System.Drawing.Point(282, 145);
this.label30.Location = new System.Drawing.Point(282, 91);
this.label30.Name = "label30";
this.label30.Size = new System.Drawing.Size(56, 17);
this.label30.TabIndex = 33;
@@ -178,7 +231,7 @@
//
this.label31.AutoSize = true;
this.label31.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
this.label31.Location = new System.Drawing.Point(266, 229);
this.label31.Location = new System.Drawing.Point(266, 163);
this.label31.Name = "label31";
this.label31.Size = new System.Drawing.Size(13, 17);
this.label31.TabIndex = 32;
@@ -186,7 +239,7 @@
//
// txtRePass
//
this.txtRePass.Location = new System.Drawing.Point(112, 226);
this.txtRePass.Location = new System.Drawing.Point(112, 160);
this.txtRePass.Name = "txtRePass";
this.txtRePass.PasswordChar = '*';
this.txtRePass.Size = new System.Drawing.Size(148, 23);
@@ -196,7 +249,7 @@
//
this.label32.AutoSize = true;
this.label32.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label32.Location = new System.Drawing.Point(27, 227);
this.label32.Location = new System.Drawing.Point(27, 161);
this.label32.Name = "label32";
this.label32.Size = new System.Drawing.Size(79, 20);
this.label32.TabIndex = 31;
@@ -206,7 +259,7 @@
//
this.label33.AutoSize = true;
this.label33.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
this.label33.Location = new System.Drawing.Point(266, 271);
this.label33.Location = new System.Drawing.Point(266, 200);
this.label33.Name = "label33";
this.label33.Size = new System.Drawing.Size(13, 17);
this.label33.TabIndex = 30;
@@ -216,7 +269,7 @@
//
this.label34.AutoSize = true;
this.label34.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
this.label34.Location = new System.Drawing.Point(266, 187);
this.label34.Location = new System.Drawing.Point(266, 127);
this.label34.Name = "label34";
this.label34.Size = new System.Drawing.Size(13, 17);
this.label34.TabIndex = 29;
@@ -226,7 +279,7 @@
//
this.label35.AutoSize = true;
this.label35.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
this.label35.Location = new System.Drawing.Point(266, 145);
this.label35.Location = new System.Drawing.Point(266, 91);
this.label35.Name = "label35";
this.label35.Size = new System.Drawing.Size(13, 17);
this.label35.TabIndex = 28;
@@ -236,7 +289,7 @@
//
this.label36.AutoSize = true;
this.label36.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
this.label36.Location = new System.Drawing.Point(266, 103);
this.label36.Location = new System.Drawing.Point(266, 55);
this.label36.Name = "label36";
this.label36.Size = new System.Drawing.Size(13, 17);
this.label36.TabIndex = 27;
@@ -252,7 +305,7 @@
"上货",
"数据",
"登录"});
this.cmbGroup.Location = new System.Drawing.Point(112, 267);
this.cmbGroup.Location = new System.Drawing.Point(112, 196);
this.cmbGroup.Name = "cmbGroup";
this.cmbGroup.Size = new System.Drawing.Size(148, 25);
this.cmbGroup.TabIndex = 26;
@@ -262,7 +315,7 @@
//
this.label37.AutoSize = true;
this.label37.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label37.Location = new System.Drawing.Point(55, 269);
this.label37.Location = new System.Drawing.Point(55, 198);
this.label37.Name = "label37";
this.label37.Size = new System.Drawing.Size(51, 20);
this.label37.TabIndex = 25;
@@ -270,7 +323,7 @@
//
// txtPassword
//
this.txtPassword.Location = new System.Drawing.Point(112, 184);
this.txtPassword.Location = new System.Drawing.Point(112, 124);
this.txtPassword.Name = "txtPassword";
this.txtPassword.PasswordChar = '*';
this.txtPassword.Size = new System.Drawing.Size(148, 23);
@@ -280,7 +333,7 @@
//
this.label38.AutoSize = true;
this.label38.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label38.Location = new System.Drawing.Point(55, 185);
this.label38.Location = new System.Drawing.Point(55, 125);
this.label38.Name = "label38";
this.label38.Size = new System.Drawing.Size(51, 20);
this.label38.TabIndex = 22;
@@ -288,7 +341,7 @@
//
// mobiletextBox
//
this.mobiletextBox.Location = new System.Drawing.Point(112, 142);
this.mobiletextBox.Location = new System.Drawing.Point(112, 88);
this.mobiletextBox.Name = "mobiletextBox";
this.mobiletextBox.Size = new System.Drawing.Size(148, 23);
this.mobiletextBox.TabIndex = 21;
@@ -297,7 +350,7 @@
//
this.label39.AutoSize = true;
this.label39.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label39.Location = new System.Drawing.Point(41, 143);
this.label39.Location = new System.Drawing.Point(41, 89);
this.label39.Name = "label39";
this.label39.Size = new System.Drawing.Size(65, 20);
this.label39.TabIndex = 20;
@@ -305,7 +358,7 @@
//
// txtNickName
//
this.txtNickName.Location = new System.Drawing.Point(112, 100);
this.txtNickName.Location = new System.Drawing.Point(112, 52);
this.txtNickName.Name = "txtNickName";
this.txtNickName.Size = new System.Drawing.Size(148, 23);
this.txtNickName.TabIndex = 19;
@@ -314,7 +367,7 @@
//
this.label40.AutoSize = true;
this.label40.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label40.Location = new System.Drawing.Point(55, 101);
this.label40.Location = new System.Drawing.Point(55, 53);
this.label40.Name = "label40";
this.label40.Size = new System.Drawing.Size(51, 20);
this.label40.TabIndex = 18;
@@ -345,6 +398,7 @@
this.mobileColumn,
this.groupIdColumn,
this.groupNameColumn,
this.forbiddenPageColumn,
this.shopCountColumn,
this.editColumn,
this.deleteColumn});
@@ -355,7 +409,7 @@
this.dgvUser.Name = "dgvUser";
this.dgvUser.ReadOnly = true;
this.dgvUser.RowTemplate.Height = 23;
this.dgvUser.Size = new System.Drawing.Size(570, 435);
this.dgvUser.Size = new System.Drawing.Size(570, 603);
this.dgvUser.TabIndex = 1;
this.dgvUser.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvUser_CellContentClick);
//
@@ -391,6 +445,13 @@
this.groupNameColumn.Name = "groupNameColumn";
this.groupNameColumn.ReadOnly = true;
//
// forbiddenPageColumn
//
this.forbiddenPageColumn.FillWeight = 200F;
this.forbiddenPageColumn.HeaderText = "禁止访问页面";
this.forbiddenPageColumn.Name = "forbiddenPageColumn";
this.forbiddenPageColumn.ReadOnly = true;
//
// shopCountColumn
//
this.shopCountColumn.HeaderText = "店铺数";
@@ -400,6 +461,7 @@
//
// editColumn
//
this.editColumn.FillWeight = 60F;
this.editColumn.HeaderText = "编辑";
this.editColumn.Name = "editColumn";
this.editColumn.ReadOnly = true;
@@ -408,6 +470,7 @@
//
// deleteColumn
//
this.deleteColumn.FillWeight = 60F;
this.deleteColumn.HeaderText = "删除";
this.deleteColumn.Name = "deleteColumn";
this.deleteColumn.ReadOnly = true;
@@ -416,7 +479,7 @@
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(933, 445);
this.ClientSize = new System.Drawing.Size(933, 613);
this.Controls.Add(this.splitContainer5);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.KeyPreview = true;
@@ -429,6 +492,8 @@
this.splitContainer5.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer5)).EndInit();
this.splitContainer5.ResumeLayout(false);
this.flowLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvUser)).EndInit();
this.ResumeLayout(false);
@@ -458,11 +523,16 @@
private UserComponent.DataGridViewEx dgvUser;
private UserControls.ButtonEx btnRefresh;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private UserComponent.UcCheckBox ucCheckBox1;
private System.Windows.Forms.Label lblForbiddenPage;
private UserComponent.UcCheckBox ucCheckBox2;
private System.Windows.Forms.DataGridViewTextBoxColumn UserIdColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn UserNickNameColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn mobileColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn groupIdColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn groupNameColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn forbiddenPageColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn shopCountColumn;
private System.Windows.Forms.DataGridViewLinkColumn editColumn;
private System.Windows.Forms.DataGridViewLinkColumn deleteColumn;
@@ -11,6 +11,8 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Work;
using TemuKJD.WXForms.ProductForms;
using TemuKJD.UserComponent;
namespace TemuKJD.WXForms.ShopForms
{
@@ -47,6 +49,17 @@ namespace TemuKJD.WXForms.ShopForms
data.Append("&sub_nick_name=" + GetHtml.UrlEncodeUtf8(txtNickName.Text));
data.Append("&sub_name=" + GetHtml.UrlEncodeUtf8(mobiletextBox.Text));
data.Append("&sub_mobile=" + GetHtml.UrlEncodeUtf8(mobiletextBox.Text));
var forbiddenPage = "";
foreach (var control in this.flowLayoutPanel1.Controls)
{
var chk = control as UcCheckBox;
if (chk != null && chk.Checked)
{
forbiddenPage += chk.Text + ",";
}
}
//data.Append("&forbidden_page=" + GetHtml.UrlEncodeUtf8(forbiddenPage.Trim(',')));
data.Append("&forbidden_page=" + forbiddenPage.Trim(','));
data.Append("&card_id=");
if (cmbGroup.Text == "客服")
data.Append("&group_id=4");
@@ -103,6 +116,7 @@ namespace TemuKJD.WXForms.ShopForms
txtPassword.Clear();
txtRePass.Clear();
mobiletextBox.Clear();
GetForbiddenCheckBoxes();
}
private void GetUser()
@@ -127,9 +141,10 @@ namespace TemuKJD.WXForms.ShopForms
user.mobile = BaseRegex.GetStringJson(ref oStr, "mobile");
user.group_id = BaseRegex.GetStringJson(ref oStr, "group_id");
user.shop_count = BaseRegex.GetIntJson(ref oStr, "shop_count");
user.forbidden_page = BaseRegex.GetStringJson(ref oStr, "forbidden_page");
AllUsers.Add(user);
dgvUser.Rows.Add(user.id, user.nick_name, user.user_name, user.group_id, user.group_name, user.shop_count, "编辑", "删除");
dgvUser.Rows.Add(user.id, user.nick_name, user.user_name, user.group_id, user.group_name, user.forbidden_page, user.shop_count, "编辑", "删除");
}
}
}
@@ -151,6 +166,7 @@ namespace TemuKJD.WXForms.ShopForms
string nickName = dgvUser.Rows[e.RowIndex].Cells["UserNickNameColumn"].Value.ToString();
string mobile = dgvUser.Rows[e.RowIndex].Cells["mobileColumn"].Value.ToString();
string groupName = dgvUser.Rows[e.RowIndex].Cells["groupNameColumn"].Value.ToString();
string forbidden_page = dgvUser.Rows[e.RowIndex].Cells["forbiddenPageColumn"].Value.ToString();
if (columname == "编辑")
{
Uid = uid;
@@ -162,6 +178,14 @@ namespace TemuKJD.WXForms.ShopForms
btnOpUser.Text = "保存用户";
btnCancel.Visible = true;
btnCancel.Text = "取消編輯";
foreach (var control in this.flowLayoutPanel1.Controls)
{
var chk = control as UcCheckBox;
if (chk!= null)
{
chk.Checked = forbidden_page.Contains(chk.Text);
}
}
}
if (columname == "删除")
{
@@ -209,9 +233,45 @@ namespace TemuKJD.WXForms.ShopForms
// this.groupIdcomboBox.Enabled = true;
//}
this.dgvUser.BackgroundColor = Color.White;
GetForbiddenCheckBoxes();
GetUser();
}
void GetForbiddenCheckBoxes()
{
this.flowLayoutPanel1.Controls.Clear();
this.flowLayoutPanel1.Controls.Add(new UcCheckBox() { Name = "客服", Text = "客服", AutoSize = true });
this.flowLayoutPanel1.Controls.Add(new Label() { Text = "-------------------------------------", AutoSize = true });
//this.flowLayoutPanel1.Controls.Add(new UcCheckBox() { Name = "采购", Text = "采购", AutoSize = true });
List<string> subUserNoAuthorityPageNames = new List<string>() { "子账号管理", "店铺地址管理", "充值二维码", "1688商品采集", "多多商品采集" };
var shopForm = MainForm.instance.shopForm as WXShopForm;
if (shopForm != null)
{
var shopHideName = shopForm.getHideTreeNodes();
foreach (TreeNode node in shopForm.tv.Nodes[0].Nodes)
{
if (!shopHideName.Contains(node.Text) && !subUserNoAuthorityPageNames.Contains(node.Text))
{
this.flowLayoutPanel1.Controls.Add(new UcCheckBox() { Name = node.Text, Text = node.Text, AutoSize = true });
}
}
}
this.flowLayoutPanel1.Controls.Add(new Label() { Text = "-------------------------------------", AutoSize = true });
var prodForm = MainForm.instance.ProductForm as WXProductForm;
if (prodForm != null)
{
var prodHideName = prodForm.getHideTreeNodes();
foreach (TreeNode node in prodForm.tv.Nodes[0].Nodes)
{
if (!prodHideName.Contains(node.Text) && !subUserNoAuthorityPageNames.Contains(node.Text))
{
this.flowLayoutPanel1.Controls.Add(new UcCheckBox() { Name = node.Text, Text = node.Text, AutoSize = true });
}
}
}
}
private void btnRefresh_Click(object sender, EventArgs e)
{
GetUser();
@@ -132,6 +132,9 @@
<metadata name="groupNameColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="forbiddenPageColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="shopCountColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>