using CommunityToolkit.Mvvm.ComponentModel;
using LiveCharts.Wpf;
using LiveCharts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
namespace Aucma.Core.DoorFoam.ViewModels
{
public partial class RealTimePageViewModel : ObservableObject
{
public RealTimePageViewModel()
{
InitEveryDayMethodAsync();
}
///
/// 获取今天的数据
///
///
private void InitEveryDayMethodAsync()
{
ChartValues achievement = new ChartValues();
Random random = new Random();
for (int i = 0; i < 2; i++)
{
achievement.Add(random.Next(0, 50));
}
ModelStatistics.Add(new ColumnSeries()
{
DataLabels = true,
Title = "型号",
Values = achievement,
Fill = new SolidColorBrush(Color.FromRgb(15, 209, 226)),
Foreground = Brushes.White,
FontSize = 18
});
MaterialNameList = new List()
{
"BCD-287CHN",
"BCD-287CHN"
};
}
#region 扫描信息
#region 物料条码
private string _stationName;
public string StationName
{
get { return _stationName; }
set
{
_stationName = value;
SetProperty(ref _stationName, value);
}
}
#endregion
#region 物料名称
private string _materialName;
public string MaterialName
{
get { return _materialName; }
set
{
_materialName = value;
SetProperty(ref _materialName, value);
}
}
#endregion
#region 订单信息
private string _orderNo;
public string OrderNo
{
get { return _orderNo; }
set
{
_orderNo = value;
SetProperty(ref _orderNo, value);
}
}
#endregion
#region 开始时间
private string _beginTime;
public string BeginTime
{
get { return _beginTime; }
set
{
_beginTime = value;
SetProperty(ref _beginTime, value);
}
}
#endregion
#endregion
#region 当日产量
#region 日产量柱状图X轴日期
///
/// 日产量柱状图X轴日期
///
private List productionHourList;
public List ProductionHourList
{
get { return productionHourList; }
set { productionHourList = value; }
}
#endregion
///
/// 日产量柱状图
///
private SeriesCollection achievement = new SeriesCollection();
public SeriesCollection Achievement
{
get { return achievement; }
set { achievement = value; }
}
#endregion
#region 型号统计
#region 型号统计柱状图x轴物料类型
///
/// 型号统计柱状图x轴物料类型
///
private List materialNameList;
public List MaterialNameList
{
get { return materialNameList; }
set { materialNameList = value; }
}
#endregion
#region 型号统计柱状图
///
/// 型号统计柱状图
///
private SeriesCollection modelStatistics = new SeriesCollection();
public SeriesCollection ModelStatistics
{
get { return modelStatistics; }
set { modelStatistics = value; }
}
#endregion
#endregion
}
}