From cc89c6b8112cfccd270951a9177c6ac0e5307d79 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期二, 29 十月 2024 17:12:12 +0800
Subject: [PATCH] 优化颜色分级配置

---
 Desktop/HStation.DeskTop.Xhs.Main/GuideMain.cs |  123 ++++++++++++++++++++++++++--------------
 1 files changed, 80 insertions(+), 43 deletions(-)

diff --git a/Desktop/HStation.DeskTop.Xhs.Main/GuideMain.cs b/Desktop/HStation.DeskTop.Xhs.Main/GuideMain.cs
index 4306ded..5eda6d2 100644
--- a/Desktop/HStation.DeskTop.Xhs.Main/GuideMain.cs
+++ b/Desktop/HStation.DeskTop.Xhs.Main/GuideMain.cs
@@ -3,9 +3,10 @@
 using DevExpress.XtraBars.Ribbon;
 using DevExpress.XtraEditors;
 using HStation.WinFrmUI;
+using HStation.WinFrmUI.Auth;
 using HStation.WinFrmUI.Basic;
+using HStation.WinFrmUI.Organize;
 using HStation.WinFrmUI.Xhs.PumpProduct;
-using HStation.WinFrmUI.Xhs.PumpProject;
 using System;
 using System.Drawing;
 using System.IO;
@@ -96,6 +97,13 @@
                     }
                     break;
 
+                case "SystemOrganize":
+                    {
+                        popSystemOrganize.MinWidth = buttonInfo.Bounds.Width;
+                        popSystemOrganize.ShowPopup(point);
+                    }
+                    break;
+
                 case "SystemAuthority":
                     {
                         popSystemAuthority.MinWidth = buttonInfo.Bounds.Width;
@@ -159,17 +167,17 @@
         /// </summary>
         private void barBtnProject_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
-            var guid = new SurfaceGuid()
+            var guid = new PageGuid()
             {
                 Function = "椤圭洰绠$悊",
-                Modular = eModular.Basic
+                Modular = ""
             };
             if (!IsExistPage(guid, true))
             {
-                var page = new XhsProjectMainPanel();
-                page.PageTitle.Caption = guid.Function;
-                page.SurfaceGuid = guid;
-                CreatePage(page, guid);
+                /*     var page = new XhsProjectMainPanel();
+                     page.PageTitle.Caption = guid.Function;
+                     page.PageGuid = guid;
+                     CreatePage(page, guid);*/
             }
         }
 
@@ -178,16 +186,16 @@
         /// </summary>
         private void barBtnPumpManage_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
-            var guid = new SurfaceGuid()
+            var guid = new PageGuid()
             {
                 Function = "娉电鐞�",
-                Modular = eModular.Basic
+                Modular = ""
             };
             if (!IsExistPage(guid, true))
             {
                 var page = new PumpProductMainPanel();
                 page.PageTitle.Caption = guid.Function;
-                page.SurfaceGuid = guid;
+                page.PageGuid = guid;
                 CreatePage(page, guid);
             }
         }
@@ -197,16 +205,16 @@
         /// </summary>
         private void barButtonTypeManage_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
-            var guid = new SurfaceGuid()
+            var guid = new PageGuid()
             {
                 Function = "绫诲瀷绠$悊",
-                Modular = eModular.Basic
+                Modular = ""
             };
             if (!IsExistPage(guid, true))
             {
                 var page = new SysTypeManageMainPanel();
                 page.PageTitle.Caption = guid.Function;
-                page.SurfaceGuid = guid;
+                page.PageGuid = guid;
                 CreatePage(page, guid);
             }
         }
@@ -216,16 +224,16 @@
         /// </summary>
         private void BtnCatlogManage_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
-            var guid = new SurfaceGuid()
+            var guid = new PageGuid()
             {
                 Function = "鍒嗙被绠$悊",
-                Modular = eModular.Basic
+                Modular = ""
             };
             if (!IsExistPage(guid, true))
             {
                 var page = new SysCatalogManageMainPanel();
                 page.PageTitle.Caption = guid.Function;
-                page.SurfaceGuid = guid;
+                page.PageGuid = guid;
                 CreatePage(page, guid);
             }
         }
