From 2ef8058f388b9e8c030b50d695334976576f9687 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期二, 22 十月 2024 17:02:14 +0800 Subject: [PATCH] 优化检查控件 --- WinFrmUI/Yw.WinFrmUI.Hydro.Core/05-check/01-control/HydroCheckResultCtrl.cs | 42 ++++++++++++++++++++++++++++++++++++------ 1 files changed, 36 insertions(+), 6 deletions(-) diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/05-check/01-control/HydroCheckResultCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/05-check/01-control/HydroCheckResultCtrl.cs index 97ada23..8045338 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/05-check/01-control/HydroCheckResultCtrl.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/05-check/01-control/HydroCheckResultCtrl.cs @@ -7,7 +7,7 @@ InitializeComponent(); this.gridView1.SetNormalView(30); this.gridView1.RegistCustomDrawRowIndicator(40); - this.gridView1.ShowFindPanel(); + //this.gridView1.ShowFindPanel(); } /// <summary> @@ -30,11 +30,11 @@ { this.peSucceed.Image = Yw.WinFrmUI.Hydro.Core.Properties.Resources.failed_64; } - this.txtMode.EditValue = HydroCheckMode.Count(); - this.txtType.EditValue = HydroCheckType.Count(); - this.txtItems.EditValue = result.Items.Count; - this.txtSucceedItems.EditValue = result.Items.Count(x => !x.Failed); - this.txtFailedItems.EditValue = result.Items.Count(x => x.Failed); + this.txtMode.EditValue = $"{HydroCheckMode.Count()}绉�"; + this.txtType.EditValue = $"{HydroCheckType.Count()}绫�"; + this.txtItems.EditValue = $"{result.Items.Count}涓�"; + this.txtSucceedItems.EditValue = $"{result.Items.Count(x => !x.Failed)}涓�"; + this.txtFailedItems.EditValue = $"{result.Items.Count(x => x.Failed)}涓�"; _allBindingList = new List<HydroCheckItemViewModel>(); foreach (var item in result.Items) @@ -42,6 +42,7 @@ var vm = new HydroCheckItemViewModel(item); _allBindingList.Add(vm); } + _allBindingList = _allBindingList.OrderBy(x => x.SortCode).ToList(); this.hydroCheckItemViewModelBindingSource.DataSource = _allBindingList; this.hydroCheckItemViewModelBindingSource.ResetBindings(false); } @@ -57,5 +58,34 @@ this.HydroClickEvent?.Invoke(row.Code); } + //鑷畾涔夊崟鍏冩牸棰滆壊 + private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) + { + var row = this.gridView1.GetRow(e.RowHandle) as HydroCheckItemViewModel; + if (row == null) + { + return; + } + if (e.RowHandle != this.gridView1.FocusedRowHandle) + { + if (row.Failed) + { + e.Appearance.BackColor = Color.Red; + e.Appearance.ForeColor = Color.White; + } + else + { + e.Appearance.BackColor = Color.Green; + e.Appearance.ForeColor = Color.White; + } + } + else + { + + e.Appearance.BackColor = Color.Orange; + e.Appearance.ForeColor = Color.White; + } + } + } } -- Gitblit v1.9.3