From bc0ed5b6cfda6c72c06f451b77da8518c41ab210 Mon Sep 17 00:00:00 2001
From: duheng <2286773002@qq.com>
Date: 星期四, 20 三月 2025 16:16:03 +0800
Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0

---
 Desktop/PBS.Desktop/MainForm.cs |  151 +++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 111 insertions(+), 40 deletions(-)

diff --git a/Desktop/PBS.Desktop/MainForm.cs b/Desktop/PBS.Desktop/MainForm.cs
index 9e9ad7b..22546f7 100644
--- a/Desktop/PBS.Desktop/MainForm.cs
+++ b/Desktop/PBS.Desktop/MainForm.cs
@@ -11,14 +11,12 @@
 using HStation.WinFrmUI.Basic;
 using HStation.WinFrmUI.Dict;
 using IBox.WinFrmUI;
-using NPOI.SS.Formula.Functions;
 using PBS.WinFrmUI;
+using PBS.WinFrmUI.Box;
 using PBS.WinFrmUI.DataAnalysis;
 using PBS.WinFrmUI.Hydro;
 using Yw.WinFrmUI;
 using Yw.WinFrmUI.Page;
-using PBS.Vmo;
-using PBS.WinFrmUI.Box;
 
 namespace PBS.Desktop
 {
@@ -162,6 +160,7 @@
             {
                 pguid = this.tabbedView1.ActiveDocument.Tag as PageGuid;
             }
+
             SelectModular(tag, pguid);
         }
 
@@ -186,8 +185,13 @@
             //if (!IsExistPage(guid, true))
             //{
             //}
-
-            SelectModular("BasicData");
+            var pageGuid = new PageGuid()
+            {
+                Modular = "Home",
+                MoudingType = eMoudingType.Tab,
+                Function = "MapInfo",
+            };
+            SelectModular("Home", pageGuid);
         }
 
         //界面正在退出时确认
@@ -539,27 +543,6 @@
                     }
                 }
 
-                /*  //智能硬件
-                  if (modular == "SmartHardware")
-                  {
-                      var guid = new PageGuid()
-                      {
-                          Modular = "SmartHardware",
-                          MoudingType = eMoudingType.Tab,
-                          Function = "IBox",
-                      };
-                          if (!IsExistPage(guid, true))
-                          {
-                              var ibox = IBoxDataHelper.GetData();
-                              var page = new IBoxForm(ibox);
-                              page.PageGuid = guid;
-                              page.PageTitle.Caption = "智能硬件";
-                              page.PageTitle.HeaderSvgImage = svgImgItem32[4];
-                              page.PageTitle.SvgImageSize = new Size(18, 18);
-                              CreatePage(page, guid);
-                          }
-                  }*/
-
                 //初始功能列表
                 this.accordionControlFunction.Elements.Clear();
                 var list = GetAccordionElementList(modular);
@@ -569,6 +552,14 @@
                     {
                         var accEle = GetAccordionControlElement(element);
                         this.accordionControlFunction.Elements.Add(accEle);
+                    }
+
+                    foreach (var element in list)
+                    {
+                        if (element.IsNormallyOpen && !IsExistPage(element.PageGuid, false))
+                        {
+                            element.Click.Invoke();
+                        }
                     }
                 }
                 _sel_modular = modular;
@@ -631,6 +622,10 @@
                         ctrl_ele.OwnerElement.Expanded = true;
                         this.accordionControlFunction.Refresh();
                     }
+                    //if (!IsExistPage(pguid, true))
+                    //{
+                    //    ele.Click.Invoke();
+                    //}
                     return true;
                 }
                 else
@@ -647,6 +642,8 @@
 
             return false;
         }
+
+        private bool _ibox_status = false;
 
         //获取
         private List<AccordionElement> GetAccordionElementList(string modular)
@@ -1437,6 +1434,12 @@
                         {
                             if (!IsExistPage(guid, true))
                             {
+                                var page = new ModelTemplatePage();
+                                page.PageGuid = guid;
+                                page.PageTitle.Caption = caption;
+                                page.PageTitle.HeaderSvgImage = svg;
+                                page.PageTitle.SvgImageSize = size;
+                                CreatePage(page, guid);
                             }
                         });
                         var rapidModeling = Get("快速建模", new PageGuid()
@@ -1517,6 +1520,23 @@
 
                 case "DataAnalysis":
                     {
+                        var analysis = Get("能耗分析", new PageGuid()
+                        {
+                            Modular = "DataAnalysis",
+                            MoudingType = eMoudingType.Tab,
+                            Function = "EnergyAnalysis",
+                        }, svgImgItem32[4], new Size(18, 18), (caption, guid, svg, size) =>
+                        {
+                            if (!IsExistPage(guid, true))
+                            {
+                                var page = new EnergyAnalysis();
+                                page.PageGuid = guid;
+                                page.PageTitle.Caption = caption;
+                                page.PageTitle.HeaderSvgImage = svg;
+                                page.PageTitle.SvgImageSize = size;
+                                CreatePage(page, guid);
+                            }
+                        });
                         var analysis1 = Get("流量压力比对分析", new PageGuid()
                         {
                             Modular = "DataAnalysis",
@@ -1552,7 +1572,7 @@
                                 CreatePage(page, guid);
                             }
                         });
-
+                        list.Add(analysis);
                         list.Add(analysis1);
                         list.Add(analysis2);
                     }