@@ -235,17 +243,34 @@
         /// </summary>
         private void BtnPropManage_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
-            var guid = new SurfaceGuid()
+            var guid = new PageGuid()
             {
                 Function = "灞炴�х鐞�",
-                Modular = eModular.Basic
+                Modular = ""
             };
             if (!IsExistPage(guid, true))
             {
                 var page = new SysPropManageMainPanel();
                 page.PageTitle.Caption = guid.Function;
-                page.SurfaceGuid = guid;
+                page.PageGuid = guid;
                 CreatePage(page, guid);
+            }
+        }
+
+        //瑙掕壊绠$悊
+        private void BarBtnRoleManage_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        {
+            var guid = new PageGuid()
+            {
+                Function = "瑙掕壊绠$悊",
+                Modular = ""
+            };
+            if (!IsExistPage(guid, true))
+            {
+                /* var page = new MenuMgrMainPanel();
+                 page.PageTitle.Caption = guid.Function;
+                 page.PageGuid = guid;
+                 CreatePage(page, guid);*/
             }
         }
 
@@ -300,12 +325,24 @@
         }
 
         /// <summary>
-        /// 鐢ㄦ埛绠$悊
+        /// 鍛樺伐绠$悊
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
         private void barBtnUser_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
+            var guid = new PageGuid()
+            {
+                Function = "鍛樺伐绠$悊",
+                Modular = ""
+            };
+            if (!IsExistPage(guid, true))
+            {
+                var page = new EmployeeMgrMainPanel();
+                page.PageTitle.Caption = guid.Function;
+                page.PageGuid = guid;
+                CreatePage(page, guid);
+            }
         }
 
         /// <summary>
@@ -334,7 +371,7 @@
         }
 
         //鏄惁瀛樺湪Page
