You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
2.8 KiB
C#
101 lines
2.8 KiB
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using System;
|
|
using System.Collections.ObjectModel;
|
|
using log4net;
|
|
using Aucma.Core.DoorFoam.Common;
|
|
using LiveCharts;
|
|
using System.Collections.Generic;
|
|
using Admin.Core.Model;
|
|
using Admin.Core.Service;
|
|
using LiveCharts.Wpf;
|
|
using Admin.Core.IService;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Media;
|
|
using Admin.Core.Model.ViewModels;
|
|
using Pipelines.Sockets.Unofficial.Arenas;
|
|
using NPOI.SS.Formula.Functions;
|
|
/*
|
|
* 首页信息
|
|
*/
|
|
namespace Aucma.Core.DoorFoam.ViewModels
|
|
{
|
|
public partial class IndexPageViewModel : ObservableObject
|
|
{
|
|
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(IndexPageViewModel));
|
|
|
|
|
|
public IndexPageViewModel()
|
|
{
|
|
InitEveryDayMethodAsync();
|
|
InitEveryDayMethod2Async();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取今天的数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
private void InitEveryDayMethodAsync()
|
|
{
|
|
for (int i = 1; i <= 20; i++)
|
|
{
|
|
TrolleyModel mode=new TrolleyModel();
|
|
mode.No = i;
|
|
mode.Name = i + "#台车";
|
|
mode.Status = "不工作";
|
|
mode.Model = $"{i}台车1#枪A门";
|
|
mode.Production = "1-1";
|
|
|
|
DoorFp1DataGrid.Add(mode);
|
|
}
|
|
|
|
}
|
|
/// <summary>
|
|
/// 获取今天的数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
private void InitEveryDayMethod2Async()
|
|
{
|
|
for (int i = 1; i <= 20; i++)
|
|
{
|
|
TrolleyModel mode = new TrolleyModel();
|
|
mode.No = i;
|
|
mode.Name = i + "#台车";
|
|
mode.Status = "不工作";
|
|
mode.Model = $"{i}台车1#枪B门";
|
|
mode.Production = "1-1";
|
|
|
|
DoorFp2DataGrid.Add(mode);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
#region 初始化datagrid
|
|
private ObservableCollection<TrolleyModel> _doorFp1DataGrid = new ObservableCollection<TrolleyModel>();
|
|
public ObservableCollection<TrolleyModel> DoorFp1DataGrid
|
|
{
|
|
get { return _doorFp1DataGrid; }
|
|
set
|
|
{
|
|
_doorFp1DataGrid = value;
|
|
OnPropertyChanged();//属性通知
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 初始化datagrid
|
|
private ObservableCollection<TrolleyModel> _doorFp2DataGrid = new ObservableCollection<TrolleyModel>();
|
|
public ObservableCollection<TrolleyModel> DoorFp2DataGrid
|
|
{
|
|
get { return _doorFp1DataGrid; }
|
|
set
|
|
{
|
|
_doorFp1DataGrid = value;
|
|
OnPropertyChanged();//属性通知
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|