From 0404a7124d87ef965a1dcc4c22d9ff10541fa63f Mon Sep 17 00:00:00 2001
From: Shuxia Ning <NingShuxia0927@outlook.com>
Date: 星期二, 12 十一月 2024 12:11:58 +0800
Subject: [PATCH] 创建方案

---
 Desktop/HStation.DeskTop.Xhs.Main/GuideMain.cs |  172 ++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 144 insertions(+), 28 deletions(-)

diff --git a/Desktop/HStation.DeskTop.Xhs.Main/GuideMain.cs b/Desktop/HStation.DeskTop.Xhs.Main/GuideMain.cs
index e15dd11..5eda6d2 100644
--- a/Desktop/HStation.DeskTop.Xhs.Main/GuideMain.cs
+++ b/Desktop/HStation.DeskTop.Xhs.Main/GuideMain.cs
@@ -3,6 +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 System;
 using System.Drawing;
 using System.IO;
@@ -93,6 +97,13 @@
                     }
                     break;
 
+                case "SystemOrganize":
+                    {
+                        popSystemOrganize.MinWidth = buttonInfo.Bounds.Width;
+                        popSystemOrganize.ShowPopup(point);
+                    }
+                    break;
+
                 case "SystemAuthority":
                     {
                         popSystemAuthority.MinWidth = buttonInfo.Bounds.Width;
@@ -156,17 +167,110 @@
         /// </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 XhsProjectListPage();
+                /*     var page = new XhsProjectMainPanel();
+                     page.PageTitle.Caption = guid.Function;
+                     page.PageGuid = guid;
+                     CreatePage(page, guid);*/
+            }
+        }
+
+        /// <summary>
+        /// 娉电鐞�
+        /// </summary>
+        private void barBtnPumpManage_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        {
+            var guid = new PageGuid()
+            {
+                Function = "娉电鐞�",
+                Modular = ""
+            };
+            if (!IsExistPage(guid, true))
+            {
+                var page = new PumpProductMainPanel();
                 page.PageTitle.Caption = guid.Function;
-                page.SurfaceGuid = guid;
+                page.PageGuid = guid;
                 CreatePage(page, guid);
+            }
+        }
+
+        /// <summary>
+        /// 绫诲瀷绠$悊
+        /// </summary>
+        private void barButtonTypeManage_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        {
+            var guid = new PageGuid()
+            {
+                Function = "绫诲瀷绠$悊",
+                Modular = ""
+            };
+            if (!IsExistPage(guid, true))
+            {
+                var page = new SysTypeManageMainPanel();
+                page.PageTitle.Caption = guid.Function;
+                page.PageGuid = guid;
+                CreatePage(page, guid);
+            }
+        }
+
+        /// <summary>
+        /// 鍒嗙被绠$悊
+        /// </summary>
+        private void BtnCatlogManage_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        {
+            var guid = new PageGuid()
+            {
+                Function = "鍒嗙被绠$悊",
+                Modular = ""
+            };
+            if (!IsExistPage(guid, true))
+            {
+                var page = new SysCatalogManageMainPanel();
+                page.PageTitle.Caption = guid.Function;
+                page.PageGuid = guid;
+                CreatePage(page, guid);
+            }
+        }
+
+        /// <summary>
+        /// 灞炴�х鐞�
+        /// </summary>
+        private void BtnPropManage_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        {
+            var guid = new PageGuid()
+            {
+                Function = "灞炴�х鐞�",
+                Modular = ""
+            };
+            if (!IsExistPage(guid, true))
+            {
+                var page = new SysPropManageMainPanel();
+                page.PageTitle.Caption = guid.Function;
+                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);*/
             }
         }
 
@@ -221,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>
@@ -255,7 +371,7 @@
         }
 
         //鏄惁瀛樺湪Page
-        private bool IsExistPage(WinFrmUI.SurfaceGuid sguid, bool isActivateDoc)
+        private bool IsExistPage(PageGuid sguid, bool isActivateDoc)
         {
             if (sguid == null)
                 return false;
@@ -266,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);
@@ -283,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;
                 }
@@ -303,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;
                     }
@@ -327,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;
@@ -354,7 +470,7 @@
             }
             else
             {
-                doc.Caption = page.SurfaceGuid?.Function;
+                doc.Caption = page.PageGuid?.Function;
             }
             doc.Tag = sguid;
             this.tabbedView1.EndUpdate();
@@ -366,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;
@@ -393,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;
                     }
@@ -411,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 XhsProjectListPage();
+                var page = new HomeXhsProjectPage_Bak();
                 page.PageTitle.Caption = guid.Function;
-                page.SurfaceGuid = guid;
+                page.PageGuid = guid;
                 CreatePage(page, guid);
             }
         }

--
Gitblit v1.9.3