From 2b31b7e3926134da96d384ab3bdac345691a179c Mon Sep 17 00:00:00 2001
From: duheng <2784771470@qq.com>
Date: 星期五, 10 一月 2025 10:48:45 +0800
Subject: [PATCH] 优化权限

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs |   60 ++++++++----------------------------------------------------
 1 files changed, 8 insertions(+), 52 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs
index bafabbf..7db75a9 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs
@@ -1,5 +1,4 @@
-锘縰sing DevExpress.Drawing;
-using DevExpress.Utils.Svg;
+锘縰sing DevExpress.Utils.Svg;
 using DevExpress.XtraBars.Docking;
 using DevExpress.XtraBars.Docking2010.Views;
 using Yw.Vmo;
@@ -17,7 +16,6 @@
             this.PageTitle.SvgImageSize = new Size(24, 24);
             this.simulationFunctionMgrCtrl1.ShowProjectSiteInfoEvent += SimulationFunctionMgrCtrl1_ShowProjectSiteInfoEvent;
             this.simulationFunctionMgrCtrl1.ShowProjectSiteSimulationEvent += SimulationFunctionMgrCtrl1_ShowProjectSiteSimulationEvent;
-            this.simulationFunctionMgrCtrl1.ShowProjectSiteWorkingEvent += SimulationFunctionMgrCtrl1_ShowProjectSiteWorkingEvent;
             this.simulationFunctionMgrCtrl1.ProjectSiteWorkingAppendEvent += SimulationFunctionMgrCtrl1_ProjectSiteWorkingAppendEvent;
             this.simulationFunctionMgrCtrl1.ProjectSiteWorkingUpdateEvent += SimulationFunctionMgrCtrl1_ProjectSiteWorkingUpdateEvent;
             this.simulationFunctionMgrCtrl1.ProjectSiteWorkingRemoveEvent += SimulationFunctionMgrCtrl1_ProjectSiteWorkingRemoveEvent;
@@ -125,11 +123,6 @@
                         //澧炲姞宸ュ喌浜嬩欢
                         this.simulationFunctionMgrCtrl1.AppendWorking(scheme, working);
                     };
-                    page.SaveModelEvent += (rhs) =>
-                    {
-                        //淇濆瓨妯″瀷浜嬩欢
-                        return this.simulationFunctionMgrCtrl1.SaveModel(scheme, rhs);
-                    };
                     page.RefreshModelEvent += () =>
                     {
                         //鍒锋柊妯″瀷浜嬩欢
@@ -146,44 +139,6 @@
                         this.simulationFunctionMgrCtrl1.RemoveScheme(rhs);
                     };
                     page.SetBindingData(project, projectSite, scheme, hydroInfo, allWorkingCheckedListDict);
-                    CreatePage(page, guid);
-                }
-            }
-        }
-
-        //鏄剧ず椤圭洰绔欏伐鍐典簨浠�
-        private void SimulationFunctionMgrCtrl1_ShowProjectSiteWorkingEvent
-            (
-                XhsProjectVmo project,
-                XhsProjectSiteVmo projectSite,
-                XhsSchemeVmo scheme,
-                Yw.Model.HydroModelInfo hydroInfo,
-                HydroWorkingVmo working,
-                SvgImage svgImage
-            )
-        {
-            lock (_locker)
-            {
-                var guid = new PageGuid()
-                {
-                    Modular = this.PageGuid.Modular,
-                    MoudingType = eMoudingType.Tab,
-                    Function = SimulationFunctionHelper.Working,
-                    TagName = $"{project.ID}-{projectSite.ID}-{scheme?.ID}-{working.ID}"
-                };
-                if (!IsExistPage(guid, true))
-                {
-                    var page = new XhsProjectSimulationWorkingPage();
-                    page.UpdateWorkingEvent += (rhs) =>
-                    {
-                        this.simulationFunctionMgrCtrl1.UpdateWorking(scheme, rhs);
-                    };
-                    page.RemoveWorkingEvent += (rhs) =>
-                    {
-                        this.simulationFunctionMgrCtrl1.RemoveWorking(scheme, rhs);
-                    };
-                    page.PageTitle.HeaderSvgImage = svgImage;
-                    page.SetBindingData(project, projectSite, scheme, hydroInfo, working);
                     CreatePage(page, guid);
                 }
             }
@@ -217,7 +172,7 @@
                 Modular = this.PageGuid.Modular,
                 MoudingType = eMoudingType.Tab,
                 Function = SimulationFunctionHelper.Simulation,
-                TagName = projectSite.ID.ToString()
+                TagName = $"{project.ID}-{projectSite.ID}-{scheme?.ID}"
             };
             var page = FindPage(guid);
             if (page == null)
@@ -246,7 +201,7 @@
                 Modular = this.PageGuid.Modular,
                 MoudingType = eMoudingType.Tab,
                 Function = SimulationFunctionHelper.Simulation,
-                TagName = projectSite.ID.ToString()
+                TagName = $"{project.ID}-{projectSite.ID}-{scheme?.ID}"
             };
             var page = FindPage(guid);
             if (page == null)
@@ -276,7 +231,7 @@
                 Modular = this.PageGuid.Modular,
                 MoudingType = eMoudingType.Tab,
                 Function = SimulationFunctionHelper.Simulation,
-                TagName = projectSite.ID.ToString()
+                TagName = $"{project.ID}-{projectSite.ID}-{scheme?.ID}"
             };
             var page = FindPage(guid);
             if (page == null)
@@ -297,17 +252,18 @@
                 XhsProjectVmo project,
                 XhsProjectSiteVmo projectSite,
                 Yw.Model.HydroModelInfo hydroInfo,
+                List<XhsSchemeVmo> allSchemeList,
                 SvgImage svgImage
             )
         {
-            WaitFormHelper.ShowWaitForm(this.FindForm(), "姝e湪鍔犺浇妯″瀷锛岃绋嶄警...");
-            var dlg = new AddXhsSchemeDlg();
+            WaitFormHelper.ShowWaitForm(this.FindForm(), "姝e湪鍔犺浇锛岃绋嶄警...");
+            var dlg = new CreateXhsSchemeDlg();
             dlg.Shown += delegate { WaitFormHelper.HideWaitForm(this.FindForm()); };
+            dlg.SetBindingData(project, projectSite, hydroInfo, allSchemeList);
             dlg.ReloadDataEvent += (rhs) =>
             {
                 this.simulationFunctionMgrCtrl1.AppendScheme(rhs);
             };
-            dlg.SetBindingData(project, projectSite, hydroInfo);
             dlg.ShowDialog();
         }
 

--
Gitblit v1.9.3