lixiaojun
2025-01-06 f373ad1f566c9c8679547f4205d86eb6e0836d59
WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/02-tank/HydroTankListCtrl.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.hydroTankViewModelBindingSource.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();
        }
@@ -272,10 +281,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();
            }
@@ -302,7 +316,6 @@
            this.colMaxLevel.Visible = false;
            this.colDN.Visible = false;
            this.colMinVol.Visible = false;
            this.colCurve.Visible = false;
            this.colOverFlow.Visible = false;
            this.colCalcuPress.Visible = false;
            this.colCalcuHead.Visible = false;
@@ -329,7 +342,6 @@
            this.colMaxLevel.Visible = true;
            this.colDN.Visible = true;
            this.colMinVol.Visible = true;
            this.colCurve.Visible = true;
            this.colOverFlow.Visible = true;
            this.colCalcuPress.Visible = false;
            this.colCalcuHead.Visible = false;
@@ -356,7 +368,6 @@
            this.colMaxLevel.Visible = true;
            this.colDN.Visible = true;
            this.colMinVol.Visible = true;
            this.colCurve.Visible = true;
            this.colOverFlow.Visible = true;
            this.colCalcuPress.Visible = true;
            this.colCalcuHead.Visible = true;
@@ -383,7 +394,6 @@
            this.colMaxLevel.Visible = true;
            this.colDN.Visible = true;
            this.colMinVol.Visible = true;
            this.colCurve.Visible = true;
            this.colOverFlow.Visible = true;
            this.colCalcuPress.Visible = false;
            this.colCalcuHead.Visible = false;
@@ -410,7 +420,6 @@
            this.colMaxLevel.Visible = true;
            this.colDN.Visible = true;
            this.colMinVol.Visible = true;
            this.colCurve.Visible = true;
            this.colOverFlow.Visible = true;
            this.colCalcuPress.Visible = true;
            this.colCalcuHead.Visible = true;