From f373ad1f566c9c8679547f4205d86eb6e0836d59 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期一, 06 一月 2025 17:22:13 +0800
Subject: [PATCH] 修改保存逻辑

---
 WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/04-junction/HydroJunctionListCtrl.cs |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/04-junction/HydroJunctionListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/04-junction/HydroJunctionListCtrl.cs
index 4425735..517ce6e 100644
--- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/04-junction/HydroJunctionListCtrl.cs
+++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/04-junction/HydroJunctionListCtrl.cs
@@ -31,6 +31,10 @@
         /// 姘村姏鏀瑰彉瑙嗗浘浜嬩欢
         /// </summary>
         public event Action<List<HydroVisualViewModel>> HydroChangedViewEvent;
+        /// <summary>
+        /// 鏋勪欢鏀瑰彉浜嬩欢
+        /// </summary>
+        public event Action<HydroParterInfo, eChangeType> ParterChangedEvent;
 
         /// <summary>
         /// 鏄惁鎷ユ湁姘村姏鍒楄〃
@@ -247,12 +251,17 @@
             dlg.SetBindingData(_allBindingList.Select(x => x.Vmo).ToList());
             dlg.ReloadDataEvent += (list) =>
             {
+                if (list == null || list.Count < 1)
+                {
+                    return;
+                }
                 _allBindingList.ForEach(x => x.UpdateProperty());
                 this.hydroJunctionViewModelBindingSource.ResetBindings(false);
                 var allVisualViewModelList = _allBindingList.Select(x => x as HydroVisualViewModel).ToList();
                 this.HydroChangedViewEvent?.Invoke(allVisualViewModelList);
                 var allVisualInfoList = allVisualViewModelList.Select(x => x.Vmo).ToList();
                 this.HydroChangedInfoEvent?.Invoke(allVisualInfoList);
+                list.ForEach(x => this.ParterChangedEvent?.Invoke(x, eChangeType.Update));
             };
             dlg.ShowDialog();
         }
@@ -271,10 +280,15 @@
                 dlg.SetBindingData(row.Vmo);
                 dlg.ReloadDataEvent += (list) =>
                 {
+                    if (list == null || list.Count < 1)
+                    {
+                        return;
+                    }
                     row.UpdateProperty();
                     this.gridView1.RefreshRow(e.RowHandle);
                     this.HydroChangedViewEvent?.Invoke(new List<HydroVisualViewModel>() { row });
                     this.HydroChangedInfoEvent?.Invoke(new List<HydroVisualInfo>() { row.Vmo });
+                    this.ParterChangedEvent?.Invoke(row.Vmo, eChangeType.Update);
                 };
                 dlg.ShowDialog();
             }

--
Gitblit v1.9.3