@@ -0,0 +1,23 @@ | |||||
using BPA.Helper; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPA.Model | |||||
{ | |||||
public class NewRecipeModel : NotifyBase | |||||
{ | |||||
public string Id { get { return _mId; } set { _mId = value; OnPropertyChanged(); } } | |||||
private string _mId; | |||||
public string Name { get { return _mName; } set { _mName = value; OnPropertyChanged(); } } | |||||
private string _mName; | |||||
public bool IsChecked { get { return _mIsChecked; } set { _mIsChecked = value; OnPropertyChanged(); } } | |||||
private bool _mIsChecked; | |||||
} | |||||
} |
@@ -10,10 +10,9 @@ namespace BPA.Model | |||||
{ | { | ||||
public class ViewItem : NotifyBase | public class ViewItem : NotifyBase | ||||
{ | { | ||||
public ViewItem(string name, string description, object content, IconType? iconType = null) | |||||
public ViewItem(string name, object content, IconType? iconType = null) | |||||
{ | { | ||||
Name = name; | Name = name; | ||||
Description = description; | |||||
Content = content; | Content = content; | ||||
Icon = iconType; | Icon = iconType; | ||||
} | } | ||||
@@ -14,7 +14,7 @@ | |||||
Margin="0,5,0,0" | Margin="0,5,0,0" | ||||
ui:GridHelper.RowDefinitions="Auto, Auto, *" | ui:GridHelper.RowDefinitions="Auto, Auto, *" | ||||
ui:PanelHelper.Spacing="10"> | ui:PanelHelper.Spacing="10"> | ||||
<TextBlock Style="{StaticResource Head3TextBlock}" Text="{TemplateBinding Title}" /> | |||||
<!--<TextBlock Style="{StaticResource Head3TextBlock}" Text="{TemplateBinding Title}" /> | |||||
<TextBox | <TextBox | ||||
x:Name="descriptionText" | x:Name="descriptionText" | ||||
Grid.Row="1" | Grid.Row="1" | ||||
@@ -23,7 +23,7 @@ | |||||
BorderThickness="0" | BorderThickness="0" | ||||
IsReadOnly="True" | IsReadOnly="True" | ||||
Text="{TemplateBinding Description}" | Text="{TemplateBinding Description}" | ||||
TextWrapping="Wrap" /> | |||||
TextWrapping="Wrap" />--> | |||||
<ui:Card | <ui:Card | ||||
Grid.Row="2" | Grid.Row="2" | ||||
Margin="3,5" | Margin="3,5" | ||||
@@ -36,11 +36,11 @@ | |||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> | SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> | ||||
</ui:Card> | </ui:Card> | ||||
</Grid> | </Grid> | ||||
<ControlTemplate.Triggers> | |||||
<!--<ControlTemplate.Triggers> | |||||
<Trigger Property="Description" Value="{x:Null}"> | <Trigger Property="Description" Value="{x:Null}"> | ||||
<Setter TargetName="descriptionText" Property="Visibility" Value="Collapsed" /> | <Setter TargetName="descriptionText" Property="Visibility" Value="Collapsed" /> | ||||
</Trigger> | </Trigger> | ||||
</ControlTemplate.Triggers> | |||||
</ControlTemplate.Triggers>--> | |||||
</ControlTemplate> | </ControlTemplate> | ||||
</Setter.Value> | </Setter.Value> | ||||
</Setter> | </Setter> | ||||
@@ -1,20 +0,0 @@ | |||||
<UserControl | |||||
x:Class="BPA.SingleDevice.View.DeviceManagementView" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:local="clr-namespace:BPA.SingleDevice.View" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
d:DesignHeight="450" | |||||
d:DesignWidth="800" | |||||
mc:Ignorable="d"> | |||||
<Grid> | |||||
<TextBlock | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
Background="Transparent" | |||||
FontSize="50" | |||||
Foreground="White" | |||||
Text="设备管理" /> | |||||
</Grid> | |||||
</UserControl> |
@@ -0,0 +1,66 @@ | |||||
<UserControl | |||||
x:Class="BPA.SingleDevice.View.NewRecipeView" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:local="clr-namespace:BPA.SingleDevice.View" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:ui="http://rubyer.io/winfx/xaml/toolkit" | |||||
xmlns:vm="clr-namespace:BPA.SingleDevice.ViewModel" | |||||
d:DesignHeight="450" | |||||
d:DesignWidth="800" | |||||
mc:Ignorable="d"> | |||||
<UserControl.DataContext> | |||||
<vm:NewRecipeViewModel /> | |||||
</UserControl.DataContext> | |||||
<Grid> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="40" /> | |||||
<RowDefinition /> | |||||
<RowDefinition Height="40" /> | |||||
</Grid.RowDefinitions> | |||||
<Grid Margin="10,0" ui:GridHelper.Columns="2"> | |||||
<TextBlock FontSize="16" Text="配方名称:" /> | |||||
<TextBox | |||||
Grid.Column="1" | |||||
Margin="0,5" | |||||
Style="{StaticResource DarkTextBox}" | |||||
Text="{Binding RawMaterResultInfo.Name}" /> | |||||
</Grid> | |||||
<ScrollViewer Grid.Row="1"> | |||||
<ListView ItemsSource="{Binding NewRecipeModels}"> | |||||
<ListView.ItemsPanel> | |||||
<ItemsPanelTemplate> | |||||
<UniformGrid Columns="5" /> | |||||
</ItemsPanelTemplate> | |||||
</ListView.ItemsPanel> | |||||
<ListView.ItemTemplate> | |||||
<DataTemplate> | |||||
<CheckBox | |||||
Margin="10,5" | |||||
Content="{Binding Name}" | |||||
FontSize="16" | |||||
IsChecked="{Binding IsChecked}" /> | |||||
</DataTemplate> | |||||
</ListView.ItemTemplate> | |||||
</ListView> | |||||
</ScrollViewer> | |||||
<Grid | |||||
Grid.Row="2" | |||||
Margin="0,5" | |||||
ui:GridHelper.ColumnDefinitions="*,*" | |||||
ui:PanelHelper.Spacing="10"> | |||||
<Button | |||||
Grid.Column="0" | |||||
Command="{Binding SaveCommand}" | |||||
Content="确认" /> | |||||
<Button Grid.Column="1" Content="取消" /> | |||||
</Grid> | |||||
</Grid> | |||||
</UserControl> |
@@ -16,11 +16,11 @@ using System.Windows.Shapes; | |||||
namespace BPA.SingleDevice.View | namespace BPA.SingleDevice.View | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// DeviceManagementView.xaml 的交互逻辑 | |||||
/// NewRecipeView.xaml 的交互逻辑 | |||||
/// </summary> | /// </summary> | ||||
public partial class DeviceManagementView : UserControl | |||||
public partial class NewRecipeView : UserControl | |||||
{ | { | ||||
public DeviceManagementView() | |||||
public NewRecipeView() | |||||
{ | { | ||||
InitializeComponent(); | InitializeComponent(); | ||||
} | } |
@@ -0,0 +1,59 @@ | |||||
<UserControl | |||||
x:Class="BPA.SingleDevice.View.OrderMainView" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:controls="clr-namespace:BPA.SingleDevice.Controls" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:local="clr-namespace:BPA.SingleDevice.View" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:ui="http://rubyer.io/winfx/xaml/toolkit" | |||||
xmlns:vm="clr-namespace:BPA.SingleDevice.ViewModel" | |||||
d:DesignHeight="450" | |||||
d:DesignWidth="800" | |||||
mc:Ignorable="d"> | |||||
<UserControl.DataContext> | |||||
<vm:OrderMainViewModel /> | |||||
</UserControl.DataContext> | |||||
<UserControl.Resources> | |||||
<Style x:Key="listViewStyle" TargetType="ListView"> | |||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" /> | |||||
</Style> | |||||
</UserControl.Resources> | |||||
<Grid Margin="10"> | |||||
<ListView ui:ItemsControlHelper.ItemPadding="0" ItemsSource="{Binding Goods}"> | |||||
<ListView.ItemsPanel> | |||||
<ItemsPanelTemplate> | |||||
<WrapPanel Orientation="Horizontal" /> | |||||
</ItemsPanelTemplate> | |||||
</ListView.ItemsPanel> | |||||
<ListView.ItemTemplate> | |||||
<DataTemplate> | |||||
<controls:ControlDisplay Grid.Row="1" ui:PanelHelper.Spacing="10"> | |||||
<Grid> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="120" /> | |||||
<RowDefinition Height="30" /> | |||||
<RowDefinition /> | |||||
</Grid.RowDefinitions> | |||||
<Border Width="120" Background="Gray" /> | |||||
<TextBlock Grid.Row="1" Text="{Binding}" /> | |||||
<Grid Grid.Row="2" ui:GridHelper.ColumnDefinitions="*,*"> | |||||
<ui:NumericBox | |||||
IsReadOnly="True" | |||||
Style="{StaticResource FrontBackNumericBox}" | |||||
Value="1" /> | |||||
<Button | |||||
Grid.Column="1" | |||||
Margin="10,0,0,0" | |||||
Content="开始下单" /> | |||||
</Grid> | |||||
</Grid> | |||||
</controls:ControlDisplay> | |||||
</DataTemplate> | |||||
</ListView.ItemTemplate> | |||||
</ListView> | |||||
</Grid> | |||||
</UserControl> |
@@ -0,0 +1,28 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using System.Windows; | |||||
using System.Windows.Controls; | |||||
using System.Windows.Data; | |||||
using System.Windows.Documents; | |||||
using System.Windows.Input; | |||||
using System.Windows.Media; | |||||
using System.Windows.Media.Imaging; | |||||
using System.Windows.Navigation; | |||||
using System.Windows.Shapes; | |||||
namespace BPA.SingleDevice.View | |||||
{ | |||||
/// <summary> | |||||
/// OrderMainView.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class OrderMainView : UserControl | |||||
{ | |||||
public OrderMainView() | |||||
{ | |||||
InitializeComponent(); | |||||
} | |||||
} | |||||
} |
@@ -60,11 +60,7 @@ | |||||
<DataGridTextColumn | <DataGridTextColumn | ||||
Width="100" | Width="100" | ||||
Binding="{Binding DeviceNum}" | Binding="{Binding DeviceNum}" | ||||
Header="任务数" /> | |||||
<DataGridTextColumn | |||||
Width="120" | |||||
Binding="{Binding WarehouseNum}" | |||||
Header="完成进度" /> | |||||
Header="是否启用" /> | |||||
<DataGridTextColumn | <DataGridTextColumn | ||||
Width="180" | Width="180" | ||||
Binding="{Binding LastModified}" | Binding="{Binding LastModified}" | ||||
@@ -1,12 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPA.SingleDevice.ViewModel | |||||
{ | |||||
internal class DeviceManagementViewModel | |||||
{ | |||||
} | |||||
} |
@@ -19,9 +19,9 @@ namespace BPA.SingleDevice.ViewModel | |||||
{ | { | ||||
ViewItems = new ObservableCollection<ViewItem> | ViewItems = new ObservableCollection<ViewItem> | ||||
{ | { | ||||
new ViewItem("原料管理", "总览", new RawMaterialManagementView(), IconType.Home2Line), | |||||
new ViewItem("设备管理", "按钮", new DeviceManagementView(), IconType.CheckboxBlankFill), | |||||
new ViewItem("配方管理", "文本框", new RecipeManagementView(), IconType.TBoxLine), | |||||
new ViewItem("原料管理", new RawMaterialManagementView(), IconType.ReservedFill), | |||||
new ViewItem("配方管理", new RecipeManagementView(), IconType.NewspaperFill), | |||||
new ViewItem("点单主页", new OrderMainView(), IconType.Home3Fill), | |||||
}; | }; | ||||
SelecteCommand = new BPARelayCommand<object>(DoNavChanged); | SelecteCommand = new BPARelayCommand<object>(DoNavChanged); | ||||
@@ -0,0 +1,39 @@ | |||||
using BPA.Helper; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using System.Collections.ObjectModel; | |||||
using BPA.Model; | |||||
using Rubyer; | |||||
namespace BPA.SingleDevice.ViewModel | |||||
{ | |||||
public class NewRecipeViewModel : NotifyBase, IDialogDataContext | |||||
{ | |||||
public NewRecipeViewModel() | |||||
{ | |||||
for (int i = 0; i < 60; i++) | |||||
{ | |||||
NewRecipeModels.Add(new NewRecipeModel() | |||||
{ | |||||
Name = $"原料-{i}" | |||||
}); | |||||
} | |||||
} | |||||
public ObservableCollection<NewRecipeModel> NewRecipeModels { get; set; } = new ObservableCollection<NewRecipeModel>(); | |||||
public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; OnPropertyChanged(); } } | |||||
private string _mRecipeName; | |||||
public string Title => ""; | |||||
public event Action<object> RequestClose; | |||||
public void OnDialogOpened(object parameters) | |||||
{ | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,23 @@ | |||||
using BPA.Helper; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using System.Collections.ObjectModel; | |||||
namespace BPA.SingleDevice.ViewModel | |||||
{ | |||||
public class OrderMainViewModel : NotifyBase | |||||
{ | |||||
public OrderMainViewModel() | |||||
{ | |||||
for (int i = 0; i < 20; i++) | |||||
{ | |||||
Goods.Add($"商品-{i}"); | |||||
} | |||||
} | |||||
public ObservableCollection<string> Goods { get; set; } = new ObservableCollection<string>(); | |||||
} | |||||
} |
@@ -29,8 +29,8 @@ namespace BPA.SingleDevice.ViewModel | |||||
AddCommand = new BPARelayCommand(async () => | AddCommand = new BPARelayCommand(async () => | ||||
{ | { | ||||
var content = new AddRawMaterialDialogView(); | |||||
var para = await Dialog.Show(content, new Parameters(), "添加原料", (d) => { }, (d, o) => | |||||
var content = new NewRecipeView(); | |||||
var para = await Dialog.Show(content, new Parameters(), "添加配方", (d) => { }, (d, o) => | |||||
{ | { | ||||
if (o is RawMaterResult rm) | if (o is RawMaterResult rm) | ||||
{ | { | ||||
@@ -45,7 +45,7 @@ namespace BPA.SingleDevice.ViewModel | |||||
LastModified = time | LastModified = time | ||||
}).Result.OnSuccess(() => | }).Result.OnSuccess(() => | ||||
{ | { | ||||
RawMaterInfos.Add(new RawMaterInfo(id, rm.Name, rm.DeviceNum, rm.ChNum, time)); | |||||
//RawMaterInfos.Add(new RawMaterInfo(id, rm.Name, rm.DeviceNum, rm.ChNum, time)); | |||||
}).OnFail(s => { Message.Error("RawMaterialManagementView", $"添加失败:{s}"); }); | }).OnFail(s => { Message.Error("RawMaterialManagementView", $"添加失败:{s}"); }); | ||||
} | } | ||||
}); | }); | ||||
@@ -61,8 +61,8 @@ namespace BPA.SingleDevice.ViewModel | |||||
var para = await Dialog.Show(new AddRawMaterialDialogView(), new RawMaterResult() | var para = await Dialog.Show(new AddRawMaterialDialogView(), new RawMaterResult() | ||||
{ | { | ||||
Name = RawMaterInfos[index].Name, | Name = RawMaterInfos[index].Name, | ||||
DeviceNum = RawMaterInfos[index].DeviceNum, | |||||
ChNum = RawMaterInfos[index].WarehouseNum, | |||||
//DeviceNum = RawMaterInfos[index].DeviceNum, | |||||
//ChNum = RawMaterInfos[index].WarehouseNum, | |||||
Id = RawMaterInfos[index].Id, | Id = RawMaterInfos[index].Id, | ||||
}, "原料编辑", (d) => { }, (d, o) => | }, "原料编辑", (d) => { }, (d, o) => | ||||
{ | { | ||||
@@ -79,9 +79,9 @@ namespace BPA.SingleDevice.ViewModel | |||||
}).Result.OnSuccess(() => | }).Result.OnSuccess(() => | ||||
{ | { | ||||
RawMaterInfos[index].Name = rm.Name; | RawMaterInfos[index].Name = rm.Name; | ||||
RawMaterInfos[index].DeviceNum = rm.DeviceNum; | |||||
RawMaterInfos[index].WarehouseNum = rm.ChNum; | |||||
RawMaterInfos[index].LastModified = time; | |||||
//RawMaterInfos[index].DeviceNum = rm.DeviceNum; | |||||
//RawMaterInfos[index].WarehouseNum = rm.ChNum; | |||||
//RawMaterInfos[index].LastModified = time; | |||||
}).OnFail(s => { Message.Error("RawMaterialManagementView", $"修改失败:{s}"); }); | }).OnFail(s => { Message.Error("RawMaterialManagementView", $"修改失败:{s}"); }); | ||||
} | } | ||||
}); | }); | ||||