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

348 lines
18 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.Academy.View.HistoryChartView"
  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.Academy.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:oxy="http://oxyplot.org/wpf"
  9. xmlns:vm="clr-namespace:BPASmartClient.Academy.ViewModel"
  10. d:DesignHeight="900"
  11. d:DesignWidth="1440"
  12. mc:Ignorable="d">
  13. <UserControl.DataContext>
  14. <vm:HistoryChartViewModel />
  15. </UserControl.DataContext>
  16. <UserControl.Resources>
  17. <Style x:Key="setCheck" TargetType="{x:Type RadioButton}">
  18. <Setter Property="HorizontalContentAlignment" Value="Center" />
  19. <Setter Property="VerticalContentAlignment" Value="Center" />
  20. <Setter Property="HorizontalAlignment" Value="Center" />
  21. <Setter Property="VerticalAlignment" Value="Center" />
  22. <Setter Property="Background" Value="Transparent" />
  23. <Setter Property="Template">
  24. <Setter.Value>
  25. <ControlTemplate TargetType="{x:Type RadioButton}">
  26. <Border Background="Transparent" BorderThickness="0">
  27. <ContentControl
  28. x:Name="check"
  29. HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
  30. VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
  31. Content="{TemplateBinding Content}"
  32. Foreground="#777777" />
  33. </Border>
  34. <ControlTemplate.Triggers>
  35. <Trigger Property="IsMouseOver" Value="True">
  36. <Setter TargetName="check" Property="Foreground" Value="White" />
  37. </Trigger>
  38. <Trigger Property="IsPressed" Value="True">
  39. <Setter TargetName="check" Property="Foreground" Value="White" />
  40. </Trigger>
  41. </ControlTemplate.Triggers>
  42. </ControlTemplate>
  43. </Setter.Value>
  44. </Setter>
  45. </Style>
  46. </UserControl.Resources>
  47. <Grid>
  48. <Grid.RowDefinitions>
  49. <RowDefinition Height="50" />
  50. <RowDefinition />
  51. </Grid.RowDefinitions>
  52. <StackPanel
  53. Margin="0,0,60,0"
  54. HorizontalAlignment="Right"
  55. VerticalAlignment="Center"
  56. Orientation="Horizontal">
  57. <TextBlock
  58. VerticalAlignment="Center"
  59. FontSize="16"
  60. Foreground="DeepSkyBlue"
  61. Text="产品编号:" />
  62. <TextBox
  63. Width="200"
  64. Height="30"
  65. Margin="0,0,10,0"
  66. VerticalContentAlignment="Center"
  67. Background="Transparent"
  68. BorderBrush="DeepSkyBlue"
  69. CaretBrush="DeepSkyBlue"
  70. FontSize="16"
  71. Foreground="DeepSkyBlue"
  72. Style="{x:Null}"
  73. Text="{Binding ProductNum}" />
  74. <Button
  75. Width="120"
  76. Height="30"
  77. Command="{Binding FindProductCommand}"
  78. Content="查询编号"
  79. Style="{StaticResource ButtonStyle}" />
  80. <TextBlock
  81. Margin="30,0,0,0"
  82. VerticalAlignment="Center"
  83. FontSize="16"
  84. Foreground="DeepSkyBlue"
  85. Text="查询时间:" />
  86. <DatePicker
  87. Width="150"
  88. Margin="0,0,10,0"
  89. BorderBrush="DeepSkyBlue"
  90. FontSize="16"
  91. SelectedDate="{Binding SelectTime}"
  92. Style="{DynamicResource PickerStyle}" />
  93. <Button
  94. Width="120"
  95. Height="30"
  96. Command="{Binding Select}"
  97. Content="查询"
  98. Style="{StaticResource ButtonStyle}" />
  99. </StackPanel>
  100. <Grid Grid.Row="1">
  101. <Grid.ColumnDefinitions>
  102. <ColumnDefinition />
  103. <ColumnDefinition Width="1.7*" />
  104. </Grid.ColumnDefinitions>
  105. <!--#region 表格-->
  106. <Grid
  107. Grid.Column="0"
  108. Margin="20,20,20,300"
  109. Background="Transparent">
  110. <Grid.RowDefinitions>
  111. <RowDefinition Height="50" />
  112. <RowDefinition />
  113. </Grid.RowDefinitions>
  114. <!--#region 标题-->
  115. <Grid Background="#ff0C255F">
  116. <Grid.ColumnDefinitions>
  117. <ColumnDefinition Width="50" />
  118. <ColumnDefinition Width="180" />
  119. <ColumnDefinition Width="200" />
  120. <ColumnDefinition Width="1*" />
  121. </Grid.ColumnDefinitions>
  122. <Border
  123. Grid.ColumnSpan="1"
  124. BorderBrush="#777777"
  125. BorderThickness="0.8" />
  126. <Border
  127. Grid.ColumnSpan="2"
  128. BorderBrush="#777777"
  129. BorderThickness="0,0.8,0.8,0.8" />
  130. <Border
  131. Grid.ColumnSpan="3"
  132. BorderBrush="#777777"
  133. BorderThickness="0,0.8,0.8,0.8" />
  134. <Border
  135. Grid.ColumnSpan="4"
  136. BorderBrush="#777777"
  137. BorderThickness="0,0.8,0.8,0.8" />
  138. <TextBlock
  139. HorizontalAlignment="Center"
  140. VerticalAlignment="Center"
  141. FontSize="16"
  142. Foreground="White"
  143. Text="序号" />
  144. <TextBlock
  145. Grid.Column="1"
  146. HorizontalAlignment="Center"
  147. VerticalAlignment="Center"
  148. FontSize="16"
  149. Foreground="White"
  150. Text="配方名称" />
  151. <TextBlock
  152. Grid.Column="2"
  153. HorizontalAlignment="Center"
  154. VerticalAlignment="Center"
  155. FontSize="16"
  156. Foreground="White"
  157. Text="创建时间" />
  158. <TextBlock
  159. Grid.Column="3"
  160. HorizontalAlignment="Center"
  161. VerticalAlignment="Center"
  162. FontSize="16"
  163. Foreground="White"
  164. Text="操作" />
  165. </Grid>
  166. <!--#endregion-->
  167. <!--#region 表格内容-->
  168. <ScrollViewer
  169. Grid.Row="1"
  170. PanningMode="VerticalOnly" IsManipulationEnabled="True"
  171. HorizontalScrollBarVisibility="Hidden"
  172. VerticalScrollBarVisibility="Hidden">
  173. <ItemsControl ItemsSource="{Binding RecipeCharts}">
  174. <ItemsControl.ItemTemplate>
  175. <DataTemplate>
  176. <Grid>
  177. <Grid
  178. Height="30"
  179. Margin="0,1"
  180. Background="#163175">
  181. <Grid.ColumnDefinitions>
  182. <ColumnDefinition Width="50" />
  183. <ColumnDefinition Width="180" />
  184. <ColumnDefinition Width="200" />
  185. <ColumnDefinition Width="1*" />
  186. </Grid.ColumnDefinitions>
  187. <Border
  188. Grid.ColumnSpan="1"
  189. BorderBrush="#777777"
  190. BorderThickness="0.4" />
  191. <Border
  192. Grid.ColumnSpan="2"
  193. BorderBrush="#777777"
  194. BorderThickness="0,0.4,0.4,0.4" />
  195. <Border
  196. Grid.ColumnSpan="3"
  197. BorderBrush="#777777"
  198. BorderThickness="0,0.4,0.4,0.4" />
  199. <Border
  200. Grid.ColumnSpan="4"
  201. BorderBrush="#777777"
  202. BorderThickness="0,0.4,0.4,0.4" />
  203. <TextBlock
  204. x:Name="num"
  205. HorizontalAlignment="Center"
  206. VerticalAlignment="Center"
  207. FontSize="16"
  208. Foreground="White"
  209. Text="{Binding Num}" />
  210. <TextBlock
  211. Grid.Column="1"
  212. HorizontalAlignment="Center"
  213. VerticalAlignment="Center"
  214. FontSize="16"
  215. Foreground="White"
  216. Text="{Binding Name}" />
  217. <TextBlock
  218. Grid.Column="2"
  219. HorizontalAlignment="Center"
  220. VerticalAlignment="Center"
  221. FontSize="16"
  222. Foreground="White"
  223. Text="{Binding CreateTime, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" />
  224. <RadioButton
  225. x:Name="ceshi"
  226. Grid.Column="3"
  227. Content="查看"
  228. FontSize="16"
  229. Foreground="White"
  230. GroupName="sss"
  231. Style="{StaticResource setCheck}" />
  232. </Grid>
  233. <Popup
  234. HorizontalAlignment="Center"
  235. VerticalAlignment="Center"
  236. AllowsTransparency="True"
  237. IsOpen="{Binding ElementName=ceshi, Path=IsChecked, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
  238. MouseLeave="Popup_MouseLeave"
  239. Placement="Bottom"
  240. PlacementTarget="{Binding ElementName=ceshi}">
  241. <Grid
  242. Width="200"
  243. Height="300"
  244. Background="Transparent">
  245. <Path
  246. Fill="#ff0C255F"
  247. Stroke="White"
  248. StrokeThickness="1">
  249. <Path.Data>
  250. <GeometryGroup>
  251. <PathGeometry>
  252. <PathFigure StartPoint="0,10">
  253. <LineSegment Point="0,300" />
  254. <LineSegment Point="200,300" />
  255. <LineSegment Point="200,10" />
  256. <LineSegment Point="60,10" />
  257. <LineSegment Point="50,0" />
  258. <LineSegment Point="40,10" />
  259. <LineSegment Point="0,10" />
  260. </PathFigure>
  261. </PathGeometry>
  262. </GeometryGroup>
  263. </Path.Data>
  264. </Path>
  265. <StackPanel
  266. Margin="0,30,0,20"
  267. HorizontalAlignment="Center"
  268. VerticalAlignment="Center"
  269. Orientation="Vertical">
  270. <Border Margin="0,10,0,0">
  271. <Button
  272. Width="100"
  273. Height="35"
  274. Click="Button_Click"
  275. CommandParameter="{Binding ElementName=num, Path=Text, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
  276. Content="温度曲线"
  277. Style="{StaticResource ButtonStyle}" />
  278. </Border>
  279. <Border Margin="0,10,0,0">
  280. <Button
  281. Width="100"
  282. Height="35"
  283. Click="Button_Click"
  284. CommandParameter="{Binding ElementName=num, Path=Text, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
  285. Content="转速曲线"
  286. Style="{StaticResource ButtonStyle}" />
  287. </Border>
  288. <Border Margin="0,10,0,0">
  289. <Button
  290. Width="100"
  291. Height="35"
  292. Click="Button_Click"
  293. CommandParameter="{Binding ElementName=num, Path=Text, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
  294. Content="重量曲线"
  295. Style="{StaticResource ButtonStyle}" />
  296. </Border>
  297. <Border Margin="0,10,0,0">
  298. <Button
  299. Width="100"
  300. Height="35"
  301. Click="Button_Click"
  302. CommandParameter="{Binding ElementName=num, Path=Text, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
  303. Content="压力曲线"
  304. Style="{StaticResource ButtonStyle}" />
  305. </Border>
  306. <Border Margin="0,10,0,0">
  307. <Button
  308. Width="100"
  309. Height="35"
  310. Click="Button_Click"
  311. CommandParameter="{Binding ElementName=num, Path=Text, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
  312. Content="开度曲线"
  313. Style="{StaticResource ButtonStyle}" />
  314. </Border>
  315. </StackPanel>
  316. </Grid>
  317. </Popup>
  318. </Grid>
  319. </DataTemplate>
  320. </ItemsControl.ItemTemplate>
  321. </ItemsControl>
  322. </ScrollViewer>
  323. <!--#endregion-->
  324. </Grid>
  325. <!--#endregion-->
  326. <!--#region 曲线-->
  327. <oxy:PlotView
  328. IsManipulationEnabled="True"
  329. x:Name="chartView"
  330. Grid.Column="1"
  331. Margin="5"
  332. Background="White"
  333. Foreground="Black"
  334. PanCursor="Hand" />
  335. <!--#endregion-->
  336. </Grid>
  337. </Grid>
  338. </UserControl>