HistoryAlarmWindow.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <Window x:Class="NEIntelligentControl2.Windows.Alarm.HistoryAlarmWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:NEIntelligentControl2.Windows.Alarm"
  7. xmlns:alarm="clr-namespace:NEIntelligentControl2.Views.Alarm"
  8. xmlns:ib="clr-namespace:NEIntelligentControl2.Views.Basic"
  9. mc:Ignorable="d"
  10. Title="历史报警" Height="662" Width="1200" Background="#FFE3E3E3" WindowStyle="None" WindowStartupLocation="CenterOwner" Loaded="Window_Loaded">
  11. <WindowChrome.WindowChrome>
  12. <WindowChrome/>
  13. </WindowChrome.WindowChrome>
  14. <Window.Resources>
  15. <ResourceDictionary>
  16. <ResourceDictionary.MergedDictionaries>
  17. <ResourceDictionary Source="/Res/Alarm.xaml"/>
  18. </ResourceDictionary.MergedDictionaries>
  19. <Style x:Key="TagStackPanelStyle" TargetType="StackPanel">
  20. <Setter Property="Orientation" Value="Horizontal"/>
  21. <Setter Property="Margin" Value="10"/>
  22. </Style>
  23. <Style x:Key="TagTextBlockStyle" TargetType="TextBlock">
  24. <Setter Property="VerticalAlignment" Value="Center"/>
  25. </Style>
  26. <Style x:Key="TagComboBoxStyle" TargetType="ComboBox">
  27. <Setter Property="MinWidth" Value="100"/>
  28. </Style>
  29. <Style x:Key="TagTextBoxStyle" TargetType="TextBox">
  30. <Setter Property="MinWidth" Value="120"/>
  31. <Setter Property="VerticalContentAlignment" Value="Center"/>
  32. </Style>
  33. <Style TargetType="{x:Type ScrollBar}">
  34. <Setter Property="Background" Value="#77F0F8FF"/>
  35. <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
  36. <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
  37. <!--滚动条宽度-->
  38. <Setter Property="Width" Value="8"/>
  39. <Setter Property="MinWidth" Value="6"/>
  40. <Setter Property="Template">
  41. <Setter.Value>
  42. <ControlTemplate TargetType="{x:Type ScrollBar}">
  43. <!--滚动条背景色-->
  44. <Grid x:Name="Bg" Background="#77DDDDDD" SnapsToDevicePixels="true" Width="8">
  45. <Grid.RowDefinitions>
  46. <RowDefinition />
  47. </Grid.RowDefinitions>
  48. <Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}">
  49. <Track.DecreaseRepeatButton>
  50. <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
  51. </Track.DecreaseRepeatButton>
  52. <Track.IncreaseRepeatButton>
  53. <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
  54. </Track.IncreaseRepeatButton>
  55. <Track.Thumb>
  56. <Thumb Style="{StaticResource ScrollBarThumb}"/>
  57. </Track.Thumb>
  58. </Track>
  59. </Grid>
  60. <ControlTemplate.Triggers>
  61. <Trigger Property="IsEnabled" Value="false">
  62. <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/>
  63. </Trigger>
  64. </ControlTemplate.Triggers>
  65. </ControlTemplate>
  66. </Setter.Value>
  67. </Setter>
  68. <Style.Triggers>
  69. <Trigger Property="Orientation" Value="Horizontal">
  70. <Setter Property="Width" Value="Auto"/>
  71. <Setter Property="MinWidth" Value="0"/>
  72. <Setter Property="Height" Value="6"/>
  73. <Setter Property="MinHeight" Value="6"/>
  74. <Setter Property="Background" Value="#77F0F8FF"/>
  75. <Setter Property="Template">
  76. <Setter.Value>
  77. <ControlTemplate TargetType="{x:Type ScrollBar}">
  78. <Grid x:Name="Bg" Background="#77DDDDDD" SnapsToDevicePixels="true">
  79. <Grid.ColumnDefinitions>
  80. <ColumnDefinition />
  81. </Grid.ColumnDefinitions>
  82. <Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}">
  83. <Track.DecreaseRepeatButton>
  84. <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/>
  85. </Track.DecreaseRepeatButton>
  86. <Track.IncreaseRepeatButton>
  87. <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/>
  88. </Track.IncreaseRepeatButton>
  89. <Track.Thumb>
  90. <Thumb Style="{StaticResource ScrollBarThumb}" />
  91. </Track.Thumb>
  92. </Track>
  93. </Grid>
  94. <ControlTemplate.Triggers>
  95. <Trigger Property="IsEnabled" Value="false">
  96. <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/>
  97. </Trigger>
  98. </ControlTemplate.Triggers>
  99. </ControlTemplate>
  100. </Setter.Value>
  101. </Setter>
  102. </Trigger>
  103. </Style.Triggers>
  104. </Style>
  105. </ResourceDictionary>
  106. </Window.Resources>
  107. <Grid Margin="5">
  108. <Grid.RowDefinitions>
  109. <RowDefinition Height="Auto"/>
  110. <RowDefinition Height="Auto"/>
  111. <RowDefinition/>
  112. <RowDefinition Height="Auto"/>
  113. </Grid.RowDefinitions>
  114. <Border Background="#FF3A4E66" CornerRadius="9,0,0,0">
  115. <Grid Margin="0,10">
  116. <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
  117. <ContentControl Template="{StaticResource title_icon}" Width="24" Height="24" Margin="5,5,0,5"/>
  118. <TextBlock x:Name="_TBTitle" Text="历史报警查询" FontSize="16" Foreground="WhiteSmoke" Margin="5"/>
  119. </StackPanel>
  120. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
  121. <ContentControl Width="24" Height="24" Margin="5" MouseLeftButtonUp="ContentControl_MouseLeftButtonUp" Tag="maximized" ToolTip="最大最小化" WindowChrome.IsHitTestVisibleInChrome="True">
  122. <ContentControl.Style>
  123. <Style TargetType="ContentControl">
  124. <Style.Triggers>
  125. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}, Path=WindowState}" Value="Maximized">
  126. <Setter Property="Template" Value="{StaticResource unmaximize}"/>
  127. </DataTrigger>
  128. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}, Path=WindowState}" Value="Normal">
  129. <Setter Property="Template" Value="{StaticResource maximize}"/>
  130. </DataTrigger>
  131. </Style.Triggers>
  132. </Style>
  133. </ContentControl.Style>
  134. </ContentControl>
  135. <ContentControl Width="24" Height="24" Template="{StaticResource close}" Background="WhiteSmoke" Margin="5" MouseLeftButtonUp="ContentControl_MouseLeftButtonUp" Tag="close" ToolTip="关闭" WindowChrome.IsHitTestVisibleInChrome="True"/>
  136. </StackPanel>
  137. </Grid>
  138. </Border>
  139. <WrapPanel Grid.Row="1" Background="#FFDDE6EF">
  140. <StackPanel Style="{StaticResource TagStackPanelStyle}">
  141. <TextBlock Text="开始时间:" Style="{StaticResource TagTextBlockStyle}"/>
  142. <TextBox x:Name="_TBStartTime" Style="{StaticResource TagTextBoxStyle}" KeyDown="TextBox_KeyDown"/>
  143. </StackPanel>
  144. <StackPanel Style="{StaticResource TagStackPanelStyle}">
  145. <TextBlock Text="结束时间:" Style="{StaticResource TagTextBlockStyle}"/>
  146. <TextBox x:Name="_TBEndTime" Style="{StaticResource TagTextBoxStyle}" KeyDown="TextBox_KeyDown"/>
  147. </StackPanel>
  148. <StackPanel Style="{StaticResource TagStackPanelStyle}">
  149. <TextBlock Text="场站:" Style="{StaticResource TagTextBlockStyle}"/>
  150. <ComboBox x:Name="_CBStation" DisplayMemberPath="FullName" Style="{StaticResource TagComboBoxStyle}" SelectionChanged="_CBStation_SelectionChanged" SelectedIndex="0"/>
  151. </StackPanel>
  152. <StackPanel Style="{StaticResource TagStackPanelStyle}">
  153. <TextBlock Text="级别:" Style="{StaticResource TagTextBlockStyle}"/>
  154. <ComboBox x:Name="_CBClass" DisplayMemberPath="Name" Style="{StaticResource TagComboBoxStyle}" SelectedIndex="0" SelectionChanged="_CBClass_SelectionChanged"/>
  155. </StackPanel>
  156. <StackPanel Style="{StaticResource TagStackPanelStyle}">
  157. <TextBlock Text="类型:" Style="{StaticResource TagTextBlockStyle}"/>
  158. <ComboBox x:Name="_CBType" DisplayMemberPath="Name" Style="{StaticResource TagComboBoxStyle}" SelectedIndex="0" SelectionChanged="_CBType_SelectionChanged"/>
  159. </StackPanel>
  160. <StackPanel Style="{StaticResource TagStackPanelStyle}">
  161. <TextBlock Text="子类型:" Style="{StaticResource TagTextBlockStyle}"/>
  162. <ComboBox x:Name="_CBSType" Style="{StaticResource TagComboBoxStyle}" DisplayMemberPath="Name" SelectionChanged="_CBSType_SelectionChanged"/>
  163. </StackPanel>
  164. <StackPanel Style="{StaticResource TagStackPanelStyle}">
  165. <TextBlock Text="风机:" Style="{StaticResource TagTextBlockStyle}"/>
  166. <ComboBox x:Name="_CBWindturbine" Style="{StaticResource TagComboBoxStyle}" SelectionChanged="_CBWindturbine_SelectionChanged"/>
  167. </StackPanel>
  168. <StackPanel Style="{StaticResource TagStackPanelStyle}">
  169. <TextBlock Text="关键字:" Style="{StaticResource TagTextBlockStyle}"/>
  170. <TextBox x:Name="_CBKeyString" Style="{StaticResource TagTextBoxStyle}" LostFocus="_CBKeyString_LostFocus" VerticalAlignment="Stretch"/>
  171. </StackPanel>
  172. <Button Content="开始查询" VerticalAlignment="Center" Margin="10" Padding="12,3" Click="Button_Click" Tag="search" Style="{StaticResource ConfirmButtonStyle}"/>
  173. <Button Content="导出" VerticalAlignment="Center" Margin="10" Padding="12,3" Click="Button_Click" Tag="output" Style="{StaticResource ConfirmButtonStyle}"/>
  174. </WrapPanel>
  175. <DataGrid x:Name="_DGMain" FontSize="14" ColumnWidth="*" Grid.Row="2" Background="#FFABABAB" IsReadOnly="True" AutoGenerateColumns="False" HorizontalGridLinesBrush="#FF9E9E9E" VerticalGridLinesBrush="#FF9E9E9E">
  176. <DataGrid.Columns>
  177. <DataGridTextColumn Header="时间" Binding="{Binding AlertTimeTimeString}" Width="150"/>
  178. <DataGridTextColumn Header="设备" Binding="{Binding ObjectName}"/>
  179. <DataGridTextColumn Header="报警信息" Binding="{Binding AlertText}" MinWidth="300"/>
  180. <DataGridTextColumn Header="级别" Binding="{Binding RankString}"/>
  181. <DataGridTextColumn Header="报警类型" Binding="{Binding Category1String}"/>
  182. <DataGridTextColumn Header="停机类型"/>
  183. <DataGridTextColumn Header="故障类型"/>
  184. <DataGridTextColumn Header="故障原因"/>
  185. </DataGrid.Columns>
  186. </DataGrid>
  187. <ib:InfoBar x:Name="_IBMain" Grid.Row="3"/>
  188. </Grid>
  189. </Window>