using Aucma.Core.BoxFoam.Models; using CommunityToolkit.Mvvm.ComponentModel; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Aucma.Core.BoxFoam.ViewModels { public partial class MonitorPageViewModel : ObservableObject { public MonitorPageViewModel() { LoadData(); LoadRealTimeData(); } #region 任务监控 data #region 加载DataGrid数据 private void LoadData() { PlanInfoDataGrid.Add(new OrderInfo() { No = 1, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" }); PlanInfoDataGrid.Add(new OrderInfo() { No = 2, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" }); PlanInfoDataGrid.Add(new OrderInfo() { No = 3, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" }); PlanInfoDataGrid.Add(new OrderInfo() { No = 4, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" }); PlanInfoDataGrid.Add(new OrderInfo() { No = 5, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" }); PlanInfoDataGrid.Add(new OrderInfo() { No = 6, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" }); PlanInfoDataGrid.Add(new OrderInfo() { No = 7, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" }); PlanInfoDataGrid.Add(new OrderInfo() { No = 8, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" }); PlanInfoDataGrid.Add(new OrderInfo() { No = 9, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" }); PlanInfoDataGrid.Add(new OrderInfo() { No = 10, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" }); } #endregion #region 加载DataGrid数据 private void LoadRealTimeData() { RealTimeDataGrid.Add(new OrderInfo() { No = 1, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" }); RealTimeDataGrid.Add(new OrderInfo() { No = 2, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" }); } #endregion #region 初始化datagrid private ObservableCollection planInfoDataGrid = new ObservableCollection(); public ObservableCollection PlanInfoDataGrid { get { return planInfoDataGrid; } set { planInfoDataGrid = value; OnPropertyChanged();//属性通知 } } #endregion #region 初始化datagrid private ObservableCollection realTimeDataGrid = new ObservableCollection(); public ObservableCollection RealTimeDataGrid { get { return realTimeDataGrid; } set { realTimeDataGrid = value; OnPropertyChanged();//属性通知 } } #endregion #endregion } }