From 5f3bc0327fa2d283aedb35f234e4c8a450fa9245 Mon Sep 17 00:00:00 2001 From: lg <999544862qq.com> Date: 星期六, 14 九月 2024 11:49:26 +0800 Subject: [PATCH] 基础资料 --- DevApp/Gs.DevApp/UserControl/ToolBarMenu.cs | 118 ++++++++++++---- DevApp/Gs.DevApp/UserControl/ToolBarMenu.resx | 16 +- DevApp/Gs.DevApp/UserControl/ToolBarMenu.Designer.cs | 241 +++++++++++++++++----------------- 3 files changed, 216 insertions(+), 159 deletions(-) diff --git a/DevApp/Gs.DevApp/UserControl/ToolBarMenu.Designer.cs b/DevApp/Gs.DevApp/UserControl/ToolBarMenu.Designer.cs index ee25295..153a551 100644 --- a/DevApp/Gs.DevApp/UserControl/ToolBarMenu.Designer.cs +++ b/DevApp/Gs.DevApp/UserControl/ToolBarMenu.Designer.cs @@ -42,42 +42,40 @@ this.btnEsc = new DevExpress.XtraBars.BarLargeButtonItem(); this.btnLoad = new DevExpress.XtraBars.BarLargeButtonItem(); this.btnDel = new DevExpress.XtraBars.BarLargeButtonItem(); - this.barLargeButtonItem9 = new DevExpress.XtraBars.BarLargeButtonItem(); - this.barLargeButtonItem10 = new DevExpress.XtraBars.BarLargeButtonItem(); - this.barLargeButtonItem1 = new DevExpress.XtraBars.BarLargeButtonItem(); - this.barLargeButtonItem2 = new DevExpress.XtraBars.BarLargeButtonItem(); - this.barLargeButtonItem8 = new DevExpress.XtraBars.BarLargeButtonItem(); - this.barLargeButtonItem3 = new DevExpress.XtraBars.BarLargeButtonItem(); - this.barLargeButtonItem4 = new DevExpress.XtraBars.BarLargeButtonItem(); + this.btnChk = new DevExpress.XtraBars.BarLargeButtonItem(); + this.btnFchk = new DevExpress.XtraBars.BarLargeButtonItem(); + this.btnPrint = new DevExpress.XtraBars.BarLargeButtonItem(); + this.btnHb = new DevExpress.XtraBars.BarLargeButtonItem(); + this.btnOut = new DevExpress.XtraBars.BarLargeButtonItem(); + this.btnIn = new DevExpress.XtraBars.BarLargeButtonItem(); + this.btnLog = new DevExpress.XtraBars.BarLargeButtonItem(); this.btnKG = new DevExpress.XtraBars.BarLargeButtonItem(); - this.btnRole = new DevExpress.XtraBars.BarLargeButtonItem(); this.btnReport = new DevExpress.XtraBars.BarLargeButtonItem(); this.btnQuery = new DevExpress.XtraBars.BarLargeButtonItem(); + this.btnRole = new DevExpress.XtraBars.BarLargeButtonItem(); this.barDockControlTop = new DevExpress.XtraBars.BarDockControl(); this.barDockControlBottom = new DevExpress.XtraBars.BarDockControl(); this.barDockControlRight = new DevExpress.XtraBars.BarDockControl(); - this.barLargeButtonItem5 = new DevExpress.XtraBars.BarLargeButtonItem(); ((System.ComponentModel.ISupportInitialize)(this.barManager1)).BeginInit(); this.SuspendLayout(); // // barButtonItem2 // - this.barButtonItem2.Caption = "barButtonItem2"; - this.barButtonItem2.Id = 11; + this.barButtonItem2.Id = 25; this.barButtonItem2.Name = "barButtonItem2"; // // barButtonItem1 // - this.barButtonItem1.Id = 8; + this.barButtonItem1.Id = 24; this.barButtonItem1.Name = "barButtonItem1"; // // barDockControlLeft // this.barDockControlLeft.CausesValidation = false; this.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left; - this.barDockControlLeft.Location = new System.Drawing.Point(0, 94); + this.barDockControlLeft.Location = new System.Drawing.Point(0, 74); this.barDockControlLeft.Manager = this.barManager1; - this.barDockControlLeft.Size = new System.Drawing.Size(0, 0); + this.barDockControlLeft.Size = new System.Drawing.Size(0, 3); // // barManager1 // @@ -97,20 +95,19 @@ this.btnEsc, this.btnLoad, this.barButtonItem2, - this.barLargeButtonItem8, - this.barLargeButtonItem9, - this.barLargeButtonItem10, - this.barLargeButtonItem1, - this.barLargeButtonItem2, - this.barLargeButtonItem3, - this.barLargeButtonItem4, + this.btnOut, + this.btnChk, + this.btnFchk, + this.btnPrint, + this.btnHb, + this.btnIn, + this.btnLog, this.btnKG, - this.barLargeButtonItem5, this.btnRole, this.btnReport, this.btnQuery}); this.barManager1.MainMenu = this.bar2; - this.barManager1.MaxItemId = 24; + this.barManager1.MaxItemId = 26; // // bar2 // @@ -125,17 +122,17 @@ new DevExpress.XtraBars.LinkPersistInfo(this.btnEsc), new DevExpress.XtraBars.LinkPersistInfo(this.btnLoad), new DevExpress.XtraBars.LinkPersistInfo(DevExpress.XtraBars.BarLinkUserDefines.PaintStyle, this.btnDel, DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph), - new DevExpress.XtraBars.LinkPersistInfo(this.barLargeButtonItem9), - new DevExpress.XtraBars.LinkPersistInfo(this.barLargeButtonItem10), - new DevExpress.XtraBars.LinkPersistInfo(this.barLargeButtonItem1), - new DevExpress.XtraBars.LinkPersistInfo(this.barLargeButtonItem2), - new DevExpress.XtraBars.LinkPersistInfo(this.barLargeButtonItem8), - new DevExpress.XtraBars.LinkPersistInfo(this.barLargeButtonItem3), - new DevExpress.XtraBars.LinkPersistInfo(this.barLargeButtonItem4), + new DevExpress.XtraBars.LinkPersistInfo(this.btnChk), + new DevExpress.XtraBars.LinkPersistInfo(this.btnFchk), + new DevExpress.XtraBars.LinkPersistInfo(this.btnPrint), + new DevExpress.XtraBars.LinkPersistInfo(this.btnHb), + new DevExpress.XtraBars.LinkPersistInfo(this.btnOut), + new DevExpress.XtraBars.LinkPersistInfo(this.btnIn), + new DevExpress.XtraBars.LinkPersistInfo(this.btnLog), new DevExpress.XtraBars.LinkPersistInfo(this.btnKG), - new DevExpress.XtraBars.LinkPersistInfo(this.btnRole), new DevExpress.XtraBars.LinkPersistInfo(this.btnReport), - new DevExpress.XtraBars.LinkPersistInfo(this.btnQuery)}); + new DevExpress.XtraBars.LinkPersistInfo(this.btnQuery), + new DevExpress.XtraBars.LinkPersistInfo(this.btnRole)}); this.bar2.OptionsBar.MultiLine = true; this.bar2.OptionsBar.UseWholeRow = true; this.bar2.Text = "Main menu"; @@ -151,6 +148,7 @@ this.btnAdd.ItemInMenuAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 12F); this.btnAdd.ItemInMenuAppearance.Normal.Options.UseFont = true; this.btnAdd.Name = "btnAdd"; + this.btnAdd.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // // btnEdit // @@ -161,6 +159,7 @@ this.btnEdit.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); this.btnEdit.ItemAppearance.Normal.Options.UseFont = true; this.btnEdit.Name = "btnEdit"; + this.btnEdit.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // // btnSave // @@ -171,6 +170,7 @@ this.btnSave.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); this.btnSave.ItemAppearance.Normal.Options.UseFont = true; this.btnSave.Name = "btnSave"; + this.btnSave.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // // btnEsc // @@ -181,6 +181,7 @@ this.btnEsc.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); this.btnEsc.ItemAppearance.Normal.Options.UseFont = true; this.btnEsc.Name = "btnEsc"; + this.btnEsc.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // // btnLoad // @@ -191,6 +192,7 @@ this.btnLoad.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); this.btnLoad.ItemAppearance.Normal.Options.UseFont = true; this.btnLoad.Name = "btnLoad"; + this.btnLoad.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // // btnDel // @@ -201,82 +203,83 @@ this.btnDel.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); this.btnDel.ItemAppearance.Normal.Options.UseFont = true; this.btnDel.Name = "btnDel"; + this.btnDel.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // - // barLargeButtonItem9 + // btnChk // - this.barLargeButtonItem9.Caption = "瀹℃牳"; - this.barLargeButtonItem9.Id = 13; - this.barLargeButtonItem9.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.checkbox2_16x16; - this.barLargeButtonItem9.ImageOptions.LargeImage = global::Gs.DevApp.Properties.Resources.checkbox2_32x32; - this.barLargeButtonItem9.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); - this.barLargeButtonItem9.ItemAppearance.Normal.Options.UseFont = true; - this.barLargeButtonItem9.Name = "barLargeButtonItem9"; - this.barLargeButtonItem9.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; + this.btnChk.Caption = "瀹℃牳"; + this.btnChk.Id = 13; + this.btnChk.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.checkbox2_16x16; + this.btnChk.ImageOptions.LargeImage = global::Gs.DevApp.Properties.Resources.checkbox2_32x32; + this.btnChk.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); + this.btnChk.ItemAppearance.Normal.Options.UseFont = true; + this.btnChk.Name = "btnChk"; + this.btnChk.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // - // barLargeButtonItem10 + // btnFchk // - this.barLargeButtonItem10.Caption = "鍙嶅鏍�"; - this.barLargeButtonItem10.Id = 14; - this.barLargeButtonItem10.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.forcetesting_16x16; - this.barLargeButtonItem10.ImageOptions.LargeImage = global::Gs.DevApp.Properties.Resources.forcetesting_32x32; - this.barLargeButtonItem10.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); - this.barLargeButtonItem10.ItemAppearance.Normal.Options.UseFont = true; - this.barLargeButtonItem10.Name = "barLargeButtonItem10"; - this.barLargeButtonItem10.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; + this.btnFchk.Caption = "鍙嶅鏍�"; + this.btnFchk.Id = 14; + this.btnFchk.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.forcetesting_16x16; + this.btnFchk.ImageOptions.LargeImage = global::Gs.DevApp.Properties.Resources.forcetesting_32x32; + this.btnFchk.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); + this.btnFchk.ItemAppearance.Normal.Options.UseFont = true; + this.btnFchk.Name = "btnFchk"; + this.btnFchk.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // - // barLargeButtonItem1 + // btnPrint // - this.barLargeButtonItem1.Caption = "鎵撳嵃"; - this.barLargeButtonItem1.Id = 15; - this.barLargeButtonItem1.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("barLargeButtonItem1.ImageOptions.Image"))); - this.barLargeButtonItem1.ImageOptions.LargeImage = ((System.Drawing.Image)(resources.GetObject("barLargeButtonItem1.ImageOptions.LargeImage"))); - this.barLargeButtonItem1.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); - this.barLargeButtonItem1.ItemAppearance.Normal.Options.UseFont = true; - this.barLargeButtonItem1.Name = "barLargeButtonItem1"; - this.barLargeButtonItem1.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; + this.btnPrint.Caption = "鎵撳嵃"; + this.btnPrint.Id = 15; + this.btnPrint.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnPrint.ImageOptions.Image"))); + this.btnPrint.ImageOptions.LargeImage = ((System.Drawing.Image)(resources.GetObject("btnPrint.ImageOptions.LargeImage"))); + this.btnPrint.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); + this.btnPrint.ItemAppearance.Normal.Options.UseFont = true; + this.btnPrint.Name = "btnPrint"; + this.btnPrint.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // - // barLargeButtonItem2 + // btnHb // - this.barLargeButtonItem2.Caption = "鍚堝苟"; - this.barLargeButtonItem2.Id = 16; - this.barLargeButtonItem2.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("barLargeButtonItem2.ImageOptions.Image"))); - this.barLargeButtonItem2.ImageOptions.LargeImage = ((System.Drawing.Image)(resources.GetObject("barLargeButtonItem2.ImageOptions.LargeImage"))); - this.barLargeButtonItem2.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); - this.barLargeButtonItem2.ItemAppearance.Normal.Options.UseFont = true; - this.barLargeButtonItem2.Name = "barLargeButtonItem2"; - this.barLargeButtonItem2.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; + this.btnHb.Caption = "鍚堝苟"; + this.btnHb.Id = 16; + this.btnHb.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnHb.ImageOptions.Image"))); + this.btnHb.ImageOptions.LargeImage = ((System.Drawing.Image)(resources.GetObject("btnHb.ImageOptions.LargeImage"))); + this.btnHb.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); + this.btnHb.ItemAppearance.Normal.Options.UseFont = true; + this.btnHb.Name = "btnHb"; + this.btnHb.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // - // barLargeButtonItem8 + // btnOut // - this.barLargeButtonItem8.Caption = "瀵煎嚭"; - this.barLargeButtonItem8.Description = "瀵煎嚭"; - this.barLargeButtonItem8.Id = 12; - this.barLargeButtonItem8.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("barLargeButtonItem8.ImageOptions.Image"))); - this.barLargeButtonItem8.ImageOptions.LargeImage = ((System.Drawing.Image)(resources.GetObject("barLargeButtonItem8.ImageOptions.LargeImage"))); - this.barLargeButtonItem8.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); - this.barLargeButtonItem8.ItemAppearance.Normal.Options.UseFont = true; - this.barLargeButtonItem8.Name = "barLargeButtonItem8"; - this.barLargeButtonItem8.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; + this.btnOut.Caption = "瀵煎嚭"; + this.btnOut.Description = "瀵煎嚭"; + this.btnOut.Id = 12; + this.btnOut.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnOut.ImageOptions.Image"))); + this.btnOut.ImageOptions.LargeImage = ((System.Drawing.Image)(resources.GetObject("btnOut.ImageOptions.LargeImage"))); + this.btnOut.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); + this.btnOut.ItemAppearance.Normal.Options.UseFont = true; + this.btnOut.Name = "btnOut"; + this.btnOut.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // - // barLargeButtonItem3 + // btnIn // - this.barLargeButtonItem3.Caption = "瀵煎叆"; - this.barLargeButtonItem3.Id = 17; - this.barLargeButtonItem3.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("barLargeButtonItem3.ImageOptions.Image"))); - this.barLargeButtonItem3.ImageOptions.LargeImage = ((System.Drawing.Image)(resources.GetObject("barLargeButtonItem3.ImageOptions.LargeImage"))); - this.barLargeButtonItem3.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); - this.barLargeButtonItem3.ItemAppearance.Normal.Options.UseFont = true; - this.barLargeButtonItem3.Name = "barLargeButtonItem3"; - this.barLargeButtonItem3.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; + this.btnIn.Caption = "瀵煎叆"; + this.btnIn.Id = 17; + this.btnIn.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnIn.ImageOptions.Image"))); + this.btnIn.ImageOptions.LargeImage = ((System.Drawing.Image)(resources.GetObject("btnIn.ImageOptions.LargeImage"))); + this.btnIn.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); + this.btnIn.ItemAppearance.Normal.Options.UseFont = true; + this.btnIn.Name = "btnIn"; + this.btnIn.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // - // barLargeButtonItem4 + // btnLog // - this.barLargeButtonItem4.Caption = "鏃ュ織"; - this.barLargeButtonItem4.Id = 18; - this.barLargeButtonItem4.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.salesperiodlifetime_16x16; - this.barLargeButtonItem4.ImageOptions.LargeImage = global::Gs.DevApp.Properties.Resources.salesperiodlifetime_32x32; - this.barLargeButtonItem4.Name = "barLargeButtonItem4"; - this.barLargeButtonItem4.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; + this.btnLog.Caption = "鏃ュ織"; + this.btnLog.Id = 18; + this.btnLog.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.salesperiodlifetime_16x16; + this.btnLog.ImageOptions.LargeImage = global::Gs.DevApp.Properties.Resources.salesperiodlifetime_32x32; + this.btnLog.Name = "btnLog"; + this.btnLog.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // // btnKG // @@ -287,14 +290,6 @@ this.btnKG.Name = "btnKG"; this.btnKG.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // - // btnRole - // - this.btnRole.Caption = "淇濆瓨鏉冮檺"; - this.btnRole.Id = 21; - this.btnRole.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.editrangepermission_16x16; - this.btnRole.ImageOptions.LargeImage = global::Gs.DevApp.Properties.Resources.editrangepermission_32x32; - this.btnRole.Name = "btnRole"; - // // btnReport // this.btnReport.Caption = "鎶ヨ〃"; @@ -302,6 +297,7 @@ this.btnReport.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnReport.ImageOptions.Image"))); this.btnReport.Name = "btnReport"; this.btnReport.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph; + this.btnReport.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // // btnQuery // @@ -309,6 +305,16 @@ this.btnQuery.Id = 23; this.btnQuery.ImageOptions.SvgImage = global::Gs.DevApp.Properties.Resources.enablesearch; this.btnQuery.Name = "btnQuery"; + this.btnQuery.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; + // + // btnRole + // + this.btnRole.Caption = "淇濆瓨鏉冮檺"; + this.btnRole.Id = 21; + this.btnRole.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.editrangepermission_16x16; + this.btnRole.ImageOptions.LargeImage = global::Gs.DevApp.Properties.Resources.editrangepermission_32x32; + this.btnRole.Name = "btnRole"; + this.btnRole.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // // barDockControlTop // @@ -316,7 +322,7 @@ this.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top; this.barDockControlTop.Location = new System.Drawing.Point(0, 0); this.barDockControlTop.Manager = this.barManager1; - this.barDockControlTop.Size = new System.Drawing.Size(1119, 94); + this.barDockControlTop.Size = new System.Drawing.Size(1293, 74); // // barDockControlBottom // @@ -324,21 +330,15 @@ this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom; this.barDockControlBottom.Location = new System.Drawing.Point(0, 77); this.barDockControlBottom.Manager = this.barManager1; - this.barDockControlBottom.Size = new System.Drawing.Size(1119, 0); + this.barDockControlBottom.Size = new System.Drawing.Size(1293, 0); // // barDockControlRight // this.barDockControlRight.CausesValidation = false; this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right; - this.barDockControlRight.Location = new System.Drawing.Point(1119, 94); + this.barDockControlRight.Location = new System.Drawing.Point(1293, 74); this.barDockControlRight.Manager = this.barManager1; - this.barDockControlRight.Size = new System.Drawing.Size(0, 0); - // - // barLargeButtonItem5 - // - this.barLargeButtonItem5.Caption = "鍒楄〃"; - this.barLargeButtonItem5.Id = 20; - this.barLargeButtonItem5.Name = "barLargeButtonItem5"; + this.barDockControlRight.Size = new System.Drawing.Size(0, 3); // // ToolBarMenu // @@ -349,7 +349,7 @@ this.Controls.Add(this.barDockControlBottom); this.Controls.Add(this.barDockControlTop); this.Name = "ToolBarMenu"; - this.Size = new System.Drawing.Size(1119, 77); + this.Size = new System.Drawing.Size(1293, 77); ((System.ComponentModel.ISupportInitialize)(this.barManager1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -368,18 +368,17 @@ private DevExpress.XtraBars.BarLargeButtonItem btnSave; private DevExpress.XtraBars.BarLargeButtonItem btnEsc; private DevExpress.XtraBars.BarLargeButtonItem btnLoad; - private DevExpress.XtraBars.BarLargeButtonItem barLargeButtonItem8; - private DevExpress.XtraBars.BarLargeButtonItem barLargeButtonItem9; - private DevExpress.XtraBars.BarLargeButtonItem barLargeButtonItem10; + private DevExpress.XtraBars.BarLargeButtonItem btnOut; + private DevExpress.XtraBars.BarLargeButtonItem btnChk; + private DevExpress.XtraBars.BarLargeButtonItem btnFchk; private DevExpress.XtraBars.BarDockControl barDockControlTop; private DevExpress.XtraBars.BarDockControl barDockControlBottom; private DevExpress.XtraBars.BarDockControl barDockControlRight; - private DevExpress.XtraBars.BarLargeButtonItem barLargeButtonItem1; - private DevExpress.XtraBars.BarLargeButtonItem barLargeButtonItem2; - private DevExpress.XtraBars.BarLargeButtonItem barLargeButtonItem3; - private DevExpress.XtraBars.BarLargeButtonItem barLargeButtonItem4; + private DevExpress.XtraBars.BarLargeButtonItem btnPrint; + private DevExpress.XtraBars.BarLargeButtonItem btnHb; + private DevExpress.XtraBars.BarLargeButtonItem btnIn; + private DevExpress.XtraBars.BarLargeButtonItem btnLog; private DevExpress.XtraBars.BarLargeButtonItem btnKG; - private DevExpress.XtraBars.BarLargeButtonItem barLargeButtonItem5; private DevExpress.XtraBars.BarLargeButtonItem btnRole; private DevExpress.XtraBars.BarLargeButtonItem btnReport; private DevExpress.XtraBars.BarLargeButtonItem btnQuery; diff --git a/DevApp/Gs.DevApp/UserControl/ToolBarMenu.cs b/DevApp/Gs.DevApp/UserControl/ToolBarMenu.cs index de3d36b..9fc2707 100644 --- a/DevApp/Gs.DevApp/UserControl/ToolBarMenu.cs +++ b/DevApp/Gs.DevApp/UserControl/ToolBarMenu.cs @@ -14,7 +14,7 @@ public partial class ToolBarMenu : DevExpress.XtraEditors.XtraUserControl { public bool isSetBtn { get; set; } - public List<string> actions { get; set; } + public List<string> actions { get; } /// <summary> /// 鏂板 /// </summary> @@ -79,16 +79,18 @@ this.btnRole.ItemClick += BtnRole_ItemClick; this.btnReport.ItemClick += BtnReport_ItemClick; this.btnQuery.ItemClick += BtnQuery_ItemClick; - initialization(); List<string> lst = new List<string>(); foreach (BarItem item in barManager1.Items) { if (item is BarLargeButtonItem largeButtonItem) { - lst.Add(item.Caption); + if (!string.IsNullOrEmpty(item.Caption)) + lst.Add(item.Caption); } } this.actions = lst; + //鍒濆鍖栨寜閽姸鎬� + // initialization(); } private void BtnQuery_ItemClick(object sender, ItemClickEventArgs e) @@ -106,7 +108,9 @@ btnReportClick(this, e); } } - + /// <summary> + /// 鍒濆鍖栨寜閽姸鎬� + /// </summary> protected override void OnCreateControl() { base.OnCreateControl(); @@ -115,19 +119,18 @@ getNamespace(); } } - private void initialization() - { - List<string> lst = new List<string>(); - lst.Add(btnAdd.Name); - lst.Add(btnEdit.Name); - lst.Add(btnLoad.Name); - lst.Add(btnDel.Name); - lst.Add(btnRole.Name); - lst.Add(btnReport.Name); - lst.Add(btnQuery.Name); - setBtn(lst); - - } + //private void initialization() + //{ + // List<string> lst = new List<string>(); + // //lst.Add(btnAdd.Name); + // //lst.Add(btnEdit.Name); + // //lst.Add(btnLoad.Name); + // //lst.Add(btnDel.Name); + // //lst.Add(btnRole.Name); + // //lst.Add(btnReport.Name); + // //lst.Add(btnQuery.Name); + // setBtn(lst); + //} private void BtnEsc_ItemClick(object sender, ItemClickEventArgs e) { @@ -139,7 +142,7 @@ lst.Add(btnLoad.Name); lst.Add(btnDel.Name); lst.Add(btnRole.Name); - setBtn(lst); + _enabledBtn(lst); if (btnEscClick != null) { btnEscClick(this, e); @@ -166,7 +169,7 @@ lst.Add(btnAdd.Name); lst.Add(btnEdit.Name); lst.Add(btnEsc.Name); - setBtn(lst); + _enabledBtn(lst); } } } @@ -190,7 +193,7 @@ lst.Add(btnSave.Name); lst.Add(btnEsc.Name); - setBtn(lst); + _enabledBtn(lst); if (btnEdtClick != null) { btnEdtClick(this, e); @@ -215,7 +218,7 @@ List<string> lst = new List<string>(); lst.Add(btnSave.Name); lst.Add(btnEsc.Name); - setBtn(lst); + _enabledBtn(lst); if (btnAddClick != null) { btnAddClick(this, e); @@ -234,7 +237,7 @@ btnRoleClick(this, e); } } - private void setBtn(List<string> lstBtn) + private void _enabledBtn(List<string> lstBtn) { foreach (BarItem item in barManager1.Items) { @@ -249,7 +252,7 @@ } /// <summary> - /// 鏍规嵁鍛藉悕绌洪棿锛岃鍙栬绐椾綋涓嬮潰鐨勬寜閽泦鍚� + /// 鏍规嵁鍛藉悕绌洪棿鍜屾潈闄愶紝璇诲彇璇ョ獥浣撲笅闈㈢殑鎸夐挳闆嗗悎 /// </summary> private void getNamespace() { @@ -277,24 +280,79 @@ strReturn = UtilityHelper.HttpPost("", "MenuAction/GetListByUserOrgSpace", JsonConvert.SerializeObject(_obj)); ReturnModel<DataTable> dd = UtilityHelper.GetNoPageTableByJson(strReturn); DataTable dt = dd.rtnData; + List<string> _enabledList = new List<string>(); foreach (BarItem item in barManager1.Items) { - if (item.Caption == "鍙栨秷" || item.Caption == "鍒锋柊" || item.Caption == "淇濆瓨") + ///鍏锋湁鑱斿姩鍏崇郴鐨勬寜閽�(澧炲姞)锛� + if (item.Caption == "澧炲姞") + { + bool ld1 = dt.AsEnumerable().Any(row => row.Field<string>("name") == "澧炲姞" + //|| row.Field<string>("name") == "淇敼" + ); + if (ld1 == true) + { + btnEsc.Visibility = btnSave.Visibility = btnLoad.Visibility = BarItemVisibility.Always; + btnAdd.Visibility = BarItemVisibility.Always; + _enabledList.Add(item.Name); + continue; + } + } + ///鍏锋湁鑱斿姩鍏崇郴鐨勬寜閽�(淇敼)锛� + if (item.Caption == "淇敼") + { + bool ld1 = dt.AsEnumerable().Any(row => row.Field<string>("name") == "淇敼" + ); + if (ld1 == true) + { + btnEsc.Visibility = btnSave.Visibility = btnLoad.Visibility = BarItemVisibility.Always; + btnEdit.Visibility = BarItemVisibility.Always; + _enabledList.Add(item.Name); + continue; + } + } + ///鍏锋湁鑱斿姩鍏崇郴鐨勬寜閽�(鏌ヨ)锛� + bool ld2 = dt.AsEnumerable().Any(row => row.Field<string>("name") == "鏌ヨ" + ); + if (ld2 == true) + { + if (item.Caption == "鍒锋柊") + { + item.Visibility = BarItemVisibility.Always; + //鍑嗗鍚敤 + _enabledList.Add(item.Name); + continue; + } + } + //鎸夐挳鏄惁鍦ㄦ潈闄愯〃涓� + bool exists = dt.AsEnumerable().Any(row => row.Field<string>("name") == item.Caption); + if (exists == true) { item.Visibility = BarItemVisibility.Always; - continue; + //鍑嗗鍚敤 + string _btnName = _FindBarLargeButtonItemByCaption(item.Caption); + if (!string.IsNullOrEmpty(_btnName)) + _enabledList.Add(_btnName); } - bool exists = dt.AsEnumerable().Any(row => row.Field<string>("name") == item.Caption); - if (exists == false) - item.Visibility = BarItemVisibility.Never; - else - item.Visibility = BarItemVisibility.Always; } + _enabledBtn(_enabledList); } catch (Exception ex) { ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } } + + + private string _FindBarLargeButtonItemByCaption(string caption) + { + foreach (BarItem item in barManager1.Items) + { + if (item is BarLargeButtonItem largeButtonItem && largeButtonItem.Caption == caption) + { + return largeButtonItem.Name; + } + } + return null; + } } } diff --git a/DevApp/Gs.DevApp/UserControl/ToolBarMenu.resx b/DevApp/Gs.DevApp/UserControl/ToolBarMenu.resx index e4e9a69..23bbc9b 100644 --- a/DevApp/Gs.DevApp/UserControl/ToolBarMenu.resx +++ b/DevApp/Gs.DevApp/UserControl/ToolBarMenu.resx @@ -187,7 +187,7 @@ f+6EnGfdugKwnQr2BIeDYf6s2JhN/P3hT7WuAGyDQf4foiES/RvDCa9FOGI5gAAAAABJRU5ErkJggg== </value> </data> - <data name="barLargeButtonItem1.ImageOptions.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <data name="btnPrint.ImageOptions.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABx0RVh0VGl0 bGUAUHJpbnRMYXlvdXRWaWV3O1ByaW50OyLF4Y0AAAM1SURBVDhPVZP9Txt1HMfvfzAx/uA/5K86dQ7r @@ -207,7 +207,7 @@ 9AyOWcpXB3xcsY/c+xvJRDliKSBA7QAAAABJRU5ErkJggg== </value> </data> - <data name="barLargeButtonItem1.ImageOptions.LargeImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <data name="btnPrint.ImageOptions.LargeImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABx0RVh0VGl0 bGUAUHJpbnRMYXlvdXRWaWV3O1ByaW50OyLF4Y0AAAjSSURBVFhHfZfpU5XnGcbP/9Cm0+l0JtPOZJrp @@ -251,7 +251,7 @@ 7cZzfWJH2Xdv/w/5uw8JIJWYLQAAAABJRU5ErkJggg== </value> </data> - <data name="barLargeButtonItem2.ImageOptions.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <data name="btnHb.ImageOptions.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAbdEVYdFRpdGxlAE1vZGVsO0NvcHk7Q29weU1vZGVs @@ -268,7 +268,7 @@ zz8CKycyKpQrsLWW0D6V6jdzUIrq8TztCAAAAABJRU5ErkJggg== </value> </data> - <data name="barLargeButtonItem2.ImageOptions.LargeImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <data name="btnHb.ImageOptions.LargeImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAbdEVYdFRpdGxlAE1vZGVsO0NvcHk7Q29weU1vZGVs @@ -311,7 +311,7 @@ RU5ErkJggg== </value> </data> - <data name="barLargeButtonItem8.ImageOptions.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <data name="btnOut.ImageOptions.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAB10RVh0VGl0 bGUARXhwb3J0O1hscztFeHBvcnRUb1hscztMoJn+AAACZklEQVQ4T2WTWWsTYRSGszdtg1r/Rk3Tmv4S @@ -328,7 +328,7 @@ SUVORK5CYII= </value> </data> - <data name="barLargeButtonItem8.ImageOptions.LargeImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <data name="btnOut.ImageOptions.LargeImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAB10RVh0VGl0 bGUARXhwb3J0O1hscztFeHBvcnRUb1hscztMoJn+AAAIXUlEQVRYR8WXeVSU1xnG2SGmSkia9Nictqfp @@ -370,7 +370,7 @@ 5gfi7zm7378N/3+C2X8Bg3DBnOf3rOsAAAAASUVORK5CYII= </value> </data> - <data name="barLargeButtonItem3.ImageOptions.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <data name="btnIn.ImageOptions.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAA50RVh0VGl0 bGUAWGxzO1NlbmRxQ3oaAAACiElEQVQ4T3WQ2U8TYRTFhxYKuP4hCBXhD/HBV5cXFawkqJgCXYSyRCWF @@ -387,7 +387,7 @@ xSRFBgDuD6syoJrXuXr4AAAAAElFTkSuQmCC </value> </data> - <data name="barLargeButtonItem3.ImageOptions.LargeImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <data name="btnIn.ImageOptions.LargeImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAA50RVh0VGl0 bGUAWGxzO1NlbmRxQ3oaAAAH5ElEQVRYR8VWaVDU5x3mBm2EmGum7ed+iYlGoYlJj+k1TjrtdNIvnXb6 -- Gitblit v1.9.3