添加项目文件。
This commit is contained in:
119
SamplePreSystem.UI/Views/ConfigManager/RoleView.xaml
Normal file
119
SamplePreSystem.UI/Views/ConfigManager/RoleView.xaml
Normal file
@@ -0,0 +1,119 @@
|
||||
<UserControl
|
||||
x:Class="SamplePre.UIWpf.ConfigManager.RoleView"
|
||||
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.ConfigManager"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Background="#e6e6e6"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Border
|
||||
Margin="5"
|
||||
Background="White"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
Text="用户列表" />
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnAdd"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5,0"
|
||||
Command="{Binding BtnAddClickCommand}"
|
||||
Content="新增"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="PackageVariantClosedPlus" />
|
||||
<Button
|
||||
x:Name="btnEdit"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5,0"
|
||||
Command="{Binding BtnEditClickCommand}"
|
||||
Content="编辑"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="ContentSaveEditOutline" />
|
||||
<Button
|
||||
x:Name="btnDele"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5,0"
|
||||
Command="{Binding BtnDeleClickCommand}"
|
||||
Content="删除"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="DeleteForeverOutline" />
|
||||
<Button
|
||||
x:Name="btnPermisson"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5,0"
|
||||
Command="{Binding BtnPermissonClickCommand}"
|
||||
Content="权限"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="LayersEdit" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
|
||||
<!-- 用户列表 -->
|
||||
<DataGrid
|
||||
x:Name="dg_roles"
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="True"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
ItemsSource="{Binding RolesList}"
|
||||
SelectedItem="{Binding ConfigRole}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
|
||||
<DataGrid.Columns>
|
||||
<!--<DataGridTextColumn Header="动作" Binding="{Binding action_name}" Width="*"/>-->
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding id}"
|
||||
Header="ID"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding name}"
|
||||
Header="角色名称"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding description}"
|
||||
Header="描述"
|
||||
IsReadOnly="True" />
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
|
||||
</UserControl>
|
||||
71
SamplePreSystem.UI/Views/ConfigManager/RoleView.xaml.cs
Normal file
71
SamplePreSystem.UI/Views/ConfigManager/RoleView.xaml.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using SamplePre.Models.Tables;
|
||||
using SamplePre.UIWpf.ConfigManager.chirld;
|
||||
using SamplePreSystem.UI.ViewModel.ConfigManager;
|
||||
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 SamplePre.UIWpf.ConfigManager
|
||||
{
|
||||
/// <summary>
|
||||
/// RoleView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class RoleView : UserControl
|
||||
{
|
||||
public RoleView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = new RoleViewModel();
|
||||
}
|
||||
|
||||
//private void btnAdd_Click(object sender, RoutedEventArgs e)
|
||||
//{
|
||||
// var vm = this.DataContext as RoleViewModel;
|
||||
|
||||
// vm.ConfigRole = new config_role();
|
||||
// NewRoleWindow frm = new NewRoleWindow(vm);
|
||||
// if (frm.ShowDialog() == true)
|
||||
// {
|
||||
// vm.GetData();
|
||||
// }
|
||||
//}
|
||||
|
||||
//private void btnEdit_Click(object sender, RoutedEventArgs e)
|
||||
//{
|
||||
// var vm = this.DataContext as RoleViewModel;
|
||||
|
||||
// NewRoleWindow frm = new NewRoleWindow(vm);
|
||||
// if (frm.ShowDialog() == true)
|
||||
// {
|
||||
// vm.GetData();
|
||||
// }
|
||||
//}
|
||||
|
||||
private void btnDele_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var vm = this.DataContext as RoleViewModel;
|
||||
vm.DeleteRole();
|
||||
}
|
||||
|
||||
private void btnPermisson_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var vm = this.DataContext as RoleViewModel;
|
||||
|
||||
if (string.IsNullOrEmpty(vm.ConfigRole.id)) return;
|
||||
PermissionWindow frm = new PermissionWindow(vm);
|
||||
frm.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
211
SamplePreSystem.UI/Views/ConfigManager/SysConfigMangerView.xaml
Normal file
211
SamplePreSystem.UI/Views/ConfigManager/SysConfigMangerView.xaml
Normal file
@@ -0,0 +1,211 @@
|
||||
<UserControl
|
||||
x:Class="SamplePreSystem.UI.ConfigManager.SysConfigMangerView"
|
||||
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:SamplePreSystem.UI.ConfigManager"
|
||||
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.ColumnDefinitions>
|
||||
<ColumnDefinition Width="250" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
<!-- 配置列表 -->
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
Margin="5"
|
||||
Background="White"
|
||||
CornerRadius="5">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Margin="5,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="配置列表:" />
|
||||
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
|
||||
<Button
|
||||
x:Name="btnAdd"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="5,0"
|
||||
Command="{Binding AddClassClickCommand}"
|
||||
Content="{materialDesign:PackIcon PlusCircleOutline}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="新增" />
|
||||
<Button
|
||||
x:Name="btnDel"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="5,0"
|
||||
Command="{Binding DelClassClickCommand}"
|
||||
Content="{materialDesign:PackIcon DeleteCircleOutline}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="删除" />
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- 配置列表 -->
|
||||
<TreeView
|
||||
x:Name="tvData"
|
||||
Grid.Row="1"
|
||||
FontSize="13"
|
||||
ItemsSource="{Binding DictClassList}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectedItemChanged">
|
||||
<i:InvokeCommandAction Command="{Binding TvDataSelectedItemChangedCommand}" PassEventArgsToCommand="True" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<!-- 全局样式:所有节点默认展开 -->
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style BasedOn="{StaticResource MaterialDesignTreeViewItem}" TargetType="TreeViewItem">
|
||||
<Setter Property="IsExpanded" Value="True" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
|
||||
<TreeView.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Margin="5,0" Kind="{Binding IconKind}" />
|
||||
<!-- 复选框 + 文字 -->
|
||||
<TextBlock Text="{Binding Name}" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
</HierarchicalDataTemplate>
|
||||
</TreeView.ItemTemplate>
|
||||
</TreeView>
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
</Border>
|
||||
|
||||
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
Margin="0,5,5,5"
|
||||
Background="White"
|
||||
CornerRadius="5">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Margin="5,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="配置内容:" />
|
||||
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
|
||||
<Button
|
||||
x:Name="btnAddItem"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="5,0"
|
||||
Command="{Binding AddItemClickCommand}"
|
||||
Content="{materialDesign:PackIcon PlusCircleOutline}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="新增" />
|
||||
<Button
|
||||
x:Name="btnDelItem"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="5,0"
|
||||
Command="{Binding DelItemClickCommand}"
|
||||
Content="{materialDesign:PackIcon DeleteCircleOutline}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="删除" />
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
|
||||
<DataGrid
|
||||
x:Name="dg_list"
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="True"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
ItemsSource="{Binding SysDicts}"
|
||||
SelectedItem="{Binding SysDict}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
|
||||
<DataGrid.Columns>
|
||||
<!--<DataGridTextColumn Header="动作" Binding="{Binding action_name}" Width="*"/>-->
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding id}"
|
||||
Header="ID"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_type}"
|
||||
Header="项目名称"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_value}"
|
||||
Header="值"
|
||||
IsReadOnly="True" />
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,37 @@
|
||||
using SamplePreSystem.UI.ConfigManager.chirld;
|
||||
using SamplePreSystem.UI.ViewModel.ConfigManager;
|
||||
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 static MaterialDesignThemes.Wpf.Theme.ToolBar;
|
||||
|
||||
namespace SamplePreSystem.UI.ConfigManager
|
||||
{
|
||||
/// <summary>
|
||||
/// SysConfigMangerView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SysConfigMangerView : UserControl
|
||||
{
|
||||
public SysConfigMangerView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = new SysConfigMangerViewModel();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
114
SamplePreSystem.UI/Views/ConfigManager/UsersView.xaml
Normal file
114
SamplePreSystem.UI/Views/ConfigManager/UsersView.xaml
Normal file
@@ -0,0 +1,114 @@
|
||||
<UserControl
|
||||
x:Class="SamplePre.UIWpf.ConfigManager.UsersView"
|
||||
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.ConfigManager"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Background="#e6e6e6"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Border
|
||||
Margin="5"
|
||||
Background="White"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
Text="用户列表" />
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnAdd"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5,0"
|
||||
Command="{Binding BtnAddClickCommand}"
|
||||
Content="新增"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="PackageVariantClosedPlus" />
|
||||
<Button
|
||||
x:Name="btnEdit"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5,0"
|
||||
Command="{Binding BtnEditClickCommand}"
|
||||
Content="编辑"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="ContentSaveEditOutline" />
|
||||
<Button
|
||||
x:Name="btnDele"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5,0"
|
||||
Command="{Binding BtnDeleClickCommand}"
|
||||
Content="删除"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="DeleteForeverOutline" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
|
||||
<!-- 用户列表 -->
|
||||
<DataGrid
|
||||
x:Name="dg_users"
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="True"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
ItemsSource="{Binding UserList}"
|
||||
SelectedItem="{Binding SelectUser}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
|
||||
<DataGrid.Columns>
|
||||
<!--<DataGridTextColumn Header="动作" Binding="{Binding action_name}" Width="*"/>-->
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding id}"
|
||||
Header="ID"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding username}"
|
||||
Header="用户名称"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding all_role_names}"
|
||||
Header="角色"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding is_enabled}"
|
||||
Header="是否启用"
|
||||
IsReadOnly="True" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
|
||||
</UserControl>
|
||||
37
SamplePreSystem.UI/Views/ConfigManager/UsersView.xaml.cs
Normal file
37
SamplePreSystem.UI/Views/ConfigManager/UsersView.xaml.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using SamplePre.UIWpf.ConfigManager.chirld;
|
||||
using SamplePreSystem.UI.ViewModel.ConfigManager;
|
||||
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 SamplePre.UIWpf.ConfigManager
|
||||
{
|
||||
/// <summary>
|
||||
/// UsersView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class UsersView : UserControl
|
||||
{
|
||||
public UsersView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var vm = new UsersViewModel();
|
||||
|
||||
this.DataContext = vm ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePreSystem.UI.ConfigManager.chirld.NewDictClassWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="新增分类"
|
||||
Width="400"
|
||||
Height="200"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="50" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
VerticalAlignment="Center"
|
||||
Text="名称:" />
|
||||
<TextBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding DictClass.dict_type}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
Text="描述:" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding DictClass.remark}" />
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="0,10,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnOK"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnOK_Click"
|
||||
Content="确定" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnCancel_Click"
|
||||
Content="取消" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,46 @@
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.ConfigManager;
|
||||
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 SamplePreSystem.UI.ConfigManager.chirld
|
||||
{
|
||||
/// <summary>
|
||||
/// NewDictClassWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NewDictClassWindow : BaseWindow
|
||||
{
|
||||
public NewDictClassWindow(SysConfigMangerViewModel vm)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = vm;
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var vm = this.DataContext as SysConfigMangerViewModel;
|
||||
if(vm.NewAddDict())
|
||||
{
|
||||
this.DialogResult = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DialogResult = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePreSystem.UI.ConfigManager.chirld.NewDictDetailWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="新增配置项"
|
||||
Width="400"
|
||||
Height="250"
|
||||
FontSize="13"
|
||||
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 />
|
||||
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
VerticalAlignment="Center"
|
||||
Text="名称:" />
|
||||
<TextBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysDict.data_type}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
Text="数值:" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysDict.data_value}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
VerticalAlignment="Center"
|
||||
Text="说明:" />
|
||||
|
||||
<TextBox
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysDict.remark}" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="0,10,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnOK"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnOK_Click"
|
||||
Content="确定" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnCancel_Click"
|
||||
Content="取消" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,46 @@
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.ConfigManager;
|
||||
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 SamplePreSystem.UI.ConfigManager.chirld
|
||||
{
|
||||
/// <summary>
|
||||
/// NewDictDetailWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NewDictDetailWindow : BaseWindow
|
||||
{
|
||||
public NewDictDetailWindow(SysConfigMangerViewModel vm)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = vm;
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var vm = this.DataContext as SysConfigMangerViewModel;
|
||||
if(vm.NewAddDictDetail())
|
||||
{
|
||||
this.DialogResult = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DialogResult = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.ConfigManager.chirld.NewRoleWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="角色编辑"
|
||||
Width="400"
|
||||
Height="200"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="50" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
VerticalAlignment="Center"
|
||||
Text="角色名称:" />
|
||||
<TextBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding ConfigRole.name}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
Text="描述:" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding ConfigRole.description}" />
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="0,10,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnOK"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnOK_Click"
|
||||
Content="确定" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnCancel_Click"
|
||||
Content="取消" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,46 @@
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.ConfigManager;
|
||||
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.ConfigManager.chirld
|
||||
{
|
||||
/// <summary>
|
||||
/// NewRoleWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NewRoleWindow : BaseWindow
|
||||
{
|
||||
public NewRoleWindow(RoleViewModel vm)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = vm;
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DialogResult = false;
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var vm = this.DataContext as RoleViewModel;
|
||||
if(vm.SaveRole())
|
||||
{
|
||||
this.DialogResult = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
146
SamplePreSystem.UI/Views/ConfigManager/chirld/NewUserWindow.xaml
Normal file
146
SamplePreSystem.UI/Views/ConfigManager/chirld/NewUserWindow.xaml
Normal file
@@ -0,0 +1,146 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.ConfigManager.chirld.NewUserWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="用户编辑"
|
||||
Width="400"
|
||||
Height="300"
|
||||
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 />
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
VerticalAlignment="Center"
|
||||
Text="用户名称:" />
|
||||
<TextBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding ConfigUser.username}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
Text="密码:" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding ConfigUser.password}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
VerticalAlignment="Center"
|
||||
Text="角色:" />
|
||||
|
||||
<!-- 多选下拉框,选择后在上方显示选中内容 -->
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Orientation="Vertical">
|
||||
<!-- 显示已选中的内容 -->
|
||||
<TextBox
|
||||
x:Name="txtSelectedRoles"
|
||||
Width="250"
|
||||
Height="30"
|
||||
materialDesign:HintAssist.Hint="已选角色"
|
||||
FontSize="13"
|
||||
IsReadOnly="True" />
|
||||
|
||||
<!-- 多选下拉框 -->
|
||||
<ComboBox
|
||||
x:Name="cmbRole"
|
||||
Width="250"
|
||||
Height="30"
|
||||
Margin="0,-30,0,0"
|
||||
ItemsSource="{Binding Roles}">
|
||||
<!-- 覆盖上去,视觉一体 -->
|
||||
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox
|
||||
x:Name="ckbRole"
|
||||
Margin="4,2"
|
||||
Click="ckbRole_Click"
|
||||
Content="{Binding name}"
|
||||
IsChecked="{Binding IsSelected, Mode=TwoWay}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
VerticalAlignment="Center"
|
||||
Text="是否启用:" />
|
||||
<ComboBox
|
||||
x:Name="cmbParamType"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding IsEnable}">
|
||||
<ComboBoxItem Content="启用" />
|
||||
<ComboBoxItem Content="禁用" />
|
||||
</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 BtnSaveUserClickCommand}"
|
||||
Content="确定" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnCancel_Click"
|
||||
Content="取消" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,56 @@
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.ConfigManager;
|
||||
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.ConfigManager.chirld
|
||||
{
|
||||
/// <summary>
|
||||
/// NewUserWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NewUserWindow : BaseWindow
|
||||
{
|
||||
public NewUserWindow(UsersViewModel vm)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
vm.CloseAction = (val) => DialogResult = val;
|
||||
|
||||
this.DataContext = vm;
|
||||
}
|
||||
|
||||
private void ckbRole_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
e.Handled = true;
|
||||
UpdateSelectedText();
|
||||
}
|
||||
|
||||
// 把选中的项显示在文本框中
|
||||
private void UpdateSelectedText()
|
||||
{
|
||||
var selected = cmbRole.ItemsSource.Cast<dynamic>()
|
||||
.Where(x => x.IsSelected == true)
|
||||
.Select(x => x.name);
|
||||
|
||||
txtSelectedRoles.Text = string.Join(",", selected);
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UpdateSelectedText();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.ConfigManager.chirld.PermissionWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="分配权限"
|
||||
Width="600"
|
||||
Height="650"
|
||||
Background="#F6F6F6"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="60" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Border
|
||||
Margin="5"
|
||||
Background="White"
|
||||
BorderBrush="LightGray"
|
||||
CornerRadius="4">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
<TextBlock
|
||||
Margin="5,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="角色:" />
|
||||
<TextBlock VerticalAlignment="Center" Text="{Binding RoleName}" />
|
||||
<Button
|
||||
x:Name="btnSave"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="20,0"
|
||||
Click="btnSave_Click"
|
||||
Content="保存权限" />
|
||||
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
|
||||
<!-- 用户列表 -->
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Margin="5,0,5,5"
|
||||
Background="White"
|
||||
BorderBrush="LightGray"
|
||||
CornerRadius="4">
|
||||
|
||||
<TreeView
|
||||
x:Name="tvData"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
ItemsSource="{Binding FunList}">
|
||||
|
||||
<TreeView.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
|
||||
|
||||
<!-- 复选框 + 文字 -->
|
||||
<CheckBox Content="{Binding Name}" IsChecked="{Binding IsChecked}" />
|
||||
|
||||
</HierarchicalDataTemplate>
|
||||
</TreeView.ItemTemplate>
|
||||
</TreeView>
|
||||
|
||||
</Border>
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,61 @@
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.ConfigManager;
|
||||
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.ConfigManager.chirld
|
||||
{
|
||||
/// <summary>
|
||||
/// PermissionWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PermissionWindow : BaseWindow
|
||||
{
|
||||
public PermissionWindow(RoleViewModel vm)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = new PermissionViewModel(vm);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 递归设置子节点
|
||||
private void SetChildrenChecked(TreeItemModel item, bool isChecked)
|
||||
{
|
||||
foreach (var child in item.Children)
|
||||
{
|
||||
child.IsChecked = isChecked;
|
||||
SetChildrenChecked(child, isChecked);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 保存权限
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btnSave_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var vm = this.DataContext as PermissionViewModel;
|
||||
if(vm.SavePermission())
|
||||
{
|
||||
this.DialogResult = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
78
SamplePreSystem.UI/Views/MainView/UserInfoWindow.xaml
Normal file
78
SamplePreSystem.UI/Views/MainView/UserInfoWindow.xaml
Normal file
@@ -0,0 +1,78 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePreSystem.UI.Views.UserInfoWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="用户信息"
|
||||
Width="300"
|
||||
Height="200"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
WindowStyle="None"
|
||||
mc:Ignorable="d">
|
||||
<basewindows:BaseWindow.Resources>
|
||||
<Style
|
||||
x:Key="CloseButtonStyle"
|
||||
BasedOn="{StaticResource MaterialDesignFlatMidBgButton}"
|
||||
TargetType="Button">
|
||||
<Setter Property="Width" Value="24" />
|
||||
<Setter Property="Height" Value="24" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="DarkRed" />
|
||||
<Setter Property="Foreground" Value="White" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</basewindows:BaseWindow.Resources>
|
||||
<Grid>
|
||||
<Border
|
||||
Margin="10"
|
||||
Background="White"
|
||||
CornerRadius="12">
|
||||
<!--<Border.Effect>
|
||||
<DropShadowEffect
|
||||
BlurRadius="20"
|
||||
Opacity="0.2"
|
||||
ShadowDepth="0" />
|
||||
</Border.Effect>-->
|
||||
<Grid>
|
||||
<!-- 内容区域 -->
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
VerticalAlignment="Center">
|
||||
<StackPanel Margin="0,10,0,0" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Width="80"
|
||||
FontSize="14"
|
||||
FontWeight="Bold"
|
||||
Text="用户名称:" />
|
||||
<TextBlock
|
||||
x:Name="txtUserName"
|
||||
FontSize="14"
|
||||
Text="{Binding UserName}" />
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,10,0,0" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Width="80"
|
||||
FontSize="14"
|
||||
FontWeight="Bold"
|
||||
Text="角色:" />
|
||||
<TextBlock
|
||||
x:Name="txtUserRoles"
|
||||
FontSize="14"
|
||||
Text="{Binding UserRoles}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
39
SamplePreSystem.UI/Views/MainView/UserInfoWindow.xaml.cs
Normal file
39
SamplePreSystem.UI/Views/MainView/UserInfoWindow.xaml.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Models.Const;
|
||||
using SamplePre.Models.Tables;
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.ViewModel.Login;
|
||||
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 SamplePreSystem.UI.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// UserInfoWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class UserInfoWindow : BaseWindow
|
||||
{
|
||||
|
||||
|
||||
public UserInfoWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = new UserInfoViewModel();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
489
SamplePreSystem.UI/Views/MonitorManager/MonitorView.xaml
Normal file
489
SamplePreSystem.UI/Views/MonitorManager/MonitorView.xaml
Normal file
@@ -0,0 +1,489 @@
|
||||
<UserControl
|
||||
x:Class="SamplePre.UIWpf.SampleManager.MonitorView"
|
||||
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:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:local="clr-namespace:SamplePre.UIWpf.SampleManager"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pro="clr-namespace:SamplePreSystem.UI.BaseControls"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Background="#E6E6E6"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="220" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
|
||||
<Border
|
||||
Margin="5,5,0,0"
|
||||
Background="White"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Height="30"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
Padding="6"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Text="样品列表" />
|
||||
</StackPanel>
|
||||
<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 SampleExecList}"
|
||||
SelectedItem="{Binding SelectSample}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="MouseDoubleClick">
|
||||
<i:InvokeCommandAction Command="{Binding MouseDoubleDetailWindowCommand}" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding qrcode}"
|
||||
Header="二维码" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding item_name}"
|
||||
Header="样品名称" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding standrad}"
|
||||
Header="标准名称" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding input_user}"
|
||||
Header="录入人员" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding input_date}"
|
||||
Header="录入日期" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding exec_state}"
|
||||
Header="状态" />
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- sop监控内容 -->
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="2*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 进度图 -->
|
||||
<Border
|
||||
Margin="5"
|
||||
Background="White"
|
||||
CornerRadius="5">
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Margin="5,5,0,10"
|
||||
HorizontalAlignment="Left"
|
||||
FontWeight="Bold"
|
||||
Text="样品进度" />
|
||||
<Grid Grid.Row="1">
|
||||
<StackPanel HorizontalAlignment="Left">
|
||||
<TextBlock Margin="5" Text="当前SOP:DCM固相萃取" />
|
||||
<TextBlock Margin="5" Text="当前样品:xxx" />
|
||||
<TextBlock Margin="5" Text="当前步骤:离心" />
|
||||
<TextBlock />
|
||||
</StackPanel>
|
||||
<pro:RingProgressBar
|
||||
x:Name="ringProgress"
|
||||
Width="200"
|
||||
Height="200"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Progress="{Binding CurrentPercent}" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="20"
|
||||
Foreground="Black"
|
||||
Text="{Binding Progress, ElementName=ringProgress, StringFormat={}{0}%}" />
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- SOP执行列表 -->
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
Margin="0,5,0,5"
|
||||
Background="White"
|
||||
CornerRadius="5">
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Margin="5"
|
||||
FontWeight="Bold"
|
||||
Text="SOP执行信息" />
|
||||
<DataGrid
|
||||
x:Name="dg_sopExec"
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="True"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding SopExecInfo}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Width="0.5*" Header="">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button
|
||||
Width="13"
|
||||
Height="13"
|
||||
Margin="0"
|
||||
HorizontalContentAlignment="Left"
|
||||
materialDesign:ButtonProgressAssist.IndicatorBackground="#ffcc80"
|
||||
materialDesign:ButtonProgressAssist.IndicatorForeground="#e65100"
|
||||
materialDesign:ButtonProgressAssist.IsIndeterminate="True"
|
||||
materialDesign:ButtonProgressAssist.IsIndicatorVisible="{Binding doIngShow}"
|
||||
materialDesign:ButtonProgressAssist.Value="-1"
|
||||
Style="{StaticResource MaterialDesignFloatingActionButton}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTextColumn
|
||||
Width="0.5*"
|
||||
Binding="{Binding state}"
|
||||
Header="状态" />
|
||||
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding sapmleName}"
|
||||
Header="样品名称" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding actionName}"
|
||||
Header="动作" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding starDate}"
|
||||
Header="开始时间" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding endDate}"
|
||||
Header="完成时间" />
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<!--<StackPanel>
|
||||
<TextBlock Text="SOP执行信息" Margin="5" FontWeight="Bold"/>
|
||||
<ListBox ItemsSource="{Binding SopExecInfo}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
<Button
|
||||
Width="13"
|
||||
Height="13"
|
||||
Margin="5"
|
||||
HorizontalContentAlignment="Left"
|
||||
materialDesign:ButtonProgressAssist.IsIndeterminate="True"
|
||||
materialDesign:ButtonProgressAssist.IsIndicatorVisible="{Binding doIngShow}"
|
||||
materialDesign:ButtonProgressAssist.Value="-1"
|
||||
Style="{StaticResource MaterialDesignFloatingActionButton}" />
|
||||
|
||||
<TextBlock
|
||||
Margin="2,0,10,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding state}" />
|
||||
|
||||
<TextBlock
|
||||
Margin="30,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding sapmleName}" />
|
||||
<TextBlock
|
||||
Margin="30,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding actionName}" />
|
||||
|
||||
<TextBlock
|
||||
Margin="30,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding starDate}" />
|
||||
<TextBlock
|
||||
Margin="30,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding endDate}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</StackPanel>-->
|
||||
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
<GridSplitter
|
||||
Grid.Column="1"
|
||||
Width="5"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="#e6e6e6" />
|
||||
|
||||
<!-- 功能单元 -->
|
||||
<Grid Grid.Column="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="31*" />
|
||||
<RowDefinition Height="44*" />
|
||||
<RowDefinition Height="15*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 功能岛信息 -->
|
||||
<Border
|
||||
Grid.RowSpan="2"
|
||||
Margin="0,5,5,5"
|
||||
Background="White"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Height="30"
|
||||
Margin="0,0"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
Padding="6"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Text="功能单元" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<ItemsControl Grid.Row="1" ItemsSource="{Binding WorkUnits}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Margin="10,5" Columns="1" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!-- 给 Border 单独写 Style,实现默认背景 + 鼠标悬停背景 -->
|
||||
<Border
|
||||
Margin="0,10"
|
||||
BorderBrush="LightGray"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<!-- 默认背景色 -->
|
||||
<Setter Property="Background" Value="White" />
|
||||
<!-- 鼠标悬停触发器 -->
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#FFF0F8FF" />
|
||||
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Margin="5"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding unitName}" />
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Margin="5"
|
||||
HorizontalAlignment="Right">
|
||||
<Hyperlink
|
||||
x:Name="hLinkDetail"
|
||||
Command="{Binding DataContext.HLinkDetailClickCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
|
||||
CommandParameter="{Binding unitName}">
|
||||
[详情]
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<!--<Image Grid.Row="1" Grid.Column="0"
|
||||
Source="{Binding imgPath}" Height="48" Width="48" Margin="5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>-->
|
||||
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Width="50"
|
||||
Height="50"
|
||||
Margin="5"
|
||||
BorderBrush="#0071b8"
|
||||
BorderThickness="2"
|
||||
CornerRadius="50">
|
||||
<materialDesign:PackIcon
|
||||
Width="40"
|
||||
Height="40"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="#0071b8"
|
||||
Kind="{Binding packIconKind}" />
|
||||
</Border>
|
||||
|
||||
|
||||
|
||||
<UniformGrid
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Columns="1"
|
||||
Rows="2">
|
||||
|
||||
<StackPanel
|
||||
Margin="0,2"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock Margin="2" Text="动作:" />
|
||||
<TextBlock Margin="2" Text="{Binding actionName}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
Margin="0,2"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Border
|
||||
Width="6"
|
||||
Height="6"
|
||||
Margin="2"
|
||||
Background="{Binding RunColor}"
|
||||
CornerRadius="3" />
|
||||
<TextBlock VerticalAlignment="Center" Text="{Binding StateName}" />
|
||||
</StackPanel>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
|
||||
<!-- 故障信息 -->
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
Margin="0,0,5,5"
|
||||
Background="White"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Height="30"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
Padding="6"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Text="故障信息" />
|
||||
</StackPanel>
|
||||
<ListBox Grid.Row="1" ItemsSource="{Binding FaultInfos}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
<Border
|
||||
Width="6"
|
||||
Height="6"
|
||||
Margin="2"
|
||||
Background="Red"
|
||||
CornerRadius="3" />
|
||||
<TextBlock
|
||||
Margin="3,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding FaultName}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
36
SamplePreSystem.UI/Views/MonitorManager/MonitorView.xaml.cs
Normal file
36
SamplePreSystem.UI/Views/MonitorManager/MonitorView.xaml.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Models.Const;
|
||||
using SamplePre.UIWpf.MonitorManager.chirld;
|
||||
using SamplePre.UIWpf.SampleManager.chirld;
|
||||
using SamplePreSystem.UI.ViewModel.Monitor;
|
||||
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 SamplePre.UIWpf.SampleManager
|
||||
{
|
||||
/// <summary>
|
||||
/// MonitorView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class MonitorView : UserControl
|
||||
{
|
||||
public MonitorView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = new MonitorViewModel();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
25
SamplePreSystem.UI/Views/MonitorManager/SopExecInfo.cs
Normal file
25
SamplePreSystem.UI/Views/MonitorManager/SopExecInfo.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace SamplePreSystem.UI.Views.MonitorManager
|
||||
{
|
||||
public class SopExecInfo
|
||||
{
|
||||
public string sapmleName { get; set; }
|
||||
|
||||
public string actionName { get; set; }
|
||||
|
||||
public string state { get; set; }
|
||||
|
||||
public DateTime starDate { get; set; }
|
||||
public DateTime endDate { get; set; }
|
||||
|
||||
public bool doIngShow { get; set; } = false;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.MonitorManager.chirld.SampleDetailWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pro="clr-namespace:SamplePreSystem.UI.BaseControls"
|
||||
Title="样品详情"
|
||||
Width="200"
|
||||
Height="300"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Margin="10">
|
||||
<TextBlock Margin="5" Text="执行标准:固相萃取" />
|
||||
<TextBlock Margin="5" Text="当前动作:离心" />
|
||||
<TextBlock Margin="5" Text="执行时间:30min" />
|
||||
<TextBlock Margin="5" Text="执行进度:40%" />
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<!-- // 自定义控件 - 预览主体部分 注意地址不一定是local 要看RingProgressBar类放在哪里 // -->
|
||||
<pro:RingProgressBar
|
||||
x:Name="ringProgress"
|
||||
Width="100"
|
||||
Height="100"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Progress="40" />
|
||||
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="20"
|
||||
Foreground="Black"
|
||||
Text="{Binding Progress, ElementName=ringProgress, StringFormat={}{0}%}" />
|
||||
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,29 @@
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
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.MonitorManager.chirld
|
||||
{
|
||||
/// <summary>
|
||||
/// SampleDetailWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SampleDetailWindow : BaseWindow
|
||||
{
|
||||
public SampleDetailWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.SampleManager.chirld.UnitDetailWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="详情"
|
||||
Width="400"
|
||||
Height="350"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="40" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ListBox Grid.Row="0" ItemsSource="{Binding FaultInfos}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Border
|
||||
Width="6"
|
||||
Height="6"
|
||||
Margin="2"
|
||||
Background="{Binding RunColor}"
|
||||
CornerRadius="3" />
|
||||
<TextBlock
|
||||
Margin="3,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding FaultName}" />
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding FaultDesc}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal">
|
||||
<TextBlock Text="当前参数信息:" />
|
||||
<TextBlock Text="-" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,33 @@
|
||||
//using SamplePre.UIWpf.ViewModel.Monitor;
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.Monitor;
|
||||
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.SampleManager.chirld
|
||||
{
|
||||
/// <summary>
|
||||
/// UnitDetailWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class UnitDetailWindow : BaseWindow
|
||||
{
|
||||
public UnitDetailWindow(string unitId)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = new UnitDetailViewModel(unitId);
|
||||
}
|
||||
}
|
||||
}
|
||||
148
SamplePreSystem.UI/Views/QueryManager/SampleQueryView.xaml
Normal file
148
SamplePreSystem.UI/Views/QueryManager/SampleQueryView.xaml
Normal file
@@ -0,0 +1,148 @@
|
||||
<UserControl
|
||||
x:Class="SamplePre.UIWpf.QueryManager.SampleQueryView"
|
||||
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.QueryManager"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Background="White"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="*" />
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Margin="10,0" Orientation="Horizontal">
|
||||
|
||||
<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}" />
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="20,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnFindSample"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="3"
|
||||
Command="{Binding GetDataCommand}"
|
||||
Content="查 询" />
|
||||
<Button
|
||||
x:Name="btnExport"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="3"
|
||||
Command="{Binding ExportExcelCommand}"
|
||||
Content="导 出" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
BorderBrush="LightGray"
|
||||
BorderThickness="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Height="30"
|
||||
VerticalAlignment="Center"
|
||||
Background="#E6E6E6">
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
Padding="6"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="样品列表" />
|
||||
</StackPanel>
|
||||
|
||||
<DataGrid
|
||||
x:Name="dg_sample"
|
||||
Grid.Row="1"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="True"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding SampleList}"
|
||||
SelectedItem="{Binding SelectSample}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<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>
|
||||
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,34 @@
|
||||
using SamplePreSystem.UI.ViewModel.QueryManager;
|
||||
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 SamplePre.UIWpf.QueryManager
|
||||
{
|
||||
/// <summary>
|
||||
/// SampleQueryView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SampleQueryView : UserControl
|
||||
{
|
||||
public SampleQueryView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = new SampleQueryViewModel();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
230
SamplePreSystem.UI/Views/SOPManager/ActionManagerView.xaml
Normal file
230
SamplePreSystem.UI/Views/SOPManager/ActionManagerView.xaml
Normal file
@@ -0,0 +1,230 @@
|
||||
<UserControl
|
||||
x:Class="SamplePre.UIWpf.ParamManager.ActionManagerView"
|
||||
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.ParamManager"
|
||||
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="2*" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Margin="5"
|
||||
Background="White"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5">
|
||||
<!-- 动作列表 -->
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel
|
||||
Grid.ColumnSpan="2"
|
||||
Height="30"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
Padding="6"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
Text="动作列表" />
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnAddAction"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="3"
|
||||
Command="{Binding BtnAddActionClickCommand}"
|
||||
Content="新增"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="PackageVariantClosedPlus" />
|
||||
|
||||
<Button
|
||||
x:Name="btnDelAction"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="3"
|
||||
Command="{Binding BtnDelActionClickCommand}"
|
||||
Content="删除"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="DeleteOutline" />
|
||||
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<DataGrid
|
||||
x:Name="dg_actions"
|
||||
Grid.Row="1"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="True"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding SysActions}"
|
||||
SelectedItem="{Binding SelectItem}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
|
||||
<!-- 分组样式 -->
|
||||
<DataGrid.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel Height="25" 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
|
||||
Width="*"
|
||||
Binding="{Binding action_name}"
|
||||
Header="动作名称" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding plc_type}"
|
||||
Header="PLC映射" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding action_adress}"
|
||||
Header="设备地址" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding action_unitname}"
|
||||
Header="动作单元" />
|
||||
<DataGridTextColumn
|
||||
Width="2*"
|
||||
Binding="{Binding remark}"
|
||||
Header="备注" />
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
<!-- 参数列表 -->
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Margin="5,0,5,5"
|
||||
Background="White"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
Text="动作参数:" />
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnSelectParam"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5,0"
|
||||
Command="{Binding BtnSelectParamClickCommand}"
|
||||
Content="新增"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="PackageVariantClosedPlus" />
|
||||
<Button
|
||||
x:Name="btnDelParm"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5,0"
|
||||
Command="{Binding BtnDelParmClickCommand}"
|
||||
Content="删除"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="DeleteOutline" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
|
||||
<DataGrid
|
||||
x:Name="dg_params"
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="False"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding ActionParams}"
|
||||
SelectedItem="{Binding SelectParam}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding title}"
|
||||
Header="参数名称" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_value}"
|
||||
Header="值" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding unit}"
|
||||
Header="单位" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding plc_type}"
|
||||
Header="PLC映射" />
|
||||
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,43 @@
|
||||
using Models.Models;
|
||||
using SamplePre.UIWpf.ParamManager.chirld;
|
||||
using SamplePreSystem.UI.ViewModel.SopManager;
|
||||
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 ActionManagerView : UserControl
|
||||
{
|
||||
ActionManagerViewModel actionManagerViewModel = new ActionManagerViewModel();
|
||||
|
||||
|
||||
public ActionManagerView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = actionManagerViewModel;
|
||||
|
||||
ListCollectionView view = (ListCollectionView)CollectionViewSource.GetDefaultView(actionManagerViewModel.SysActions);//获取数据视图
|
||||
|
||||
////分组
|
||||
view.GroupDescriptions.Clear();
|
||||
view.GroupDescriptions.Add(new PropertyGroupDescription("action_unitname"));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
141
SamplePreSystem.UI/Views/SOPManager/ParamManagerView.xaml
Normal file
141
SamplePreSystem.UI/Views/SOPManager/ParamManagerView.xaml
Normal file
@@ -0,0 +1,141 @@
|
||||
<UserControl
|
||||
x:Class="SamplePre.UIWpf.ParamManager.ParamManagerView"
|
||||
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.ParamManager"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Background="#e6e6e6"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Border
|
||||
Margin="5"
|
||||
Background="White"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Width="100"
|
||||
Margin="10,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
Text="参数列表" />
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
|
||||
|
||||
<TextBlock
|
||||
Margin="15,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="参数类型:" />
|
||||
<ComboBox
|
||||
x:Name="cmbDataType"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="0,0,10,0"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
ItemsSource="{Binding DataTypes}"
|
||||
SelectedItem="{Binding FilterType}" />
|
||||
<Button
|
||||
x:Name="btnAddParam"
|
||||
Width="90"
|
||||
Height="30"
|
||||
Margin="3"
|
||||
Command="{Binding BtnAddParamClickCommand}"
|
||||
Content="新增"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="PackageVariantClosedPlus" />
|
||||
<Button
|
||||
x:Name="btnEdit"
|
||||
Width="90"
|
||||
Height="30"
|
||||
Margin="3"
|
||||
Command="{Binding BtnEditClickCommand}"
|
||||
Content="编辑"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="ContentSaveEditOutline" />
|
||||
<Button
|
||||
x:Name="btnDelParam"
|
||||
Width="80"
|
||||
Height="30"
|
||||
Margin="3"
|
||||
Command="{Binding BtnDelParamClickCommand}"
|
||||
Content="删除"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="DeleteForeverOutline" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- 参数列表 -->
|
||||
<DataGrid
|
||||
x:Name="dg_params"
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="False"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding SysParams}"
|
||||
SelectedItem="{Binding SelectItem}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding title}"
|
||||
Header="参数名称" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding unit}"
|
||||
Header="单位" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_type}"
|
||||
Header="数据类型" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_value}"
|
||||
Header="值" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding plc_type}"
|
||||
Header="PLC映射" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding param_type}"
|
||||
Header="参数类型" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</UserControl>
|
||||
37
SamplePreSystem.UI/Views/SOPManager/ParamManagerView.xaml.cs
Normal file
37
SamplePreSystem.UI/Views/SOPManager/ParamManagerView.xaml.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Models.Models;
|
||||
using SamplePre.UIWpf.ParamManager.chirld;
|
||||
using SamplePreSystem.UI.ViewModel.SopManager;
|
||||
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 ParamManagerView : UserControl
|
||||
{
|
||||
ParamManagerViewModel paramManagerViewModel = new ParamManagerViewModel();
|
||||
public ParamManagerView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = paramManagerViewModel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
385
SamplePreSystem.UI/Views/SOPManager/SopManagerView.xaml
Normal file
385
SamplePreSystem.UI/Views/SOPManager/SopManagerView.xaml
Normal file
@@ -0,0 +1,385 @@
|
||||
<UserControl
|
||||
x:Class="SamplePre.UIWpf.SopManagerView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:bh="clr-namespace:SamplePreSystem.UI.Behaviors"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:local="clr-namespace:SamplePre.UIWpf"
|
||||
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>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="3*" />
|
||||
<ColumnDefinition Width="0.7*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 标准列表 -->
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
Margin="5"
|
||||
Background="White"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Height="30"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
Padding="6"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Text="标准列表" />
|
||||
</StackPanel>
|
||||
|
||||
<TreeView
|
||||
x:Name="standardList"
|
||||
Grid.Row="1"
|
||||
FontSize="13"
|
||||
ItemsSource="{Binding StandardGroups}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectedItemChanged">
|
||||
<i:InvokeCommandAction Command="{Binding StandSelectedItemChangedCommand}" CommandParameter="{Binding Path=SelectedItem, RelativeSource={RelativeSource AncestorType=TreeView}}" />
|
||||
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style BasedOn="{StaticResource MaterialDesignTreeViewItem}" TargetType="TreeViewItem">
|
||||
<Setter Property="IsExpanded" Value="True" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
|
||||
|
||||
<TreeView.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding ListItems}">
|
||||
|
||||
<!-- 一级节点的显示内容 -->
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Margin="5,0" Kind="Book" />
|
||||
<TextBlock Text="{Binding SopName}" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- 二级节点(子项)的模板 -->
|
||||
<HierarchicalDataTemplate.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Margin="5,0" Kind="TextBoxOutline" />
|
||||
<TextBlock Margin="10,0,0,0" Text="{Binding DisplayText}" />
|
||||
</StackPanel>
|
||||
|
||||
</DataTemplate>
|
||||
</HierarchicalDataTemplate.ItemTemplate>
|
||||
</HierarchicalDataTemplate>
|
||||
</TreeView.ItemTemplate>
|
||||
</TreeView>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 中间区域 -->
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- sop动作 -->
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Margin="0,5,5,5"
|
||||
Background="White"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Text="动作列表" />
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
|
||||
|
||||
<Button
|
||||
x:Name="btnUp"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="2,0"
|
||||
Click="btnUp_Click"
|
||||
Content="{materialDesign:PackIcon MenuUpOutline}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="上移" />
|
||||
<Button
|
||||
x:Name="btnDown"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="2,0"
|
||||
Click="btnDown_Click"
|
||||
Content="{materialDesign:PackIcon MenuDownOutline}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="下移" />
|
||||
<Button
|
||||
x:Name="btnDelAction"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="2,0"
|
||||
Click="btnDelAction_Click"
|
||||
Content="{materialDesign:PackIcon DeleteOutline}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="删除动作" />
|
||||
<Button
|
||||
x:Name="btnUpdateSeq"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="2,0"
|
||||
Click="btnUpdateSeq_Click"
|
||||
Content="{materialDesign:PackIcon ContentSave}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="更新顺序" />
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<DataGrid
|
||||
x:Name="dg_soplist"
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
AllowDrop="True"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="False"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding SopList}"
|
||||
SelectedItem="{Binding SelectItem}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
|
||||
<i:Interaction.Behaviors>
|
||||
<bh:DataGridDragBehavior DropCompletedCommand="{Binding AddDragSopActionCommand}" />
|
||||
</i:Interaction.Behaviors>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="auto"
|
||||
Binding="{Binding process_no}"
|
||||
Header="序号" />
|
||||
<DataGridTextColumn
|
||||
Width="auto"
|
||||
Binding="{Binding action_name}"
|
||||
Header="动作名称" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding all_param}"
|
||||
Header="动作参数" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding remark}"
|
||||
Header="说明" />
|
||||
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 参数 -->
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Margin="0,0,5,5"
|
||||
Background="White"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Width="100"
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Text="参数列表:" />
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnAddParam"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="1,0"
|
||||
Click="btnAddParam_Click"
|
||||
Content="{materialDesign:PackIcon Plus}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="新增参数" />
|
||||
<Button
|
||||
x:Name="btnEidtParam"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="1,0"
|
||||
Click="btnEidtParam_Click"
|
||||
Content="{materialDesign:PackIcon ContentSaveEditOutline}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="修改参数" />
|
||||
<Button
|
||||
x:Name="btnDelParam"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="1,0"
|
||||
Click="btnDelParam_Click"
|
||||
Content="{materialDesign:PackIcon DeleteOutline}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="删除参数" />
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<DataGrid
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="True"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
ItemsSource="{Binding ActionParamList}"
|
||||
SelectedItem="{Binding SelectParamItem}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="2*"
|
||||
Binding="{Binding title}"
|
||||
Header="参数名称"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_value}"
|
||||
Header="参数值" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding unit}"
|
||||
Header="单位"
|
||||
IsReadOnly="True" />
|
||||
|
||||
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- //动作字典 -->
|
||||
<Border
|
||||
Grid.Column="2"
|
||||
Margin="0,5,5,5"
|
||||
Background="White"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Text="动作字典:" />
|
||||
|
||||
<TreeView
|
||||
Grid.Row="1"
|
||||
AllowDrop="False"
|
||||
ItemsSource="{Binding ActionGroups}">
|
||||
|
||||
<i:Interaction.Behaviors>
|
||||
<bh:TreeViewDragBehavior />
|
||||
</i:Interaction.Behaviors>
|
||||
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style BasedOn="{StaticResource MaterialDesignTreeViewItem}" TargetType="TreeViewItem">
|
||||
<Setter Property="IsExpanded" Value="True" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
|
||||
|
||||
<TreeView.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding ListItems}">
|
||||
<!-- 一级节点的显示内容 -->
|
||||
<!--<TextBlock Text="{Binding SopName}" />-->
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Margin="5,0" Kind="Collage" />
|
||||
<TextBlock Text="{Binding SopName}" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- 二级节点(子项)的模板 -->
|
||||
<HierarchicalDataTemplate.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Margin="5,0" Kind="TextBoxOutline" />
|
||||
<TextBlock Margin="10,0,0,0" Text="{Binding DisplayText}" />
|
||||
</StackPanel>
|
||||
|
||||
</DataTemplate>
|
||||
</HierarchicalDataTemplate.ItemTemplate>
|
||||
</HierarchicalDataTemplate>
|
||||
</TreeView.ItemTemplate>
|
||||
</TreeView>
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
|
||||
</UserControl>
|
||||
102
SamplePreSystem.UI/Views/SOPManager/SopManagerView.xaml.cs
Normal file
102
SamplePreSystem.UI/Views/SOPManager/SopManagerView.xaml.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using Models.Models;
|
||||
using SamplePre.Models;
|
||||
using SamplePre.Models.Ext;
|
||||
using SamplePreSystem.UI.ViewModel.SopManager;
|
||||
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 SamplePre.UIWpf
|
||||
{
|
||||
/// <summary>
|
||||
/// SopManagerView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SopManagerView : UserControl
|
||||
{
|
||||
|
||||
SopMangerViewModel sopMangerViewModel = new SopMangerViewModel();
|
||||
public SopManagerView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = sopMangerViewModel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除动作
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btnDelAction_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dataContext = this.DataContext as SopMangerViewModel;
|
||||
dataContext.RemoveAction();
|
||||
}
|
||||
|
||||
private void btnUp_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dataContext = this.DataContext as SopMangerViewModel;
|
||||
dataContext.UpMove();
|
||||
}
|
||||
|
||||
private void btnDown_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dataContext = this.DataContext as SopMangerViewModel;
|
||||
dataContext.DownMove();
|
||||
}
|
||||
|
||||
private void btnUpdateSeq_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
sopMangerViewModel.UpdateSeqno();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改参数
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btnEidtParam_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dataContext = this.DataContext as SopMangerViewModel;
|
||||
dataContext.AddEidtParam();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增参数
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btnAddParam_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dataContext = this.DataContext as SopMangerViewModel;
|
||||
dataContext.AddParamShow();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除参数
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btnDelParam_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dataContext = this.DataContext as SopMangerViewModel;
|
||||
dataContext.RemoveParam();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
112
SamplePreSystem.UI/Views/SOPManager/chirld/NewActionWindow.xaml
Normal file
112
SamplePreSystem.UI/Views/SOPManager/chirld/NewActionWindow.xaml
Normal file
@@ -0,0 +1,112 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.ParamManager.chirld.NewActionWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="新增动作"
|
||||
Width="400"
|
||||
Height="300"
|
||||
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="名称:" />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysAction.action_name}" />
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
VerticalAlignment="Center"
|
||||
Text="备注:" />
|
||||
<TextBox
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysAction.remark}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
VerticalAlignment="Center"
|
||||
Text="动作单元:" />
|
||||
<ComboBox
|
||||
x:Name="cmbDataType"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
DisplayMemberPath="data_type"
|
||||
ItemsSource="{Binding ActionUnits}"
|
||||
SelectedItem="{Binding SelectSysDict}"
|
||||
SelectedValuePath="id" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
Text="PLC映射:" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysAction.plc_type}" />
|
||||
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="0,10,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnOK"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnOK_Click"
|
||||
Content="确定" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnCancel_Click"
|
||||
Content="取消" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,53 @@
|
||||
using Models.Models;
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.Child;
|
||||
using SamplePreSystem.UI.ViewModel.SopManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
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>
|
||||
/// NewStandParmWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NewActionWindow : BaseWindow
|
||||
{
|
||||
ActionManagerViewModel actionManagerVM;
|
||||
public NewActionWindow(ActionManagerViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = new NewActionViewModel();
|
||||
|
||||
this.actionManagerVM = viewModel;
|
||||
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var vm = this.DataContext as NewActionViewModel;
|
||||
|
||||
if (vm.SaveNewData() < 0) return;
|
||||
|
||||
this.DialogResult = true;
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DialogResult = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.ParamManager.chirld.NewStandParmWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
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="名称:" />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysParm.title}" />
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
Text="值:" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysParm.data_value}" />
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
VerticalAlignment="Center"
|
||||
Text="单位:" />
|
||||
<ComboBox
|
||||
x:Name="cmbUnit"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalContentAlignment="Center"
|
||||
DisplayMemberPath="data_type"
|
||||
ItemsSource="{Binding Units}"
|
||||
SelectedValuePath="id"
|
||||
Text="{Binding SysParm.unit}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
VerticalAlignment="Center"
|
||||
Text="数据类型:" />
|
||||
<ComboBox
|
||||
x:Name="cmbDataType"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysParm.data_type}">
|
||||
<ComboBoxItem Content="数值" />
|
||||
<ComboBoxItem Content="字符串" />
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="4"
|
||||
VerticalAlignment="Center"
|
||||
Text="PLC映射:" />
|
||||
<TextBox
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysParm.plc_type}" />
|
||||
|
||||
<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 SysParm.param_type}">
|
||||
<ComboBoxItem Content="通用" />
|
||||
<ComboBoxItem Content="耗材" />
|
||||
<ComboBoxItem Content="液体" />
|
||||
</ComboBox>
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="0,10,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnOK"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnOK_Click"
|
||||
Content="确定" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnCancel_Click"
|
||||
Content="取消" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,52 @@
|
||||
using Models.Models;
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.SopManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
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>
|
||||
/// NewStandParmWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NewStandParmWindow : BaseWindow
|
||||
{
|
||||
ParamManagerViewModel viewModel;
|
||||
public NewStandParmWindow(ParamManagerViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = viewModel;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var v= this.DataContext as ParamManagerViewModel;
|
||||
|
||||
if (!v.SaveParam()) return;
|
||||
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.ParamManager.chirld.SelectParmListWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="选择参数"
|
||||
Width="600"
|
||||
Height="450"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="40" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="参数类型:" />
|
||||
<ComboBox
|
||||
x:Name="cmbDataType"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
ItemsSource="{Binding DataTypes}"
|
||||
SelectedItem="{Binding FilterType}" />
|
||||
</StackPanel>
|
||||
<DataGrid
|
||||
x:Name="dg_params"
|
||||
Grid.Row="1"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="True"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding Parms}"
|
||||
SelectedItem="{Binding SelectParm}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding title}"
|
||||
Header="标题" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding unit}"
|
||||
Header="PLC单位" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_type}"
|
||||
Header="数据类型" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_value}"
|
||||
Header="值" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding plc_type}"
|
||||
Header="PLC映射" />
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Margin="0,0,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"
|
||||
Command="{Binding BtnCancelClickCommand}"
|
||||
Content="取消" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,53 @@
|
||||
using Models.Models;
|
||||
using SamplePre.Models.Ext;
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.Child;
|
||||
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>
|
||||
/// SelectParmListWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SelectParmListWindow : BaseWindow
|
||||
{
|
||||
public SelectParmListWindow(sys_standard_action_ext sysStandardAction)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var vm = new SelectParmListViewModel(sysStandardAction);
|
||||
|
||||
//关闭窗口委托
|
||||
vm.CloseAction = (val) => DialogResult = val;
|
||||
|
||||
this.DataContext = vm;
|
||||
}
|
||||
|
||||
public SelectParmListWindow(sys_action_ext sysStandardAction)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var vm = new SelectParmListViewModel(sysStandardAction);
|
||||
|
||||
//关闭窗口委托
|
||||
vm.CloseAction = (val) => DialogResult = val;
|
||||
|
||||
this.DataContext = vm;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
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