终端一体化运控平台
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.
 
 
 

374 lines
17 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.CustomResource.Pages.View.RunLogView"
  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:RunLogViewModel />
  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="#5523CACA" />
  25. <SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
  26. <SolidColorBrush x:Key="TitleFontColor" Color="White" />
  27. <SolidColorBrush x:Key="CursorColor" Color="Aqua" />
  28. <SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />
  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="Red" />
  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. Visibility="{Binding IsVisibility}">
  119. <Button.Foreground>
  120. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  121. <GradientStop Color="#FFBB662A" />
  122. <GradientStop Offset="1" Color="White" />
  123. </LinearGradientBrush>
  124. </Button.Foreground>
  125. </Button>
  126. <Button
  127. Width="140"
  128. Height="30"
  129. Margin="20,0,0,0"
  130. Background="#FF19B7EC"
  131. Command="{Binding SwitchCommand}"
  132. Content="{Binding ButContent}"
  133. FontFamily="楷体"
  134. FontSize="18"
  135. Template="{StaticResource ButTemplate}">
  136. <Button.Foreground>
  137. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  138. <GradientStop Color="#FFBB662A" />
  139. <GradientStop Offset="1" Color="White" />
  140. </LinearGradientBrush>
  141. </Button.Foreground>
  142. </Button>
  143. </StackPanel>
  144. <!--#region 表格标题栏设置-->
  145. <Grid Grid.Row="1" Background="#FF19B7EC">
  146. <Grid.ColumnDefinitions>
  147. <ColumnDefinition Width="0.7*" />
  148. <ColumnDefinition Width="0.7*" />
  149. <ColumnDefinition />
  150. </Grid.ColumnDefinitions>
  151. <TextBlock
  152. Grid.Column="0"
  153. HorizontalAlignment="Center"
  154. VerticalAlignment="Center"
  155. FontSize="16"
  156. Foreground="{StaticResource TitleFontColor}"
  157. Text="日期" />
  158. <Grid Grid.Column="1">
  159. <TextBlock
  160. HorizontalAlignment="Center"
  161. VerticalAlignment="Center"
  162. FontSize="16"
  163. Foreground="{StaticResource TitleFontColor}"
  164. Text="时间" />
  165. <Border
  166. BorderBrush="{StaticResource TitleBorderColor}"
  167. BorderThickness="1,0,1,0"
  168. Cursor="SizeWE" />
  169. </Grid>
  170. <TextBlock
  171. Grid.Column="2"
  172. HorizontalAlignment="Center"
  173. VerticalAlignment="Center"
  174. FontSize="16"
  175. Foreground="{StaticResource TitleFontColor}"
  176. Text="消息日志" />
  177. <!--<Grid Grid.Column="3">
  178. <TextBlock
  179. HorizontalAlignment="Center"
  180. VerticalAlignment="Center"
  181. FontSize="16"
  182. Foreground="{StaticResource TitleFontColor}"
  183. Text="报警信息" />
  184. <Border
  185. BorderBrush="{StaticResource TitleBorderColor}"
  186. BorderThickness="1,0,1,0"
  187. Cursor="SizeWE" />
  188. </Grid>-->
  189. <!--<TextBlock
  190. Grid.Column="4"
  191. HorizontalAlignment="Center"
  192. VerticalAlignment="Center"
  193. FontSize="16"
  194. Foreground="{StaticResource TitleFontColor}"
  195. Text="报警值" />
  196. <Grid Grid.Column="5">
  197. <TextBlock
  198. HorizontalAlignment="Center"
  199. VerticalAlignment="Center"
  200. FontSize="16"
  201. Foreground="{StaticResource TitleFontColor}"
  202. Text="报警等级" />
  203. <Border
  204. BorderBrush="{StaticResource TitleBorderColor}"
  205. BorderThickness="1,0,1,0"
  206. Cursor="SizeWE" />
  207. </Grid>-->
  208. </Grid>
  209. <!--#endregion-->
  210. <!--#region 表格数据显示-->
  211. <ScrollViewer
  212. Grid.Row="2"
  213. HorizontalScrollBarVisibility="Hidden"
  214. VerticalScrollBarVisibility="Hidden">
  215. <Grid>
  216. <!--#region 实时报警信息-->
  217. <ItemsControl ItemsSource="{Binding Log}" Visibility="{Binding CurrentDataVis}">
  218. <ItemsControl.ItemTemplate>
  219. <DataTemplate>
  220. <Grid x:Name="gr" Height="30">
  221. <Grid.ColumnDefinitions>
  222. <ColumnDefinition Width="0.7*" />
  223. <ColumnDefinition Width="0.7*" />
  224. <ColumnDefinition />
  225. </Grid.ColumnDefinitions>
  226. <TextBlock
  227. Grid.Column="0"
  228. Style="{StaticResource DataTextBlockStyle}"
  229. Text="{Binding Date}" />
  230. <Grid Grid.Column="1">
  231. <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Time}" />
  232. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  233. </Grid>
  234. <TextBlock
  235. Grid.Column="2"
  236. Style="{StaticResource DataTextBlockStyle}"
  237. Text="{Binding RunLogInfo}"
  238. />
  239. <!--<Grid Grid.Column="3">
  240. <TextBlock
  241. Margin="10,0,0,0"
  242. HorizontalAlignment="Left"
  243. Style="{StaticResource DataTextBlockStyle}"
  244. Text="{Binding Info}" />
  245. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  246. </Grid>
  247. <TextBlock
  248. Grid.Column="4"
  249. Style="{StaticResource DataTextBlockStyle}"
  250. Text="{Binding Value}" />
  251. <Grid Grid.Column="5">
  252. <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Grade}" />
  253. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  254. </Grid>-->
  255. <Border
  256. Grid.ColumnSpan="6"
  257. BorderBrush="{StaticResource BorderSolid}"
  258. BorderThickness="1" />
  259. </Grid>
  260. <DataTemplate.Triggers>
  261. <Trigger Property="IsMouseOver" Value="true">
  262. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  263. </Trigger>
  264. </DataTemplate.Triggers>
  265. </DataTemplate>
  266. </ItemsControl.ItemTemplate>
  267. </ItemsControl>
  268. <!--#endregion-->
  269. <!--#region 历史报警信息-->
  270. <ItemsControl ItemsSource="{Binding HistoryRunLog}" Visibility="{Binding HistoryDataVis}">
  271. <ItemsControl.ItemTemplate>
  272. <DataTemplate>
  273. <Grid x:Name="gr" Height="30">
  274. <Grid.ColumnDefinitions>
  275. <ColumnDefinition Width="0.7*" />
  276. <ColumnDefinition Width="0.7*" />
  277. <ColumnDefinition />
  278. </Grid.ColumnDefinitions>
  279. <TextBlock
  280. Grid.Column="0"
  281. Style="{StaticResource DataTextBlockStyle}"
  282. Text="{Binding Date}" />
  283. <Grid Grid.Column="1">
  284. <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Time}" />
  285. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  286. </Grid>
  287. <TextBlock
  288. Grid.Column="2"
  289. Style="{StaticResource DataTextBlockStyle}"
  290. Text="{Binding RunLogInfo}" />
  291. <!--<Grid Grid.Column="3">
  292. <TextBlock
  293. Margin="10,0,0,0"
  294. HorizontalAlignment="Left"
  295. Style="{StaticResource DataTextBlockStyle}"
  296. Text="{Binding Info}" />
  297. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  298. </Grid>
  299. <TextBlock
  300. Grid.Column="4"
  301. Style="{StaticResource DataTextBlockStyle}"
  302. Text="{Binding Value}" />
  303. <Grid Grid.Column="5">
  304. <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Grade}" />
  305. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  306. </Grid>-->
  307. <Border
  308. Grid.ColumnSpan="6"
  309. BorderBrush="{StaticResource BorderSolid}"
  310. BorderThickness="1" />
  311. </Grid>
  312. <DataTemplate.Triggers>
  313. <Trigger Property="IsMouseOver" Value="true">
  314. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  315. </Trigger>
  316. </DataTemplate.Triggers>
  317. </DataTemplate>
  318. </ItemsControl.ItemTemplate>
  319. </ItemsControl>
  320. <!--#endregion-->
  321. </Grid>
  322. </ScrollViewer>
  323. <!--#endregion-->
  324. </Grid>
  325. </UserControl>