终端一体化运控平台
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

382 řádky
17 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.CustomResource.Pages.View.UserManagerView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
  10. Width="1400"
  11. Height="900"
  12. Background="{x:Null}"
  13. mc:Ignorable="d">
  14. <UserControl.DataContext>
  15. <vm:UserManagerViewModel />
  16. </UserControl.DataContext>
  17. <UserControl.Resources>
  18. <!--<Style x:Key="CommonTextBlockStyle" TargetType="TextBlock">
  19. <Setter Property="Background" Value="Transparent" />
  20. <Setter Property="Foreground" Value="#B1E8FF" />
  21. <Setter Property="HorizontalAlignment" Value="Center" />
  22. <Setter Property="VerticalAlignment" Value="Center" />
  23. </Style>
  24. <Style TargetType="{x:Type DataGridCell}">
  25. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  26. <Setter Property="TextBlock.FontSize" Value="13" />
  27. <Setter Property="Background" Value="Transparent" />
  28. <Setter Property="BorderBrush" Value="#87CEFA" />
  29. <Setter Property="BorderThickness" Value="1" />
  30. <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Content.Text}" />
  31. <Setter Property="Template">
  32. <Setter.Value>
  33. <ControlTemplate TargetType="{x:Type DataGridCell}">
  34. <Border
  35. Background="{TemplateBinding Background}"
  36. BorderBrush="{TemplateBinding BorderBrush}"
  37. BorderThickness="1"
  38. SnapsToDevicePixels="True">
  39. -->
  40. <!-- HorizontalAlignment 可以设置内容展示位置 -->
  41. <!--
  42. <ContentPresenter
  43. Margin="{TemplateBinding Padding}"
  44. HorizontalAlignment="Center"
  45. VerticalAlignment="Center"
  46. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  47. </Border>
  48. </ControlTemplate>
  49. </Setter.Value>
  50. </Setter>
  51. <Style.Triggers>
  52. <Trigger Property="IsEnabled" Value="False">
  53. <Setter Property="Opacity" Value=".56" />
  54. </Trigger>
  55. </Style.Triggers>
  56. </Style>
  57. <Style TargetType="DataGridRow">
  58. <Setter Property="FontSize" Value="16" />
  59. <Setter Property="VerticalAlignment" Value="Center" />
  60. <Setter Property="Margin" Value="0,5" />
  61. <Style.Triggers>
  62. -->
  63. <!-- 隔行换色 -->
  64. <!--
  65. <Trigger Property="AlternationIndex" Value="0">
  66. <Setter Property="Background" Value="Transparent" />
  67. </Trigger>
  68. <Trigger Property="AlternationIndex" Value="1">
  69. <Setter Property="Background" Value="Transparent" />
  70. </Trigger>
  71. <Trigger Property="IsMouseOver" Value="True">
  72. <Setter Property="Background" Value="#87CEFA" />
  73. </Trigger>
  74. </Style.Triggers>
  75. </Style>
  76. <Style TargetType="DataGridColumnHeader">
  77. <Setter Property="SnapsToDevicePixels" Value="True" />
  78. <Setter Property="MinWidth" Value="0" />
  79. <Setter Property="MinHeight" Value="40" />
  80. <Setter Property="Foreground" Value="#ddd" />
  81. <Setter Property="FontSize" Value="26" />
  82. <Setter Property="Cursor" Value="Hand" />
  83. <Setter Property="Background" Value="Transparent" />
  84. <Setter Property="Template">
  85. <Setter.Value>
  86. <ControlTemplate TargetType="DataGridColumnHeader">
  87. <Grid>
  88. <Grid.ColumnDefinitions>
  89. <ColumnDefinition Width="*" />
  90. </Grid.ColumnDefinitions>
  91. <ContentPresenter
  92. Margin="0,0,0,0"
  93. HorizontalAlignment="Center"
  94. VerticalAlignment="Center" />
  95. <Path
  96. x:Name="SortArrow"
  97. Grid.Column="0"
  98. Width="8"
  99. Height="6"
  100. Margin="0,0,50,0"
  101. VerticalAlignment="Center"
  102. Data="M0,0 L1,0 0.5,1 z"
  103. Fill="Transparent"
  104. RenderTransformOrigin="1,1"
  105. Stretch="Fill"
  106. Visibility="Collapsed" />
  107. <Rectangle
  108. Grid.ColumnSpan="1"
  109. Width="1"
  110. HorizontalAlignment="Right"
  111. Fill="#87CEFA" />
  112. </Grid>
  113. </ControlTemplate>
  114. </Setter.Value>
  115. </Setter>
  116. <Setter Property="Height" Value="25" />
  117. </Style>
  118. <Style x:Key="datagridButton" TargetType="Button">
  119. <Setter Property="Background" Value="Transparent" />
  120. <Setter Property="BorderBrush" Value="Transparent" />
  121. <Setter Property="Foreground" Value="#1874CD" />
  122. <Setter Property="FontSize" Value="18" />
  123. </Style>-->
  124. <ResourceDictionary>
  125. <ResourceDictionary.MergedDictionaries>
  126. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/GlobalDataTableStyle.xaml" />
  127. </ResourceDictionary.MergedDictionaries>
  128. </ResourceDictionary>
  129. </UserControl.Resources>
  130. <Grid>
  131. <!--<Grid.ColumnDefinitions>
  132. </Grid.ColumnDefinitions>
  133. <Grid.RowDefinitions>
  134. <RowDefinition Height="50"/>
  135. <RowDefinition Height="*"/>
  136. <RowDefinition Height="100"/>
  137. </Grid.RowDefinitions>-->
  138. <Grid.RowDefinitions>
  139. <RowDefinition Height="50" />
  140. <RowDefinition Height="50" />
  141. <RowDefinition />
  142. </Grid.RowDefinitions>
  143. <!--<TextBlock Text="用户管理" FontSize="28" Style="{DynamicResource CommonTextBlockStyle}"/>-->
  144. <!--<DataGrid
  145. Grid.Row="1"
  146. Margin="30"
  147. VerticalAlignment="Top"
  148. AlternationCount="2"
  149. AutoGenerateColumns="False"
  150. Background="Transparent"
  151. CanUserAddRows="False"
  152. CanUserReorderColumns="False"
  153. CanUserResizeColumns="False"
  154. CanUserResizeRows="False"
  155. FrozenColumnCount="1"
  156. IsReadOnly="True"
  157. ItemsSource="{Binding userManager}"
  158. RowHeaderWidth="0"
  159. RowHeight="35"
  160. SelectionMode="Single"
  161. Visibility="Hidden">
  162. <DataGrid.Columns>
  163. <DataGridTemplateColumn Width="200" Header="用户名">
  164. <DataGridTemplateColumn.CellTemplate>
  165. <DataTemplate>
  166. <TextBlock
  167. FontSize="20"
  168. Foreground="White"
  169. Text="{Binding UserName}" />
  170. </DataTemplate>
  171. </DataGridTemplateColumn.CellTemplate>
  172. </DataGridTemplateColumn>
  173. <DataGridTemplateColumn Width="300" Header="最后登录时间">
  174. <DataGridTemplateColumn.CellTemplate>
  175. <DataTemplate>
  176. <TextBlock
  177. FontSize="20"
  178. Foreground="White"
  179. Text="{Binding LastLogInTime}" />
  180. </DataTemplate>
  181. </DataGridTemplateColumn.CellTemplate>
  182. </DataGridTemplateColumn>
  183. <DataGridTemplateColumn Width="250" Header="权限">
  184. <DataGridTemplateColumn.CellTemplate>
  185. <DataTemplate>
  186. <Button
  187. Command="{Binding DataContext.EditUserConfigCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
  188. CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}, Path=SelectedItem}"
  189. Content="权限"
  190. Style="{DynamicResource datagridButton}" />
  191. </DataTemplate>
  192. </DataGridTemplateColumn.CellTemplate>
  193. </DataGridTemplateColumn>
  194. <DataGridTemplateColumn Width="250" Header="重置密码">
  195. <DataGridTemplateColumn.CellTemplate>
  196. <DataTemplate>
  197. <Button
  198. Command="{Binding DataContext.ChangePasswardCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
  199. CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}, Path=SelectedItem}"
  200. Content="重置密码"
  201. Style="{DynamicResource datagridButton}" />
  202. </DataTemplate>
  203. </DataGridTemplateColumn.CellTemplate>
  204. </DataGridTemplateColumn>
  205. <DataGridTemplateColumn Width="*" Header="删除">
  206. <DataGridTemplateColumn.CellTemplate>
  207. <DataTemplate>
  208. <Button
  209. Command="{Binding DataContext.DeleteUserCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
  210. CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}, Path=SelectedItem}"
  211. Content="删除"
  212. Style="{DynamicResource datagridButton}" />
  213. </DataTemplate>
  214. </DataGridTemplateColumn.CellTemplate>
  215. </DataGridTemplateColumn>
  216. </DataGrid.Columns>
  217. </DataGrid>-->
  218. <!--#region 列表-->
  219. <!--#region 表格标题栏设置-->
  220. <Grid
  221. Grid.Row="1"
  222. Margin="0,10,0,0"
  223. Background="#ff0C255F">
  224. <Grid.ColumnDefinitions>
  225. <ColumnDefinition />
  226. <ColumnDefinition />
  227. <ColumnDefinition />
  228. <ColumnDefinition />
  229. <ColumnDefinition />
  230. </Grid.ColumnDefinitions>
  231. <TextBlock
  232. Grid.Column="0"
  233. Style="{StaticResource TitleTextblockStyle}"
  234. Text="用户名" />
  235. <Grid Grid.Column="1">
  236. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="最后登录时间" />
  237. <Border
  238. BorderBrush="{StaticResource bordColor}"
  239. BorderThickness="1,0,1,0"
  240. Cursor="SizeWE" />
  241. </Grid>
  242. <TextBlock
  243. Grid.Column="2"
  244. Style="{StaticResource TitleTextblockStyle}"
  245. Text="权限" />
  246. <Grid Grid.Column="3">
  247. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="重置密码" />
  248. <Border
  249. BorderBrush="{StaticResource bordColor}"
  250. BorderThickness="1,0,1,0"
  251. Cursor="SizeWE" />
  252. </Grid>
  253. <TextBlock
  254. Grid.Column="4"
  255. Style="{StaticResource TitleTextblockStyle}"
  256. Text="删除" />
  257. <Border
  258. Grid.ColumnSpan="10"
  259. BorderBrush="{StaticResource bordColor}"
  260. BorderThickness="1,0,1,0" />
  261. </Grid>
  262. <!--#endregion-->
  263. <Grid Grid.Row="2">
  264. <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
  265. <ItemsControl ItemsSource="{Binding userManager}">
  266. <ItemsControl.ItemTemplate>
  267. <DataTemplate>
  268. <Grid Name="gr" Height="30">
  269. <Grid.ColumnDefinitions>
  270. <ColumnDefinition />
  271. <ColumnDefinition />
  272. <ColumnDefinition />
  273. <ColumnDefinition />
  274. <ColumnDefinition />
  275. </Grid.ColumnDefinitions>
  276. <TextBlock
  277. Grid.Column="0"
  278. Foreground="{StaticResource tabColor}"
  279. Style="{StaticResource DisiableTextblockStyle}"
  280. Text="{Binding UserName}" />
  281. <Grid Grid.Column="1">
  282. <TextBlock
  283. Foreground="{StaticResource tabColor}"
  284. Style="{StaticResource DisiableTextblockStyle}"
  285. Text="{Binding LastLogInTime}" />
  286. <Border
  287. BorderBrush="{StaticResource bordColor}"
  288. BorderThickness="1,0,1,0"
  289. Cursor="SizeWE" />
  290. </Grid>
  291. <Button
  292. Grid.Column="2"
  293. Command="{Binding DataContext.EditUserConfigCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
  294. CommandParameter="{Binding}"
  295. Content="权限"
  296. Foreground="{StaticResource tabColor}"
  297. Style="{StaticResource ControlButtonStyle}" />
  298. <Grid Grid.Column="3">
  299. <Button
  300. Command="{Binding DataContext.ChangePasswardCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
  301. CommandParameter="{Binding}"
  302. Content="重置密码"
  303. Style="{StaticResource ControlButtonStyle}" />
  304. <Border
  305. BorderBrush="{StaticResource bordColor}"
  306. BorderThickness="1,0,1,0"
  307. Cursor="SizeWE" />
  308. </Grid>
  309. <Button
  310. Grid.Column="4"
  311. Command="{Binding DataContext.DeleteUserCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
  312. CommandParameter="{Binding}"
  313. Content="删除"
  314. Style="{StaticResource RemoveButtonStyle}" />
  315. <Border
  316. Grid.ColumnSpan="10"
  317. BorderBrush="{StaticResource bordColor}"
  318. BorderThickness="1,0,1,1" />
  319. </Grid>
  320. <DataTemplate.Triggers>
  321. <Trigger Property="IsMouseOver" Value="true">
  322. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  323. </Trigger>
  324. </DataTemplate.Triggers>
  325. </DataTemplate>
  326. </ItemsControl.ItemTemplate>
  327. </ItemsControl>
  328. </ScrollViewer>
  329. </Grid>
  330. <!--#endregion-->
  331. <Button
  332. Width="200"
  333. Height="50"
  334. Margin="10,0"
  335. HorizontalAlignment="Right"
  336. Command="{Binding AddNewUserCommand}"
  337. Content="添加新用户"
  338. FontSize="24"
  339. Style="{StaticResource ImageButtonStyle}" />
  340. <!--<Button Grid.Row="2"
  341. Height="50" Width="200"
  342. Background="#009DFF"
  343. BorderThickness="0"
  344. Command="{Binding AddNewUserCommand}"
  345. Content="添加新用户"
  346. FontSize="24"
  347. Foreground="White" />-->
  348. </Grid>
  349. </UserControl>