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

MainControlView.xaml 13 KiB

2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <UserControl x:Class="BPASmartClient.MilkWithTea.View.MainControlView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:BPASmartClient.MilkWithTea.View"
  7. xmlns:vm="clr-namespace:BPASmartClient.MilkWithTea.ViewModel"
  8. xmlns:controls="clr-namespace:BPASmartClient.MilkWithTea.Control"
  9. xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters;assembly=BPASmartClient.CustomResource"
  10. mc:Ignorable="d"
  11. d:DesignHeight="800" d:DesignWidth="1400" Background="Transparent">
  12. <UserControl.DataContext>
  13. <vm:MainControlViewModel/>
  14. </UserControl.DataContext>
  15. <UserControl.Resources>
  16. <ResourceDictionary>
  17. <con:ColorConverter x:Key="ColorConverter" />
  18. <con:TextConverter x:Key="TextConverter" />
  19. <con:OpacityConverter x:Key="OpacityConverter"/>
  20. <Style TargetType="TextBlock">
  21. <Setter Property="FontSize" Value="28"/>
  22. <Setter Property="VerticalAlignment" Value="Center"/>
  23. <Setter Property="Foreground" Value="DarkSlateGray"/>
  24. <Setter Property="FontWeight" Value="Bold"/>
  25. </Style>
  26. <Style TargetType="{x:Type ListBox}">
  27. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
  28. <Setter Property="BorderThickness" Value="0"/>
  29. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  30. <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
  31. <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
  32. <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
  33. <Setter Property="ScrollViewer.PanningMode" Value="Both"/>
  34. <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  35. <Setter Property="VerticalContentAlignment" Value="Center"/>
  36. <Setter Property="Template">
  37. <Setter.Value>
  38. <ControlTemplate TargetType="{x:Type ListBox}">
  39. <Border x:Name="Bd" BorderBrush="Transparent" BorderThickness="0"
  40. Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
  41. <ScrollViewer Focusable="false">
  42. <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Stretch"/>
  43. </ScrollViewer>
  44. </Border>
  45. <ControlTemplate.Triggers>
  46. <MultiTrigger>
  47. <MultiTrigger.Conditions>
  48. <Condition Property="IsGrouping" Value="true"/>
  49. </MultiTrigger.Conditions>
  50. <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
  51. </MultiTrigger>
  52. </ControlTemplate.Triggers>
  53. </ControlTemplate>
  54. </Setter.Value>
  55. </Setter>
  56. </Style>
  57. <Style TargetType="DataGridRow">
  58. <Setter Property="FontSize" Value="16"/>
  59. <Setter Property="VerticalAlignment" Value="Center"/>
  60. <Setter Property="Height" Value="28"/>
  61. <Style.Triggers>
  62. <!-- 隔行换色 -->
  63. <Trigger Property="AlternationIndex" Value="0">
  64. <Setter Property="Background" Value="#FFFAFAFA" />
  65. </Trigger>
  66. <Trigger Property="AlternationIndex" Value="1">
  67. <Setter Property="Background" Value="#FFF5F5F7" />
  68. </Trigger>
  69. <Trigger Property="IsMouseOver" Value="True">
  70. <Setter Property="Background" Value="#4fade8" />
  71. </Trigger>
  72. </Style.Triggers>
  73. </Style>
  74. </ResourceDictionary>
  75. </UserControl.Resources>
  76. <Grid Background="#F3F6F9" Margin="20">
  77. <Grid.ColumnDefinitions>
  78. <ColumnDefinition Width="6*"/>
  79. <ColumnDefinition Width="1"/>
  80. <ColumnDefinition Width="3*"/>
  81. </Grid.ColumnDefinitions>
  82. <Grid.RowDefinitions>
  83. <RowDefinition Height="2*"/>
  84. <RowDefinition Height="60"/>
  85. <RowDefinition Height="280"/>
  86. <RowDefinition Height="*"/>
  87. </Grid.RowDefinitions>
  88. <GroupBox Header="订单队列" Style="{StaticResource GroupBoxStyle1}" FontSize="18">
  89. <DataGrid ItemsSource="{Binding orderStatusLists}"
  90. Grid.Row="1" AutoGenerateColumns="False" RowHeight="250"
  91. FrozenColumnCount="1" Margin="30,5"
  92. VerticalAlignment="Top"
  93. IsReadOnly="True"
  94. CanUserResizeColumns="False" CanUserResizeRows="False" SelectionMode="Single"
  95. CanUserReorderColumns="False" RowHeaderWidth="0" CanUserAddRows="False">
  96. <DataGrid.Columns>
  97. <DataGridTextColumn Header="取餐号" Binding="{Binding OrderPush.SortNum}" Width="*"
  98. Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}">
  99. </DataGridTextColumn>
  100. <DataGridTextColumn Header="商品名" Binding="{Binding OrderPush.GoodsName}" Width="2*" />
  101. <DataGridTextColumn Header="开始时间" Binding="{Binding StartDate}" Width="2*"/>
  102. <DataGridTextColumn Header="结束时间" Binding="{Binding EndDate}" Width="2*"/>
  103. <DataGridTextColumn Header="制作状态" Binding="{Binding OrderStatus, Converter={StaticResource TextConverter}}" Width="2*"/>
  104. <DataGridTextColumn Header="完成时间" Binding="{Binding CompleteDate}" Width="2*" />
  105. </DataGrid.Columns>
  106. </DataGrid>
  107. </GroupBox>
  108. <GroupBox Grid.Row="2" Header="当前奶茶进度" Style="{StaticResource GroupBoxStyle1}" FontSize="18">
  109. <Grid >
  110. <Grid.ColumnDefinitions>
  111. <ColumnDefinition Width="220"/>
  112. <ColumnDefinition Width="200"/>
  113. <ColumnDefinition Width="200"/>
  114. <ColumnDefinition Width="*"/>
  115. </Grid.ColumnDefinitions>
  116. <TextBlock Grid.Column="1" Text="{Binding CurrentGood}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20"/>
  117. <controls:CircularProgressBar Grid.Column="2" Percent="{Binding MakePercent}" />
  118. </Grid>
  119. </GroupBox>
  120. <Border Grid.Column="1" Grid.RowSpan="5" BorderBrush="Black" BorderThickness="1" />
  121. <Grid Opacity="{Binding MakeEnable ,Converter= {StaticResource OpacityConverter}}" Grid.Column="2" Grid.RowSpan="5">
  122. <Grid.ColumnDefinitions>
  123. <ColumnDefinition Width="*"/>
  124. <ColumnDefinition Width="*"/>
  125. </Grid.ColumnDefinitions>
  126. <Grid.RowDefinitions>
  127. <RowDefinition Height="60"/>
  128. <RowDefinition Height="60"/>
  129. <RowDefinition Height="50"/>
  130. <RowDefinition Height="*"/>
  131. <RowDefinition Height="100"/>
  132. </Grid.RowDefinitions>
  133. <TextBlock Grid.ColumnSpan="2" Text="本地奶茶下单" HorizontalAlignment="Center" />
  134. <Border Grid.ColumnSpan="2" Grid.Row="1" Background="Transparent" Visibility="{Binding Visibility}" Margin="5">
  135. <Border Background="White" Height="50" CornerRadius="10" HorizontalAlignment="Stretch">
  136. <Grid Height="Auto">
  137. <Grid.ColumnDefinitions>
  138. <ColumnDefinition Width="50"/>
  139. <ColumnDefinition Width="*"/>
  140. </Grid.ColumnDefinitions>
  141. <TextBlock Text="&#xe62f;" FontFamily="/BPASmartClient.CustomResource;component/Fonts/MT/#iconfont" FontSize="28"
  142. VerticalAlignment="Center" HorizontalAlignment="Center"/>
  143. <TextBox Grid.Column="1" x:Name="searchQuery"
  144. HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" TextAlignment="Left"
  145. BorderThickness="0" Background="Transparent"
  146. IsEnabled="{Binding MakeEnable}"/>
  147. <TextBlock Grid.Column="1" Margin="3,0,0,0" Text="搜索本地奶茶" FontWeight="Bold" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Foreground="LightGray" IsHitTestVisible="False">
  148. <TextBlock.Style>
  149. <Style TargetType="{x:Type TextBlock}">
  150. <Setter Property="Visibility" Value="Collapsed"/>
  151. <Style.Triggers>
  152. <DataTrigger Binding="{Binding Text, ElementName=searchQuery}" Value="">
  153. <Setter Property="Visibility" Value="Visible"/>
  154. </DataTrigger>
  155. </Style.Triggers>
  156. </Style>
  157. </TextBlock.Style>
  158. </TextBlock>
  159. </Grid>
  160. </Border>
  161. </Border>
  162. <TextBlock Text="奶茶" Grid.Row="2" Margin="20,10" FontSize="22" />
  163. <TextBlock Text="配方" Grid.Row="2" Grid.Column="1" Margin="10" FontSize="22"/>
  164. <Border BorderBrush="#D5DFE5" BorderThickness="4" Grid.Row="3" Margin="20,0,0,0">
  165. <ListBox ItemsSource="{Binding localTeaWithMilks}" SelectionChanged="ListBox_SelectionChanged" IsEnabled="{Binding MakeEnable}"
  166. Foreground="LightSlateGray">
  167. <ListBox.ItemTemplate>
  168. <DataTemplate >
  169. <Grid>
  170. <TextBlock Text="{Binding GoodNames}" Margin="5,10" FontSize="22"
  171. Background="Transparent" />
  172. </Grid>
  173. </DataTemplate>
  174. </ListBox.ItemTemplate>
  175. </ListBox>
  176. </Border>
  177. <ListBox x:Name="recipeList" Grid.Row="3" Grid.Column="1" Margin="5,10"
  178. ItemsSource="{Binding materialRecipes}" FontSize="18"
  179. Width="200" HorizontalAlignment="Left" Foreground="LightSlateGray">
  180. <ListBox.ItemTemplate>
  181. <DataTemplate >
  182. <Grid>
  183. <StackPanel Orientation="Horizontal">
  184. <TextBlock Text="{Binding Material}" Margin="20,10"/>
  185. <TextBlock Text="{Binding MaterialWeight}" Margin="20,10,0,10"/>
  186. <TextBlock Text="g" Margin="0,10"/>
  187. </StackPanel>
  188. </Grid>
  189. </DataTemplate>
  190. </ListBox.ItemTemplate>
  191. </ListBox>
  192. <Button Grid.Row="4" Style="{StaticResource buttonNormal}" VerticalAlignment="Top" Height="40" Width="150" Margin="20"
  193. Command="{Binding MakeGoodCommand}" IsEnabled="{Binding MakeEnable}">
  194. <Button.Content>
  195. <Grid>
  196. <Grid.ColumnDefinitions>
  197. <ColumnDefinition Width="30"/>
  198. <ColumnDefinition Width="*"/>
  199. </Grid.ColumnDefinitions>
  200. <TextBlock Text="&#xe607;" VerticalAlignment="Center" Foreground="White" FontSize="18" HorizontalAlignment="Center" FontFamily="/BPASmartClient.CustomResource;component/Fonts/MT/#iconfont"/>
  201. <TextBlock Grid.Column="1" Text="制作奶茶" TextAlignment="Left" VerticalAlignment="Center" FontWeight="Bold" Foreground="White" FontSize="16"/>
  202. </Grid>
  203. </Button.Content>
  204. </Button>
  205. </Grid>
  206. </Grid>
  207. </UserControl>