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

449 lines
21 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.CustomResource.Pages.View.UserLogView"
  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:pry="clr-namespace:BPASmartClient.CustomResource.UserControls"
  9. xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
  10. d:DesignHeight="450"
  11. d:DesignWidth="800"
  12. mc:Ignorable="d">
  13. <UserControl.DataContext>
  14. <vm:UserLogViewModel />
  15. </UserControl.DataContext>
  16. <UserControl.Resources>
  17. <ResourceDictionary>
  18. <ResourceDictionary.MergedDictionaries>
  19. <ResourceDictionary>
  20. <!--<convert:TextDisplayConvert x:Key="textDisplayConvert" />
  21. <convert:IsEnableConvert x:Key="isEnableConvert" />
  22. <convert:AnalogAlarmConvert x:Key="analogAlarmConvert" />
  23. <convert:DiscreteAlarmConvert x:Key="discreteAlarmConvert" />
  24. <convert:AlarmTypeTextConvert x:Key="alarmTypeTextConvert" />-->
  25. <SolidColorBrush x:Key="BorderSolid" Color="#332AB2E7" />
  26. <SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
  27. <SolidColorBrush x:Key="TitleFontColor" Color="#FF2AB2E7" />
  28. <SolidColorBrush x:Key="CursorColor" Color="Aqua" />
  29. <SolidColorBrush x:Key="TitleBorderColor" Color="#332AB2E7" />
  30. <Style x:Key="TextBlockStyle" TargetType="TextBlock">
  31. <Setter Property="FontFamily" Value="楷体" />
  32. <Setter Property="FontSize" Value="18" />
  33. <Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
  34. <Setter Property="VerticalAlignment" Value="Center" />
  35. <Setter Property="HorizontalAlignment" Value="Center" />
  36. </Style>
  37. <Style x:Key="TextBoxStyle" TargetType="TextBox">
  38. <Setter Property="FontFamily" Value="楷体" />
  39. <Setter Property="FontSize" Value="22" />
  40. <Setter Property="Background" Value="Transparent" />
  41. <Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
  42. <Setter Property="BorderBrush" Value="#FF23CACA" />
  43. <Setter Property="CaretBrush" Value="Aqua" />
  44. <Setter Property="VerticalAlignment" Value="Center" />
  45. </Style>
  46. <Style x:Key="DataTextBlockStyle" TargetType="TextBlock">
  47. <Setter Property="HorizontalAlignment" Value="Center" />
  48. <Setter Property="VerticalAlignment" Value="Center" />
  49. <Setter Property="Background" Value="Transparent" />
  50. <Setter Property="Foreground" Value="#20FDFA" />
  51. <Setter Property="FontSize" Value="14" />
  52. </Style>
  53. <ControlTemplate x:Key="ButTemplate" TargetType="Button">
  54. <Border
  55. x:Name="br"
  56. Background="Transparent"
  57. BorderBrush="#FF19B7EC"
  58. BorderThickness="2">
  59. <StackPanel
  60. HorizontalAlignment="Center"
  61. VerticalAlignment="Center"
  62. Orientation="Horizontal">
  63. <ContentControl
  64. HorizontalAlignment="Center"
  65. VerticalAlignment="Center"
  66. Content="{TemplateBinding Content}"
  67. Foreground="{TemplateBinding Foreground}" />
  68. </StackPanel>
  69. </Border>
  70. <ControlTemplate.Triggers>
  71. <Trigger Property="IsMouseOver" Value="True">
  72. <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
  73. </Trigger>
  74. <Trigger Property="IsPressed" Value="true">
  75. <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
  76. </Trigger>
  77. </ControlTemplate.Triggers>
  78. </ControlTemplate>
  79. <!--#region 用户输入框样式-->
  80. <Style x:Key="SearchTextBoxStyle" TargetType="TextBox">
  81. <Setter Property="Background" Value="Transparent" />
  82. <Setter Property="CaretBrush" Value="#009DFF" />
  83. <Setter Property="Template">
  84. <Setter.Value>
  85. <ControlTemplate TargetType="TextBox">
  86. <Border
  87. x:Name="border"
  88. Background="{TemplateBinding Background}"
  89. BorderBrush="{TemplateBinding BorderBrush}"
  90. BorderThickness="{TemplateBinding BorderThickness}"
  91. CornerRadius="0"
  92. SnapsToDevicePixels="true">
  93. <Grid>
  94. <Grid.ColumnDefinitions>
  95. <ColumnDefinition Width="40" />
  96. <ColumnDefinition />
  97. </Grid.ColumnDefinitions>
  98. <TextBlock
  99. x:Name="PasswordTextBlock"
  100. HorizontalAlignment="Center"
  101. VerticalAlignment="Center"
  102. FontFamily="../../Fonts/#iconfont"
  103. FontSize="16"
  104. Foreground="{TemplateBinding BorderBrush}"
  105. Text="&#xe602;" />
  106. <TextBlock
  107. Name="markText"
  108. Grid.Column="1"
  109. Margin="10,0"
  110. HorizontalAlignment="Left"
  111. VerticalAlignment="Center"
  112. FontSize="16"
  113. Foreground="#88009dff"
  114. Text="请输入账号名称"
  115. Visibility="Collapsed" />
  116. <ScrollViewer
  117. x:Name="PART_ContentHost"
  118. Grid.Column="1"
  119. MinHeight="20"
  120. VerticalAlignment="Center"
  121. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  122. </Grid>
  123. </Border>
  124. <ControlTemplate.Triggers>
  125. <Trigger Property="IsEnabled" Value="false">
  126. <Setter TargetName="border" Property="Opacity" Value="0.56" />
  127. </Trigger>
  128. <Trigger Property="IsMouseOver" Value="true">
  129. <Setter TargetName="border" Property="BorderBrush" Value="#FF7EB4EA" />
  130. </Trigger>
  131. <Trigger Property="IsKeyboardFocused" Value="true">
  132. <Setter TargetName="border" Property="BorderBrush" Value="#FF569DE5" />
  133. </Trigger>
  134. <DataTrigger Binding="{Binding Path=Text, RelativeSource={RelativeSource Mode=self}}" Value="">
  135. <Setter TargetName="markText" Property="Visibility" Value="Visible" />
  136. </DataTrigger>
  137. </ControlTemplate.Triggers>
  138. </ControlTemplate>
  139. </Setter.Value>
  140. </Setter>
  141. </Style>
  142. <!--#endregion-->
  143. </ResourceDictionary>
  144. </ResourceDictionary.MergedDictionaries>
  145. </ResourceDictionary>
  146. </UserControl.Resources>
  147. <Grid Margin="10">
  148. <Grid.RowDefinitions>
  149. <RowDefinition Height="50" />
  150. <RowDefinition Height="30" />
  151. <RowDefinition />
  152. </Grid.RowDefinitions>
  153. <StackPanel
  154. Margin="0,8"
  155. HorizontalAlignment="Right"
  156. Orientation="Horizontal">
  157. <TextBox
  158. Width="200"
  159. Margin="20,0"
  160. BorderBrush="#009DFF"
  161. FontSize="16"
  162. Foreground="#aadddddd"
  163. Style="{DynamicResource SearchTextBoxStyle}"
  164. TabIndex="1"
  165. Text="{Binding SearchUser}"
  166. Visibility="{Binding IsVisibility}" />
  167. <DatePicker
  168. Background="Transparent"
  169. BorderBrush="#aa3aa7f3"
  170. BorderThickness="2"
  171. SelectedDate="{Binding StartDateTime}"
  172. Style="{StaticResource PickerStyle}"
  173. Text="请输入开始时间"
  174. Visibility="{Binding IsVisibility}" />
  175. <DatePicker
  176. Margin="20,0,20,0"
  177. Background="Transparent"
  178. BorderBrush="#aa3aa7f3"
  179. BorderThickness="2"
  180. SelectedDate="{Binding EndDateTime}"
  181. Style="{StaticResource PickerStyle}"
  182. Text="请输入结束时间"
  183. Visibility="{Binding IsVisibility}" />
  184. <Button
  185. Width="140"
  186. Height="30"
  187. Background="#FF19B7EC"
  188. Command="{Binding ControlCommand}"
  189. Content="{Binding ControlButText}"
  190. FontFamily="楷体"
  191. FontSize="18"
  192. Template="{StaticResource ButTemplate}"
  193. Visibility="{Binding IsVisibility}">
  194. <Button.Foreground>
  195. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  196. <GradientStop Color="#FFBB662A" />
  197. <GradientStop Offset="1" Color="White" />
  198. </LinearGradientBrush>
  199. </Button.Foreground>
  200. </Button>
  201. <Button
  202. Width="140"
  203. Height="30"
  204. Margin="20,0,0,0"
  205. Background="#FF19B7EC"
  206. Command="{Binding SwitchCommand}"
  207. Content="{Binding ButContent}"
  208. FontFamily="楷体"
  209. FontSize="18"
  210. Template="{StaticResource ButTemplate}">
  211. <Button.Foreground>
  212. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  213. <GradientStop Color="#FFBB662A" />
  214. <GradientStop Offset="1" Color="White" />
  215. </LinearGradientBrush>
  216. </Button.Foreground>
  217. </Button>
  218. </StackPanel>
  219. <!--#region 表格标题栏设置-->
  220. <Grid Grid.Row="1" Margin="0 0 17 0" Background="#ff0C255F">
  221. <Grid.ColumnDefinitions>
  222. <ColumnDefinition Width="0.3*" />
  223. <ColumnDefinition Width="0.3*" />
  224. <ColumnDefinition Width="0.3*" />
  225. <ColumnDefinition Width="0.3*" />
  226. <ColumnDefinition />
  227. </Grid.ColumnDefinitions>
  228. <TextBlock
  229. Grid.Column="0"
  230. HorizontalAlignment="Center"
  231. VerticalAlignment="Center"
  232. FontSize="16"
  233. Foreground="{StaticResource TitleFontColor}"
  234. Text="日期" />
  235. <Grid Grid.Column="1">
  236. <TextBlock
  237. HorizontalAlignment="Center"
  238. VerticalAlignment="Center"
  239. FontSize="16"
  240. Foreground="{StaticResource TitleFontColor}"
  241. Text="时间" />
  242. <Border
  243. BorderBrush="{StaticResource TitleBorderColor}"
  244. BorderThickness="1,0,1,0"
  245. Cursor="SizeWE" />
  246. </Grid>
  247. <TextBlock
  248. Grid.Column="2"
  249. HorizontalAlignment="Center"
  250. VerticalAlignment="Center"
  251. FontSize="16"
  252. Foreground="{StaticResource TitleFontColor}"
  253. Text="操作权限" />
  254. <Grid Grid.Column="3">
  255. <TextBlock
  256. HorizontalAlignment="Center"
  257. VerticalAlignment="Center"
  258. FontSize="16"
  259. Foreground="{StaticResource TitleFontColor}"
  260. Text="用户名" />
  261. <Border
  262. BorderBrush="{StaticResource TitleBorderColor}"
  263. BorderThickness="1,0,1,0"
  264. Cursor="SizeWE" />
  265. </Grid>
  266. <TextBlock
  267. Grid.Column="4"
  268. HorizontalAlignment="Center"
  269. VerticalAlignment="Center"
  270. FontSize="16"
  271. Foreground="{StaticResource TitleFontColor}"
  272. Text="消息日志" />
  273. </Grid>
  274. <!--#endregion-->
  275. <!--#region 表格数据显示-->
  276. <ScrollViewer
  277. Grid.Row="2"
  278. HorizontalScrollBarVisibility="Hidden"
  279. VerticalScrollBarVisibility="Visible">
  280. <Grid>
  281. <!--#region 实时报警信息-->
  282. <ItemsControl ItemsSource="{Binding UserLogs}" Visibility="{Binding CurrentDataVis}">
  283. <ItemsControl.ItemTemplate>
  284. <DataTemplate>
  285. <Grid x:Name="gr" Height="30">
  286. <Grid.ColumnDefinitions>
  287. <ColumnDefinition Width="0.3*" />
  288. <ColumnDefinition Width="0.3*" />
  289. <ColumnDefinition Width="0.3*" />
  290. <ColumnDefinition Width="0.3*" />
  291. <ColumnDefinition />
  292. </Grid.ColumnDefinitions>
  293. <TextBlock
  294. Grid.Column="0"
  295. Style="{StaticResource DataTextBlockStyle}"
  296. Text="{Binding Date}" />
  297. <Grid Grid.Column="1">
  298. <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Time}" />
  299. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  300. </Grid>
  301. <TextBlock
  302. Grid.Column="2"
  303. Style="{StaticResource DataTextBlockStyle}"
  304. Text="{Binding Permission}" />
  305. <Grid Grid.Column="3">
  306. <TextBlock
  307. Margin="10,0,0,0"
  308. HorizontalAlignment="Center"
  309. Style="{StaticResource DataTextBlockStyle}"
  310. Text="{Binding UserName}" />
  311. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  312. </Grid>
  313. <TextBlock
  314. Grid.Column="4"
  315. Margin="10,0,0,0"
  316. HorizontalAlignment="Left"
  317. Style="{StaticResource DataTextBlockStyle}"
  318. Text="{Binding LogInfo}" />
  319. <Border
  320. Grid.ColumnSpan="6"
  321. BorderBrush="{StaticResource BorderSolid}"
  322. BorderThickness="1" />
  323. </Grid>
  324. <DataTemplate.Triggers>
  325. <Trigger Property="IsMouseOver" Value="true">
  326. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  327. </Trigger>
  328. </DataTemplate.Triggers>
  329. </DataTemplate>
  330. </ItemsControl.ItemTemplate>
  331. </ItemsControl>
  332. <!--#endregion-->
  333. <!--#region 历史报警信息-->
  334. <ItemsControl ItemsSource="{Binding HistoryUserLog}" Visibility="{Binding HistoryDataVis}">
  335. <ItemsControl.ItemTemplate>
  336. <DataTemplate>
  337. <Grid x:Name="gr" Height="30">
  338. <Grid.ColumnDefinitions>
  339. <ColumnDefinition Width="0.3*" />
  340. <ColumnDefinition Width="0.3*" />
  341. <ColumnDefinition Width="0.3*" />
  342. <ColumnDefinition Width="0.3*" />
  343. <ColumnDefinition />
  344. </Grid.ColumnDefinitions>
  345. <TextBlock
  346. Grid.Column="0"
  347. Style="{StaticResource DataTextBlockStyle}"
  348. Text="{Binding Date}" />
  349. <Grid Grid.Column="1">
  350. <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Time}" />
  351. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  352. </Grid>
  353. <TextBlock
  354. Grid.Column="2"
  355. Style="{StaticResource DataTextBlockStyle}"
  356. Text="{Binding Permission}" />
  357. <Grid Grid.Column="3">
  358. <TextBlock
  359. Margin="10,0,0,0"
  360. HorizontalAlignment="Left"
  361. Style="{StaticResource DataTextBlockStyle}"
  362. Text="{Binding UserName}" />
  363. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  364. </Grid>
  365. <TextBlock
  366. Grid.Column="4"
  367. Margin="10,0,0,0"
  368. HorizontalAlignment="Left"
  369. Style="{StaticResource DataTextBlockStyle}"
  370. Text="{Binding LogInfo}"
  371. TextWrapping="Wrap"
  372. />
  373. <Border
  374. Grid.ColumnSpan="6"
  375. BorderBrush="{StaticResource BorderSolid}"
  376. BorderThickness="1" />
  377. </Grid>
  378. <DataTemplate.Triggers>
  379. <Trigger Property="IsMouseOver" Value="true">
  380. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  381. </Trigger>
  382. </DataTemplate.Triggers>
  383. </DataTemplate>
  384. </ItemsControl.ItemTemplate>
  385. </ItemsControl>
  386. <!--#endregion-->
  387. </Grid>
  388. </ScrollViewer>
  389. <!--#endregion-->
  390. </Grid>
  391. </UserControl>