duheng
2024-10-24 4812786898dc040fc236e9e00e21b9f4d08f57e3
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchCtrl.cs
@@ -5,6 +5,7 @@
        public XhsProjectSimulationSearchCtrl()
        {
            InitializeComponent();
            this.gridView1.SetNormalView();
            this.searchControl1.SetSearchSettings(Search, Recover);
        }
@@ -15,6 +16,7 @@
        //水力信息方法
        private Func<Yw.Model.HydroModelInfo> _hydroInfoFunc;
        private List<XhsProjectSimulationSearchViewModel> _allBindingList = null;
        /// <summary>
        /// 初始化数据
@@ -37,7 +39,24 @@
            {
                return;
            }
            //var allParterList =
            var allParterList = hydroInfo.GetAllParters();
            var parters = allParterList?.Where(x => (!string.IsNullOrEmpty(x.Code) && x.Code.Contains(condition))
                || (!string.IsNullOrEmpty(x.Name) && x.Name.Contains(condition))
                || (!string.IsNullOrEmpty(x.Catalog) && x.Catalog.Contains(condition))
                || (!string.IsNullOrEmpty(x.ModelType) && x.ModelType.Contains(condition))
                ).ToList();
            _allBindingList = new List<XhsProjectSimulationSearchViewModel>();
            if (parters != null && parters.Count > 0)
            {
                foreach (var parter in parters)
                {
                    var vm = new XhsProjectSimulationSearchViewModel(parter);
                    _allBindingList.Add(vm);
                }
            }
            this.xhsProjectSimulationSearchViewModelBindingSource.DataSource = _allBindingList;
            this.xhsProjectSimulationSearchViewModelBindingSource.ResetBindings(false);
            this.ApplySearchEvent?.Invoke(parters);
        }
        //覆盖
@@ -51,6 +70,16 @@
            this.ApplySearchEvent?.Invoke(null);
        }
        //行点击事件
        private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            var row = this.gridView1.GetRow(e.RowHandle) as XhsProjectSimulationSearchViewModel;
            if (row == null)
            {
                return;
            }
            this.ApplySearchEvent?.Invoke(new List<Yw.Model.HydroParterInfo>() { row.Vmo });
        }