change - 界面实现,修改监控首页,添加历史数据页面

master
wenjy 4 months ago
parent 4010fb89e9
commit 1131d1e6a1

@ -39,6 +39,9 @@
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Horizontal">
<Button Content="首 页" x:Name="Index" Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=Index}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#5095F3" BorderBrush="#5095F3" Margin="10,0,10,0"/>
<Button Content="数据记录" x:Name="History" Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=History}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>
<Button Content="日志信息" x:Name="Log" Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=Log}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>
<Button Content="系统版本" x:Name="Version" Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=Version}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>
<Button Content="键 盘" Command="{Binding OpenSystemKeyboardCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>
<Button Content="最小化" x:Name="Minimized" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Minimized}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#FF9900" BorderBrush="#FF9900" Margin="0,0,10,0"/>
<Button Content="退 出" x:Name="Exit" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Exit}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#FF0033" BorderBrush="#FF0033" Margin="0,0,10,0"/>

@ -0,0 +1,36 @@
<UserControl x:Class="SlnMesnac.WPF.Page.History.HistoryControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SlnMesnac.WPF.Page.History"
mc:Ignorable="d"
d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="14*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#EBF4FD" BorderThickness="2" CornerRadius="10" Background="#EBF4FD" Margin="10,10">
</Border>
<Border Grid.Row="1" BorderBrush="#EBF4FD" BorderThickness="2" CornerRadius="10" Background="#EBF4FD" Margin="10,10">
<DataGrid Grid.Row="0" ItemsSource="{Binding ScanItems}" Background="Transparent"
FontSize="16" ColumnHeaderHeight="35"
RowHeight="31" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" HorizontalAlignment="Center"
Foreground="#31446E" x:Name="dataGrid" >
<!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding CreateTime ,StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Header="记录时间" Width="1.5*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Rfid}" Header="RFID" Width="2*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Code}" Header="ATR" Width="2*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Ocr}" Header="OCR" Width="2*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding url}" Header="图像路径" Width="2*" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
</Border>
</Grid>
</UserControl>

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace SlnMesnac.WPF.Page.History
{
/// <summary>
/// HistoryControl.xaml 的交互逻辑
/// </summary>
public partial class HistoryControl : UserControl
{
public HistoryControl()
{
InitializeComponent();
}
}
}

@ -46,7 +46,7 @@
<RowDefinition Height="3*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="条码信息" FontSize="24" Foreground="#31446E" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0"/>
<TextBox Grid.Row="1" Width="240" Height="70" Margin="10" VerticalContentAlignment="Center" HorizontalAlignment="Center" Padding="5">
<TextBox Text="{Binding TagCode}" FontSize="24" Grid.Row="1" Width="240" Height="70" Margin="10" VerticalContentAlignment="Center" HorizontalAlignment="Center" Padding="5">
<TextBox.Template>
<ControlTemplate TargetType="TextBox">
<Border Background="White" BorderBrush="White" BorderThickness="1" CornerRadius="10">
@ -68,7 +68,7 @@
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="条码总数" FontSize="24" Foreground="#31446E" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0"/>
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="361" FontSize="24" Foreground="#31446E" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding TagAmount}" FontSize="24" Foreground="#31446E" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="个" FontSize="24" Foreground="#31446E" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</StackPanel>
</Grid>
@ -141,20 +141,19 @@
<ColumnDefinition Width="3*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" CornerRadius="10" Background="#EBF4FD" Margin="10">
<DataGrid Grid.Row="0" ItemsSource="{Binding PlanInfoDataGrid}" Background="Transparent"
FontSize="15" ColumnHeaderHeight="35"
<DataGrid Grid.Row="0" ItemsSource="{Binding ScanItems}" Background="Transparent"
FontSize="16" ColumnHeaderHeight="35"
RowHeight="31" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" HorizontalAlignment="Center"
Foreground="#31446E" >
Foreground="#31446E" x:Name="dataGrid" >
<!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Id}" Header="序号" Width="*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding RfidCode}" Header="RFID" Width="2*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding AtrCode}" Header="ATR" Width="2*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding OcrCode}" Header="OCR" Width="2*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding FilePath}" Header="图像路径" Width="2*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding RecordTime ,StringFormat=\{0:MM月dd日 HH:mm\}}" Header="记录时间" Width="1.5*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding CreateTime ,StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Header="记录时间" Width="1.5*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Rfid}" Header="RFID" Width="2*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Code}" Header="ATR" Width="2*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Ocr}" Header="OCR" Width="2*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding url}" Header="图像路径" Width="2*" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
</Border>

