From 046df0f7526575cfb8b4b8c045d864c498b5a46c Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期五, 06 十二月 2024 17:06:46 +0800 Subject: [PATCH] 项目Service优化,可见视图列表优化 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs | 178 ++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 157 insertions(+), 21 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs index 439fb80..37f5caf 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs @@ -15,18 +15,22 @@ this.PageTitle.Caption = "姘村姏妯℃嫙"; this.PageTitle.HeaderSvgImage = this.svgImg32[0]; this.PageTitle.SvgImageSize = new Size(24, 24); - this.xhsProjectSimulationFunctionMgrCtrl1.ShowProjectSiteInfoEvent += XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteInfoEvent; - this.xhsProjectSimulationFunctionMgrCtrl1.ShowProjectSiteSimulationEvent += XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteSimulationEvent; - this.xhsProjectSimulationFunctionMgrCtrl1.ShowProjectSiteWorkingEvent += XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteWorkingEvent; - this.xhsProjectSimulationFunctionMgrCtrl1.ProjectSiteWorkingCheckedEvent += XhsProjectSimulationFunctionMgrCtrl1_ProjectSiteWorkingCheckedEvent; - this.xhsProjectSimulationFunctionMgrCtrl1.CreateProjectSiteSchemeEvent += XhsProjectSimulationFunctionMgrCtrl1_CreateProjectSiteSchemeEvent; - this.xhsProjectSimulationFunctionMgrCtrl1.ShowProjectSiteSchemeEvent += XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteSchemeEvent; - this.xhsProjectSimulationFunctionMgrCtrl1.ShowProjectSiteSchemeWorkingEvent += XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteSchemeWorkingEvent; + this.simulationFunctionMgrCtrl1.ShowProjectSiteInfoEvent += XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteInfoEvent; + this.simulationFunctionMgrCtrl1.ShowProjectSiteSimulationEvent += XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteSimulationEvent; + this.simulationFunctionMgrCtrl1.ShowProjectSiteWorkingEvent += XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteWorkingEvent; + this.simulationFunctionMgrCtrl1.ProjectSiteWorkingUpdateEvent += XhsProjectSimulationFunctionMgrCtrl1_ProjectSiteWorkingUpdateEvent; + this.simulationFunctionMgrCtrl1.ProjectSiteWorkingRemoveEvent += XhsProjectSimulationFunctionMgrCtrl1_ProjectSiteWorkingRemoveEvent; + this.simulationFunctionMgrCtrl1.ProjectSiteWorkingCheckedEvent += XhsProjectSimulationFunctionMgrCtrl1_ProjectSiteWorkingCheckedEvent; + this.simulationFunctionMgrCtrl1.CreateProjectSiteSchemeEvent += XhsProjectSimulationFunctionMgrCtrl1_CreateProjectSiteSchemeEvent; + this.simulationFunctionMgrCtrl1.ShowProjectSiteSchemeEvent += XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteSchemeEvent; + this.simulationFunctionMgrCtrl1.ShowProjectSiteSchemeWorkingEvent += XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteSchemeWorkingEvent; + this.simulationFunctionMgrCtrl1.ProjectSiteSchemeWorkingCheckedEvent += SimulationFunctionMgrCtrl1_ProjectSiteSchemeWorkingCheckedEvent; + this.simulationFunctionMgrCtrl1.ProjectSiteSchemeWorkingUpdateEvent += SimulationFunctionMgrCtrl1_ProjectSiteSchemeWorkingUpdateEvent; + this.simulationFunctionMgrCtrl1.ProjectSiteSchemeWorkingRemoveEvent += SimulationFunctionMgrCtrl1_ProjectSiteSchemeWorkingRemoveEvent; } private XhsProjectVmo _project = null;//椤圭洰 private object _locker = new object();//閿佸畾瀵硅薄 - /// <summary> /// 鍒濆鍖栨暟鎹簮 @@ -38,7 +42,7 @@ { return; } - await this.xhsProjectSimulationFunctionMgrCtrl1.SetBindingData(_project); + await this.simulationFunctionMgrCtrl1.SetBindingData(_project); } /// <summary> @@ -67,7 +71,7 @@ //鏄剧ず椤圭洰绔欐鍐典簨浠� private void XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteInfoEvent - (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, DevExpress.Utils.Svg.SvgImage svgImage) + (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, SvgImage svgImage) { lock (_locker) { @@ -89,7 +93,7 @@ //鏄剧ず椤圭洰绔欐按鍔涙ā鎷熶簨浠� private void XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteSimulationEvent - (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, Dictionary<HydroWorkingVmo, bool> allWorkingCheckedListDict, DevExpress.Utils.Svg.SvgImage svgImage) + (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, Dictionary<HydroWorkingVmo, bool> allWorkingCheckedListDict, SvgImage svgImage) { lock (_locker) { @@ -106,7 +110,7 @@ page.PageTitle.HeaderSvgImage = svgImage; page.AppendWorkingEvent += (working) => { - this.xhsProjectSimulationFunctionMgrCtrl1.AppendWorking(working); + this.simulationFunctionMgrCtrl1.AppendWorking(working); }; page.SetBindingData(project, projectSite, hydroInfo, allWorkingCheckedListDict); CreatePage(page, guid); @@ -116,7 +120,7 @@ //鏄剧ず椤圭洰绔欏伐鍐典簨浠� private void XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteWorkingEvent - (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, HydroWorkingVmo working, DevExpress.Utils.Svg.SvgImage svgImage) + (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, HydroWorkingVmo working, SvgImage svgImage) { lock (_locker) { @@ -130,11 +134,67 @@ if (!IsExistPage(guid, true)) { var page = new XhsProjectSimulationWorkingPage(); + page.UpdateWorkingEvent += (rhs) => + { + this.simulationFunctionMgrCtrl1.UpdateWorking(rhs); + }; + page.RemoveWorkingEvent += (rhs) => + { + this.simulationFunctionMgrCtrl1.RemoveWorking(rhs); + }; page.PageTitle.HeaderSvgImage = svgImage; page.SetBindingData(project, projectSite, hydroInfo, working); CreatePage(page, guid); } } + } + + //椤圭洰绔欏伐鍐垫洿鏂颁簨浠� + private void XhsProjectSimulationFunctionMgrCtrl1_ProjectSiteWorkingUpdateEvent + (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, HydroWorkingVmo working) + { + var guid = new PageGuid() + { + Modular = this.PageGuid.Modular, + MoudingType = eMoudingType.Tab, + Function = SimulationFunctionHelper.Simulation, + TagName = projectSite.ID.ToString() + }; + var page = FindPage(guid); + if (page == null) + { + return; + } + var ctrl = page as XhsProjectSimulationCorePage; + if (ctrl == null) + { + return; + } + ctrl.UpdateWorkingCheckedList(working); + } + + //椤圭洰绔欏伐鍐电Щ闄や簨浠� + private void XhsProjectSimulationFunctionMgrCtrl1_ProjectSiteWorkingRemoveEvent + (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, HydroWorkingVmo working) + { + var guid = new PageGuid() + { + Modular = this.PageGuid.Modular, + MoudingType = eMoudingType.Tab, + Function = SimulationFunctionHelper.Simulation, + TagName = projectSite.ID.ToString() + }; + var page = FindPage(guid); + if (page == null) + { + return; + } + var ctrl = page as XhsProjectSimulationCorePage; + if (ctrl == null) + { + return; + } + ctrl.RemoveWorkingCheckedList(working); } //椤圭洰绔欏伐鍐甸�夋嫨鏀瑰彉浜嬩欢 @@ -163,14 +223,14 @@ //椤圭洰绔欐柟妗堝垱寤轰簨浠� private void XhsProjectSimulationFunctionMgrCtrl1_CreateProjectSiteSchemeEvent - (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, DevExpress.Utils.Svg.SvgImage svgImage) + (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, SvgImage svgImage) { WaitFormHelper.ShowWaitForm(this.FindForm(), "姝e湪鍔犺浇妯″瀷锛岃绋嶄警..."); var dlg = new AddXhsSchemeDlg(); dlg.Shown += delegate { WaitFormHelper.HideWaitForm(this.FindForm()); }; dlg.ReloadDataEvent += (rhs) => { - this.xhsProjectSimulationFunctionMgrCtrl1.AppendScheme(rhs); + this.simulationFunctionMgrCtrl1.AppendScheme(rhs); }; dlg.SetBindingData(project, projectSite, hydroInfo); dlg.ShowDialog(); @@ -178,7 +238,7 @@ //鏄剧ず椤圭洰绔欐柟妗堜簨浠� private void XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteSchemeEvent - (XhsProjectVmo project, XhsProjectSiteVmo projectSite, XhsSchemeVmo scheme, Yw.Model.HydroModelInfo hydroInfo, Dictionary<HydroWorkingVmo, bool> dict, DevExpress.Utils.Svg.SvgImage svgImage) + (XhsProjectVmo project, XhsProjectSiteVmo projectSite, XhsSchemeVmo scheme, Yw.Model.HydroModelInfo hydroInfo, Dictionary<HydroWorkingVmo, bool> dict, SvgImage svgImage) { lock (_locker) { @@ -195,7 +255,7 @@ page.PageTitle.HeaderSvgImage = svgImage; page.AppendWorkingEvent += (working) => { - this.xhsProjectSimulationFunctionMgrCtrl1.AppendSchemeWorking(scheme, working); + this.simulationFunctionMgrCtrl1.AppendSchemeWorking(scheme, working); }; page.SetBindingData(project, projectSite, scheme, hydroInfo, dict); CreatePage(page, guid); @@ -205,7 +265,7 @@ //鏄剧ず椤圭洰绔欐柟妗堝伐鍐典簨浠� private void XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteSchemeWorkingEvent - (XhsProjectVmo project, XhsProjectSiteVmo projectSite, XhsSchemeVmo scheme, Yw.Model.HydroModelInfo hydroInfo, HydroWorkingVmo working, DevExpress.Utils.Svg.SvgImage svgImage) + (XhsProjectVmo project, XhsProjectSiteVmo projectSite, XhsSchemeVmo scheme, Yw.Model.HydroModelInfo hydroInfo, HydroWorkingVmo working, SvgImage svgImage) { lock (_locker) { @@ -220,11 +280,89 @@ { var page = new XhsProjectSimulationWorkingPage(); page.PageTitle.HeaderSvgImage = svgImage; - page.SetBindingData(project, projectSite, hydroInfo, working); + page.UpdateWorkingEvent += (rhs) => + { + this.simulationFunctionMgrCtrl1.UpdateSchemeWorking(scheme, rhs); + }; + page.RemoveWorkingEvent += (rhs) => + { + this.simulationFunctionMgrCtrl1.RemoveSchemeWorking(scheme, rhs); + }; + page.SetBindingData(project, projectSite, scheme, hydroInfo, working); CreatePage(page, guid); } } } + + //椤圭洰绔欐柟妗堝伐鍐甸�夋嫨鏀瑰彉浜嬩欢 + private void SimulationFunctionMgrCtrl1_ProjectSiteSchemeWorkingCheckedEvent(XhsSchemeVmo scheme, HydroWorkingVmo working, bool hasChecked) + { + var guid = new PageGuid() + { + Modular = this.PageGuid.Modular, + MoudingType = eMoudingType.Tab, + Function = SimulationFunctionHelper.Scheme, + TagName = scheme.ID.ToString() + }; + var page = FindPage(guid); + if (page == null) + { + return; + } + var ctrl = page as XhsProjectSimulationSchemePage; + if (ctrl == null) + { + return; + } + ctrl.UpdateWorkingCheckedList(working, hasChecked); + } + + //椤圭洰绔欐柟妗堝伐鍐垫洿鏂颁簨浠� + private void SimulationFunctionMgrCtrl1_ProjectSiteSchemeWorkingUpdateEvent(XhsSchemeVmo scheme, HydroWorkingVmo working) + { + var guid = new PageGuid() + { + Modular = this.PageGuid.Modular, + MoudingType = eMoudingType.Tab, + Function = SimulationFunctionHelper.Scheme, + TagName = scheme.ID.ToString() + }; + var page = FindPage(guid); + if (page == null) + { + return; + } + var ctrl = page as XhsProjectSimulationSchemePage; + if (ctrl == null) + { + return; + } + + } + + //椤圭洰绔欐柟妗堝伐鍐电Щ闄や簨浠� + private void SimulationFunctionMgrCtrl1_ProjectSiteSchemeWorkingRemoveEvent(XhsSchemeVmo scheme, HydroWorkingVmo working) + { + var guid = new PageGuid() + { + Modular = this.PageGuid.Modular, + MoudingType = eMoudingType.Tab, + Function = SimulationFunctionHelper.Scheme, + TagName = scheme.ID.ToString() + }; + var page = FindPage(guid); + if (page == null) + { + return; + } + var ctrl = page as XhsProjectSimulationSchemePage; + if (ctrl == null) + { + return; + } + + } + #endregion @@ -460,7 +598,6 @@ docPnl.Show(); } break; - case eMoudingType.Tab: { this.tabbedView1.BeginUpdate(); @@ -479,7 +616,6 @@ this.tabbedView1.Controller.Activate(doc); } break; - default: break; } page.InitialDataSource(); -- Gitblit v1.9.3