@@ -1571,6 +1591,7 @@
                         }, svgImgItem32[4], new Size(18, 18), (caption, guid, svg, size) =>
                         {
                             var dlg = new PBS.WinFrmUI.Box.ChoiceFacilityDlg();
+                            dlg.SetDataSource();
                             dlg.VisibleChanged += (bol) =>
                             {
                                 accordionElement_Facility.Enable = bol;
@@ -1579,16 +1600,35 @@
                                     foreach (var ele in item.Elements)
                                     {
                                         ele.Enable = true;
+                                        _ibox_status = true;
                                     }
                                 }
                             };
                             dlg.ShowDialog();
                         });
+                        AccordionElement accordionElement_IboxInfo = new();
+                        accordionElement_IboxInfo = Get("硬件详情", new PageGuid()
+                        {
+                            Modular = "SmartHardware",
+                            MoudingType = eMoudingType.Tab,
+                            Function = "IBoxInfo",
+                        }, svgImgItem32[4], new Size(18, 18), (caption, guid, svg, size) =>
+                        {
+                            if (!IsExistPage(guid, true))
+                            {
+                                var page = new IBoxInfoMgr();
+                                page.PageGuid = guid;
+                                page.PageTitle.Caption = caption;
+                                page.PageTitle.HeaderSvgImage = svg;
+                                page.PageTitle.SvgImageSize = size;
+                                CreatePage(page, guid);
+                            }
+                        }, true);
 
                         var accordionElement_Monitor = new AccordionElement()
                         {
                             Id = "monitor",
-                            Caption = "检测分析",
+                            Caption = "监测分析",
                             SvgImage = svgImgGroup32[0],
                             SvgImageSize = new Size(24, 24),
                             AllowGlyphSkinning = true,
@@ -1678,12 +1718,12 @@
                         {
                             Modular = "SmartHardware",
                             MoudingType = eMoudingType.Tab,
-                            Function = "DataProcessingMgr",
+                            Function = "DataFilterMgr",
                         }, svgImgItem32[2], new Size(18, 18), (caption, guid, svg, size) =>
                         {
                             if (!IsExistPage(guid, true))
                             {
-                                var page = new DataProcessingMgr();
+                                var page = new DataFilter();
                                 page.PageGuid = guid;
                                 page.PageTitle.Caption = caption;
                                 page.PageTitle.HeaderSvgImage = svg;
@@ -1705,9 +1745,10 @@
                                 page.PageTitle.Caption = caption;
                                 page.PageTitle.HeaderSvgImage = svg;
                                 page.PageTitle.SvgImageSize = size;
+
                                 CreatePage(page, guid);
                             }
-                        }),Get("智控数据", new PageGuid()
+                        }),/*Get("智控数据", new PageGuid()
                             {
                             Modular = "SmartHardware",
                             MoudingType = eMoudingType.Tab,
@@ -1743,7 +1784,8 @@
                             if (!IsExistPage(guid, true))
                             {
                             }
-                        }),Get("基础信息", new PageGuid()
+                        })*/
+                             Get("基础信息", new PageGuid()
                             {
                             Modular = "SmartHardware",
                             MoudingType = eMoudingType.Tab,
@@ -1779,18 +1821,46 @@
                     }
                         };
                         allAccordionElements.Add(accordionElement_DataManagement);
-                        /*   foreach (var item in allAccordionElements)
-                           {
-                               foreach (var ele in item.Elements)
-                               {
-                                   ele.Enable = false;
-                               }
-                           }*/
+                        if (!_ibox_status)
+                        {
+                            foreach (var item in allAccordionElements)
+                            {
+                                foreach (var ele in item.Elements)
+                                {
+                                    ele.Enable = false;
+                                }
+                            }
+                        }
                         list.Add(accordionElement_Facility);
+                        list.Add(accordionElement_IboxInfo);
                         list.Add(accordionElement_Monitor);
                         list.Add(accordionElement_DataManagement);
                     }
 
+                    break;
+
+                case "Home":
+                    {
+                        AccordionElement accordionElement_Home = new();
+                        accordionElement_Home = Get("地图信息", new PageGuid()
+                        {
+                            Modular = "Home",
+                            MoudingType = eMoudingType.Tab,
+                            Function = "MapInfo",
+                        }, svgImgItem32[4], new Size(18, 18), (caption, guid, svg, size) =>
+                        {
+                            if (!IsExistPage(guid, true))
+                            {
+                                var page = new HomePbsProjectPage();
+                                page.PageGuid = guid;
+                                page.PageTitle.Caption = caption;
+                                page.PageTitle.HeaderSvgImage = svg;
+                                page.PageTitle.SvgImageSize = size;
+                                CreatePage(page, guid);
+                            }
+                        }, true);
+                        list.Add(accordionElement_Home);
+                    }
                     break;
 
                 default:
@@ -1800,7 +1870,7 @@
             return list;
         }
 
-        private AccordionElement Get(string caption, PageGuid guid, SvgImage svg_img, Size size, Action<string, PageGuid, SvgImage, Size> action, bool glyph_skinning = true)
+        private AccordionElement Get(string caption, PageGuid guid, SvgImage svg_img, Size size, Action<string, PageGuid, SvgImage, Size> action, bool is_normally_open = false, bool glyph_skinning = true)
         {
             var ele = new AccordionElement();
             if (guid == null)
@@ -1817,6 +1887,7 @@
             ele.SvgImage = svg_img;
             ele.SvgImageSize = size;
             ele.AllowGlyphSkinning = glyph_skinning;
+            ele.IsNormallyOpen = is_normally_open;
             return ele;
         }
 

--
Gitblit v1.9.3