From 217756094e1f22763edf2b18d3723403786c82fc Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期五, 18 十月 2024 11:18:28 +0800
Subject: [PATCH] 提交错误修补

---
 WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/01-waterbox/SetWaterboxCalcuPrefixListCtrl.cs |   89 ++++++++++++++++++++++++++++++++++++++------
 1 files changed, 77 insertions(+), 12 deletions(-)

diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/01-waterbox/SetWaterboxCalcuPrefixListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/01-waterbox/SetWaterboxCalcuPrefixListCtrl.cs
index 3a6572b..3756408 100644
--- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/01-waterbox/SetWaterboxCalcuPrefixListCtrl.cs
+++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/01-waterbox/SetWaterboxCalcuPrefixListCtrl.cs
@@ -1,4 +1,5 @@
-锘縰sing DevExpress.XtraEditors;
+锘縰sing DevExpress.Utils.Layout;
+using DevExpress.XtraEditors;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -7,7 +8,9 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows.Controls;
 using System.Windows.Forms;
+using Yw.WinFrmUI;
 
 namespace Yw.WinFrmUI
 {
@@ -18,7 +21,13 @@
             InitializeComponent();
         }
 
+        /// <summary>
+        /// 椤甸潰鐘舵�佸彂鐢熸敼鍙�
+        /// </summary>
+        public event Action PageStateChangedEvent;
+
         private SetHydroCalcuPrefixViewModel _vm = null;
+        private List<SetWaterboxCalcuPrefixCtrl> _allCalcuPrefixCtrlList = null;
 
         /// <summary>
         /// 鍒濆鍖栭〉闈�
@@ -26,26 +35,82 @@
         public void InitialPage(SetHydroCalcuPrefixViewModel vm)
         {
             _vm = vm;
-            this.
+            InitialControls();
         }
 
-        //鍗曠嫭鎺т欢楂樺害
-        private const int SingleContorlHeight = 145;
+        //鍒濆鍖栨帶浠�
+        private void InitialControls()
+        {
+            if (_vm == null)
+            {
+                return;
+            }
+            if (_allCalcuPrefixCtrlList == null)
+            {
+                _allCalcuPrefixCtrlList = new List<SetWaterboxCalcuPrefixCtrl>();
+                this.tabPanelCore.Columns.Add(new TablePanelColumn(TablePanelEntityStyle.Relative, 55F));
+                if (_vm.HydroInfo.Waterboxs != null && _vm.HydroInfo.Waterboxs.Count > 0)
+                {
+                    for (int i = 0; i < _vm.HydroInfo.Waterboxs.Count; i++)
+                    {
+                        this.tabPanelCore.Rows.Add(new TablePanelRow(TablePanelEntityStyle.AutoSize, 150F));
+                        var ctrl = new SetWaterboxCalcuPrefixCtrl();
+                        // ctrl.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+                        ctrl.SetBindingData(_vm.HydroInfo.Waterboxs[i]);
+                        //ctrl.Size = new Size();
+                        this.tabPanelCore.Controls.Add(ctrl);
+                        this.tabPanelCore.SetCell(ctrl, i, 0);
+                    }
+                    this.tabPanelCore.Rows.Add(new TablePanelRow(TablePanelEntityStyle.AutoSize, 150F));
+                }
+            }
+        }
 
+        //鍏佽涓婁竴姝�
         public bool AllowPrev
         {
-
+            get
+            {
+                if (_vm == null)
+                {
+                    return false;
+                }
+                if (_vm.FirstPage == this)
+                {
+                    return false;
+                }
+                return true;
+            }
         }
 
-        public bool AllowNext { get { return true; } }
+        //鍏佽涓婁竴姝�
+        public bool AllowNext
+        {
+            get
+            {
+                if (_vm == null)
+                {
+                    return false;
+                }
+                if (_vm.LastPage == this)
+                {
+                    return false;
+                }
+                return true;
+            }
+        }
 
-        public bool AllowCancel { get { return true; } }
+        //鍏佽鍙栨秷
+        public bool AllowCancel
+        {
+            get { return true; }
+        }
 
-        public bool AllowComplete { get { return true; } }
-
-        public event Action PageStateChangedEvent;
-
-
+        //鍏佽瀹屾垚
+        public bool AllowComplete
+        {
+            get { return true; }
+        }
 
         public bool CanPrev()
         {

--
Gitblit v1.9.3