126 lines
7.0 KiB
XML
126 lines
7.0 KiB
XML
<UserControl x:Class="FATrace.WPLApp.Views.DashboardView"
|
|
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:FATrace.WPLApp.Views"
|
|
xmlns:prism="http://prismlibrary.com/"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="720" d:DesignWidth="1280"
|
|
prism:ViewModelLocator.AutoWireViewModel="True">
|
|
<Grid Margin="12">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="2*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- 顶部统计卡片 -->
|
|
<Grid Grid.Row="0" Margin="0,0,0,10">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Border Grid.Column="0" Background="#F3F6FA" BorderBrush="#DDE3EB" BorderThickness="1" CornerRadius="6" Padding="12" Margin="0,0,10,0">
|
|
<StackPanel>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock FontFamily="/Assets/Fonts/#iconfont" FontSize="16" Text="" Margin="0,0,6,0"/>
|
|
<TextBlock Text="本日称重总量" Foreground="#55657E" FontSize="14"/>
|
|
</StackPanel>
|
|
<TextBlock Text="{Binding TodayWeight, StringFormat={}{0:N2} g}" FontSize="26" FontWeight="Bold"/>
|
|
</StackPanel>
|
|
</Border>
|
|
<Border Grid.Column="1" Background="#F3F6FA" BorderBrush="#DDE3EB" BorderThickness="1" CornerRadius="6" Padding="12" Margin="0,0,10,0">
|
|
<StackPanel>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock FontFamily="/Assets/Fonts/#iconfont" FontSize="16" Text="" Margin="0,0,6,0"/>
|
|
<TextBlock Text="本月称重总量" Foreground="#55657E" FontSize="14"/>
|
|
</StackPanel>
|
|
<TextBlock Text="{Binding MonthWeight, StringFormat={}{0:N2} g}" FontSize="26" FontWeight="Bold"/>
|
|
</StackPanel>
|
|
</Border>
|
|
<Border Grid.Column="2" Background="#F3F6FA" BorderBrush="#DDE3EB" BorderThickness="1" CornerRadius="6" Padding="12" Margin="0,0,10,0">
|
|
<StackPanel>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock FontFamily="/Assets/Fonts/#iconfont" FontSize="16" Text="" Margin="0,0,6,0"/>
|
|
<TextBlock Text="本年称重总量" Foreground="#55657E" FontSize="14"/>
|
|
</StackPanel>
|
|
<TextBlock Text="{Binding YearWeight, StringFormat={}{0:N2} g}" FontSize="26" FontWeight="Bold"/>
|
|
</StackPanel>
|
|
</Border>
|
|
<Border Grid.Column="3" Background="#F3F6FA" BorderBrush="#DDE3EB" BorderThickness="1" CornerRadius="6" Padding="12" Margin="0,0,10,0">
|
|
<StackPanel>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock FontFamily="/Assets/Fonts/#iconfont" FontSize="16" Text="" Margin="0,0,6,0"/>
|
|
<TextBlock Text="累计称重总量" Foreground="#55657E" FontSize="14"/>
|
|
</StackPanel>
|
|
<TextBlock Text="{Binding TotalWeight, StringFormat={}{0:N2} g}" FontSize="26" FontWeight="Bold"/>
|
|
</StackPanel>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<!-- 中部:实时运行信息 + 右侧状态 -->
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="2*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- 实时信息 -->
|
|
<Border Grid.Column="0" BorderBrush="#DDE3EB" BorderThickness="1" CornerRadius="6" Padding="8" Background="White" Margin="0,0,10,0">
|
|
<DockPanel>
|
|
<TextBlock DockPanel.Dock="Top" Text="实时运行信息(扫码/喷码)" FontWeight="Bold" FontSize="14" Margin="2,0,0,6"/>
|
|
<ListBox ItemsSource="{Binding LiveMessages}">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding}" FontFamily="Consolas" FontSize="13"/>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
</DockPanel>
|
|
</Border>
|
|
|
|
<!-- 右侧状态 -->
|
|
<Border Grid.Column="1" BorderBrush="#DDE3EB" BorderThickness="1" CornerRadius="6" Padding="12" Background="White">
|
|
<StackPanel>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock FontFamily="/Assets/Fonts/#iconfont" FontSize="16" Text="" Margin="0,0,6,0"/>
|
|
<TextBlock Text="设备/通信状态" FontWeight="Bold" FontSize="14"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,8,0,0" VerticalAlignment="Center">
|
|
<Ellipse Width="14" Height="14">
|
|
<Ellipse.Style>
|
|
<Style TargetType="Ellipse">
|
|
<Setter Property="Fill" Value="#D9534F"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding PlcConnected}" Value="True">
|
|
<Setter Property="Fill" Value="#5CB85C"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Ellipse.Style>
|
|
</Ellipse>
|
|
<TextBlock Text=" PLC连接" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
|
|
<Separator Margin="0,10,0,10"/>
|
|
<TextBlock Text="最近称重扫码" Foreground="#55657E"/>
|
|
<TextBox Text="{Binding LatestWeightScanCode}" IsReadOnly="True" FontFamily="Consolas"/>
|
|
|
|
<TextBlock Text="最近外箱扫码" Foreground="#55657E" Margin="0,8,0,0"/>
|
|
<TextBox Text="{Binding LatestBoxScanCode}" IsReadOnly="True" FontFamily="Consolas"/>
|
|
</StackPanel>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<!-- 底部:预留区域 -->
|
|
<Border Grid.Row="2" BorderBrush="#DDE3EB" BorderThickness="1" CornerRadius="6" Padding="12" Background="#F9FAFB" Margin="0,10,0,0">
|
|
<TextBlock Text="预留区域(可放置其他信息)" Foreground="#7A8CA6"/>
|
|
</Border>
|
|
</Grid>
|
|
</UserControl>
|