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

322 lines
18 KiB
Plaintext

<Window x:Class="CommonFunc.Tools.MachineRepairWin"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:CommonFunc.Tools"
mc:Ignorable="d"
Title="MachineRepairWin" Height="550" Width="900" WindowStartupLocation="CenterScreen" WindowStyle="None" Loaded="Window_Loaded">
<Window.Resources>
<SolidColorBrush x:Key="EvenRowBackground" Color="#E0E0E0"/>
<SolidColorBrush x:Key="OddRowBackground" Color="#FFFFFF"/>
<Style x:Key="ColumnHeaderGripperStyle" TargetType="DataGridColumnHeader"/>
<Style x:Key="DataGridRowStyle" TargetType="DataGridRow">
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Background" Value="{StaticResource EvenRowBackground}"/>
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="{StaticResource OddRowBackground}"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="CustomCellStyle" TargetType="DataGridCell">
<Setter Property="Foreground" Value="Black" />
<Setter Property="TextBlock.TextAlignment" Value="Center" />
<Setter Property="TextBlock.FontSize" Value="22" />
</Style>
<Style x:Key="ApplicantList_ListBox_Style" TargetType="{x:Type ListBox}">
<Setter Property="Background" Value="#00000000"/>
<Setter Property="BorderBrush" Value="#00000000"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<!--<Setter Property="ItemContainerStyle" Value="{DynamicResource ApplicantList_ListBoxItem_Style}" />-->
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<!--<WrapPanel Orientation="Horizontal" IsItemsHost="True" />-->
<UniformGrid Columns="2"/>
<!--设置横向Horizontal 纵向Vertical显示-->
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="btnKey" TargetType="Button">
<Setter Property="Width" Value="150" />
<Setter Property="Height" Value="60" />
<Setter Property="Margin" Value="5.5"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="#2B7EE6" BorderThickness="2" CornerRadius="10">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ApplicantList_ListBoxItem_Style" TargetType="{x:Type ListBoxItem}">
<Setter Property="Margin" Value="10,10,10,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="Bd" BorderThickness="3"
Width="120"
Height="40"
Margin="2,0,0,0"
Style="{DynamicResource ListBoxItemNormalBackground_Border_Style}">
<Grid >
<Image Source="../Resources/leaf.png" Margin="223,-82,0,0" Width="50"/>
<TextBlock Text="{Binding childprocess_code}"
VerticalAlignment="Center"
Margin="10,0,0,0" FontWeight="Bold" Foreground="Black"
Style="{DynamicResource ListBoxItemContent_TextBlock_Style}"/>
<TextBlock Text="{Binding childprocess_name}"
VerticalAlignment="Center"
Margin="35,0,0,0" FontWeight="Bold" Foreground="Black"
Style="{DynamicResource ListBoxItemContent_TextBlock_Style}"/>
<Grid
Margin="-15,12,0,0"
Width="90"
Height="102"
VerticalAlignment="Top"
HorizontalAlignment="Left" >
<Image Source="../Resources/circular.png" Width="10" Height="10" Margin="0,-62,0,0"/>
<Image Source="../Resources/circular.png" Width="10" Height="10" Margin="0,-22,0,0"/>
<Image Source="../Resources/circular.png" Width="10" Height="10" Margin="0,18,0,0"/>
<Image Source="../Resources/circular.png" Width="10" Height="10" Margin="0,56,0,0"/>
<!--<Image Source="../Resources/lanjuLogo.png" VerticalAlignment="Stretch"/>-->
<!--<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding rfid_no}" FontSize="18"
Foreground="{Binding rfid_no,Converter={StaticResource ForeGroundBatchType}}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Image Source="..\Img\1.png"></Image>
</StackPanel>-->
</Grid>
</Grid>
</Border>
<!--控件触发器-->
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="true">
<Setter Property="Background" TargetName="Bd">
<Setter.Value>
<!--LinearGradientBrush,渐变线画笔-->
<LinearGradientBrush
StartPoint="0.4,0"
EndPoint="0.4,1">
<LinearGradientBrush.GradientStops>
<!--GradientStops渐变线停止GradientStopCollection渐变线停止集合点-->
<GradientStopCollection>
<GradientStop
Color="#FFffeeac"
Offset="0" />
<GradientStop
Color="#FFfbe178"
Offset="0.4" />
<GradientStop
Color="#FFfbe178"
Offset="0.6" />
<GradientStop
Color="#FFfffbd9"
Offset="1" />
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="BorderBrush" TargetName="Bd" Value="RoyalBlue"></Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="Bd">
<Setter.Value>
<!--LinearGradientBrush,渐变线画笔-->
<LinearGradientBrush
StartPoint="0.4,0"
EndPoint="0.4,1">
<LinearGradientBrush.GradientStops>
<!--GradientStops渐变线停止GradientStopCollection渐变线停止集合点-->
<GradientStopCollection>
<GradientStop
Color="#FFC2E0FF"
Offset="0" />
<GradientStop
Color="#FFC2E0dF"
Offset="0.4" />
<GradientStop
Color="#FFC2E0dF"
Offset="0.6" />
<GradientStop
Color="#FFfffbd9"
Offset="1" />
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type Border}" x:Key="ListBoxItemHeadBackground_Border_Style">
<Setter Property="BitmapEffect">
<Setter.Value>
<DropShadowBitmapEffect Color="Black" Direction="340" ShadowDepth="7" Softness="0.1" Opacity="0.3"/>
</Setter.Value>
</Setter>
<Setter Property="Background" >
<Setter.Value>
<LinearGradientBrush
StartPoint="0.4,0"
EndPoint="0.4,1">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop
Color="#FFffeeac"
Offset="0" />
<GradientStop
Color="#FFfbe178"
Offset="0.4" />
<GradientStop
Color="#FFfbe178"
Offset="0.6" />
<GradientStop
Color="#FFfffbd9"
Offset="1" />
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
<!--字体样式-->
<Style x:Key="Title_TextBlock_Style" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="34"/>
<Setter Property="FontFamily" Value="微软雅黑"/>
<Setter Property="Foreground" Value="#FFFFFFFF"/>
</Style>
<Style x:Key="Copyright_TextBlock_Style" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontFamily" Value="宋体"/>
<Setter Property="Foreground" Value="#FF939393"/>
</Style>
<Style x:Key="ChirdrenControlTitle_TextBlock_Style" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontFamily" Value="微软雅黑"/>
<Setter Property="Foreground" Value="#FFFFFFFF"/>
</Style>
<Style x:Key="ListBoxItemName_TextBlock_Style" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontFamily" Value="微软雅黑"/>
<Setter Property="Foreground" Value="#000000"/>
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
<Style x:Key="ListBoxItemContent_TextBlock_Style" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontFamily" Value="微软雅黑"/>
<Setter Property="Foreground" Value="#333333"/>
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
<!--ListBox元素边框样式-->
<Style x:Key="ListBoxItemNormalBackground_Border_Style" TargetType="{x:Type Border}">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="5" />
<Setter Property="BorderBrush" Value="#E1E1E1"/>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0.5,0"
EndPoint="0.5,1">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFffffff"
Offset="0" />
<GradientStop Color="#FFE4E4E4"
Offset="0.96" />
<GradientStop Color="#FFe4e4e4"
Offset="1" />
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect Color="#9e9e9e"
Direction="315"
ShadowDepth="3"
Opacity="1" />
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<Grid Grid.Row="0" Grid.RowSpan="2" Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="0.15*"/>
<RowDefinition Height="0.85*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Grid.Column ="0" Orientation="Horizontal" Margin="5">
<TextBlock Text="故障描述:" VerticalAlignment="Center"/>
<TextBox x:Name="txtP" Width="309" Height="30" FontSize="18" VerticalAlignment="Center" VerticalContentAlignment="Center" TextChanged="txtP_TextChanged"/>
<Button x:Name="btnQueryUser" Content="查询" FontWeight="Bold" Width="100" Height="40" Style="{StaticResource btnKey}" Click="btnQueryUser_Click" Visibility="Collapsed"/>
<Button x:Name="btnUserConfirm" Content="确认" FontWeight="Bold" Width="100" Height="40" Style="{StaticResource btnKey}" Click="btnUserConfirm_Click"/>
2 years ago
<Button x:Name="btnCloseWin" HorizontalAlignment="Right" Content="关闭" FontWeight="Bold" Width="100" Height="40" Style="{StaticResource btnKey}" Click="btnCloseWin_Click"/>
</StackPanel>
<DataGrid
Grid.Row="1"
x:Name="dgUserInfo"
MinWidth="400"
MinHeight="260"
RowStyle="{StaticResource DataGridRowStyle}"
AlternationCount="2"
FontSize="18"
LoadingRow="dgWorkOrderInfo_LoadingRow"
HeadersVisibility="Column"
HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalContentAlignment="Center" IsReadOnly="True"
AutoGenerateColumns="False" CanUserAddRows="False" SelectionMode="Single" SelectionUnit="FullRow" Width="880" Height="447" >
<DataGrid.ColumnHeaderStyle >
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="Height" Value="48" />
<Setter Property="FontSize" Value="20" />
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="#2B7EE6" />
</Style>
</DataGrid.ColumnHeaderStyle>
<DataGrid.Columns>
<DataGridTemplateColumn Header=" 序号" Width="80" MinWidth="10" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,0,0"></TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Width="230*" Header="故障编码" Binding="{Binding fault_code}"/>
<DataGridTextColumn Width="290*" Header="故障描述" Binding="{Binding fault_subclass}"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Grid>
</Window>