@ -1,4 +1,5 @@
using SlnMesnac.WPF.ViewModel;
using SlnMesnac.Model.domain;
using SlnMesnac.WPF.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;

@ -2,6 +2,7 @@
using CommunityToolkit.Mvvm.ComponentModel;
using LiveCharts;
using LiveCharts.Wpf;
using SlnMesnac.Model.domain;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@ -56,6 +57,36 @@ namespace SlnMesnac.WPF.ViewModel
ImagePath = "E:\\2024年项目\\RFID行李跟踪\\程序设计\\SlnMesnac.RfidIdentification\\SlnMesnac.WPF\\bin\\Debug\\net6.0-windows\\picture\\3898291920.jpg";
RefreshLogMessage($"1#站台任务下发站台任务下发站台任务下发站台任务下发站台任务下发站台任务下发");
ScanItems = new ObservableCollection<ScanLogModel>()
{
new ScanLogModel {CreateTime = DateTime.Now,DataType=1,Rfid="20240918",Code="20240918",Ocr="20240918"},
new ScanLogModel {CreateTime = DateTime.Now,DataType=1,Rfid="20240918",Code="20240918",Ocr="20240918"},
new ScanLogModel {CreateTime = DateTime.Now,DataType=1,Rfid="20240918",Code="20240918",Ocr="20240918"},
};
TagCode = "20240918";
TagAmount = 362;
}
/// <summary>
/// 条码信息
/// </summary>
public string _tagCode;
public string TagCode
{
get => _tagCode;
set => SetProperty(ref _tagCode, value);
}
/// <summary>
/// 条码总数
/// </summary>
public int _tagAmount;
public int TagAmount
{
get => _tagAmount;
set => SetProperty(ref _tagAmount, value);
}
/// <summary>
@ -109,6 +140,18 @@ namespace SlnMesnac.WPF.ViewModel
set => SetProperty(ref _logMessages, value);
}
/// <summary>
/// 扫描记录
/// </summary>
private ObservableCollection<ScanLogModel> _scanItems = new ObservableCollection<ScanLogModel>();
public ObservableCollection<ScanLogModel> ScanItems
{
get => _scanItems;
set => SetProperty(ref _scanItems, value);
}
private ObservableCollection<string> listItems = new ObservableCollection<string>();
/// <summary>
/// 系统运行日志输出

@ -3,6 +3,7 @@ using GalaSoft.MvvmLight.Command;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using SlnMesnac.WPF.Page;
using SlnMesnac.WPF.Page.History;
using System;
using System.Windows;
@ -13,6 +14,7 @@ namespace SlnMesnac.WPF.ViewModel
private readonly ILogger<MainWindowViewModel> _logger;
private IndexControl indexControl = new IndexControl();
private HistoryControl historyControl = new HistoryControl();
#region 参数定义
/// <summary>
@ -85,6 +87,8 @@ namespace SlnMesnac.WPF.ViewModel
ControlOnClickCommand = new RelayCommand<object>(obj => ControlOnClick(obj));
FormControlCommand = new RelayCommand<object>(x => FormControl(x));
UserContent = indexControl;
}
/// <summary>
@ -146,6 +150,9 @@ namespace SlnMesnac.WPF.ViewModel
{
case "Index":
UserContent = indexControl; break;
case "History":
UserContent = historyControl; break;
//historyControl
default: break;
}
}

Loading…
Cancel
Save