-        private bool IsExistPage(WinFrmUI.SurfaceGuid sguid, bool isActivateDoc)
+        private bool IsExistPage(PageGuid sguid, bool isActivateDoc)
         {
             if (sguid == null)
                 return false;
@@ -345,9 +382,9 @@
                 {
                     if (doc.Tag != null)
                     {
-                        if (doc.Tag is WinFrmUI.SurfaceGuid)
+                        if (doc.Tag is PageGuid)
                         {
-                            if ((doc.Tag as WinFrmUI.SurfaceGuid).ToString() == sguid.ToString())
+                            if ((doc.Tag as PageGuid).ToString() == sguid.ToString())
                             {
                                 if (isActivateDoc)
                                     this.tabbedView1.Controller.Activate(doc);
@@ -362,19 +399,19 @@
         }
 
         //鏇存柊鏁版嵁
-        private void RefreshPageData(WinFrmUI.SurfaceGuid sguid)
+        private void RefreshPageData(PageGuid sguid)
         {
             if (sguid == null)
                 return;
 
             if (this.tabbedView1.Documents != null && this.tabbedView1.Documents.Count > 0)
             {
-                var doc = this.tabbedView1.Documents.ToList().Find(x => x.Tag != null && x.Tag is WinFrmUI.SurfaceGuid && (x.Tag as WinFrmUI.SurfaceGuid).ToString() == sguid.ToString());
+                var doc = this.tabbedView1.Documents.ToList().Find(x => x.Tag != null && x.Tag is PageGuid && (x.Tag as PageGuid).ToString() == sguid.ToString());
                 if (doc != null)
                 {
-                    if (doc.Control is WinFrmUI.DocumentPage page)
+                    if (doc.Control is DocumentPage page)
                     {
-                        page.RefreshDataSource();
+                        page.RefreshData();
                     }
                     return;
                 }
@@ -382,21 +419,21 @@
         }
 
         //鏇存柊PageTitle
-        private void UpdatePageTitle(WinFrmUI.SurfaceGuid sguid, WinFrmUI.PageTitle title)
+        private void UpdatePageTitle(PageGuid sguid, PageTitle title)
         {
             if (sguid == null || title == null)
                 return;
 
             if (this.tabbedView1.Documents != null && this.tabbedView1.Documents.Count > 0)
             {
-                var doc = this.tabbedView1.Documents.ToList().Find(x => x.Tag != null && x.Tag is WinFrmUI.SurfaceGuid && (x.Tag as WinFrmUI.SurfaceGuid).ToString() == sguid.ToString());
+                var doc = this.tabbedView1.Documents.ToList().Find(x => x.Tag != null && x.Tag is PageGuid && (x.Tag as PageGuid).ToString() == sguid.ToString());
                 if (doc != null)
                 {
                     doc.Caption = title.Caption;
                     doc.ImageOptions.Image = title.HeaderImage;
                     doc.ImageOptions.SvgImage = title.HeaderSvgImage;
                     doc.ImageOptions.SvgImageSize = title.SvgImageSize;
-                    if (doc.Control is WinFrmUI.DocumentPage page)
+                    if (doc.Control is DocumentPage page)
                     {
                         page.PageTitle = title;
                     }
@@ -406,11 +443,11 @@
         }
 
         //鍒涘缓Page
-        private bool CreatePage(WinFrmUI.DocumentPage page, WinFrmUI.SurfaceGuid sguid)
+        private bool CreatePage(DocumentPage page, PageGuid sguid)
         {
             if (page == null || sguid == null)
                 return false;
-            page.SurfaceGuid = sguid;
+            page.PageGuid = sguid;
             page.Dock = DockStyle.Fill;
             page.IsExistPageEvent += IsExistPage;
             page.CreatePageEvent += CreatePage;
@@ -433,7 +470,7 @@
             }
             else
             {
-                doc.Caption = page.SurfaceGuid?.Function;
+                doc.Caption = page.PageGuid?.Function;
             }
             doc.Tag = sguid;
             this.tabbedView1.EndUpdate();
@@ -445,21 +482,21 @@
         }
 
         //鍏抽棴Page
-        private void ClosePage(WinFrmUI.SurfaceGuid sguid)
+        private void ClosePage(PageGuid sguid)
         {
             if (this.tabbedView1.Documents != null && this.tabbedView1.Documents.Count > 0)
             {
-                var doc = this.tabbedView1.Documents.ToList().Find(x => x.Tag != null && x.Tag is WinFrmUI.SurfaceGuid && (x.Tag as WinFrmUI.SurfaceGuid).ToString() == sguid.ToString());
+                var doc = this.tabbedView1.Documents.ToList().Find(x => x.Tag != null && x.Tag is PageGuid && (x.Tag as PageGuid).ToString() == sguid.ToString());
                 if (doc != null)
                 {
-                    var page = doc.Control as WinFrmUI.DocumentPage;
+                    var page = doc.Control as DocumentPage;
                     this.tabbedView1.Controller.Close(doc);//浼氳Е鍙戞鍦ㄥ叧闂拰鍏抽棴浜嬩欢
                 }
             }
         }
 
         //鏌ユ壘page
-        private WinFrmUI.DocumentPage FindPage(WinFrmUI.SurfaceGuid sguid, bool isActiveDoc)
+        private DocumentPage FindPage(PageGuid sguid, bool isActiveDoc)
         {
             if (sguid == null)
                 return default;
@@ -472,7 +509,7 @@
                 {
                     if (isActiveDoc)
                         this.tabbedView1.Controller.Activate(doc);
-                    if (doc.Control is WinFrmUI.DocumentPage page)
+                    if (doc.Control is DocumentPage page)
                     {
                         return page;
                     }
@@ -490,16 +527,16 @@
 
         private void GuideMain_Load(object sender, EventArgs e)
         {
-            var guid = new SurfaceGuid()
+            var guid = new PageGuid()
             {
-                Function = "椤圭洰绠$悊",
-                Modular = eModular.Basic
+                Function = "椤圭洰鎬昏",
+                Modular = ""
             };
             if (!IsExistPage(guid, true))
             {
-                var page = new XhsProjectMainPanel();
+                var page = new HomeXhsProjectPage_Bak();
                 page.PageTitle.Caption = guid.Function;
-                page.SurfaceGuid = guid;
+                page.PageGuid = guid;
                 CreatePage(page, guid);
             }
         }

--
Gitblit v1.9.3