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

284 Zeilen
14 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.MorkCL.View.RecipeManageView"
  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.MorkCL.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  9. xmlns:vm="clr-namespace:BPASmartClient.MorkCL.ViewModel"
  10. Name="配方管理"
  11. mc:Ignorable="d">
  12. <UserControl.DataContext>
  13. <vm:RecipeManageViewModel />
  14. </UserControl.DataContext>
  15. <UserControl.Resources>
  16. <ResourceDictionary>
  17. <ResourceDictionary.MergedDictionaries>
  18. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
  19. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
  20. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Recdictionarys/GlobalStyle.xaml" />
  21. </ResourceDictionary.MergedDictionaries>
  22. <Style x:Key="DataShowTextBoxStyle" TargetType="TextBox">
  23. <Setter Property="Margin" Value="5,0,0,0" />
  24. <Setter Property="BorderThickness" Value="0" />
  25. <Setter Property="HorizontalAlignment" Value="Center" />
  26. <Setter Property="Height" Value="50" />
  27. <Setter Property="CaretBrush" Value="{StaticResource TitleBorderColor}" />
  28. <Setter Property="Foreground" Value="{StaticResource TitleBorderColor}" />
  29. <Setter Property="VerticalContentAlignment" Value="Center" />
  30. <Setter Property="FontSize" Value="14" />
  31. <Setter Property="Background" Value="Transparent" />
  32. <Setter Property="VerticalAlignment" Value="Center" />
  33. </Style>
  34. <Style
  35. x:Key="IssueRecipeButtonStyle"
  36. BasedOn="{StaticResource ControlButtonStyle}"
  37. TargetType="Button">
  38. <Setter Property="Foreground" Value="{StaticResource FontColor}" />
  39. <Setter Property="Template">
  40. <Setter.Value>
  41. <ControlTemplate TargetType="Button">
  42. <Border
  43. Name="TitleBarBr"
  44. BorderBrush="#00c2f4"
  45. BorderThickness="0"
  46. CornerRadius="0"
  47. Opacity="0.8">
  48. <ContentPresenter
  49. Margin="{TemplateBinding Margin}"
  50. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  51. VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
  52. <Border.Background>
  53. <ImageBrush
  54. ImageSource="/BPASmartClient.CustomResource;component/Image/组合边框2.1.png"
  55. Opacity="0.8"
  56. Stretch="Fill" />
  57. </Border.Background>
  58. </Border>
  59. <ControlTemplate.Triggers>
  60. <Trigger Property="IsMouseOver" Value="true">
  61. <Setter TargetName="TitleBarBr" Property="Opacity" Value="1" />
  62. </Trigger>
  63. </ControlTemplate.Triggers>
  64. </ControlTemplate>
  65. </Setter.Value>
  66. </Setter>
  67. </Style>
  68. </ResourceDictionary>
  69. </UserControl.Resources>
  70. <Grid>
  71. <Grid.RowDefinitions>
  72. <RowDefinition Height="40" />
  73. <RowDefinition Height="1*" />
  74. </Grid.RowDefinitions>
  75. <!--#region 标题栏设置-->
  76. <pry:ImageBorder Grid.Row="0">
  77. <StackPanel
  78. Height="40"
  79. Margin="5,0"
  80. FlowDirection="RightToLeft"
  81. Orientation="Horizontal">
  82. <Button
  83. Height="35"
  84. Margin="10,0,50,0"
  85. VerticalAlignment="Center"
  86. Command="{Binding ClearAllRecipeCommand}"
  87. Content="清除所有配方" />
  88. <Button
  89. Height="35"
  90. Margin="5,0"
  91. VerticalAlignment="Center"
  92. Command="{Binding AddRecipeCommand}"
  93. Content="添加配方" />
  94. <Button
  95. Height="35"
  96. Margin="5,0"
  97. VerticalAlignment="Center"
  98. Command="{Binding AddTemplateRecipeCommand}"
  99. Content="添加模板配方" />
  100. <!--<Button
  101. Margin="5,0"
  102. VerticalAlignment="Center"
  103. Command="{Binding SaveParamCommand}"
  104. Content="保存所有配方" />-->
  105. </StackPanel>
  106. </pry:ImageBorder>
  107. <!--#endregion-->
  108. <!--#region 配方管理正文-->
  109. <pry:ImageBorder Grid.Row="1" Margin="5">
  110. <Grid>
  111. <Grid.RowDefinitions>
  112. <RowDefinition Height="40" />
  113. <RowDefinition Height="1*" />
  114. </Grid.RowDefinitions>
  115. <!--#region 标题栏设置-->
  116. <Grid Margin="0,10,17,0" Background="#ff0C255F">
  117. <Grid.ColumnDefinitions>
  118. <ColumnDefinition Width="400" />
  119. <ColumnDefinition Width="100" />
  120. <ColumnDefinition />
  121. <ColumnDefinition Width="200" />
  122. <ColumnDefinition Width="200" />
  123. <ColumnDefinition Width="100" />
  124. </Grid.ColumnDefinitions>
  125. <TextBlock
  126. Grid.Column="0"
  127. Style="{StaticResource TitleTextblockStyle}"
  128. Text="名称" />
  129. <Grid Grid.Column="1">
  130. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="菜品类型" />
  131. <Border
  132. BorderBrush="{StaticResource bordColor}"
  133. BorderThickness="1,0,1,0"
  134. Cursor="SizeWE" />
  135. </Grid>
  136. <Grid Grid.Column="2">
  137. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="备注" />
  138. <Border
  139. BorderBrush="{StaticResource bordColor}"
  140. BorderThickness="1,0,1,0"
  141. Cursor="SizeWE" />
  142. </Grid>
  143. <TextBlock
  144. Grid.Column="3"
  145. Style="{StaticResource TitleTextblockStyle}"
  146. Text="下发" />
  147. <Grid Grid.Column="4">
  148. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="编辑" />
  149. <Border
  150. BorderBrush="{StaticResource bordColor}"
  151. BorderThickness="1,0,1,0"
  152. Cursor="SizeWE" />
  153. </Grid>
  154. <Grid Grid.Column="5">
  155. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="删除" />
  156. <Border
  157. BorderBrush="{StaticResource bordColor}"
  158. BorderThickness="1,0,1,0"
  159. Cursor="SizeWE" />
  160. </Grid>
  161. <Border
  162. Grid.ColumnSpan="10"
  163. BorderBrush="{StaticResource bordColor}"
  164. BorderThickness="1,0,1,0" />
  165. </Grid>
  166. <!--#endregion-->
  167. <!--#region 表格数据显示设置-->
  168. <Grid Grid.Row="1">
  169. <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Visible">
  170. <ItemsControl ItemsSource="{Binding Recipes}">
  171. <ItemsControl.ItemTemplate>
  172. <DataTemplate>
  173. <Grid>
  174. <Grid.ColumnDefinitions>
  175. <ColumnDefinition Width="400" />
  176. <ColumnDefinition Width="100" />
  177. <ColumnDefinition />
  178. <ColumnDefinition Width="200" />
  179. <ColumnDefinition Width="200" />
  180. <ColumnDefinition Width="100" />
  181. </Grid.ColumnDefinitions>
  182. <TextBlock
  183. Grid.Column="0"
  184. HorizontalAlignment="Center"
  185. FontSize="26"
  186. Style="{StaticResource TextBlockStyle}"
  187. Text="{Binding Name}"
  188. TextAlignment="Center" />
  189. <Grid Grid.Column="1">
  190. <TextBox
  191. MinWidth="400"
  192. FontSize="26"
  193. Style="{StaticResource DataShowTextBoxStyle}"
  194. Text="{Binding DishType}"
  195. TextAlignment="Center" />
  196. <Border
  197. BorderBrush="{StaticResource bordColor}"
  198. BorderThickness="2,0,2,0"
  199. Cursor="SizeWE" />
  200. </Grid>
  201. <Grid Grid.Column="2">
  202. <TextBox
  203. MinWidth="400"
  204. Style="{StaticResource DataShowTextBoxStyle}"
  205. Text="{Binding Remark}"
  206. TextAlignment="Center" />
  207. <Border
  208. BorderBrush="{StaticResource bordColor}"
  209. BorderThickness="2,0,2,0"
  210. Cursor="SizeWE" />
  211. </Grid>
  212. <Grid Grid.Column="3" Margin="5">
  213. <Button
  214. Command="{Binding DataContext.IssueCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  215. CommandParameter="{Binding}"
  216. Content="下发"
  217. FontSize="16"
  218. Style="{StaticResource IssueRecipeButtonStyle}" />
  219. <Border
  220. BorderBrush="{StaticResource bordColor}"
  221. BorderThickness="2,0,2,0"
  222. Cursor="SizeWE" />
  223. </Grid>
  224. <Grid Grid.Column="4" Margin="5">
  225. <Button
  226. Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  227. CommandParameter="{Binding}"
  228. Content="编辑"
  229. FontSize="16"
  230. Style="{StaticResource IssueRecipeButtonStyle}" />
  231. <Border
  232. BorderBrush="{StaticResource bordColor}"
  233. BorderThickness="2,0,2,0"
  234. Cursor="SizeWE" />
  235. </Grid>
  236. <Grid Grid.Column="5">
  237. <Button
  238. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  239. CommandParameter="{Binding Id}"
  240. Content="删除"
  241. FontSize="16"
  242. Style="{StaticResource ControlButtonStyle}" />
  243. <Border
  244. BorderBrush="{StaticResource bordColor}"
  245. BorderThickness="2,0,2,0"
  246. Cursor="SizeWE" />
  247. </Grid>
  248. <Border
  249. Grid.ColumnSpan="10"
  250. BorderBrush="{StaticResource bordColor}"
  251. BorderThickness="2,0,2,2" />
  252. </Grid>
  253. </DataTemplate>
  254. </ItemsControl.ItemTemplate>
  255. </ItemsControl>
  256. </ScrollViewer>
  257. </Grid>
  258. <!--#endregion-->
  259. </Grid>
  260. </pry:ImageBorder>
  261. <!--#endregion-->
  262. </Grid>
  263. </UserControl>