using AllBase; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; using TemuKJD.BaseForms; using TemuKJD.PDDForms.AdminForms; using TemuKJD.PDDForms.ProductSelectForms; using TemuKJD.ToolForms; namespace TemuKJD.WXForms.AdminForms { public partial class WXAdminForm : BaseForm { public Lazy adminAccountForm = new Lazy(); public Lazy adminShopForm = new Lazy(); public Lazy pddDbProdListForm = new Lazy(); public Lazy getJuShuitanProdForm = new Lazy(); public Lazy getJuShuitanProductSKUListForm = new Lazy(); public Lazy get1688ProdForm = new Lazy(); public Lazy imgToolForm = new Lazy(); public Lazy getAddressForm = new Lazy(); public Lazy saleAssistantForm = new Lazy(); public Lazy randomComProductForm = new Lazy(); public Lazy waybillManageForm = new Lazy(); public Lazy banPlatformForm = new Lazy(); public Lazy adminSetTopUpQrCodeForm = new Lazy(); public WXAdminForm() { InitializeComponent(); try { tv.SelectedNode = tv.Nodes[0].Nodes[0]; tv.ExpandGroup(tv.Nodes[0].Name); List hideName = new List() { "运单管理", "地址管理1", "1688厂家采集1", "图片工具", "Sku采集回传1", "超级用户管理", "超级店铺管理", "PDD产品库", "SKU替换图", "选品加价管理", "认领待上传", "库存上传", "商品核价" }; if (BaseClass.GroupId == 3) { /*BaseClass.UserName == "18888888888" || BaseClass.UserName == "15333333333"*/ if (BaseClass.SaLevel==1) { hideName.Remove("超级用户管理"); hideName.Remove("超级店铺管理"); hideName.Remove("PDD产品库"); //hideName.Remove("SKU替换图"); } if (BaseClass.SaLevel==2) { hideName.Remove("超级店铺管理"); } } foreach (var item in hideName) { var n = tv.Nodes[0].Nodes.Find(item, true); if (n.Count() > 0) n[0].Remove(); } } catch { } } private void tv_AfterSelect(object sender, TreeViewEventArgs e) { MainForm.sCurrentModule = e.Node.Name; this.lblName.Text = e.Node.Text; // 如果是一级菜单,不做任何动作 if (e.Node.Parent == null) return; //new Thread(() => //{ //Thread.Sleep(200); //Invoke(new Action(() => //{ switch (e.Node.Name) { case "超级用户管理": SetForm(adminAccountForm.Value); break; case "超级店铺管理": SetForm(adminShopForm.Value); break; case "PDD产品库": SetForm(pddDbProdListForm.Value); break; case "设置禁售": SetForm(banPlatformForm.Value); break; case "厂家商品采集": SetForm(getJuShuitanProdForm.Value); break; case "Sku采集回传": SetForm(getJuShuitanProductSKUListForm.Value); break; case "1688厂家采集": SetForm(get1688ProdForm.Value); break; case "地址管理": SetForm(getAddressForm.Value); break; case "带货助手": saleAssistantForm.Value.panel1.Visible = true; SetForm(saleAssistantForm.Value); break; case "图片工具": SetForm(imgToolForm.Value); break; case "随机厂商商品": SetForm(randomComProductForm.Value); break; case "运单管理": SetForm(waybillManageForm.Value); break; case "充值二维码": SetForm(adminSetTopUpQrCodeForm.Value); break; } //})); //}).Start(); } /// /// 显示隐藏层 /// /// private void SetForm(Form f) { if (f == null) { foreach (Control form in panel3.Controls) { form.Visible = false; if (form is Form) { panel3.Controls.Remove(form as Form); } } return; } bool had = false; string sCurrentFormName = f.Name; for (int i = 0; i < panel3.Controls.Count; i++) { if (sCurrentFormName == panel3.Controls[i].Name) { had = true; panel3.Controls[i].Visible = true; } else { panel3.Controls[i].Visible = false; } } if (had) { f = null; return; } f.TopLevel = false; f.Left = 0; f.Top = 0; f.FormBorderStyle = FormBorderStyle.None; panel3.Controls.Add(f); f.AutoSize = true; f.Dock = DockStyle.Fill; f.Show(); } private void ShopForm_Load(object sender, EventArgs e) { try { var ns = tv.Nodes.Find("运费模板", true); if (ns.Count() > 0) { //foreach (var n in ns) //{ // tv.Nodes.Remove(n); //} if (AllBase.BaseClass.IsCloudBuyOrder) this.tv.Nodes[0].Nodes.Insert(ns[0].Index + 1, new TreeNode() { Text = "高级运费模板", Name = "高级运费模板" }); } tv.SelectedNode = tv.Nodes[0].Nodes[0]; tv.ExpandGroup(tv.Nodes[0].Name); } catch { } } } }