终端一体化运控平台
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

403 Zeilen
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="#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="#FF2BD06F" />
  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
  146. Grid.Row="1"
  147. Margin="0,0,17,0"
  148. Background="#ff0C255F">
  149. <Grid.ColumnDefinitions>
  150. <ColumnDefinition Width="150" />
  151. <ColumnDefinition Width="150" />
  152. <ColumnDefinition />
  153. </Grid.ColumnDefinitions>
  154. <TextBlock
  155. Grid.Column="0"
  156. HorizontalAlignment="Center"
  157. VerticalAlignment="Center"
  158. FontSize="16"
  159. Foreground="{StaticResource TitleFontColor}"
  160. Text="日期" />
  161. <Grid Grid.Column="1">
  162. <TextBlock
  163. HorizontalAlignment="Center"
  164. VerticalAlignment="Center"
  165. FontSize="16"
  166. Foreground="{StaticResource TitleFontColor}"
  167. Text="时间" />
  168. <Border
  169. BorderBrush="{StaticResource TitleBorderColor}"
  170. BorderThickness="1,0,1,0"
  171. Cursor="SizeWE" />
  172. </Grid>
  173. <TextBlock
  174. Grid.Column="2"
  175. HorizontalAlignment="Center"
  176. VerticalAlignment="Center"
  177. FontSize="16"
  178. Foreground="{StaticResource TitleFontColor}"
  179. Text="消息日志" />
  180. <!--<Grid Grid.Column="3">
  181. <TextBlock
  182. HorizontalAlignment="Center"
  183. VerticalAlignment="Center"
  184. FontSize="16"
  185. Foreground="{StaticResource TitleFontColor}"
  186. Text="报警信息" />
  187. <Border
  188. BorderBrush="{StaticResource TitleBorderColor}"
  189. BorderThickness="1,0,1,0"
  190. Cursor="SizeWE" />
  191. </Grid>-->
  192. <!--<TextBlock
  193. Grid.Column="4"
  194. HorizontalAlignment="Center"
  195. VerticalAlignment="Center"
  196. FontSize="16"
  197. Foreground="{StaticResource TitleFontColor}"
  198. Text="报警值" />
  199. <Grid Grid.Column="5">
  200. <TextBlock
  201. HorizontalAlignment="Center"
  202. VerticalAlignment="Center"
  203. FontSize="16"
  204. Foreground="{StaticResource TitleFontColor}"
  205. Text="报警等级" />
  206. <Border
  207. BorderBrush="{StaticResource TitleBorderColor}"
  208. BorderThickness="1,0,1,0"
  209. Cursor="SizeWE" />
  210. </Grid>-->
  211. </Grid>
  212. <!--#endregion-->
  213. <!--#region 表格数据显示-->
  214. <!--<ScrollViewer
  215. Grid.Row="2"
  216. HorizontalScrollBarVisibility="Hidden"
  217. VerticalScrollBarVisibility="Visible">-->
  218. <Grid Grid.Row="2">
  219. <!--#region 实时报警信息-->
  220. <ItemsControl
  221. ItemsSource="{Binding Log}"
  222. ScrollViewer.CanContentScroll="True"
  223. VirtualizingStackPanel.IsVirtualizing="True"
  224. Visibility="{Binding CurrentDataVis}">
  225. <ItemsControl.ItemsPanel>
  226. <ItemsPanelTemplate>
  227. <VirtualizingStackPanel />
  228. </ItemsPanelTemplate>
  229. </ItemsControl.ItemsPanel>
  230. <ItemsControl.Template>
  231. <ControlTemplate>
  232. <Border
  233. Padding="{TemplateBinding Control.Padding}"
  234. Background="{TemplateBinding Panel.Background}"
  235. BorderBrush="{TemplateBinding Border.BorderBrush}"
  236. BorderThickness="{TemplateBinding Border.BorderThickness}"
  237. SnapsToDevicePixels="True">
  238. <ScrollViewer Padding="{TemplateBinding Control.Padding}" Focusable="False">
  239. <ItemsPresenter SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
  240. </ScrollViewer>
  241. </Border>
  242. </ControlTemplate>
  243. </ItemsControl.Template>
  244. <ItemsControl.ItemTemplate>
  245. <DataTemplate>
  246. <Grid x:Name="gr" MinHeight="30">
  247. <Grid.ColumnDefinitions>
  248. <ColumnDefinition Width="150" />
  249. <ColumnDefinition Width="150" />
  250. <ColumnDefinition />
  251. </Grid.ColumnDefinitions>
  252. <TextBlock
  253. Grid.Column="0"
  254. Style="{StaticResource DataTextBlockStyle}"
  255. Text="{Binding Date}" />
  256. <Grid Grid.Column="1">
  257. <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Time}" />
  258. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  259. </Grid>
  260. <TextBlock
  261. Grid.Column="2"
  262. Margin="10,0,0,0"
  263. HorizontalAlignment="Left"
  264. Style="{StaticResource DataTextBlockStyle}"
  265. Text="{Binding RunLogInfo}"
  266. TextWrapping="Wrap" />
  267. <Border
  268. Grid.ColumnSpan="6"
  269. BorderBrush="{StaticResource BorderSolid}"
  270. BorderThickness="1" />
  271. </Grid>
  272. <DataTemplate.Triggers>
  273. <Trigger Property="IsMouseOver" Value="true">
  274. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  275. </Trigger>
  276. </DataTemplate.Triggers>
  277. </DataTemplate>
  278. </ItemsControl.ItemTemplate>
  279. </ItemsControl>
  280. <!--#endregion-->
  281. <!--#region 历史报警信息-->
  282. <ItemsControl
  283. ItemsSource="{Binding HistoryRunLog}"
  284. ScrollViewer.CanContentScroll="True"
  285. VirtualizingStackPanel.IsVirtualizing="True"
  286. Visibility="{Binding HistoryDataVis}">
  287. <ItemsControl.ItemsPanel>
  288. <ItemsPanelTemplate>
  289. <VirtualizingStackPanel />
  290. </ItemsPanelTemplate>
  291. </ItemsControl.ItemsPanel>
  292. <ItemsControl.Template>
  293. <ControlTemplate>
  294. <Border
  295. Padding="{TemplateBinding Control.Padding}"
  296. Background="{TemplateBinding Panel.Background}"
  297. BorderBrush="{TemplateBinding Border.BorderBrush}"
  298. BorderThickness="{TemplateBinding Border.BorderThickness}"
  299. SnapsToDevicePixels="True">
  300. <ScrollViewer Padding="{TemplateBinding Control.Padding}" Focusable="False">
  301. <ItemsPresenter SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
  302. </ScrollViewer>
  303. </Border>
  304. </ControlTemplate>
  305. </ItemsControl.Template>
  306. <ItemsControl.ItemTemplate>
  307. <DataTemplate>
  308. <Grid x:Name="gr" MinHeight="30">
  309. <Grid.ColumnDefinitions>
  310. <ColumnDefinition Width="150" />
  311. <ColumnDefinition Width="150" />
  312. <ColumnDefinition />
  313. </Grid.ColumnDefinitions>
  314. <TextBlock
  315. Grid.Column="0"
  316. Style="{StaticResource DataTextBlockStyle}"
  317. Text="{Binding Date}" />
  318. <Grid Grid.Column="1">
  319. <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Time}" />
  320. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  321. </Grid>
  322. <TextBlock
  323. Grid.Column="2"
  324. Margin="10,0,0,0"
  325. HorizontalAlignment="Left"
  326. Style="{StaticResource DataTextBlockStyle}"
  327. Text="{Binding RunLogInfo}" />
  328. <Border
  329. Grid.ColumnSpan="6"
  330. BorderBrush="{StaticResource BorderSolid}"
  331. BorderThickness="1" />
  332. </Grid>
  333. <DataTemplate.Triggers>
  334. <Trigger Property="IsMouseOver" Value="true">
  335. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  336. </Trigger>
  337. </DataTemplate.Triggers>
  338. </DataTemplate>
  339. </ItemsControl.ItemTemplate>
  340. </ItemsControl>
  341. <!--#endregion-->
  342. </Grid>
  343. <!--</ScrollViewer>-->
  344. <!--#endregion-->
  345. </Grid>
  346. </UserControl>