终端一体化运控平台
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

1064 行
54 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.DosingSystem.View.RecipeControlView"
  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.DosingSystem.Converter"
  6. xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View"
  9. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  10. xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  11. xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel"
  12. d:DesignHeight="800"
  13. d:DesignWidth="1400"
  14. mc:Ignorable="d">
  15. <UserControl.DataContext>
  16. <vm:RecipeControlViewModel x:Name="bingSource" />
  17. </UserControl.DataContext>
  18. <UserControl.Resources>
  19. <con:RunStatusConvert x:Key="RunStatusConvert" />
  20. <con:EnbleConvert x:Key="EnbleConvert" />
  21. <con:IntToSourceConvert x:Key="IntToSourceConvert" />
  22. <Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem">
  23. <Style.Resources>
  24. <!-- SelectedItem with focus -->
  25. <SolidColorBrush
  26. x:Key="{x:Static SystemColors.HighlightBrushKey}"
  27. Opacity=".4"
  28. Color="White" />
  29. <!-- SelectedItem without focus -->
  30. <SolidColorBrush
  31. x:Key="{x:Static SystemColors.ControlBrushKey}"
  32. Opacity=".4"
  33. Color="White" />
  34. </Style.Resources>
  35. <!-- 设置触发器 -->
  36. <Style.Triggers>
  37. <Trigger Property="IsMouseOver" Value="true">
  38. <Setter Property="Background" Value="White" />
  39. <Setter Property="Foreground" Value="White" />
  40. </Trigger>
  41. <Trigger Property="IsFocused" Value="true">
  42. <Setter Property="Background" Value="White" />
  43. <Setter Property="Foreground" Value="White" />
  44. </Trigger>
  45. </Style.Triggers>
  46. </Style>
  47. <Style x:Key="RadioState" TargetType="RadioButton">
  48. <Setter Property="Margin" Value="1" />
  49. <Setter Property="Background" Value="Transparent" />
  50. <Setter Property="Foreground" Value="#ddd" />
  51. <Setter Property="VerticalContentAlignment" Value="Bottom" />
  52. <Setter Property="Margin" Value="2,5" />
  53. <Setter Property="FontSize" Value="16" />
  54. <Setter Property="FontFamily" Value="Consolas" />
  55. <Setter Property="Template">
  56. <Setter.Value>
  57. <ControlTemplate TargetType="RadioButton">
  58. <Border
  59. Name="radiobutton"
  60. Background="{TemplateBinding Background}"
  61. CornerRadius="5"
  62. Opacity="0.85">
  63. <Grid>
  64. <!--<Border
  65. x:Name="back_border"
  66. BorderBrush="Black"
  67. BorderThickness="0"
  68. CornerRadius="1">
  69. <Border.Effect>
  70. <BlurEffect KernelType="Gaussian" Radius="2" />
  71. </Border.Effect>
  72. </Border>
  73. <Border
  74. x:Name="fore_border"
  75. Margin="2"
  76. BorderBrush="White"
  77. BorderThickness="0"
  78. CornerRadius="{Binding ElementName=button, Path=CornerRadius}"
  79. Opacity="0.7">
  80. <Border.Effect>
  81. <BlurEffect KernelType="Gaussian" Radius="2" />
  82. </Border.Effect>
  83. </Border>-->
  84. <ContentPresenter
  85. HorizontalAlignment="Center"
  86. VerticalAlignment="Center"
  87. Content="{TemplateBinding Content}"
  88. TextBlock.FontFamily="{TemplateBinding FontFamily}"
  89. TextBlock.FontSize="{TemplateBinding FontSize}"
  90. TextBlock.Foreground="{TemplateBinding Foreground}" />
  91. <Image
  92. Name="im"
  93. Source="/BPASmartClient.CustomResource;component/Image/按钮/组 8.png"
  94. Stretch="Fill" />
  95. </Grid>
  96. </Border>
  97. <ControlTemplate.Triggers>
  98. <Trigger Property="IsChecked" Value="True">
  99. <!--<Setter TargetName="back_border" Property="BorderThickness" Value="1,0,1,1" />
  100. <Setter TargetName="back_border" Property="CornerRadius" Value="5" />
  101. <Setter TargetName="fore_border" Property="BorderThickness" Value="0,2,0,0" />
  102. <Setter Property="Background" Value=" #4169E1" />-->
  103. <Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮/组 7.png" />
  104. </Trigger>
  105. <Trigger Property="IsChecked" Value="False">
  106. <Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮/组 8.png" />
  107. </Trigger>
  108. <Trigger Property="IsMouseOver" Value="True">
  109. <!--<Setter TargetName="back_border" Property="BorderBrush" Value="white" />
  110. <Setter TargetName="back_border" Property="BorderThickness" Value="1,1,1,1" />-->
  111. <Setter TargetName="radiobutton" Property="Opacity" Value="1" />
  112. <!--<Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮背景蓝色.png" />-->
  113. </Trigger>
  114. </ControlTemplate.Triggers>
  115. </ControlTemplate>
  116. </Setter.Value>
  117. </Setter>
  118. </Style>
  119. <Style x:Key="materialMakingButton" TargetType="Button">
  120. <Setter Property="Background" Value="Transparent" />
  121. <Setter Property="FontSize" Value="16" />
  122. <Setter Property="Foreground" Value="#CD5555" />
  123. <Setter Property="BorderThickness" Value="0" />
  124. <Setter Property="HorizontalAlignment" Value="Left" />
  125. <Setter Property="Template">
  126. <Setter.Value>
  127. <ControlTemplate>
  128. <Border
  129. x:Name="brState"
  130. Padding="2"
  131. BorderBrush="White"
  132. BorderThickness="0">
  133. <TextBlock
  134. x:Name="txState"
  135. Margin="1"
  136. HorizontalAlignment="Center"
  137. VerticalAlignment="Center"
  138. Text="{Binding RecipeStatus, Converter={StaticResource RunStatusConvert}}" />
  139. </Border>
  140. <ControlTemplate.Triggers>
  141. <Trigger Property="IsEnabled" Value="True">
  142. <Setter TargetName="brState" Property="BorderThickness" Value="0" />
  143. <Setter TargetName="brState" Property="CornerRadius" Value="5" />
  144. <Setter TargetName="brState" Property="Background" Value="#F0FFFF" />
  145. <Setter TargetName="txState" Property="Foreground" Value="#CD5555" />
  146. </Trigger>
  147. <DataTrigger Binding="{Binding RecipeStatus}" Value="3">
  148. <Setter TargetName="brState" Property="Background" Value="#F0FFFF" />
  149. <Setter TargetName="txState" Property="Foreground" Value="#3CB371" />
  150. </DataTrigger>
  151. <DataTrigger Binding="{Binding RecipeStatus}" Value="2">
  152. <Setter TargetName="txState" Property="Foreground" Value="Aqua" />
  153. </DataTrigger>
  154. <MultiTrigger>
  155. <MultiTrigger.Conditions>
  156. <Condition Property="IsMouseOver" Value="True" />
  157. <Condition Property="IsEnabled" Value="True" />
  158. </MultiTrigger.Conditions>
  159. <Setter TargetName="txState" Property="FontSize" Value="17 " />
  160. </MultiTrigger>
  161. </ControlTemplate.Triggers>
  162. </ControlTemplate>
  163. </Setter.Value>
  164. </Setter>
  165. <Style.Triggers />
  166. </Style>
  167. <DataTemplate x:Key="TreeItemTemplate" DataType="TreeViewItem">
  168. <Grid Height="28" Margin="50,0,0,0">
  169. <Grid.ColumnDefinitions>
  170. <ColumnDefinition Width="*" />
  171. <ColumnDefinition Width="*" />
  172. </Grid.ColumnDefinitions>
  173. <TextBlock
  174. Margin="10,0"
  175. HorizontalAlignment="Left"
  176. VerticalAlignment="Center"
  177. FontSize="15"
  178. Foreground="#aa2AB2E7"
  179. Text="原料:" />
  180. <TextBlock
  181. Grid.Column="1"
  182. Margin="10,0"
  183. HorizontalAlignment="Left"
  184. VerticalAlignment="Center"
  185. FontSize="15"
  186. Foreground="#aa2AB2E7"
  187. Text="{Binding RawMaterialName}" />
  188. </Grid>
  189. </DataTemplate>
  190. <Style x:Key="recipeTreeItem" TargetType="TreeViewItem">
  191. <Setter Property="Background" Value="Transparent" />
  192. <Setter Property="BorderThickness" Value="0" />
  193. <Setter Property="IsExpanded" Value="True" />
  194. <Setter Property="HeaderTemplate">
  195. <Setter.Value>
  196. <HierarchicalDataTemplate ItemTemplate="{StaticResource TreeItemTemplate}" ItemsSource="{Binding RawMaterials, Mode=TwoWay}">
  197. <StackPanel
  198. Height="28"
  199. HorizontalAlignment="Left"
  200. VerticalAlignment="Center"
  201. Orientation="Horizontal">
  202. <TextBlock
  203. Margin="5,0,0,0"
  204. VerticalAlignment="Center"
  205. FontSize="15"
  206. Foreground="#FF2AB2E7"
  207. Text="配方:" />
  208. <TextBlock
  209. Margin="5,0,0,0"
  210. VerticalAlignment="Center"
  211. FontSize="15"
  212. Foreground="#FF2AB2E7"
  213. Text="{Binding RecipeName}" />
  214. </StackPanel>
  215. </HierarchicalDataTemplate>
  216. </Setter.Value>
  217. </Setter>
  218. <Setter Property="Template">
  219. <Setter.Value>
  220. <ControlTemplate TargetType="{x:Type TreeViewItem}">
  221. <Grid>
  222. <Grid.ColumnDefinitions>
  223. <ColumnDefinition Width="Auto" />
  224. <ColumnDefinition Width="*" />
  225. </Grid.ColumnDefinitions>
  226. <Grid.RowDefinitions>
  227. <RowDefinition Height="Auto" />
  228. <RowDefinition />
  229. </Grid.RowDefinitions>
  230. <Border
  231. x:Name="Bd"
  232. Grid.Column="0"
  233. Padding="{TemplateBinding Padding}"
  234. Background="{TemplateBinding Background}"
  235. BorderBrush="{TemplateBinding BorderBrush}"
  236. BorderThickness="{TemplateBinding BorderThickness}">
  237. <ContentPresenter
  238. x:Name="PART_Header"
  239. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  240. ContentSource="Header" />
  241. </Border>
  242. <ItemsPresenter
  243. x:Name="ItemsHost"
  244. Grid.Row="1"
  245. Grid.Column="0"
  246. Grid.ColumnSpan="2"
  247. Visibility="Collapsed" />
  248. <VisualStateManager.VisualStateGroups>
  249. <VisualStateGroup x:Name="SelectionStates">
  250. <VisualState x:Name="Selected">
  251. <Storyboard>
  252. <ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  253. <EasingColorKeyFrame KeyTime="0" Value="Transparent" />
  254. </ColorAnimationUsingKeyFrames>
  255. </Storyboard>
  256. </VisualState>
  257. <VisualState x:Name="Unselected" />
  258. <VisualState x:Name="SelectedInactive">
  259. <Storyboard>
  260. <ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  261. <EasingColorKeyFrame KeyTime="0" Value="Transparent" />
  262. </ColorAnimationUsingKeyFrames>
  263. </Storyboard>
  264. </VisualState>
  265. </VisualStateGroup>
  266. <VisualStateGroup x:Name="ExpansionStates">
  267. <VisualState x:Name="Expanded">
  268. <Storyboard>
  269. <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="(UIElement.Visibility)">
  270. <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
  271. </ObjectAnimationUsingKeyFrames>
  272. </Storyboard>
  273. </VisualState>
  274. <VisualState x:Name="Collapsed" />
  275. </VisualStateGroup>
  276. </VisualStateManager.VisualStateGroups>
  277. </Grid>
  278. <ControlTemplate.Triggers>
  279. <MultiTrigger>
  280. <MultiTrigger.Conditions>
  281. <Condition Property="HasHeader" Value="false" />
  282. <Condition Property="Width" Value="Auto" />
  283. </MultiTrigger.Conditions>
  284. <Setter TargetName="PART_Header" Property="MinWidth" Value="75" />
  285. </MultiTrigger>
  286. <MultiTrigger>
  287. <MultiTrigger.Conditions>
  288. <Condition Property="HasHeader" Value="false" />
  289. <Condition Property="Height" Value="Auto" />
  290. </MultiTrigger.Conditions>
  291. <Setter TargetName="PART_Header" Property="MinHeight" Value="19" />
  292. </MultiTrigger>
  293. </ControlTemplate.Triggers>
  294. </ControlTemplate>
  295. </Setter.Value>
  296. </Setter>
  297. </Style>
  298. </UserControl.Resources>
  299. <Grid Margin="20">
  300. <Grid.ColumnDefinitions>
  301. <ColumnDefinition />
  302. <ColumnDefinition Width="0.25*" />
  303. </Grid.ColumnDefinitions>
  304. <Grid Name="ggr" Margin="10">
  305. <pry:ImageBorder Width="{Binding ElementName=ggr, Path=ActualWidth}" Height="{Binding ElementName=ggr, Path=ActualHeight}" />
  306. <ListBox
  307. Margin="5"
  308. VerticalAlignment="Top"
  309. Background="Transparent"
  310. BorderThickness="0"
  311. ItemsSource="{Binding Recipes}"
  312. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  313. <ListBox.ItemsPanel>
  314. <ItemsPanelTemplate>
  315. <WrapPanel Orientation="Horizontal" />
  316. </ItemsPanelTemplate>
  317. </ListBox.ItemsPanel>
  318. <ListBox.ItemTemplate>
  319. <DataTemplate>
  320. <Grid
  321. Name="tt"
  322. Width="180"
  323. Height="220"
  324. Margin="5">
  325. <Grid.RowDefinitions>
  326. <RowDefinition Height="30" />
  327. <RowDefinition Height="20" />
  328. <RowDefinition Height="128" />
  329. <RowDefinition Height="2" />
  330. <RowDefinition Height="40" />
  331. </Grid.RowDefinitions>
  332. <Image
  333. Grid.RowSpan="5"
  334. Source="/BPASmartClient.CustomResource;component/Image/配方背景/竖背景框.png"
  335. Stretch="Fill" />
  336. <TextBlock
  337. Grid.Row="0"
  338. Margin="5,0,0,0"
  339. VerticalAlignment="Center"
  340. Foreground="#FF2AB2E7"
  341. Text="配方信息:" />
  342. <TextBlock
  343. Grid.Row="1"
  344. Margin="20,0,0,0"
  345. HorizontalAlignment="Left"
  346. VerticalAlignment="Center"
  347. FontSize="12"
  348. Foreground="#FF2AB2E7"
  349. Text="配方名称:" />
  350. <TextBlock
  351. Grid.Row="1"
  352. Margin="100,0,0,0"
  353. HorizontalAlignment="Left"
  354. VerticalAlignment="Center"
  355. FontSize="12"
  356. Foreground="#FF2AB2E7"
  357. Text="{Binding RecipeName}" />
  358. <ScrollViewer
  359. Grid.Row="2"
  360. VerticalAlignment="Top"
  361. Background="Transparent"
  362. HorizontalScrollBarVisibility="Hidden"
  363. VerticalScrollBarVisibility="Hidden">
  364. <Grid>
  365. <Grid.ColumnDefinitions>
  366. <ColumnDefinition Width="auto" />
  367. <ColumnDefinition />
  368. </Grid.ColumnDefinitions>
  369. <ItemsControl ItemsSource="{Binding RawMaterials}">
  370. <ItemsControl.ItemTemplate>
  371. <DataTemplate>
  372. <Grid>
  373. <TextBlock
  374. Grid.Row="1"
  375. Margin="5,0,0,0"
  376. HorizontalAlignment="Right"
  377. VerticalAlignment="Center"
  378. Foreground="#aa2AB2E7"
  379. Text="{Binding RawMaterialName}" />
  380. </Grid>
  381. </DataTemplate>
  382. </ItemsControl.ItemTemplate>
  383. </ItemsControl>
  384. <!--<ItemsControl Grid.Column="1" ItemsSource="{Binding RawMaterials}">
  385. <ItemsControl.ItemTemplate>
  386. <DataTemplate>
  387. <StackPanel Orientation="Horizontal">
  388. <TextBlock
  389. Margin="5,0,0,0"
  390. HorizontalAlignment="Center"
  391. VerticalAlignment="Center"
  392. Foreground="#aa2AB2E7"
  393. Text=":" />
  394. <TextBlock
  395. Margin="5,0,0,0"
  396. HorizontalAlignment="Center"
  397. VerticalAlignment="Center"
  398. Foreground="#aa2AB2E7"
  399. Text="{Binding RawMaterialWeight}" />
  400. <TextBlock
  401. Margin="5,0,0,0"
  402. HorizontalAlignment="Center"
  403. VerticalAlignment="Center"
  404. Foreground="#aa2AB2E7"
  405. Text="g" />
  406. </StackPanel>
  407. </DataTemplate>
  408. </ItemsControl.ItemTemplate>
  409. </ItemsControl>-->
  410. </Grid>
  411. </ScrollViewer>
  412. <!--<Grid
  413. Grid.Row="3"
  414. Height="2"
  415. VerticalAlignment="Bottom">
  416. <Grid.Background>
  417. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/直线.png" Stretch="Fill" />
  418. </Grid.Background>
  419. </Grid>-->
  420. <Image
  421. Grid.Row="3"
  422. Width="{Binding ElementName=tt, Path=ActualWidth}"
  423. Height="2"
  424. VerticalAlignment="Bottom"
  425. Source="/BPASmartClient.CustomResource;component/Image/直线.png"
  426. Stretch="Fill" />
  427. <Grid
  428. Name="gr"
  429. Grid.Row="4"
  430. Height="30"
  431. Margin="0,0,0,10"
  432. VerticalAlignment="Bottom"
  433. Background="Transparent">
  434. <!--<Grid.ColumnDefinitions>
  435. <ColumnDefinition />
  436. <ColumnDefinition />
  437. </Grid.ColumnDefinitions>-->
  438. <!--<Image
  439. Height="2"
  440. Grid.ColumnSpan="2"
  441. Width="{Binding ElementName=gr, Path=ActualWidth}"
  442. VerticalAlignment="Top"
  443. Source="/BPASmartClient.CustomResource;component/Image/直线.png" />-->
  444. <pry:IcoButton
  445. Width="{Binding ElementName=gr, Path=ActualWidth}"
  446. Height="{Binding ElementName=gr, Path=ActualHeight}"
  447. Margin="4,4,4,0"
  448. HorizontalAlignment="Center"
  449. VerticalAlignment="Center"
  450. Background="#222bd06f"
  451. BorderThickness="0"
  452. Command="{Binding DataContext.StartCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  453. CommandParameter="{Binding RecipeName}"
  454. Content="配方下发"
  455. EnterBackground="#332bd06f"
  456. FontStyle="Normal"
  457. Foreground="#ff2bd06f"
  458. IcoText="&#xe6cf;"
  459. IsEnabled="{Binding IsEnable}"
  460. Style="{StaticResource IcoButtonStyle}" />
  461. <!--<pry:IcoButton
  462. Width="{Binding ElementName=gr, Path=ActualWidth}"
  463. Height="{Binding ElementName=gr, Path=ActualHeight}"
  464. Margin="4,4,3,0"
  465. HorizontalAlignment="Center"
  466. VerticalAlignment="Center"
  467. Background="#11F53F62"
  468. BorderThickness="0"
  469. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  470. CommandParameter="{Binding RecipCode}"
  471. Content="删除"
  472. EnterBackground="#22F53F62"
  473. FontStyle="Normal"
  474. Foreground="#FFF53F62"
  475. IcoText="&#xe68e;"
  476. Style="{StaticResource IcoButtonStyle}" />
  477. <pry:IcoButton
  478. Grid.Column="1"
  479. Width="{Binding ElementName=gr, Path=ActualWidth}"
  480. Height="{Binding ElementName=gr, Path=ActualHeight}"
  481. Margin="3,4,4,0"
  482. HorizontalAlignment="Center"
  483. VerticalAlignment="Center"
  484. Background="#112AB2E7"
  485. BorderThickness="0"
  486. Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  487. CommandParameter="{Binding RecipCode}"
  488. Content="编辑"
  489. EnterBackground="#222AB2E7"
  490. Foreground="#FF2AB2E7"
  491. IcoText="&#xe636;"
  492. Style="{StaticResource IcoButtonStyle}" />-->
  493. </Grid>
  494. <!--</StackPanel>-->
  495. </Grid>
  496. <!--<Grid Name="tt" Margin="5">
  497. <Grid.RowDefinitions>
  498. <RowDefinition Height="auto" />
  499. <RowDefinition Height="auto" />
  500. <RowDefinition />
  501. <RowDefinition />
  502. </Grid.RowDefinitions>
  503. <Image
  504. Grid.RowSpan="4"
  505. Source="/BPASmartClient.CustomResource;component/Image/配方背景/竖背景框.png"
  506. Stretch="Fill" />
  507. <TextBlock
  508. Grid.Row="0"
  509. Margin="2,5,0,0"
  510. HorizontalAlignment="Center"
  511. VerticalAlignment="Top"
  512. FontSize="18"
  513. Foreground="#FF2AB2E7"
  514. Text="{Binding RecipeName}" />
  515. <TextBlock
  516. Grid.Row="1"
  517. Margin="5,0,0,5"
  518. Foreground="#ffc000"
  519. Text="配方信息:" />
  520. <ScrollViewer
  521. Grid.Row="2"
  522. HorizontalScrollBarVisibility="Hidden"
  523. VerticalScrollBarVisibility="Hidden">
  524. <Grid>
  525. <Grid.ColumnDefinitions>
  526. <ColumnDefinition Width="auto" />
  527. <ColumnDefinition />
  528. </Grid.ColumnDefinitions>
  529. <ItemsControl ItemsSource="{Binding RawMaterials}">
  530. <ItemsControl.ItemTemplate>
  531. <DataTemplate>
  532. <Grid>
  533. <TextBlock
  534. Grid.Row="1"
  535. Margin="5,0,0,0"
  536. HorizontalAlignment="Right"
  537. VerticalAlignment="Center"
  538. Foreground="#aaffc000"
  539. Text="{Binding RawMaterialName}" />
  540. </Grid>
  541. </DataTemplate>
  542. </ItemsControl.ItemTemplate>
  543. </ItemsControl>
  544. <ItemsControl Grid.Column="1" ItemsSource="{Binding RawMaterials}">
  545. <ItemsControl.ItemTemplate>
  546. <DataTemplate>
  547. <StackPanel Orientation="Horizontal">
  548. <TextBlock
  549. Margin="5,0,0,0"
  550. HorizontalAlignment="Center"
  551. VerticalAlignment="Center"
  552. Foreground="#aaffc000"
  553. Text=":" />
  554. <TextBlock
  555. Margin="5,0,0,0"
  556. HorizontalAlignment="Center"
  557. VerticalAlignment="Center"
  558. Foreground="#aaffc000"
  559. Text="{Binding RawMaterialWeight}" />
  560. <TextBlock
  561. Margin="5,0,0,0"
  562. HorizontalAlignment="Center"
  563. VerticalAlignment="Center"
  564. Foreground="#aaffc000"
  565. Text="g" />
  566. </StackPanel>
  567. </DataTemplate>
  568. </ItemsControl.ItemTemplate>
  569. </ItemsControl>
  570. </Grid>
  571. </ScrollViewer>
  572. <Grid
  573. Name="grb"
  574. Grid.Row="3"
  575. Height="30"
  576. Margin="0,0,0,10"
  577. VerticalAlignment="Bottom"
  578. Background="Transparent">
  579. <Image
  580. Width="{Binding ElementName=grb, Path=ActualWidth}"
  581. VerticalAlignment="Top"
  582. StretchDirection="Both"
  583. Source="/BPASmartClient.CustomResource;component/Image/直线.png" />
  584. <pry:IcoButton
  585. Width="{Binding ElementName=grb, Path=ActualWidth}"
  586. Height="{Binding ElementName=grb, Path=ActualHeight}"
  587. Margin="4,4,4,0"
  588. HorizontalAlignment="Center"
  589. VerticalAlignment="Center"
  590. Background="#222bd06f"
  591. BorderThickness="0"
  592. Command="{Binding DataContext.StartCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  593. CommandParameter="{Binding RecipeName}"
  594. Content="配方下发"
  595. EnterBackground="#332bd06f"
  596. FontStyle="Normal"
  597. Foreground="#ff2bd06f"
  598. IcoText="&#xe6cf;"
  599. IsEnabled="{Binding IsEnable}"
  600. Style="{StaticResource IcoButtonStyle}" />
  601. </Grid>
  602. </Grid>-->
  603. </DataTemplate>
  604. </ListBox.ItemTemplate>
  605. </ListBox>
  606. </Grid>
  607. <Grid
  608. Name="gr"
  609. Grid.Column="1"
  610. Margin="10">
  611. <Grid.RowDefinitions>
  612. <RowDefinition Height="50" />
  613. <RowDefinition />
  614. </Grid.RowDefinitions>
  615. <pry:ImageBorder
  616. Grid.RowSpan="2"
  617. Width="{Binding ElementName=gr, Path=ActualWidth}"
  618. Height="{Binding ElementName=gr, Path=ActualHeight}" />
  619. <Grid Margin="5">
  620. <Grid.ColumnDefinitions>
  621. <ColumnDefinition />
  622. <ColumnDefinition />
  623. <ColumnDefinition />
  624. </Grid.ColumnDefinitions>
  625. <RadioButton
  626. Click="RadioButtonWait_Click"
  627. Command="{Binding ChangeRecipeStateCommand}"
  628. Content="等待中"
  629. GroupName="state"
  630. IsChecked="True"
  631. Style="{DynamicResource RadioState}" />
  632. <RadioButton
  633. Grid.Column="1"
  634. Click="RadioButtonMaking_Click"
  635. Content="执行中"
  636. GroupName="state"
  637. Style="{DynamicResource RadioState}" />
  638. <RadioButton
  639. Grid.Column="2"
  640. Click="RadioButtonCompelete_Click"
  641. Content="已完成"
  642. GroupName="state"
  643. Style="{DynamicResource RadioState}" />
  644. </Grid>
  645. <!--<ScrollViewer
  646. Grid.Row="1"
  647. HorizontalScrollBarVisibility="Hidden"
  648. VerticalScrollBarVisibility="Hidden">
  649. <Border>
  650. <Grid Grid.Row="1">
  651. <Grid x:Name="repiceListMaking" Margin="5">
  652. <Grid.RowDefinitions>
  653. <RowDefinition Height="30" />
  654. <RowDefinition />
  655. </Grid.RowDefinitions>
  656. <TextBlock
  657. Margin="10,0"
  658. HorizontalAlignment="Left"
  659. VerticalAlignment="Center"
  660. FontSize="18"
  661. Foreground="#FF2AB2E7"
  662. Text="{Binding CurrentRecipeName}" />
  663. <ItemsControl
  664. Grid.Row="1"
  665. Margin="50,0"
  666. ItemsSource="{Binding recipeProcesses}">
  667. <ItemsControl.ItemTemplate>
  668. <DataTemplate>
  669. <Grid Margin="5">
  670. <Grid.ColumnDefinitions>
  671. <ColumnDefinition />
  672. <ColumnDefinition Width="16" />
  673. <ColumnDefinition />
  674. </Grid.ColumnDefinitions>
  675. <TextBlock
  676. Margin="10,0,5,0"
  677. HorizontalAlignment="Left"
  678. VerticalAlignment="Center"
  679. FontSize="15"
  680. Foreground="#AA2AB2E7"
  681. Text="{Binding RawMaterialName}"
  682. ToolTip="{Binding RawMaterialSource, Converter={StaticResource IntToSourceConvert}}" />
  683. <TextBlock
  684. Grid.Column="1"
  685. Margin="0,0,5,0"
  686. HorizontalAlignment="Left"
  687. VerticalAlignment="Center"
  688. FontSize="15"
  689. Foreground="#AA2AB2E7"
  690. Text=":" />
  691. <Button
  692. Grid.Column="2"
  693. HorizontalAlignment="Center"
  694. VerticalAlignment="Center"
  695. Command="{Binding DataContext.ChangeRecipeStateCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  696. CommandParameter="{Binding RawMaterialId}"
  697. Content="{Binding RecipeStatus, Converter={StaticResource RunStatusConvert}}"
  698. IsEnabled="{Binding RawMaterialSource, Converter={StaticResource EnbleConvert}}"
  699. Style="{StaticResource materialMakingButton}" />
  700. </Grid>
  701. </DataTemplate>
  702. </ItemsControl.ItemTemplate>
  703. </ItemsControl>
  704. </Grid>
  705. -->
  706. <!--<TreeView x:Name="repiceListMaking" ItemsSource="{Binding RecipeProcesse}"
  707. ScrollViewer.VerticalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" Background="Wheat" ItemContainerStyle="{StaticResource recipeTreeItem}">
  708. </TreeView>-->
  709. <!-- 等待和已完成 -->
  710. <!--<TreeView
  711. x:Name="repiceList"
  712. HorizontalAlignment="Stretch"
  713. Background="Transparent"
  714. BorderThickness="0"
  715. ItemContainerStyle="{StaticResource recipeTreeItem}"
  716. ItemsSource="{Binding UserTreeWait}"
  717. ScrollViewer.VerticalScrollBarVisibility="Visible" />-->
  718. <!--
  719. </Grid>
  720. </Border>
  721. </ScrollViewer>-->
  722. <!--#region 等待制作和制作完成列表显示-->
  723. <Grid
  724. Name="WaitOrCompleteGrid"
  725. Grid.Row="1"
  726. Margin="10">
  727. <Grid.RowDefinitions>
  728. <RowDefinition Height="30" />
  729. <RowDefinition />
  730. </Grid.RowDefinitions>
  731. <!--#region 表格标题栏设置-->
  732. <Grid
  733. Grid.Row="0"
  734. Margin="0,5"
  735. Background="#ff0C255F">
  736. <Grid.ColumnDefinitions>
  737. <ColumnDefinition Width="50" />
  738. <ColumnDefinition />
  739. <ColumnDefinition Width="70" />
  740. </Grid.ColumnDefinitions>
  741. <TextBlock
  742. Grid.Column="0"
  743. Style="{StaticResource TitleTextblockStyle}"
  744. Text="序号" />
  745. <Grid Grid.Column="1">
  746. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="配方名称" />
  747. <Border
  748. BorderBrush="{StaticResource bordColor}"
  749. BorderThickness="1,0,1,0"
  750. Cursor="SizeWE" />
  751. </Grid>
  752. <TextBlock
  753. Grid.Column="2"
  754. Style="{StaticResource TitleTextblockStyle}"
  755. Text="状态" />
  756. <Border
  757. Grid.ColumnSpan="10"
  758. BorderBrush="{StaticResource bordColor}"
  759. BorderThickness="1,0,1,0" />
  760. </Grid>
  761. <!--#endregion-->
  762. <ScrollViewer
  763. Grid.Row="1"
  764. HorizontalScrollBarVisibility="Hidden"
  765. VerticalScrollBarVisibility="Hidden">
  766. <ItemsControl Name="Wait" ItemsSource="{Binding UserTreeWait}">
  767. <ItemsControl.ItemTemplate>
  768. <DataTemplate>
  769. <Grid Height="30">
  770. <Grid.ColumnDefinitions>
  771. <ColumnDefinition Width="50" />
  772. <ColumnDefinition />
  773. <ColumnDefinition Width="100" />
  774. </Grid.ColumnDefinitions>
  775. <TextBlock
  776. HorizontalAlignment="Center"
  777. VerticalAlignment="Center"
  778. FontSize="16"
  779. Foreground="#FF2AB2E7"
  780. Text="{Binding SerialNum}" />
  781. <Grid Grid.Column="1">
  782. <TextBlock
  783. Grid.Column="1"
  784. Margin="5,0,0,0"
  785. HorizontalAlignment="Left"
  786. VerticalAlignment="Center"
  787. FontSize="16"
  788. Foreground="#FF2AB2E7"
  789. Text="{Binding RecipeName}" />
  790. <Border
  791. BorderBrush="{StaticResource bordColor}"
  792. BorderThickness="1,0,1,0"
  793. Cursor="SizeWE" />
  794. </Grid>
  795. <TextBlock
  796. Grid.Column="2"
  797. HorizontalAlignment="Center"
  798. VerticalAlignment="Center"
  799. FontSize="16"
  800. Foreground="{Binding RecipStatus, Converter={StaticResource RecipeStatusConvert}}"
  801. Text="{Binding RecipStatus}" />
  802. <Border
  803. Grid.ColumnSpan="10"
  804. BorderBrush="{StaticResource bordColor}"
  805. BorderThickness="1" />
  806. </Grid>
  807. </DataTemplate>
  808. </ItemsControl.ItemTemplate>
  809. </ItemsControl>
  810. </ScrollViewer>
  811. </Grid>
  812. <!--#endregion-->
  813. <!--#region 制作中设备状态监视-->
  814. <Grid
  815. Name="CookingGrid"
  816. Grid.Row="1"
  817. Margin="10"
  818. Visibility="Collapsed">
  819. <!--<Grid.RowDefinitions>
  820. <RowDefinition Height="30"/>
  821. <RowDefinition/>
  822. </Grid.RowDefinitions>-->
  823. <ItemsControl ItemsSource="{Binding recipeProcesses}">
  824. <ItemsControl.ItemTemplate>
  825. <DataTemplate>
  826. <Grid>
  827. <Grid.RowDefinitions>
  828. <RowDefinition Height="30" />
  829. <RowDefinition Height="30" />
  830. <RowDefinition Height="auto" />
  831. <RowDefinition Height="40" />
  832. <RowDefinition Height="10" />
  833. </Grid.RowDefinitions>
  834. <Image
  835. Grid.RowSpan="5"
  836. Source="/BPASmartClient.CustomResource;component/Image/背景边框4.png"
  837. Stretch="Fill" />
  838. <!--<Image
  839. Grid.RowSpan="4"
  840. Source="/BPASmartClient.CustomResource;component/Image/组合边框2.png"
  841. Stretch="Fill" />-->
  842. <TextBlock
  843. Grid.Row="0"
  844. Margin="0,5,0,0"
  845. HorizontalAlignment="Center"
  846. VerticalAlignment="Top"
  847. FontSize="18"
  848. Foreground="#FF2AB2E7"
  849. Text="{Binding RecipeName}" />
  850. <!--#region 表格标题栏设置-->
  851. <Grid
  852. Grid.Row="1"
  853. Height="30"
  854. Margin="5,0"
  855. VerticalAlignment="Top"
  856. Background="#ff0C255F">
  857. <Grid.ColumnDefinitions>
  858. <ColumnDefinition />
  859. <ColumnDefinition />
  860. </Grid.ColumnDefinitions>
  861. <TextBlock
  862. Grid.Column="0"
  863. Style="{StaticResource TitleTextblockStyle}"
  864. Text="原料" />
  865. <Grid Grid.Column="1">
  866. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="状态" />
  867. <Border
  868. BorderBrush="{StaticResource bordColor}"
  869. BorderThickness="1,0,1,0"
  870. Cursor="SizeWE" />
  871. </Grid>
  872. <Border
  873. Grid.ColumnSpan="10"
  874. BorderBrush="{StaticResource bordColor}"
  875. BorderThickness="1,0,1,0" />
  876. </Grid>
  877. <!--#endregion-->
  878. <ItemsControl
  879. Grid.Row="2"
  880. Margin="0,0,0,15"
  881. ItemsSource="{Binding RawMaterials}">
  882. <ItemsControl.ItemTemplate>
  883. <DataTemplate>
  884. <Grid Height="30">
  885. <Grid.ColumnDefinitions>
  886. <ColumnDefinition />
  887. <ColumnDefinition />
  888. </Grid.ColumnDefinitions>
  889. <StackPanel
  890. Margin="0,0,5,0"
  891. HorizontalAlignment="Right"
  892. Orientation="Horizontal">
  893. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="{Binding RawMaterialName}" />
  894. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text=":" />
  895. </StackPanel>
  896. <StackPanel
  897. Grid.Column="1"
  898. Margin="2,0,0,0"
  899. Orientation="Horizontal">
  900. <TextBlock
  901. Margin="0,0,5,0"
  902. Foreground="{Binding Status, Converter={StaticResource ForegroundConverter}}"
  903. Style="{StaticResource TitleTextblockStyle}"
  904. Text="{Binding Status}" />
  905. <TextBlock
  906. FontFamily="/BPASmartClient.CustomResource;component/Fonts/#iconfont"
  907. FontSize="20"
  908. Foreground="{Binding Status, Converter={StaticResource ForegroundConverter}}"
  909. Style="{StaticResource TitleTextblockStyle}"
  910. Text="{Binding Status, Converter={StaticResource StatusIconConverter}}" />
  911. </StackPanel>
  912. </Grid>
  913. </DataTemplate>
  914. </ItemsControl.ItemTemplate>
  915. </ItemsControl>
  916. <Button
  917. Grid.Row="3"
  918. Height="40"
  919. Margin="20,0,20,0"
  920. VerticalContentAlignment="Center"
  921. Command="{Binding DataContext.CancelRecipeCommand, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
  922. CommandParameter="{Binding}"
  923. Content="取消配料"
  924. FontSize="16"
  925. Style="{StaticResource ControlButtonStyle}" />
  926. <!--<Button
  927. Grid.Row="3"
  928. Height="40"
  929. Margin="5,0,5,0"
  930. Command="{Binding CancelRecipeCommand}"
  931. CommandParameter="{Binding}"
  932. Content="取消配料"
  933. FontSize="20"
  934. Style="{StaticResource ImageButtonStyle}" />-->
  935. </Grid>
  936. </DataTemplate>
  937. </ItemsControl.ItemTemplate>
  938. </ItemsControl>
  939. </Grid>
  940. <!--#endregion-->
  941. </Grid>
  942. </Grid>
  943. </UserControl>