You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

251 lines
18 KiB

<UserControl x:Class="Gumming.SlotView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
xmlns:local="clr-namespace:Gumming"
xmlns:tool="clr-namespace:GummingCommon;assembly=GummingCommon"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
d:DesignHeight="700" d:DesignWidth="1000"
Background="Transparent"
x:Name="rootControl">
<UserControl.Resources>
<tool:RadioButtonConverter x:Key="RadioConverter"/>
<tool:BooleanToOpacityConverter x:Key="OpacityConverter"/>
<tool:EditorTextConverter x:Key="TextBrushConverter"/>
<tool:EditorBorderConverter x:Key="BorderBrushConverter"/>
<tool:PathTypeToThemeConverter x:Key="PathTypeConverter"/>
<tool:StepStyleConverter x:Key="StepStyleConverter"/>
<tool:ListViewDisabledStyleConverter x:Key="ListViewDisabledStyleConverter"/>
<DataTemplate x:Key="PortFieldMapping">
<Border Name="ItemBorder" Height="30" BorderThickness="0" BorderBrush="Black">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"></ColumnDefinition>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="160"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border BorderThickness="1,0,0,1" BorderBrush="{DynamicResource DefaultBorderBrush}" >
<TextBlock Text="{Binding SlotIndex}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
</Border>
<Border Grid.Column="1" BorderThickness="1,0,0,1" BorderBrush="{DynamicResource DefaultBorderBrush}">
<TextBlock Text="{Binding StepCode}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
</Border>
<!--<Border Grid.Column="2" BorderThickness="1,0,0,1" BorderBrush="{DynamicResource DefaultBorderBrush}">
<ComboBox BorderThickness="0" ItemsSource="{Binding Path=UnitFlows}" SelectedItem="{Binding SelecedUnitFlow, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding FlowName, Mode=TwoWay}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Border>-->
<Border Grid.Column="2" BorderThickness="1,0,1,1" BorderBrush="{DynamicResource DefaultBorderBrush}" >
<ComboBox BorderThickness="0" ItemsSource="{Binding Path=Process}" SelectedItem="{Binding SelecedProcess, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding ProcessSure, Mode=TwoWay}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!--<TextBox Style="{DynamicResource ListViewTextBoxStyle}" Text="{Binding Priority, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" FontSize="14" FontWeight="Bold"></TextBox>-->
</Border>
</Grid>
</Border>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor,
AncestorType={x:Type ListViewItem}}, Path=IsSelected}" Value="True">
<Setter TargetName="ItemBorder" Property="Background" Value="#DDD"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="5"></RowDefinition>
<RowDefinition Height="70"></RowDefinition>
</Grid.RowDefinitions>
<ListBox Grid.Column="0" tool:TouchScrolling.IsEnabled="True" ScrollViewer.HorizontalScrollBarVisibility="Disabled" PreviewKeyDown="listBox_PreviewKeyDown" x:Name="LstFormula" Background="Transparent" BorderBrush="{DynamicResource DefaultBorderBrush}" BorderThickness="1" ItemsSource="{Binding HardFlows}" SelectedItem="{Binding SelectedFlow, Mode=TwoWay}" ItemContainerStyle="{DynamicResource PatternListBoxItem}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock TextAlignment="Left" VerticalAlignment="Center" Text="{Binding FlowName}" TextTrimming="CharacterEllipsis">
<TextBlock.ToolTip>
<TextBlock Text="{Binding FlowName}"></TextBlock>
</TextBlock.ToolTip>
</TextBlock>
</DataTemplate>
</ListBox.ItemTemplate>
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<tool:ExecuteCommandAction Command="{Binding SelectFlowCommand}" CommandParameter="{Binding SelectedItem,ElementName=LstFormula}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</ListBox>
<Grid Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition Height="31"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="31"></RowDefinition>
<RowDefinition Height="0"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="5"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="5"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Margin="2" FontSize="15" Style="{DynamicResource CommonIconButton}" Command="{Binding NewCommand}" Content="新增"></Button>
<Button Grid.Column="2" Margin="2" FontSize="15" Style="{DynamicResource CommonIconButton}" Command="{Binding AllowCommand}" Content="编辑"></Button>
<Button Grid.Column="4" Margin="2" FontSize="15" IsEnabled="{Binding AllowEdit}" Style="{DynamicResource CommonIconButton}" Command="{Binding DisabledCommand}" Content="取消"></Button>
<Button Grid.Row="2" Grid.Column="0" Margin="2" FontSize="15" IsEnabled="{Binding AllowEdit}" Style="{DynamicResource CommonIconButton}" Command="{Binding SaveStepCommand}" Content="保存"></Button>
<Button Grid.Row="2" Grid.Column="2" Margin="2" FontSize="15" Style="{DynamicResource CommonIconButton}" Command="{Binding SaveAsFormulaCommand}" Content="另存"></Button>
<Button Grid.Row="2" Grid.Column="4" Margin="2" FontSize="15" Style="{DynamicResource CommonIconButton}" Command="{Binding DeleteFormulaCommand}" Content="删除"></Button>
</Grid>
</Grid>
<Grid Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="5"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="5"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid Grid.Row="2" Grid.Column="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"></ColumnDefinition>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="160"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border BorderThickness="1,1,0,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="Transparent" >
<TextBlock Text="顺序" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
</Border>
<Border Grid.Column="1" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="Transparent" >
<TextBlock Text="槽" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
</Border>
<!--<Border Grid.Column="2" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="Transparent" >
<TextBlock Text="为每槽设置[流片配方]" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
</Border>-->
<Border Grid.Column="2" BorderThickness="1,1,1,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="Transparent" >
<TextBlock Text="加工确认" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
</Border>
</Grid>
<ListView Grid.Row="3" x:Name="FieldMappingView" tool:TouchScrolling.IsEnabled="True" ItemTemplate="{DynamicResource PortFieldMapping}" ItemsSource="{Binding HardSlots}"
Template="{DynamicResource ListViewItemMapping}" ItemContainerStyle="{Binding Path=AllowEdit,Converter={StaticResource ListViewDisabledStyleConverter}}" BorderThickness="0" IsHitTestVisible="True"
SelectedItem="{Binding SelectedStep, Mode=TwoWay}" SelectionMode="Extended" Foreground="{DynamicResource FontBrush4}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<tool:ExecuteCommandAction Command="{Binding SelectStepCommand}" CommandParameter="{Binding SelectedItems, ElementName=FieldMappingView}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</ListView>
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="220"></ColumnDefinition>
<ColumnDefinition Width="140"></ColumnDefinition>
<ColumnDefinition Width="230"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="Transparent" >
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="8"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="1" Text="批配方名称:" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14"></TextBlock>
<TextBox Grid.Column="3" Text="{Binding FlowName}" IsEnabled="{Binding AllowEdit}" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14"></TextBox>
</Grid>
</Border>
<Border Grid.Column="1" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="Transparent" >
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="8"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="1" Text="花篮:" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14"></TextBlock>
<ComboBox Grid.Column="3" BorderThickness="0" IsEnabled="{Binding AllowEdit}" ItemsSource="{Binding Path=Baskets}" SelectedItem="{Binding SelectedBasket, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding BasketName, Mode=TwoWay}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
</Border>
<Border Grid.Column="2" BorderThickness="1,1,1,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="Transparent" >
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="8"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="1" Text="创建人:" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14"></TextBlock>
<TextBox Grid.Column="3" IsEnabled="False" Text="{Binding CreateBy}" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14"></TextBox>
</Grid>
</Border>
</Grid>
<Grid Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
</Grid>
<Grid Grid.Row="6">
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="5"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="5"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="5"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="5"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Button Grid.Row="0" Grid.Column="0" Margin="2" FontSize="15" IsEnabled="{Binding AllowEdit}" Style="{DynamicResource CommonIconButton}" Command="{Binding SetDefaultCommand}" Content="全部设置"></Button>
<Button Grid.Row="0" Grid.Column="2" Margin="2" FontSize="15" IsEnabled="{Binding AllowEdit}" Style="{DynamicResource CommonIconButton}" Command="{Binding DeleteDefaultCommand}" Content="全部删除"></Button>
</Grid>
</Grid>
</Grid>
</UserControl>