添加项目文件。
This commit is contained in:
250
SamplePreSystem.UI/Views/SampleManager/SampleExecView.xaml
Normal file
250
SamplePreSystem.UI/Views/SampleManager/SampleExecView.xaml
Normal file
@@ -0,0 +1,250 @@
|
||||
<UserControl
|
||||
x:Class="SamplePre.UIWpf.ParamManager.SampleExecView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:local="clr-namespace:SamplePre.UIWpf.ParamManager"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Background="#E6E6E6"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="*" />
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 样品列表 -->
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="0.3*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border
|
||||
Margin="5"
|
||||
Background="White"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel VerticalAlignment="Center">
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
Padding="6"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
FontWeight="Bold"
|
||||
Text="样品列表" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
|
||||
|
||||
<Button
|
||||
x:Name="btnAddSample"
|
||||
Command="{Binding BtnAddSampleClickCommand}"
|
||||
Content="添加"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="PackageVariantClosedPlus" />
|
||||
|
||||
<Button
|
||||
x:Name="btnDelSample"
|
||||
Margin="3"
|
||||
Command="{Binding BtnDelSampleClickCommand}"
|
||||
Content="删除"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="StoreRemove" />
|
||||
<Button
|
||||
x:Name="btnImportSample"
|
||||
Margin="3"
|
||||
Command="{Binding BtnImportSampleClickCommand}"
|
||||
Content="导入"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="Import" />
|
||||
<Button
|
||||
x:Name="btnCreateCmd"
|
||||
Margin="3"
|
||||
Command="{Binding BtnCreateCmdClickCommand}"
|
||||
Content="生成指令"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="Abacus" />
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
<DataGrid
|
||||
x:Name="dg_sample"
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="True"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding TubeInputs}"
|
||||
SelectedItem="{Binding SelectSample}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<!-- 表头背景色 -->
|
||||
<Setter Property="Background" Value="#F5F5F5" />
|
||||
<!-- 表头文字颜色 -->
|
||||
<!--
|
||||
<Setter Property="Foreground" Value="#2C7DBD"/>-->
|
||||
<!-- 表头高度 -->
|
||||
<Setter Property="Height" Value="35" />
|
||||
<!-- 表头文字居中 -->
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding qrcode}"
|
||||
Header="二维码" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding item_name}"
|
||||
Header="样品名称" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding standrad_id}"
|
||||
Header="标准ID" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding standrad}"
|
||||
Header="标准名称" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding input_user}"
|
||||
Header="录入人员" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding input_date}"
|
||||
Header="录入日期" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding bach_no}"
|
||||
Header="批号" />
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
|
||||
|
||||
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
Margin="0,5,5,5"
|
||||
Background="White"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Height="40"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
FontWeight="Bold"
|
||||
Text="指令批次" />
|
||||
</StackPanel>
|
||||
<!-- 指令列表 -->
|
||||
<DataGrid
|
||||
x:Name="dg_cmds"
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="True"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding CmdList}"
|
||||
SelectedItem="{Binding SelectItemCmd}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
|
||||
<!-- 引入行为 -->
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="MouseDoubleClick">
|
||||
<i:InvokeCommandAction Command="{Binding RowDoubleClickCommand}" PassEventArgsToCommand="True" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
|
||||
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<!-- 表头背景色 -->
|
||||
<Setter Property="Background" Value="#F5F5F5" />
|
||||
<!-- 表头高度 -->
|
||||
<Setter Property="Height" Value="35" />
|
||||
<!-- 表头文字居中 -->
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding exec_state}"
|
||||
Header="状态" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding standradName}"
|
||||
Header="指令集" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding sample_count}"
|
||||
Header="数量" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,38 @@
|
||||
using Models.Models;
|
||||
using SamplePre.UIWpf.ParamManager.chirld;
|
||||
using SamplePre.UIWpf.SampleManager.chirld;
|
||||
using SamplePreSystem.UI.ViewModel.SampleManager;
|
||||
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;
|
||||
using System.Xml.XPath;
|
||||
|
||||
namespace SamplePre.UIWpf.ParamManager
|
||||
{
|
||||
/// <summary>
|
||||
/// ParamManagerView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SampleExecView : UserControl
|
||||
{
|
||||
SampleExecViewModel viewModel = new SampleExecViewModel();
|
||||
public SampleExecView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<local:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.SampleManager.chirld.ActionShowWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="命令下发"
|
||||
Width="400"
|
||||
Height="500"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="10,0"
|
||||
Command="{Binding CmdDoClickCommand}"
|
||||
Content="下发命令" />
|
||||
<Button
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="10,0"
|
||||
Command="{Binding InitPlcStateCommand}"
|
||||
Content="复位" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- 指令列表 -->
|
||||
<DataGrid
|
||||
x:Name="dg_cmds"
|
||||
Grid.Row="1"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="True"
|
||||
FrozenColumnCount="1"
|
||||
HeadersVisibility="None"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
ItemsSource="{Binding ActionParmList}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<!-- 分组样式 -->
|
||||
<DataGrid.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel
|
||||
Height="25"
|
||||
Background="#EEEEEE"
|
||||
LastChildFill="True">
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding Name}" />
|
||||
</DockPanel>
|
||||
</DataTemplate>
|
||||
</GroupStyle.HeaderTemplate>
|
||||
</GroupStyle>
|
||||
</DataGrid.GroupStyle>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<!--<DataGridTextColumn Header="动作" Binding="{Binding action_name}" Width="*"/>-->
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding title}"
|
||||
Header="参数名称"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_value}"
|
||||
Header="值"
|
||||
IsReadOnly="False" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding unit}"
|
||||
Header="单位"
|
||||
IsReadOnly="True" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</local:BaseWindow>
|
||||
@@ -0,0 +1,46 @@
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.SampleManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
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.Shapes;
|
||||
|
||||
namespace SamplePre.UIWpf.SampleManager.chirld
|
||||
{
|
||||
/// <summary>
|
||||
/// ActionShowWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ActionShowWindow : BaseWindow
|
||||
{
|
||||
public ActionShowWindow(SampleExecViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = viewModel;
|
||||
|
||||
viewModel.InitCmdData();
|
||||
|
||||
|
||||
ListCollectionView view = (ListCollectionView)CollectionViewSource.GetDefaultView(viewModel.ActionParmList);//获取数据视图
|
||||
|
||||
////分组
|
||||
//view.SortDescriptions.Add(new SortDescription("action_seqno", ListSortDirection.Ascending));
|
||||
view.GroupDescriptions.Clear();
|
||||
view.GroupDescriptions.Add(new PropertyGroupDescription("actionAndseqno"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
<local:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.ParamManager.chirld.ImportSampleWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="导入历史样品"
|
||||
Width="900"
|
||||
Height="650"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Margin="10,0" Orientation="Horizontal">
|
||||
<FrameworkElement x:Name="DataContextProxy" Visibility="Collapsed" />
|
||||
|
||||
<TextBlock VerticalAlignment="Center" Text="时间:" />
|
||||
<DatePicker
|
||||
Width="140"
|
||||
Height="40"
|
||||
Margin="10,0"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
SelectedDate="{Binding StartDate}" />
|
||||
<TextBlock VerticalAlignment="Center" Text="—" />
|
||||
<DatePicker
|
||||
Width="140"
|
||||
Height="40"
|
||||
Margin="10,0"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
SelectedDate="{Binding EndDate}" />
|
||||
|
||||
|
||||
<Button
|
||||
x:Name="btnFind"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="15,0,5,0"
|
||||
Command="{Binding FindClickCommand}"
|
||||
Content="查询" />
|
||||
<Button
|
||||
x:Name="btnImport"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5,0"
|
||||
Command="{Binding ImportClickCommand}"
|
||||
Content="导入" />
|
||||
</StackPanel>
|
||||
<!-- 样品列表 -->
|
||||
<DataGrid
|
||||
x:Name="dg_samples"
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="True"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
ItemsSource="{Binding SampleList}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
|
||||
|
||||
|
||||
<!-- 分组样式 -->
|
||||
<DataGrid.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel Height="25" LastChildFill="True">
|
||||
<Border Background="Transparent">
|
||||
<CheckBox
|
||||
Command="{Binding DataContext.CheckBoxClickCommand, Source={x:Reference DataContextProxy}}"
|
||||
CommandParameter="{Binding RelativeSource={RelativeSource Self}}"
|
||||
Content="{Binding Name}"
|
||||
FontWeight="Bold"
|
||||
IsChecked="{Binding DataContext.IsGroupSelected, Source={x:Reference DataContextProxy}}" />
|
||||
</Border>
|
||||
|
||||
<!--<TextBlock
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding Name}" />-->
|
||||
</DockPanel>
|
||||
</DataTemplate>
|
||||
</GroupStyle.HeaderTemplate>
|
||||
</GroupStyle>
|
||||
</DataGrid.GroupStyle>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<!-- 列头复选框样式 -->
|
||||
<DataGridCheckBoxColumn Binding="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridCheckBoxColumn.Header>
|
||||
<Border Background="Transparent">
|
||||
<CheckBox IsChecked="{Binding DataContext.IsAllItems1Selected, Source={x:Reference DataContextProxy}}" />
|
||||
</Border>
|
||||
</DataGridCheckBoxColumn.Header>
|
||||
<DataGridCheckBoxColumn.HeaderStyle>
|
||||
<Style BasedOn="{StaticResource MaterialDesignDataGridColumnHeader}" TargetType="{x:Type DataGridColumnHeader}">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
</Style>
|
||||
</DataGridCheckBoxColumn.HeaderStyle>
|
||||
</DataGridCheckBoxColumn>
|
||||
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding qrcode}"
|
||||
Header="二维码"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding item_name}"
|
||||
Header="样品名称"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding standrad}"
|
||||
Header="标准"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding input_date}"
|
||||
Header="录入日期"
|
||||
IsReadOnly="False" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding bach_no}"
|
||||
Header="批次"
|
||||
IsReadOnly="True" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</local:BaseWindow>
|
||||
@@ -0,0 +1,52 @@
|
||||
using Models.Models;
|
||||
using SamplePre.Models.Ext;
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.Child;
|
||||
using SamplePreSystem.UI.ViewModel.SampleManager;
|
||||
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.Shapes;
|
||||
|
||||
namespace SamplePre.UIWpf.ParamManager.chirld
|
||||
{
|
||||
/// <summary>
|
||||
/// ImportSampleWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ImportSampleWindow : BaseWindow
|
||||
{
|
||||
|
||||
|
||||
|
||||
public ImportSampleWindow(SampleExecViewModel sampleExecViewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
ImportSampleViewModel vm = new ImportSampleViewModel(sampleExecViewModel);
|
||||
|
||||
//关闭窗口委托
|
||||
vm.CloseAction = (val) => DialogResult = val;
|
||||
|
||||
this.DataContext = vm;
|
||||
|
||||
ListCollectionView view = (ListCollectionView)CollectionViewSource.GetDefaultView(vm.SampleList);//获取数据视图
|
||||
|
||||
//分组
|
||||
view.GroupDescriptions.Add(new PropertyGroupDescription("bach_no"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
<local:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.SampleManager.chirld.NewSampleWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="样品管理"
|
||||
Width="400"
|
||||
Height="350"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="50" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock VerticalAlignment="Center" Text="样品类型:" />
|
||||
<ComboBox
|
||||
x:Name="cmbSampleType"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalContentAlignment="Center"
|
||||
DisplayMemberPath="data_type"
|
||||
ItemsSource="{Binding SampleTypeDict}"
|
||||
SelectedItem="{Binding SelectSampleType}"
|
||||
SelectedValuePath="id" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
Text="检样名:" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding TubeInput.item_name}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
VerticalAlignment="Center"
|
||||
Text="执行标准:" />
|
||||
<!--<ComboBox x:Name="cmbStandard" Grid.Row="2" Grid.Column="1"
|
||||
ItemsSource="{Binding StandardList}"
|
||||
DisplayMemberPath="standard_name"
|
||||
SelectedValuePath="id"
|
||||
SelectedItem="{Binding SelectStandard}"
|
||||
Width="250" Height="30" HorizontalAlignment="Left" VerticalContentAlignment="Center"/>-->
|
||||
|
||||
|
||||
<!-- 多选下拉框,选择后在上方显示选中内容 -->
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Orientation="Vertical">
|
||||
<!-- 显示已选中的内容 -->
|
||||
<TextBox
|
||||
x:Name="txtSelectedStandards"
|
||||
Width="250"
|
||||
Height="30"
|
||||
materialDesign:HintAssist.Hint="已选执行标准"
|
||||
FontSize="13"
|
||||
IsReadOnly="True" />
|
||||
|
||||
<!-- 多选下拉框 -->
|
||||
<ComboBox
|
||||
x:Name="cmbDataType"
|
||||
Width="250"
|
||||
Height="30"
|
||||
Margin="0,-30,0,0"
|
||||
ItemsSource="{Binding StandardList}">
|
||||
<!-- 覆盖上去,视觉一体 -->
|
||||
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox
|
||||
Margin="4,2"
|
||||
Click="ckbStand_Click"
|
||||
Content="{Binding standard_name}"
|
||||
IsChecked="{Binding IsSelected, Mode=TwoWay}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<!--<ComboBox x:Name="cmbDataType" ItemsSource="{Binding StandardList}"
|
||||
Grid.Row="2" Grid.Column="1"
|
||||
Width="250" Height="30"
|
||||
materialDesign:HintAssist.Hint="请选择执行标准" >
|
||||
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox x:Name="ckbStand" Click="ckbStand_Click" Content="{Binding standard_name}" IsChecked="{Binding IsSelected, Mode=TwoWay}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>-->
|
||||
|
||||
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
VerticalAlignment="Center"
|
||||
Text="样品编号:" />
|
||||
<TextBox
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding TubeInput.qrcode}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="4"
|
||||
VerticalAlignment="Center"
|
||||
Text="样品数量:" />
|
||||
<TextBox
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding TubeInput.tube_count}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="5"
|
||||
VerticalAlignment="Center"
|
||||
Text="录入人员:" />
|
||||
<ComboBox
|
||||
x:Name="cmbParamType"
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding TubeInput.input_user}">
|
||||
<ComboBoxItem Content="人员1" />
|
||||
<ComboBoxItem Content="人员2" />
|
||||
<ComboBoxItem Content="人员3" />
|
||||
</ComboBox>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="0,10,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnOK"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Command="{Binding BtnOKClickCommand}"
|
||||
Content="确定" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnCancel_Click"
|
||||
Content="取消" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</local:BaseWindow>
|
||||
@@ -0,0 +1,64 @@
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.SampleManager;
|
||||
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.Animation;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using System.Xml.XPath;
|
||||
|
||||
namespace SamplePre.UIWpf.SampleManager.chirld
|
||||
{
|
||||
/// <summary>
|
||||
/// NewSampleWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NewSampleWindow : BaseWindow
|
||||
{
|
||||
|
||||
public NewSampleWindow(SampleExecViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
viewModel.CloseAction = (val) => this.DialogResult = val;
|
||||
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
|
||||
private void ckbStand_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
e.Handled = true;
|
||||
UpdateSelectedText();
|
||||
}
|
||||
|
||||
// 把选中的项显示在文本框中
|
||||
private void UpdateSelectedText()
|
||||
{
|
||||
var selected = cmbDataType.ItemsSource.Cast<dynamic>()
|
||||
.Where(x => x.IsSelected == true)
|
||||
.Select(x => x.standard_name);
|
||||
|
||||
txtSelectedStandards.Text = string.Join(",", selected);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user