终端一体化运控平台
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

384 linhas
17 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.CustomResource.Pages.View.AlarmView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
  9. d:DesignHeight="450"
  10. d:DesignWidth="800"
  11. mc:Ignorable="d">
  12. <UserControl.DataContext>
  13. <vm:AlarmViewModel />
  14. </UserControl.DataContext>
  15. <UserControl.Resources>
  16. <ResourceDictionary>
  17. <ResourceDictionary.MergedDictionaries>
  18. <ResourceDictionary>
  19. <!--<convert:TextDisplayConvert x:Key="textDisplayConvert" />
  20. <convert:IsEnableConvert x:Key="isEnableConvert" />
  21. <convert:AnalogAlarmConvert x:Key="analogAlarmConvert" />
  22. <convert:DiscreteAlarmConvert x:Key="discreteAlarmConvert" />
  23. <convert:AlarmTypeTextConvert x:Key="alarmTypeTextConvert" />-->
  24. <SolidColorBrush x:Key="BorderSolid" Color="#332AB2E7" />
  25. <SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
  26. <SolidColorBrush x:Key="TitleFontColor" Color="#FF2AB2E7" />
  27. <SolidColorBrush x:Key="CursorColor" Color="Aqua" />
  28. <SolidColorBrush x:Key="TitleBorderColor" Color="#332AB2E7" />
  29. <Style x:Key="TextBlockStyle" TargetType="TextBlock">
  30. <Setter Property="FontFamily" Value="楷体" />
  31. <Setter Property="FontSize" Value="18" />
  32. <Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
  33. <Setter Property="VerticalAlignment" Value="Center" />
  34. <Setter Property="HorizontalAlignment" Value="Center" />
  35. </Style>
  36. <Style x:Key="TextBoxStyle" TargetType="TextBox">
  37. <Setter Property="FontFamily" Value="楷体" />
  38. <Setter Property="FontSize" Value="22" />
  39. <Setter Property="Background" Value="Transparent" />
  40. <Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
  41. <Setter Property="BorderBrush" Value="#FF23CACA" />
  42. <Setter Property="CaretBrush" Value="Aqua" />
  43. <Setter Property="VerticalAlignment" Value="Center" />
  44. </Style>
  45. <Style x:Key="DataTextBlockStyle" TargetType="TextBlock">
  46. <Setter Property="HorizontalAlignment" Value="Center" />
  47. <Setter Property="VerticalAlignment" Value="Center" />
  48. <Setter Property="Background" Value="Transparent" />
  49. <Setter Property="Foreground" Value="#FFF53F62" />
  50. <Setter Property="FontSize" Value="14" />
  51. </Style>
  52. <ControlTemplate x:Key="ButTemplate" TargetType="Button">
  53. <Border
  54. x:Name="br"
  55. Background="Transparent"
  56. BorderBrush="#FF19B7EC"
  57. BorderThickness="2">
  58. <StackPanel
  59. HorizontalAlignment="Center"
  60. VerticalAlignment="Center"
  61. Orientation="Horizontal">
  62. <ContentControl
  63. HorizontalAlignment="Center"
  64. VerticalAlignment="Center"
  65. Content="{TemplateBinding Content}"
  66. Foreground="{TemplateBinding Foreground}" />
  67. </StackPanel>
  68. </Border>
  69. <ControlTemplate.Triggers>
  70. <Trigger Property="IsMouseOver" Value="True">
  71. <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
  72. </Trigger>
  73. <Trigger Property="IsPressed" Value="true">
  74. <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
  75. </Trigger>
  76. </ControlTemplate.Triggers>
  77. </ControlTemplate>
  78. </ResourceDictionary>
  79. </ResourceDictionary.MergedDictionaries>
  80. </ResourceDictionary>
  81. </UserControl.Resources>
  82. <Grid Margin="10">
  83. <Grid.RowDefinitions>
  84. <RowDefinition Height="50" />
  85. <RowDefinition Height="30" />
  86. <RowDefinition />
  87. </Grid.RowDefinitions>
  88. <StackPanel
  89. Margin="0,8"
  90. HorizontalAlignment="Right"
  91. Orientation="Horizontal">
  92. <DatePicker
  93. Background="Transparent"
  94. BorderBrush="#aa3aa7f3"
  95. BorderThickness="2"
  96. SelectedDate="{Binding StartDateTime}"
  97. Style="{StaticResource PickerStyle}"
  98. Text="请输入开始时间"
  99. Visibility="{Binding IsVisibility}" />
  100. <DatePicker
  101. Margin="20,0,20,0"
  102. Background="Transparent"
  103. BorderBrush="#aa3aa7f3"
  104. BorderThickness="2"
  105. SelectedDate="{Binding EndDateTime}"
  106. Style="{StaticResource PickerStyle}"
  107. Text="请输入结束时间"
  108. Visibility="{Binding IsVisibility}" />
  109. <Button
  110. Width="140"
  111. Height="30"
  112. Background="#FF19B7EC"
  113. Command="{Binding ControlCommand}"
  114. Content="{Binding ControlButText}"
  115. FontFamily="楷体"
  116. FontSize="18"
  117. Template="{StaticResource ButTemplate}">
  118. <Button.Foreground>
  119. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  120. <GradientStop Color="#FFBB662A" />
  121. <GradientStop Offset="1" Color="White" />
  122. </LinearGradientBrush>
  123. </Button.Foreground>
  124. </Button>
  125. <Button
  126. Width="140"
  127. Height="30"
  128. Margin="20,0,0,0"
  129. Background="#FF19B7EC"
  130. Command="{Binding SwitchCommand}"
  131. Content="{Binding ButContent}"
  132. FontFamily="楷体"
  133. FontSize="18"
  134. Template="{StaticResource ButTemplate}">
  135. <Button.Foreground>
  136. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  137. <GradientStop Color="#FFBB662A" />
  138. <GradientStop Offset="1" Color="White" />
  139. </LinearGradientBrush>
  140. </Button.Foreground>
  141. </Button>
  142. </StackPanel>
  143. <!--#region 表格标题栏设置-->
  144. <Grid Grid.Row="1" Background="#ff0C255F">
  145. <Grid.ColumnDefinitions>
  146. <ColumnDefinition Width="0.3*" />
  147. <ColumnDefinition Width="0.7*" />
  148. <ColumnDefinition Width="0.7*" />
  149. <ColumnDefinition />
  150. <ColumnDefinition Width="0.7*" />
  151. <ColumnDefinition Width="0.5*" />
  152. </Grid.ColumnDefinitions>
  153. <TextBlock
  154. Grid.Column="0"
  155. HorizontalAlignment="Center"
  156. VerticalAlignment="Center"
  157. FontSize="16"
  158. Foreground="{StaticResource TitleFontColor}"
  159. Text="ID" />
  160. <Grid Grid.Column="1">
  161. <TextBlock
  162. HorizontalAlignment="Center"
  163. VerticalAlignment="Center"
  164. FontSize="16"
  165. Foreground="{StaticResource TitleFontColor}"
  166. Text="报警日期" />
  167. <Border
  168. BorderBrush="{StaticResource TitleBorderColor}"
  169. BorderThickness="1,0,1,0"
  170. Cursor="SizeWE" />
  171. </Grid>
  172. <TextBlock
  173. Grid.Column="2"
  174. HorizontalAlignment="Center"
  175. VerticalAlignment="Center"
  176. FontSize="16"
  177. Foreground="{StaticResource TitleFontColor}"
  178. Text="报警时间" />
  179. <Grid Grid.Column="3">
  180. <TextBlock
  181. HorizontalAlignment="Center"
  182. VerticalAlignment="Center"
  183. FontSize="16"
  184. Foreground="{StaticResource TitleFontColor}"
  185. Text="报警信息" />
  186. <Border
  187. BorderBrush="{StaticResource TitleBorderColor}"
  188. BorderThickness="1,0,1,0"
  189. Cursor="SizeWE" />
  190. </Grid>
  191. <TextBlock
  192. Grid.Column="4"
  193. HorizontalAlignment="Center"
  194. VerticalAlignment="Center"
  195. FontSize="16"
  196. Foreground="{StaticResource TitleFontColor}"
  197. Text="报警值" />
  198. <Grid Grid.Column="5">
  199. <TextBlock
  200. HorizontalAlignment="Center"
  201. VerticalAlignment="Center"
  202. FontSize="16"
  203. Foreground="{StaticResource TitleFontColor}"
  204. Text="报警等级" />
  205. <Border
  206. BorderBrush="{StaticResource TitleBorderColor}"
  207. BorderThickness="1,0,1,0"
  208. Cursor="SizeWE" />
  209. </Grid>
  210. </Grid>
  211. <!--#endregion-->
  212. <!--#region 表格数据显示-->
  213. <ScrollViewer
  214. Grid.Row="2"
  215. HorizontalScrollBarVisibility="Hidden"
  216. VerticalScrollBarVisibility="Hidden">
  217. <Grid>
  218. <Grid.ColumnDefinitions>
  219. <ColumnDefinition Width="139*"/>
  220. <ColumnDefinition Width="641*"/>
  221. </Grid.ColumnDefinitions>
  222. <!--#region 实时报警信息-->
  223. <ItemsControl ItemsSource="{Binding AlarmInfos}" Visibility="{Binding CurrentDataVis}" Grid.ColumnSpan="2">
  224. <ItemsControl.ItemTemplate>
  225. <DataTemplate>
  226. <Grid x:Name="gr" Height="30">
  227. <Grid.ColumnDefinitions>
  228. <ColumnDefinition Width="0.3*" />
  229. <ColumnDefinition Width="0.7*" />
  230. <ColumnDefinition Width="0.7*" />
  231. <ColumnDefinition />
  232. <ColumnDefinition Width="0.7*" />
  233. <ColumnDefinition Width="0.5*" />
  234. </Grid.ColumnDefinitions>
  235. <TextBlock
  236. Grid.Column="0"
  237. Style="{StaticResource DataTextBlockStyle}"
  238. Text="{Binding NumId}" />
  239. <Grid Grid.Column="1">
  240. <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Date}" />
  241. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  242. </Grid>
  243. <TextBlock
  244. Grid.Column="2"
  245. Style="{StaticResource DataTextBlockStyle}"
  246. Text="{Binding Time}" />
  247. <Grid Grid.Column="3">
  248. <TextBlock
  249. Margin="10,0,0,0"
  250. HorizontalAlignment="Left"
  251. Style="{StaticResource DataTextBlockStyle}"
  252. Text="{Binding Info}" />
  253. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  254. </Grid>
  255. <TextBlock
  256. Grid.Column="4"
  257. Style="{StaticResource DataTextBlockStyle}"
  258. Text="{Binding Value}" />
  259. <Grid Grid.Column="5">
  260. <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Grade}" />
  261. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  262. </Grid>
  263. <Border
  264. Grid.ColumnSpan="6"
  265. BorderBrush="{StaticResource BorderSolid}"
  266. BorderThickness="1" />
  267. </Grid>
  268. <DataTemplate.Triggers>
  269. <Trigger Property="IsMouseOver" Value="true">
  270. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  271. </Trigger>
  272. </DataTemplate.Triggers>
  273. </DataTemplate>
  274. </ItemsControl.ItemTemplate>
  275. </ItemsControl>
  276. <!--#endregion-->
  277. <!--#region 历史报警信息-->
  278. <ItemsControl ItemsSource="{Binding HistoryAlarm}" Visibility="{Binding HistoryDataVis}" Grid.ColumnSpan="2">
  279. <ItemsControl.ItemTemplate>
  280. <DataTemplate>
  281. <Grid x:Name="gr" Height="30">
  282. <Grid.ColumnDefinitions>
  283. <ColumnDefinition Width="0.3*" />
  284. <ColumnDefinition Width="0.7*" />
  285. <ColumnDefinition Width="0.7*" />
  286. <ColumnDefinition />
  287. <ColumnDefinition Width="0.7*" />
  288. <ColumnDefinition Width="0.5*" />
  289. </Grid.ColumnDefinitions>
  290. <TextBlock
  291. Grid.Column="0"
  292. Style="{StaticResource DataTextBlockStyle}"
  293. Text="{Binding Id}" />
  294. <Grid Grid.Column="1">
  295. <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Date}" />
  296. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  297. </Grid>
  298. <TextBlock
  299. Grid.Column="2"
  300. Style="{StaticResource DataTextBlockStyle}"
  301. Text="{Binding Time}" />
  302. <Grid Grid.Column="3">
  303. <TextBlock
  304. Margin="10,0,0,0"
  305. HorizontalAlignment="Left"
  306. Style="{StaticResource DataTextBlockStyle}"
  307. Text="{Binding Info}" />
  308. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  309. </Grid>
  310. <TextBlock
  311. Grid.Column="4"
  312. Style="{StaticResource DataTextBlockStyle}"
  313. Text="{Binding Value}" />
  314. <Grid Grid.Column="5">
  315. <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Grade}" />
  316. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  317. </Grid>
  318. <Border
  319. Grid.ColumnSpan="6"
  320. BorderBrush="{StaticResource BorderSolid}"
  321. BorderThickness="1" />
  322. </Grid>
  323. <DataTemplate.Triggers>
  324. <Trigger Property="IsMouseOver" Value="true">
  325. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  326. </Trigger>
  327. </DataTemplate.Triggers>
  328. </DataTemplate>
  329. </ItemsControl.ItemTemplate>
  330. </ItemsControl>
  331. <!--#endregion-->
  332. </Grid>
  333. </ScrollViewer>
  334. <!--#endregion-->
  335. </Grid>
  336. </UserControl>