liulb@mesnac.com 1 year ago
parent 110e510b3e
commit 67ba1307b9

@ -19,7 +19,7 @@ namespace Aucma.Core.DoorFoam.ViewModels
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(MainWindowViewModel));
private IndexPageView firstPage = new IndexPageView();//首页
private StatisticsPageView recordPage = new StatisticsPageView();
public MainWindowViewModel()
{
UserContent = firstPage;
@ -95,6 +95,7 @@ namespace Aucma.Core.DoorFoam.ViewModels
Scanner1State(flag1);
}
#endregion
#region 更换界面
public System.Windows.Controls.UserControl _content;
@ -186,11 +187,12 @@ namespace Aucma.Core.DoorFoam.ViewModels
{
switch (page)
{
case "FirstPage":
case "FoamLinePage":
UserContent = firstPage;
break;
case "RecordPage":
UserContent = recordPage;
case "RealTimePage":
RealTimePageView realTimePageView = new RealTimePageView();
UserContent = realTimePageView;
break;
default:
break;

@ -22,47 +22,28 @@ namespace Aucma.Core.DoorFoam.ViewModels
/// <returns></returns>
private void InitEveryDayMethodAsync()
{
DateTime startTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));
DateTime endTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
//var list = await _doorFoamRecordServices.QueryAsync(d => d.BeginTime >= startTime && d.EndTime <= endTime);
ChartValues<double> achievement = new ChartValues<double>();
Random random = new Random();
for (int i = 0; i < 5; i++)
for (int i = 0; i < 2; i++)
{
achievement.Add(random.Next(60, 100));
achievement.Add(random.Next(0, 50));
}
var column = new ColumnSeries();
column.DataLabels = true;
column.Title = "型号";
column.Values = achievement;
column.Foreground = Brushes.White;
ModelStatistics.Add(column);
ProductionHourList = new List<string>()
ModelStatistics.Add(new ColumnSeries()
{
"12",
"13",
"14",
"15",
"16",
};
ChartValues<double> achievement2 = new ChartValues<double>();
Random random2 = new Random();
for (int i = 0; i < 5; i++)
DataLabels = true,
Title = "型号",
Values = achievement,
Fill = new SolidColorBrush(Color.FromRgb(15, 209, 226)),
Foreground = Brushes.White,
FontSize = 18
});
MaterialNameList = new List<string>()
{
achievement2.Add(random2.Next(60, 100));
}
var column2 = new ColumnSeries();
column2.DataLabels = true;
column2.Title = "产量";
column2.Values = achievement2;
column2.Foreground = Brushes.White;
"BCD-287CHN",
"BCD-287CHN"
};
Achievement.Add(column2);
}
#region 扫描信息

@ -1,4 +1,5 @@
using System;
using Aucma.Core.DoorFoam.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -23,7 +24,7 @@ namespace Aucma.Core.DoorFoam.Views
public RealTimePageView()
{
InitializeComponent();
this.DataContext = new RealTimePageView();
this.DataContext = new RealTimePageViewModel();
}
}
}

@ -314,7 +314,7 @@ namespace Aucma.Core.PrintTo.ViewModels
#endregion
printBarCode.ProductCode = ProductCode;
printBarCode.OrderCode = ProductCode;
printBarCode.MaterialCode = item.MaterialCode;
printBarCode.MaterialName = item.MaterialName;
printBarCode.PrintTime = DateTime.Now;

@ -100,7 +100,7 @@ namespace Aucma.Core.PrintTo.ViewModels
if (!string.IsNullOrEmpty(queryStr))
{
Datalist.Clear();
var list = await _barCodeServices.QueryAsync(d => d.MaterialName.Contains(queryStr) ||d.MaterialBarcode.Equals(ProductNo) || d.ProductCode.Equals(ProductNo));
var list = await _barCodeServices.QueryAsync(d => d.MaterialName.Contains(queryStr) ||d.MaterialBarcode.Equals(ProductNo) || d.OrderCode.Equals(ProductNo));
foreach (var item in list)
{
@ -126,7 +126,7 @@ namespace Aucma.Core.PrintTo.ViewModels
#region 加载DataGrid数据
private async Task LoadData(string productCode,string material_code)
{
var list = await _barCodeServices.QueryAsync(d => d.ProductCode.Contains(productCode)&& d.MaterialCode.Contains(material_code));
var list = await _barCodeServices.QueryAsync(d => d.OrderCode.Contains(productCode)&& d.MaterialCode.Contains(material_code));
foreach (var item in list)
{

@ -13,7 +13,7 @@
<UserControl.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="20"/>
<Setter Property="FontSize" Value="15"/>
</Style>
<Style TargetType="DataGrid">
@ -302,7 +302,7 @@
HorizontalAlignment="Center" VerticalAlignment="Top" AlternationCount="2" RowHeaderWidth="0"
ColumnWidth="*" AutoGenerateColumns="False" IsReadOnly="True"
CanUserAddRows="False" SelectionMode="Single" Foreground="White"
SelectedItem="{Binding SelectedCells, Mode=OneWayToSource}" FontSize="18">
SelectedItem="{Binding SelectedCells, Mode=OneWayToSource}" FontSize="15">
<DataGrid.Columns >
<DataGridTextColumn Binding="{Binding ID}" Header="主键" Width="auto" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Hidden" />
<DataGridTextColumn Binding="{Binding No}" x:Name="No" Header="编号" Width="0.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
@ -315,7 +315,7 @@
<DataGridTextColumn Binding="{Binding BeginTime ,StringFormat=\{0:MM-dd HH:mm\}}" Header="开始时间" Width="1.2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ExecuteStatus}" Header="执行状态" Visibility="Collapsed"/>
<DataGridTemplateColumn Header="操作" Width="3.5*" >
<DataGridTemplateColumn Header="操作" Width="2.5*" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>

Loading…
Cancel
Save