添加项目文件。
This commit is contained in:
110
MonitorModule/Views/Dialogs/ValueLimitView.xaml
Normal file
110
MonitorModule/Views/Dialogs/ValueLimitView.xaml
Normal file
@@ -0,0 +1,110 @@
|
||||
<UserControl x:Class="MonitorModule.Views.Dialogs.ValueLimitView"
|
||||
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:MonitorModule.Views.Dialogs"
|
||||
xmlns:oxy="http://oxyplot.org/wpf"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
mc:Ignorable="d"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
xmlns:cons="clr-namespace:UIShare.Converters;assembly=UIShare"
|
||||
Background="White"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
Height="500"
|
||||
Width="900">
|
||||
<prism:Dialog.WindowStyle>
|
||||
<Style BasedOn="{StaticResource DialogUserManageStyle}"
|
||||
TargetType="Window" />
|
||||
</prism:Dialog.WindowStyle>
|
||||
<GroupBox Padding="0,0,0,0"
|
||||
MouseLeftButtonDown="MouseLeftButtonDown">
|
||||
<GroupBox.Header>
|
||||
<Grid Margin="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="上下限设置"
|
||||
Foreground="White"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,10,0" />
|
||||
<Button Content="关闭"
|
||||
Grid.Column="2"
|
||||
Margin="150 0 0 0"
|
||||
Width="60"
|
||||
Command="{Binding CloseCommand}"
|
||||
Height="25" />
|
||||
|
||||
</Grid>
|
||||
</GroupBox.Header>
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<DataGrid SelectedItem="{Binding SelectValueLimitVM}"
|
||||
SelectionUnit="FullRow"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
IsReadOnly="False"
|
||||
ItemsSource="{Binding ValueLimitList}"
|
||||
Margin="0,0,0,10">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="信号名"
|
||||
Binding="{Binding SignalName}"
|
||||
Width="auto" />
|
||||
<DataGridTextColumn Header="上限"
|
||||
Binding="{Binding Upper, Mode=TwoWay}"
|
||||
Width="auto" />
|
||||
<DataGridTextColumn Header="下限"
|
||||
Binding="{Binding Lower, Mode=TwoWay}"
|
||||
Width="auto" />
|
||||
<DataGridTextColumn Header="上极限"
|
||||
Binding="{Binding UpperExtreme, Mode=TwoWay}"
|
||||
Width="auto" />
|
||||
<DataGridTextColumn Header="下极限"
|
||||
Binding="{Binding LowerExtreme, Mode=TwoWay}"
|
||||
Width="auto" />
|
||||
<DataGridTextColumn Header="报警状态"
|
||||
Binding="{Binding AlarmSatus}"
|
||||
Width="auto" />
|
||||
|
||||
</DataGrid.Columns>
|
||||
<!--<DataGrid.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="删除"
|
||||
Foreground="Red"
|
||||
Command="{Binding DeleteCommand}" />
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>-->
|
||||
</DataGrid>
|
||||
<!--<StackPanel Grid.Row="1"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,10,0,0">
|
||||
<Label Content="待添加监控值"
|
||||
VerticalAlignment="Center" />
|
||||
<ComboBox ItemsSource="{Binding DeviceSingleList}"
|
||||
SelectedItem="{Binding SelectCurve}"
|
||||
materialDesign:HintAssist.Hint=""
|
||||
MinWidth="130"
|
||||
VerticalAlignment="Center" />
|
||||
<Button Content="添加"
|
||||
Margin="10,0,10,0"
|
||||
Command="{Binding SelectSignalCommand}" />
|
||||
</StackPanel>-->
|
||||
<StackPanel Grid.Row="1"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,10,0,0">
|
||||
<Button Content="保存"
|
||||
Width="80"
|
||||
Margin="0,0,10,0"
|
||||
Command="{Binding SaveCommand}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</UserControl>
|
||||
36
MonitorModule/Views/Dialogs/ValueLimitView.xaml.cs
Normal file
36
MonitorModule/Views/Dialogs/ValueLimitView.xaml.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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 MonitorModule.Views.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// ValueLimitView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ValueLimitView : UserControl
|
||||
{
|
||||
public ValueLimitView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.LeftButton == MouseButtonState.Pressed)
|
||||
{
|
||||
Window.GetWindow(this)?.DragMove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
228
MonitorModule/Views/MonitorView.xaml
Normal file
228
MonitorModule/Views/MonitorView.xaml
Normal file
@@ -0,0 +1,228 @@
|
||||
<UserControl x:Class="MonitorModule.Views.MonitorView"
|
||||
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
xmlns:b="clr-namespace:UIShare.Behaviors;assembly=UIShare"
|
||||
xmlns:converters="clr-namespace:UIShare.Converters;assembly=UIShare"
|
||||
xmlns:oxy="http://oxyplot.org/wpf"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="700"
|
||||
d:DesignWidth="1200">
|
||||
<UserControl.Resources>
|
||||
<converters:LessThanConverter x:Key="LessThanConverter"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Border Background="#F5F7FA">
|
||||
<i:Interaction.Behaviors>
|
||||
<b:MouseDoubleClickBehavior
|
||||
Command="{Binding DataContext.RefreshCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"/>
|
||||
</i:Interaction.Behaviors>
|
||||
|
||||
<Grid x:Name="RootGrid" Margin="8">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition>
|
||||
<RowDefinition.Style>
|
||||
<Style TargetType="RowDefinition">
|
||||
<Setter Property="Height" Value="Auto"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ActualWidth, ElementName=RootGrid, Converter={StaticResource LessThanConverter}, ConverterParameter=600}" Value="True">
|
||||
<Setter Property="Height" Value="0"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</RowDefinition.Style>
|
||||
</RowDefinition>
|
||||
<RowDefinition>
|
||||
<RowDefinition.Style>
|
||||
<Style TargetType="RowDefinition">
|
||||
<Setter Property="Height" Value="Auto"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ActualWidth, ElementName=RootGrid, Converter={StaticResource LessThanConverter}, ConverterParameter=600}" Value="True">
|
||||
<Setter Property="Height" Value="0"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</RowDefinition.Style>
|
||||
</RowDefinition>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition>
|
||||
<RowDefinition.Style>
|
||||
<Style TargetType="RowDefinition">
|
||||
<Setter Property="Height" Value="Auto"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ActualWidth, ElementName=RootGrid, Converter={StaticResource LessThanConverter}, ConverterParameter=600}" Value="True">
|
||||
<Setter Property="Height" Value="0"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</RowDefinition.Style>
|
||||
</RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- ====== Row0:标题 ====== -->
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding TestStatus, StringFormat=监控界面 - {0}}"
|
||||
FontSize="20" FontWeight="Bold"
|
||||
Margin="4,0,0,8"/>
|
||||
|
||||
<!-- ====== Row1:工具栏 ====== -->
|
||||
<Border Grid.Row="1"
|
||||
Background="White"
|
||||
BorderBrush="#DDD" BorderThickness="1"
|
||||
CornerRadius="4" Padding="8" Margin="0,0,0,6">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Content="+ 添加监测项"
|
||||
Command="{Binding AddChannelCommand}"
|
||||
Padding="12,4"/>
|
||||
<Button Content="− 删除监测项"
|
||||
Command="{Binding DeleteChannelCommand}"
|
||||
Padding="12,4" Margin="6,0,0,0"/>
|
||||
<Button Content="↺ 复原视图"
|
||||
Command="{Binding ResetViewCommand}"
|
||||
Padding="12,4" Margin="20,0,0,0"
|
||||
ToolTip="按数据范围重置坐标轴缩放/平移"/>
|
||||
<Button Content="⟳ 刷新"
|
||||
Command="{Binding RefreshDataCommand}"
|
||||
Padding="12,4" Margin="6,0,0,0"
|
||||
ToolTip="重新绘制图表"/>
|
||||
<Button Content=" 保存"
|
||||
Command="{Binding SaveCommand}"
|
||||
Padding="12,4" Margin="6,0,0,0"
|
||||
ToolTip="保存到配置文件"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- ====== Row2:主体 ====== -->
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition>
|
||||
<ColumnDefinition.Style>
|
||||
<Style TargetType="ColumnDefinition">
|
||||
<Setter Property="Width" Value="280"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ActualWidth, ElementName=RootGrid, Converter={StaticResource LessThanConverter}, ConverterParameter=600}" Value="True">
|
||||
<Setter Property="Width" Value="0"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ColumnDefinition.Style>
|
||||
</ColumnDefinition>
|
||||
|
||||
<ColumnDefinition>
|
||||
<ColumnDefinition.Style>
|
||||
<Style TargetType="ColumnDefinition">
|
||||
<Setter Property="Width" Value="6"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ActualWidth, ElementName=RootGrid, Converter={StaticResource LessThanConverter}, ConverterParameter=600}" Value="True">
|
||||
<Setter Property="Width" Value="0"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ColumnDefinition.Style>
|
||||
</ColumnDefinition>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 左侧:可用方法列表 + 已添加监测通道列表 -->
|
||||
<Border Grid.Column="0"
|
||||
Background="White"
|
||||
BorderBrush="#DDD" BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 可用方法列表 -->
|
||||
<Border Grid.Row="0" Background="#ECEFF4" Padding="8,4">
|
||||
<TextBlock Text="可用监测项(选择后点击添加)" FontWeight="Bold"/>
|
||||
</Border>
|
||||
<ListBox Grid.Row="1"
|
||||
ItemsSource="{Binding AvailableMethods}"
|
||||
SelectedItem="{Binding SelectedAvailableMethod}"
|
||||
BorderThickness="0">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DisplayName}" Margin="2"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<!-- 分隔 -->
|
||||
<Border Grid.Row="2" Background="#ECEFF4" Padding="8,4">
|
||||
<TextBlock Text="已添加监测通道" FontWeight="Bold"/>
|
||||
</Border>
|
||||
|
||||
<!-- 监测通道列表(带显示/隐藏CheckBox) -->
|
||||
<ListBox Grid.Row="3"
|
||||
ItemsSource="{Binding Channels}"
|
||||
SelectedItem="{Binding SelectedChannel}"
|
||||
BorderThickness="0">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="2">
|
||||
<DockPanel>
|
||||
<!-- 显示/隐藏复选框 -->
|
||||
<CheckBox IsChecked="{Binding IsDisplayed}"
|
||||
VerticalAlignment="Center"
|
||||
ToolTip="勾选=在图表上显示,取消=仅记录不显示"/>
|
||||
<!-- 颜色色块 -->
|
||||
<Border Width="10" Height="10"
|
||||
CornerRadius="2"
|
||||
VerticalAlignment="Center"
|
||||
Margin="4,0,6,0">
|
||||
<Border.Background>
|
||||
<SolidColorBrush Color="SteelBlue"/>
|
||||
</Border.Background>
|
||||
</Border>
|
||||
<TextBlock Text="{Binding DisplayName}"
|
||||
VerticalAlignment="Center"
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<!-- 状态 -->
|
||||
<TextBlock Grid.Row="4"
|
||||
Text="{Binding StatusMessage}"
|
||||
FontSize="11" Foreground="#666"
|
||||
Margin="4,2" TextWrapping="Wrap"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<GridSplitter Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="Transparent"/>
|
||||
|
||||
<!-- 右侧:OxyPlot 图表 -->
|
||||
<Border Grid.Column="2"
|
||||
Background="White"
|
||||
BorderBrush="#DDD" BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<oxy:PlotView Model="{Binding Plot}"
|
||||
Background="Transparent"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- ====== Row3:状态栏 ====== -->
|
||||
<Border Grid.Row="3"
|
||||
Background="#ECEFF4"
|
||||
Padding="8,4" Margin="0,6,0,0"
|
||||
CornerRadius="2">
|
||||
<TextBlock Text="{Binding StatusMessage}"
|
||||
Foreground="#444"
|
||||
FontSize="12"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
28
MonitorModule/Views/MonitorView.xaml.cs
Normal file
28
MonitorModule/Views/MonitorView.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 MonitorModule.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// MonitorView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class MonitorView : UserControl
|
||||
{
|
||||
public MonitorView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
197
MonitorModule/Views/RecordView.xaml
Normal file
197
MonitorModule/Views/RecordView.xaml
Normal file
@@ -0,0 +1,197 @@
|
||||
<UserControl x:Class="MonitorModule.Views.RecordView"
|
||||
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
xmlns:b="clr-namespace:UIShare.Behaviors;assembly=UIShare"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="700"
|
||||
d:DesignWidth="1200">
|
||||
<!-- 外层 Border:1) 装 MouseDoubleClickBehavior 实现九宫格双击展开;
|
||||
2) 给整个记录界面一个浅色背景 -->
|
||||
<Border Background="#F5F7FA">
|
||||
<i:Interaction.Behaviors>
|
||||
<b:MouseDoubleClickBehavior
|
||||
Command="{Binding DataContext.RefreshCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"/>
|
||||
</i:Interaction.Behaviors>
|
||||
|
||||
<Grid Margin="8">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<!-- 标题 -->
|
||||
<RowDefinition Height="Auto"/>
|
||||
<!-- 工具栏 -->
|
||||
<RowDefinition Height="*"/>
|
||||
<!-- 数据表 -->
|
||||
<RowDefinition Height="Auto"/>
|
||||
<!-- 分页 -->
|
||||
<RowDefinition Height="Auto"/>
|
||||
<!-- 状态栏 -->
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 顶部:工位名称(区分九宫格) -->
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding TestStatus, StringFormat=记录界面 - {0}}"
|
||||
FontSize="20" FontWeight="Bold"
|
||||
Margin="4,0,0,8"/>
|
||||
|
||||
<!-- 工具栏:监测项筛选 / 台架筛选 / 日期筛选 / 查询 / 清除 / 导出 -->
|
||||
<Border Grid.Row="1"
|
||||
Background="White"
|
||||
BorderBrush="#DDD" BorderThickness="1"
|
||||
CornerRadius="4" Padding="8" Margin="0,0,0,6">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="200"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="150"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="150"/>
|
||||
<ColumnDefinition Width="150"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 监测项 -->
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="监测项:"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,4,0"/>
|
||||
<ComboBox Grid.Column="1"
|
||||
materialDesign:HintAssist.Hint="全部"
|
||||
ItemsSource="{Binding MonitorNames}"
|
||||
SelectedItem="{Binding SelectedMonitorName}"
|
||||
IsEditable="True"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<!-- 台架 -->
|
||||
<TextBlock Grid.Column="2"
|
||||
Text="台架:"
|
||||
VerticalAlignment="Center"
|
||||
Margin="12,0,4,0"/>
|
||||
<ComboBox Grid.Column="3"
|
||||
materialDesign:HintAssist.Hint="全部"
|
||||
ItemsSource="{Binding ScopeNames}"
|
||||
SelectedItem="{Binding SelectedScope}"
|
||||
IsEditable="True"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<!-- 日期 -->
|
||||
<TextBlock Grid.Column="4"
|
||||
Text="日期:"
|
||||
VerticalAlignment="Center"
|
||||
Margin="12,0,4,0"/>
|
||||
<DatePicker Grid.Column="5"
|
||||
SelectedDate="{Binding SelectedStartDate}"
|
||||
materialDesign:HintAssist.Hint="开始时间"
|
||||
VerticalAlignment="Center"/>
|
||||
<DatePicker Grid.Column="6"
|
||||
Margin=" 5 0 0 0"
|
||||
SelectedDate="{Binding SelectedEndDate}"
|
||||
materialDesign:HintAssist.Hint="结束时间"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<!-- 按钮 -->
|
||||
<Button Grid.Column="7"
|
||||
Content="查询"
|
||||
Command="{Binding QueryCommand}"
|
||||
Padding="12,4" Margin="12,0,0,0"/>
|
||||
<Button Grid.Column="8"
|
||||
Content="清除"
|
||||
Command="{Binding ClearFilterCommand}"
|
||||
Padding="12,4" Margin="6,0,0,0"/>
|
||||
<Button Grid.Column="9"
|
||||
Content="导出 CSV"
|
||||
Command="{Binding ExportCsvCommand}"
|
||||
Padding="12,4" Margin="6,0,0,0"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- DataGrid:显式列定义,隐藏 Id / IsDel -->
|
||||
<DataGrid Grid.Row="2"
|
||||
ItemsSource="{Binding ResultTable}"
|
||||
AutoGenerateColumns="False"
|
||||
IsReadOnly="True"
|
||||
CanUserAddRows="False"
|
||||
CanUserDeleteRows="False"
|
||||
GridLinesVisibility="All"
|
||||
HeadersVisibility="All"
|
||||
AlternatingRowBackground="#F9FAFB"
|
||||
RowBackground="White"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="监测项" Binding="{Binding MonitorName}" Width="*"/>
|
||||
<DataGridTextColumn Header="监测值" Binding="{Binding MonitorValue}" Width="120"/>
|
||||
<DataGridTextColumn Header="台架" Binding="{Binding Scope}" Width="120"/>
|
||||
<DataGridTextColumn Header="记录时间" Binding="{Binding CreateTime, StringFormat=yyyy-MM-dd HH:mm:ss}" Width="180"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<!-- 分页控件 -->
|
||||
<Border Grid.Row="3"
|
||||
Background="White"
|
||||
BorderBrush="#DDD" BorderThickness="1"
|
||||
CornerRadius="4" Padding="8" Margin="0,6,0,0">
|
||||
<Grid>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Left">
|
||||
<TextBlock Text="每页:" VerticalAlignment="Center"/>
|
||||
<ComboBox Text="{Binding PageSize, Mode=TwoWay, UpdateSourceTrigger=LostFocus}"
|
||||
IsEditable="True"
|
||||
materialDesign:HintAssist.Hint="页码"
|
||||
Width="80" VerticalAlignment="Center" Margin="4,0,0,0">
|
||||
<ComboBoxItem Content="20"/>
|
||||
<ComboBoxItem Content="50"/>
|
||||
<ComboBoxItem Content="100"/>
|
||||
<ComboBoxItem Content="200"/>
|
||||
<ComboBoxItem Content="500"/>
|
||||
</ComboBox>
|
||||
<TextBlock Text="{Binding TotalCount, StringFormat=共 {0} 行}"
|
||||
VerticalAlignment="Center" Margin="16,0,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Right">
|
||||
<Button Content="« 首页"
|
||||
Command="{Binding FirstPageCommand}"
|
||||
Padding="10,3"/>
|
||||
<Button Content="‹ 上一页"
|
||||
Command="{Binding PrevPageCommand}"
|
||||
Padding="10,3" Margin="6,0,0,0"/>
|
||||
<TextBlock VerticalAlignment="Center" Margin="12,0">
|
||||
<Run Text="第 "/>
|
||||
<Run Text="{Binding PageIndex}" FontWeight="Bold"/>
|
||||
<Run Text=" / "/>
|
||||
<Run Text="{Binding TotalPages, Mode=OneWay}" FontWeight="Bold"/>
|
||||
<Run Text=" 页"/>
|
||||
</TextBlock>
|
||||
<Button Content="下一页 ›"
|
||||
Command="{Binding NextPageCommand}"
|
||||
Padding="10,3"/>
|
||||
<Button Content="末页 »"
|
||||
Command="{Binding LastPageCommand}"
|
||||
Padding="10,3" Margin="6,0,0,0"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 底部状态栏 -->
|
||||
<Border Grid.Row="4"
|
||||
Background="#ECEFF4"
|
||||
Padding="8,4" Margin="0,6,0,0"
|
||||
CornerRadius="2">
|
||||
<TextBlock Text="{Binding StatusMessage}"
|
||||
Foreground="#444"
|
||||
FontSize="12"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
28
MonitorModule/Views/RecordView.xaml.cs
Normal file
28
MonitorModule/Views/RecordView.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 MonitorModule.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// RecordView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class RecordView : UserControl
|
||||
{
|
||||
public RecordView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user