386 lines
17 KiB
Plaintext
386 lines
17 KiB
Plaintext
|
|
<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>
|