初版
This commit is contained in:
125
FATrace.WPLApp/Views/DashboardView.xaml
Normal file
125
FATrace.WPLApp/Views/DashboardView.xaml
Normal file
@@ -0,0 +1,125 @@
|
||||
<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>
|
||||
28
FATrace.WPLApp/Views/DashboardView.xaml.cs
Normal file
28
FATrace.WPLApp/Views/DashboardView.xaml.cs
Normal file
@@ -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 FATrace.WPLApp.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// DashboardView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DashboardView : UserControl
|
||||
{
|
||||
public DashboardView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
<Grid Margin="2,1,2,2" Background="#f6f5ec">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="2*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
@@ -78,13 +78,34 @@
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<StackPanel Style="{StaticResource StackPanelStyle}">
|
||||
<Ellipse
|
||||
Width="10"
|
||||
Height="10"
|
||||
Margin="0,0,6,0">
|
||||
<Ellipse.Style>
|
||||
<Style TargetType="Ellipse">
|
||||
<Setter Property="Fill" Value="Red" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding SysRunService.PlcLinkState}" Value="True">
|
||||
<Setter Property="Fill" Value="Lime" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Ellipse.Style>
|
||||
</Ellipse>
|
||||
<TextBlock Style="{StaticResource TextBlockIcon}" Text="" />
|
||||
<TextBlock Style="{StaticResource TextBlockStyle}" Text="PLC通信:" />
|
||||
<TextBlock Style="{StaticResource TextBlockStyle}" Text="PLC:" />
|
||||
<TextBlock
|
||||
Margin="5,0"
|
||||
FontSize="16"
|
||||
Foreground="White"
|
||||
Text="{Binding SysRunService.PlcEndPoint}" />
|
||||
<TextBlock Style="{StaticResource TextBlockStyle}" Text="/" />
|
||||
<TextBlock Style="{StaticResource TextBlockStyle}" Text="{Binding SysRunService.SysRunState.ComMsg}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Column="2" Style="{StaticResource BoardStyle}">
|
||||
<!--<Border Grid.Column="2" Style="{StaticResource BoardStyle}">
|
||||
<StackPanel Style="{StaticResource StackPanelStyle}">
|
||||
<TextBlock Style="{StaticResource TextBlockIcon}" Text="" />
|
||||
<TextBlock Style="{StaticResource TextBlockStyle}" Text="数据记录:" />
|
||||
@@ -94,9 +115,9 @@
|
||||
Foreground="White"
|
||||
Text="{Binding c}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Border>-->
|
||||
|
||||
<Border Grid.Column="3">
|
||||
<Border Grid.Column="2">
|
||||
<Border.Style>
|
||||
<Style BasedOn="{StaticResource BoardStyle}" TargetType="Border">
|
||||
<Style.Triggers>
|
||||
|
||||
Reference in New Issue
Block a user