applelon 2 лет назад
Родитель
Сommit
f9a457f10e
35 измененных файлов: 1647 добавлений и 85 удалений
  1. +23
    -0
      BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
  2. +46
    -0
      BPASmartClient.CustomResource/Converters/ColorConverter.cs
  3. +45
    -0
      BPASmartClient.CustomResource/Converters/TextConverter.cs
  4. Двоичные данные
     
  5. Двоичные данные
     
  6. Двоичные данные
     
  7. Двоичные данные
     
  8. Двоичные данные
     
  9. Двоичные данные
     
  10. Двоичные данные
     
  11. Двоичные данные
     
  12. +24
    -0
      BPASmartClient.CustomResource/RecDictionarys/RecTitleBarButton.xaml
  13. +0
    -4
      BPASmartClient.CustomResource/RecDictionarys/RecTitleBarButtonStyle.xaml
  14. +21
    -3
      BPASmartClient.CustomResource/Themes/GenricStyle.xaml
  15. +64
    -25
      BPASmartClient.CustomResource/Themes/MyStyle.xaml
  16. +32
    -0
      BPASmartClient.CustomResource/UserControls/DateTimeUI.xaml
  17. +56
    -0
      BPASmartClient.CustomResource/UserControls/DateTimeUI.xaml.cs
  18. +6
    -0
      BPASmartClient.ViewModel/BPASmartClient.ViewModel.csproj
  19. +251
    -0
      BPASmartClient.ViewModel/LogViewModel.cs
  20. +25
    -0
      BPASmartClient.ViewModel/MainViewModel.cs
  21. +97
    -0
      BPASmartClient.ViewModel/OrderListDialogViewModel.cs
  22. +124
    -0
      BPASmartClient.ViewModel/OrderStatusViewModel.cs
  23. +25
    -6
      BPASmartClient/App.xaml
  24. +90
    -2
      BPASmartClient/App.xaml.cs
  25. +1
    -0
      BPASmartClient/BPASmartClient.csproj
  26. +103
    -0
      BPASmartClient/Control/LogOrAlarmView.xaml
  27. +28
    -0
      BPASmartClient/Control/LogOrAlarmView.xaml.cs
  28. +65
    -0
      BPASmartClient/Control/LogView.xaml
  29. +28
    -0
      BPASmartClient/Control/LogView.xaml.cs
  30. +354
    -0
      BPASmartClient/Control/OrderStatusView.xaml
  31. +28
    -0
      BPASmartClient/Control/OrderStatusView.xaml.cs
  32. +45
    -34
      BPASmartClient/MainWindow.xaml
  33. +37
    -7
      BPASmartClient/MainWindow.xaml.cs
  34. +6
    -4
      BPASmartClient/OrderListDialogView.xaml
  35. +23
    -0
      BPASmartClient/OrderListDialogView.xaml.cs

+ 23
- 0
BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj Просмотреть файл

@@ -50,13 +50,19 @@
<None Remove="Image\内部.png" />
<None Remove="Image\告警.png" />
<None Remove="Image\告警\Wifi_NO.ico" />
<None Remove="Image\告警\Wifi_NO.png" />
<None Remove="Image\告警\Wifi_OK.ico" />
<None Remove="Image\告警\Wifi_OK.png" />
<None Remove="Image\告警\严重告警.png" />
<None Remove="Image\告警\告警.png" />
<None Remove="Image\告警\成功0ecb74.png" />
<None Remove="Image\告警\报错.png" />
<None Remove="Image\告警\提醒359fda.png" />
<None Remove="Image\告警\无告警.png" />
<None Remove="Image\告警\无告警1.png" />
<None Remove="Image\告警\正常.png" />
<None Remove="Image\告警\消息.png" />
<None Remove="Image\告警\轻微告警.png" />
<None Remove="Image\告警\预警f44b4b.png" />
<None Remove="Image\图层1.png" />
<None Remove="Image\圆形.png" />
@@ -130,8 +136,10 @@
<None Remove="Image\表格\表格顶左.png" />
<None Remove="Image\表格标题背景2.png" />
<None Remove="Image\边框效果2.png" />
<None Remove="Image\边角.png" />
<None Remove="Image\退出.png" />
<None Remove="Image\退出按钮.png" />
<None Remove="Image\阴影边框.png" />
<None Remove="Image\顶部.png" />
<None Remove="Image\顶部切图\Button_No.png" />
<None Remove="Image\顶部切图\Button_Select.png" />
@@ -149,10 +157,21 @@
<None Remove="Image\黑菠萝科技.png" />
</ItemGroup>

<ItemGroup>
<Resource Include="Image\告警\Wifi_NO.png" />
<Resource Include="Image\告警\Wifi_OK.png" />
<Resource Include="Image\告警\严重告警.png" />
<Resource Include="Image\告警\无告警.png" />
<Resource Include="Image\告警\无告警1.png" />
<Resource Include="Image\告警\轻微告警.png" />
<Resource Include="Image\边角.png" />
</ItemGroup>

<ItemGroup>
<Resource Include="Image\HBL.png" />
<Resource Include="Image\告警\Wifi_NO.ico" />
<Resource Include="Image\告警\Wifi_OK.ico" />
<Resource Include="Image\阴影边框.png" />
<Resource Include="Image\顶部切图\Button_No.png" />
<Resource Include="Image\顶部切图\Button_Select.png" />
<Resource Include="Image\顶部切图\Top_L.png" />
@@ -169,6 +188,10 @@
<Folder Include="Themes\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BPA.Message" Version="1.0.11" />
</ItemGroup>

<ItemGroup>
<Resource Include="Fonts\iconfont.ttf" />
<Resource Include="Image\bg.png" />


+ 46
- 0
BPASmartClient.CustomResource/Converters/ColorConverter.cs Просмотреть файл

@@ -0,0 +1,46 @@
using BPA.Message.Enum;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace BPASmartClient.CustomResource.Converters
{
public class ColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
SolidColorBrush returnValue = new SolidColorBrush(Color.FromArgb(255, 0, 204, 255));
switch ((ORDER_STATUS)value)
{
case ORDER_STATUS.WAIT:
returnValue = new SolidColorBrush(Color.FromArgb(255, 0, 204, 255));
break;
case ORDER_STATUS.COOKING:
returnValue = new SolidColorBrush(Color.FromArgb(255, 0, 255, 127));
break;
case ORDER_STATUS.COMPLETED_COOK:
returnValue = new SolidColorBrush(Color.FromArgb(255, 255, 215, 00));
break;
case ORDER_STATUS.COMPLETED_TAKE:
returnValue = new SolidColorBrush(Color.FromArgb(255, 102, 204, 153));
break;
case ORDER_STATUS.ERR_NOT_REPLY_WHEN_COOKING:
returnValue = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0));
break;
default:
break;
}
return returnValue;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

+ 45
- 0
BPASmartClient.CustomResource/Converters/TextConverter.cs Просмотреть файл

@@ -0,0 +1,45 @@
using BPA.Message.Enum;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace BPASmartClient.CustomResource.Converters
{
public class TextConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
string Text = string.Empty;
switch ((ORDER_STATUS)value)
{
case ORDER_STATUS.WAIT:
Text = "等待制作";
break;
case ORDER_STATUS.COOKING:
Text = "开始制作";
break;
case ORDER_STATUS.COMPLETED_COOK:
Text = "等待取餐";
break;
case ORDER_STATUS.COMPLETED_TAKE:
Text = "取餐完成";
break;
case ORDER_STATUS.ERR_NOT_REPLY_WHEN_COOKING:
Text = "制作超时";
break;
default:
break;
}
return Text;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

Двоичные данные
Просмотреть файл


Двоичные данные
Просмотреть файл


Двоичные данные
Просмотреть файл


Двоичные данные
Просмотреть файл


Двоичные данные
Просмотреть файл


Двоичные данные
Просмотреть файл


Двоичные данные
Просмотреть файл


Двоичные данные
Просмотреть файл


+ 24
- 0
BPASmartClient.CustomResource/RecDictionarys/RecTitleBarButton.xaml Просмотреть файл

@@ -0,0 +1,24 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="TitleBarStyle" TargetType="Button">
<Setter Property="Foreground" Value="#5500c2f4" />
<Setter Property="FontSize" Value="24" />
<Setter Property="FontFamily" Value="../Fonts/#iconfont" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Name="TitleBarBr" Background="Transparent">
<ContentPresenter
Margin="{TemplateBinding Margin}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="TitleBarBr" Property="Background" Value="#33ffffff" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

+ 0
- 4
BPASmartClient.CustomResource/RecDictionarys/RecTitleBarButtonStyle.xaml Просмотреть файл

@@ -1,4 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</ResourceDictionary>

+ 21
- 3
BPASmartClient.CustomResource/Themes/GenricStyle.xaml Просмотреть файл

@@ -527,7 +527,7 @@
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="Foreground" Value="#abf4ff"></Setter>
<Setter Property="FontSize" Value="12"></Setter>
<Setter Property="FontSize" Value="10"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridRow}">
@@ -1396,6 +1396,22 @@
</Setter>
</Style>

<Style x:Key="Separator1" TargetType="{x:Type Separator}">
<Setter Property="Height" Value="1"/>
<Setter Property="Margin" Value="0,4,0,4"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Separator}">
<Border >
<Border.Background>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/顶部线条.png" />
</Border.Background>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<!-- TopLevelHeader -->
<ControlTemplate x:Key="{x:Static MenuItem.TopLevelHeaderTemplateKey}" TargetType="{x:Type MenuItem}">
<Border Name="Border" Cursor="Hand" >
@@ -1768,8 +1784,10 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<StackPanel Background="Transparent" SnapsToDevicePixels="True" Orientation="Horizontal">
<Image x:Name="image1" Source="/BPASmartClient.CustomResource;component/Image/Cb_HalfChecked.png" Width="12" Height="14"></Image>

<Grid>
<Image Source="/BPASmartClient.CustomResource;component/Image/Cb_HalfChecked.png" Width="12" Height="14"></Image>
<Image x:Name="image1" Source="/BPASmartClient.CustomResource;component/Image/Cb_HalfChecked.png" Width="12" Height="14"></Image>
</Grid>
<ContentPresenter Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</StackPanel>
<ControlTemplate.Triggers>


+ 64
- 25
BPASmartClient.CustomResource/Themes/MyStyle.xaml Просмотреть файл

@@ -21,22 +21,23 @@
<!--#region ToggleButton-->
<Style x:Key="StatusBtnStyle告警" TargetType="ToggleButton">
<Style.Setters>
<Setter Property="Width" Value="36"></Setter>
<Setter Property="Height" Value="32"></Setter>
<Setter Property="Width" Value="30"></Setter>
<Setter Property="Height" Value="19"></Setter>
<Setter Property="Cursor" Value="Hand"></Setter>
<Setter Property="IsChecked" Value="{Binding IsCheck,Mode=TwoWay}"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Grid Cursor="Hand">
<Border x:Name="bd1" Cursor="Hand" Visibility="Collapsed" Width="25" Height="13" HorizontalAlignment="Right" Panel.ZIndex="100" VerticalAlignment="Top" Margin="0,-5,-5,0" CornerRadius="3" Background="#33FF0000" >
<TextBlock Text="{Binding ListNum}" Foreground="#FF2AA7D3" HorizontalAlignment="Center"></TextBlock>
<Border x:Name="bd1" Cursor="Hand" Visibility="Collapsed" Width="25" Height="13" HorizontalAlignment="Right" Panel.ZIndex="100" VerticalAlignment="Top" Margin="0,-10,-5,0" CornerRadius="3" Background="#2600CAFF" >
<TextBlock Text="{Binding ListNum}" Foreground="#FF00E6F7" HorizontalAlignment="Center" FontSize="8"></TextBlock>
<!---->
</Border>
<Image x:Name="image1" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Source="/BPASmartClient.CustomResource;component/Image/告警.png" Panel.ZIndex="0" Stretch="UniformToFill" ></Image>
<Image x:Name="image1" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Source="/BPASmartClient.CustomResource;component/Image/告警/无告警.png" Panel.ZIndex="0" UseLayoutRounding="True" SnapsToDevicePixels="True" RenderOptions.BitmapScalingMode="HighQuality" ></Image>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="image1" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/告警.png"></Setter>
<Setter TargetName="image1" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/告警/严重告警.png"></Setter>
</Trigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
@@ -44,7 +45,7 @@
<Condition Binding="{Binding IsAlarm}" Value="true"></Condition>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
<Setter TargetName="image1" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/告警.png"></Setter>
<Setter TargetName="image1" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/告警/严重告警.png"></Setter>
<Setter TargetName="bd1" Property="Visibility" Value="Visible"></Setter>
</MultiDataTrigger.Setters>
</MultiDataTrigger>
@@ -65,11 +66,11 @@
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Grid Cursor="Hand">
<Image x:Name="image1" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Source="/BPASmartClient.CustomResource;component/Image/告警/Wifi_NO.ico" Panel.ZIndex="0" ></Image>
<Image x:Name="image1" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Source="/BPASmartClient.CustomResource;component/Image/告警/Wifi_NO.png" Panel.ZIndex="0" UseLayoutRounding="True" SnapsToDevicePixels="True" RenderOptions.BitmapScalingMode="HighQuality"></Image>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="image1" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/告警/Wifi_OK.ico"></Setter>
<Setter TargetName="image1" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/告警/Wifi_OK.png"></Setter>
</Trigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
@@ -77,7 +78,7 @@
<Condition Binding="{Binding IsAlarm}" Value="true"></Condition>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
<Setter TargetName="image1" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/告警/Wifi_OK.ico"></Setter>
<Setter TargetName="image1" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/告警/Wifi_OK.png"></Setter>
</MultiDataTrigger.Setters>
</MultiDataTrigger>
</ControlTemplate.Triggers>
@@ -89,6 +90,14 @@
<!--#endregion-->
<!--#region Image -->
<Style TargetType="Image">
<Style.Setters>
<Setter Property="UseLayoutRounding" Value="True"></Setter>
<Setter Property="SnapsToDevicePixels" Value="True"></Setter>
<Setter Property="RenderOptions.BitmapScalingMode" Value="HighQuality"></Setter>
</Style.Setters>
</Style>

<Style x:Key="imagetop_L" TargetType="Image">
<Style.Setters>
<Setter Property="Height" Value="80"></Setter>
@@ -274,10 +283,30 @@
</Style.Setters>
</Style>

<Style x:Key="bordertop矩形" TargetType="Border">
<Style x:Key="border阴影边框" TargetType="Border">
<Style.Setters>
<Setter Property="Height" Value="50"></Setter>
<Setter Property="VerticalAlignment" Value="Top"></Setter>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/阴影边框.png"/>
</Setter.Value>
</Setter>
</Style.Setters>
</Style>

<Style x:Key="border边角" TargetType="Border">
<Style.Setters>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/边角.png"/>
</Setter.Value>
</Setter>
</Style.Setters>
</Style>

<Style x:Key="bordertop矩形" TargetType="Border">
<Style.Setters>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/顶部切图/顶部矩形.png"/>
@@ -285,7 +314,7 @@
</Setter>
</Style.Setters>
</Style>
<Style x:Key="bordertopTitle" TargetType="Border">
<Style.Setters>
<Setter Property="Height" Value="100"></Setter>
@@ -297,6 +326,16 @@
</Style.Setters>
</Style>

<Style x:Key="borderFromTitle" TargetType="Border">
<Style.Setters>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/tittle.png"/>
</Setter.Value>
</Setter>
</Style.Setters>
</Style>

<Style x:Key="border窗体背景1" TargetType="Border">
<Style.Setters>
<Setter Property="Background">
@@ -542,11 +581,11 @@
<Style.Setters>
<Setter Property="HorizontalAlignment" Value="Right"></Setter>
<Setter Property="VerticalAlignment" Value="Bottom"></Setter>
<Setter Property="Height" Value="20"></Setter>
<Setter Property="Width" Value="20"></Setter>
<Setter Property="Height" Value="23"></Setter>
<Setter Property="Width" Value="22"></Setter>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/表格/表格底右.png" Stretch="None"/>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/窗体样式/From/右下.png" Stretch="None"/>
</Setter.Value>
</Setter>
</Style.Setters>
@@ -556,11 +595,11 @@
<Style.Setters>
<Setter Property="HorizontalAlignment" Value="Left"></Setter>
<Setter Property="VerticalAlignment" Value="Bottom"></Setter>
<Setter Property="Height" Value="20"></Setter>
<Setter Property="Width" Value="20"></Setter>
<Setter Property="Height" Value="22"></Setter>
<Setter Property="Width" Value="23"></Setter>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/表格/表格底左.png" Stretch="None"/>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/窗体样式/From/左下.png" Stretch="None"/>
</Setter.Value>
</Setter>
</Style.Setters>
@@ -570,11 +609,11 @@
<Style.Setters>
<Setter Property="HorizontalAlignment" Value="Left"></Setter>
<Setter Property="VerticalAlignment" Value="Top"></Setter>
<Setter Property="Height" Value="90"></Setter>
<Setter Property="Width" Value="20"></Setter>
<Setter Property="Height" Value="22"></Setter>
<Setter Property="Width" Value="23"></Setter>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/表格/表格顶左.png" Stretch="None"/>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/窗体样式/From/左边.png" Stretch="None"/>
</Setter.Value>
</Setter>
</Style.Setters>
@@ -584,11 +623,11 @@
<Style.Setters>
<Setter Property="HorizontalAlignment" Value="Right"></Setter>
<Setter Property="VerticalAlignment" Value="Top"></Setter>
<Setter Property="Height" Value="20"></Setter>
<Setter Property="Width" Value="20"></Setter>
<Setter Property="Height" Value="23"></Setter>
<Setter Property="Width" Value="22"></Setter>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/表格/表格顶右.png" Stretch="None"/>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/窗体样式/From/右上.png" Stretch="None"/>
</Setter.Value>
</Setter>
</Style.Setters>
@@ -669,7 +708,7 @@
</VisualStateManager.VisualStateGroups>
<StackPanel HorizontalAlignment="Center" Margin="5" Orientation="Horizontal">
<Image Source="/BPASmartClient.CustomResource;component/Image/退出.png" Width="16" ></Image>
<TextBlock Margin="5,0,0,0" x:Name="textBlock" Text="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Foreground="#A5FFFFFF" />
<TextBlock Margin="5,0,0,0" x:Name="textBlock" Text="{TemplateBinding Content}" FontSize="14" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Foreground="#A5FFFFFF" />
</StackPanel>

</Border>


+ 32
- 0
BPASmartClient.CustomResource/UserControls/DateTimeUI.xaml Просмотреть файл

@@ -0,0 +1,32 @@
<UserControl x:Class=" BPASmartClient.CustomResource.UserControls.DateTimeUI"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.CustomResource.UserControls"
mc:Ignorable="d"
d:DesignHeight="50" d:DesignWidth="100">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml"/>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Grid.Row="0">
<TextBlock x:Name="time" FontSize="16">14:48:30</TextBlock>
<Image Style="{DynamicResource timeImage}" Margin="10,0,0,0"></Image>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal">
<TextBlock x:Name="dateRL" FontSize="10">星期一</TextBlock>

<TextBlock x:Name="date" Margin="10,0,0,0" FontSize="10">2021-11-13</TextBlock>
</StackPanel>
</Grid>
</UserControl>

+ 56
- 0
BPASmartClient.CustomResource/UserControls/DateTimeUI.xaml.cs Просмотреть файл

@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
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 BPASmartClient.CustomResource.UserControls
{
/// <summary>
/// DateTimeUI.xaml 的交互逻辑
/// </summary>
public partial class DateTimeUI : UserControl
{
public DateTimeUI()
{
InitializeComponent();
Task.Run(new Action(() =>
{
while (true)
{
this.Dispatcher.Invoke(new Action(() =>
{
time.Text = DateTime.Now.ToString("HH:mm:ss");
date.Text = DateTime.Now.ToString("yyyy-MM-dd");
if (DateTime.Now.DayOfWeek == DayOfWeek.Monday)
dateRL.Text = "星期一";
else if (DateTime.Now.DayOfWeek == DayOfWeek.Tuesday)
dateRL.Text = "星期二";
else if (DateTime.Now.DayOfWeek == DayOfWeek.Wednesday)
dateRL.Text = "星期三";
else if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday)
dateRL.Text = "星期四";
else if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
dateRL.Text = "星期五";
else if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
dateRL.Text = "星期六";
else if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
dateRL.Text = "星期天";

}));
Thread.Sleep(500);
}
}));
}
}
}

+ 6
- 0
BPASmartClient.ViewModel/BPASmartClient.ViewModel.csproj Просмотреть файл

@@ -10,4 +10,10 @@
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BPASmartClient.Business\BPASmartClient.Business.csproj" />
<ProjectReference Include="..\BPASmartClient.Helper\BPASmartClient.Helper.csproj" />
<ProjectReference Include="..\BPASmartClient.Model\BPASmartClient.Model.csproj" />
</ItemGroup>

</Project>

+ 251
- 0
BPASmartClient.ViewModel/LogViewModel.cs Просмотреть файл

@@ -0,0 +1,251 @@
using BPASmartClient.Message;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using System.Windows.Threading;

namespace BPASmartClient.ViewModel
{
/// <summary>
/// 日志界面
/// </summary>
public class LogViewModel :ObservableObject
{
public DispatcherTimer dispatcherTimer;

private ObservableCollection<LogModel> _LogModels;
public ObservableCollection<LogModel> LogDataGrid
{
get
{
return _LogModels;
}
set
{
if (_LogModels == value)
return;
_LogModels = value;
OnPropertyChanged("LogDataGrid");
}
}

public LogViewModel()
{
LogDataGrid = new ObservableCollection<LogModel>();
MessageLog.GetInstance.InfoNotify = new Action<string>((s) =>
{
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{
LogDataGrid.Insert(0,new LogModel { message = s,type = "Info" });
}));
});
MessageLog.GetInstance.ExInfoNotify = new Action<string>((s) =>
{
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{
LogDataGrid.Insert(0,new LogModel { message = s,type = "Error" });
}));
});
ExcelCommand = new RelayCommand(() =>
{
ExcellOrder();
});

//dispatcherTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) };//1秒一流转
//dispatcherTimer.Tick += delegate
//{
// if (TimedClear)
// {
// }
//};
//dispatcherTimer.Start();
}

/// <summary>
/// 导出数据
/// </summary>
public void ExcellOrder()
{
if (LogDataGrid.Count > 0)
{
string text = "时间 类型 日志内容\n";
LogDataGrid?.ToList().ForEach(temp =>
{
text = text + temp.time + " " + temp.type + " " + temp.message+ "\n";
});
SaveFileDialog openfile = new SaveFileDialog();
openfile.Filter = "Txt文件(*.txt)|*.txt";
if (openfile.ShowDialog() == false)
{
return;
}
string path = openfile.FileName;
if (!System.IO.File.Exists(path))
{
//没有则创建这个文件
FileStream fs1 = new FileStream(path,FileMode.Create,FileAccess.Write);//创建写入文件
StreamWriter sw = new StreamWriter(fs1);
sw.WriteLine(text);//开始写入值
sw.Close();
fs1.Close();
}
else
{
FileStream fs = new FileStream(path,FileMode.Open,FileAccess.Write);
StreamWriter sr = new StreamWriter(fs);
sr.WriteLine(text);//开始写入值
sr.Close();
fs.Close();
}
string msg = string.Format("记录导出完成,共导出记录{0}条,是否打开!",LogDataGrid.Count);
if (System.Windows.MessageBox.Show(msg,"提示",MessageBoxButton.OKCancel) == MessageBoxResult.OK)
{
OpenFile(openfile.FileName);
}
}
else
System.Windows.MessageBox.Show("无数据!");

}
/// <summary>
/// 打开指定路径下文件,比如:Word、Excel、Dll、图片等都可以(前提是你已经安装打开程序的对应软件)
/// </summary>
/// <param name="NewFileName">eg:D:\Test\模版8.doc</param>
/// <param name="NewFileName">eg:D:\Test\模版8.doc</param>
private void OpenFile(string NewFileName)
{
Process process = new Process();
ProcessStartInfo processStartInfo = new ProcessStartInfo(NewFileName);
process.StartInfo = processStartInfo;
#region 下面这段被注释掉代码(可以用来全屏打开代码)
//建立新的系统进程
////System.Diagnostics.Process process = new System.Diagnostics.Process();
//设置文件名,此处为图片的真实路径 + 文件名(需要有后缀)
////process.StartInfo.FileName = NewFileName;
//此为关键部分。设置进程运行参数,此时为最大化窗口显示图片。
////process.StartInfo.Arguments = "rundll32.exe C://WINDOWS//system32//shimgvw.dll,ImageView_Fullscreen";
// 此项为是否使用Shell执行程序,因系统默认为true,此项也可不设,但若设置必须为true
process.StartInfo.UseShellExecute = true;
#endregion
try
{
process.Start();
try
{
// process.WaitForExit();
}
catch (Exception ex)
{
throw ex;
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
try
{
if (process != null)
{
process.Close();
process = null;
}
}
catch { }
}
}

private bool _RealTimeModel = true;
public bool RealTimeModel
{
get
{
return _RealTimeModel;
}
set
{
if (_RealTimeModel == value)
return;
_RealTimeModel = value;
OnPropertyChanged("RealTimeModel");
}
}

private bool _TimedClear = true;
public bool TimedClear
{
get
{
return _TimedClear;
}
set
{
if (_TimedClear == value)
return;
_TimedClear = value;
OnPropertyChanged("TimedClear");
}
}

public RelayCommand ExcelCommand { get; set; }

}

public class LogModel :ObservableObject
{
public string time { get; set; }

private string _type;
public string type
{
get
{
return _type;
}
set
{
if (_type == value)
return;
_type = value;
if(_type== "Error") foreground = new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#ed0032"));

OnPropertyChanged("type");
}
}
public string message { get; set; }

private Brush _foreground;
public Brush foreground
{
get
{
return _foreground;
}
set
{
if (_foreground == value)
return;
_foreground = value;
OnPropertyChanged("foreground");
}
}
public LogModel()
{
foreground=new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#21bb2e"));
time =DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
}
}

+ 25
- 0
BPASmartClient.ViewModel/MainViewModel.cs Просмотреть файл

@@ -0,0 +1,25 @@
using BPASmartClient.Business;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;

namespace BPASmartClient.ViewModel
{
/// <summary>
/// 主界面
/// </summary>
public class MainViewModel :ObservableObject
{
public MainViewModel()
{

}
}
}

+ 97
- 0
BPASmartClient.ViewModel/OrderListDialogViewModel.cs Просмотреть файл

@@ -1,18 +1,115 @@
using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading;
using BPA.Message.Enum;
using BPASmartClient.Helper;
using BPASmartClient.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using Microsoft.Toolkit.Mvvm.Messaging;

namespace BPASmartClient.ViewModel
{
public class OrderListDialogViewModel : ObservableObject
{
public static bool IsAutoClose = false;
public OrderListDialogViewModel()
{
Init();
}

private void Init()
{
CloseButton();
CancelButton();
ConfirmButton();
if (Json<KeepDataBase>.Data.orderLists.Count > 0)
{
ThreadManage.GetInstance().Start(new Action(() =>
{
Thread.Sleep(10000);
if (!IsAutoClose) WeakReferenceMessenger.Default.Send("false", "Close");
}), "延时退出");
}
AllSelected = true;
}

/// <summary>
/// 关闭按钮
/// </summary>
private void CloseButton()
{
CloseCommand = new RelayCommand(() =>
{
Json<KeepDataBase>.Data.orderLists.Clear();
WeakReferenceMessenger.Default.Send("false", "Close");
Json<KeepDataBase>.Save();
});
}

/// <summary>
/// 取消按钮
/// </summary>
private void CancelButton()
{
CancelCommand = new RelayCommand(() =>
{
Json<KeepDataBase>.Data.orderLists.Clear();
WeakReferenceMessenger.Default.Send("false", "Close");
Json<KeepDataBase>.Save();
});
}

/// <summary>
/// 确定按钮
/// </summary>
private void ConfirmButton()
{
ConfirmCommand = new RelayCommand(() =>
{
var res = orderStatusLists.Where(p => p.IsSelected == true).ToList();
if (res != null)
{
Json<KeepDataBase>.Data.orderLists.Clear();
foreach (var item in res)
{
item.OrderStatus = ORDER_STATUS.WAIT;
Json<KeepDataBase>.Data.orderLists.Add(item);
}
}
WeakReferenceMessenger.Default.Send("true", "Close");
});
}

/// <summary>
/// 全选标志
/// </summary>
public bool AllSelected
{
get { return _mAllSelected; }
set
{
_mAllSelected = value;
OnPropertyChanged();
for (int i = 0; i < orderStatusLists.Count; i++)
{
orderStatusLists.ElementAt(i).IsSelected = value;
}
}
}
private bool _mAllSelected = true;

public RelayCommand CloseCommand { get; set; }

public RelayCommand CancelCommand { get; set; }

public RelayCommand ConfirmCommand { get; set; }

public ObservableCollection<OrderData> orderStatusLists
{
get { return Json<KeepDataBase>.Data.orderLists; }
set { Json<KeepDataBase>.Data.orderLists = value; }
}
}
}

+ 124
- 0
BPASmartClient.ViewModel/OrderStatusViewModel.cs Просмотреть файл

@@ -0,0 +1,124 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using BPA.Message;
using BPA.Message.Enum;
using BPASmartClient.Helper;
using BPASmartClient.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;

namespace BPASmartClient.ViewModel
{
public class OrderStatusViewModel : ObservableObject
{
public OrderStatusViewModel()
{

}

/// <summary>
/// 订单状态列表
/// </summary>
public static ObservableCollection<OrderData> orderStatusLists
{
get { return Json<KeepDataBase>.Data.orderLists; }
set { Json<KeepDataBase>.Data.orderLists = value; }
}

/// <summary>
/// 等待取餐列表
/// </summary>
public static ObservableCollection<OrderData> WaitTakeMeal { get; set; } = new ObservableCollection<OrderData>();

/// <summary>
/// MQTT 大屏取餐通知委托
/// </summary>
public void MqttReceive()
{
//清除订单数据
ActionManage.GetInstance.Register(new Action(() =>
{
Application.Current.Dispatcher.Invoke(() =>
{
orderStatusLists.Clear();
WaitTakeMeal.Clear();
});
}), "ClearOrders");

ActionManage.GetInstance.Register(new Action<object>((o) =>
{
if (o is MorkOrderPush morkOrderpush)
{
System.Windows.Application.Current?.Dispatcher.BeginInvoke((Action)delegate
{
var result = orderStatusLists.FirstOrDefault(p => p.OrderPush.SuborderId == morkOrderpush.SuborderId);
if (result == null)
{
orderStatusLists.Add(new OrderData()
{
OrderPush = morkOrderpush,
OrderStatus = ORDER_STATUS.WAIT,
IsSelected = true,
StartDate = DateTime.Now.ToString("HH:mm:ss")
});
}
});
}
}), "AddOrder");

ActionManage.GetInstance.Register(new Action<object>((o) =>
{
if (o is OrderStatusChange orderStatusChange)
{
Application.Current?.Dispatcher.BeginInvoke((Action)delegate
{
int index = Array.FindIndex(orderStatusLists.ToArray(), p => p.OrderPush.SuborderId == orderStatusChange.SuborderId);

switch (orderStatusChange.CookingStatus)
{
case ORDER_STATUS.COOKING:
if (index >= 0 && index < orderStatusLists.Count)
orderStatusLists.ElementAt(index).OrderStatus = orderStatusChange.CookingStatus;
break;
case ORDER_STATUS.COMPLETED_COOK:
if (index >= 0 && index < orderStatusLists.Count)
{
Application.Current.Dispatcher.BeginInvoke((Action)delegate
{
orderStatusLists.ElementAt(index).OrderStatus = orderStatusChange.CookingStatus;
orderStatusLists.ElementAt(index).EndDate = DateTime.Now.ToString("HH:mm:ss");
TimeSpan timeSpan = DateTime.Now.Subtract(Convert.ToDateTime(orderStatusLists.ElementAt(index).StartDate));
orderStatusLists.ElementAt(index).CompleteDate = $"{timeSpan.TotalSeconds.ToString("0.00")} S";
WaitTakeMeal.Insert(0, orderStatusLists.ElementAt(index));
orderStatusLists.RemoveAt(index);
});
}

break;
case ORDER_STATUS.COMPLETED_TAKE:
var re = WaitTakeMeal.FirstOrDefault(p => p.OrderPush.SuborderId == orderStatusChange.SuborderId);
if (re != null)
{
Application.Current.Dispatcher.BeginInvoke((Action)delegate
{
WaitTakeMeal.Remove(re);
Json<KeepDataBase>.Data.orderLists.Remove(re);
});
}
break;
default:
break;
}
});

}
}), "OrderStatusChange");
}


}
}

+ 25
- 6
BPASmartClient/App.xaml Просмотреть файл

@@ -1,9 +1,28 @@
<Application x:Class="BPASmartClient.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:BPASmartClient"
StartupUri="MainWindow.xaml">
<Application
x:Class="BPASmartClient.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters;assembly=BPASmartClient.CustomResource"
xmlns:local="clr-namespace:BPASmartClient">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>

<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecCheckBox.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecTitleBarButton.xaml" />
<!--<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml"/>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml"/>-->

<ResourceDictionary>
<con:ColorConverter x:Key="ColorConverter" />
<con:TextConverter x:Key="TextConverter" />
</ResourceDictionary>

<ResourceDictionary>
<ImageBrush x:Key="hbl" ImageSource="pack://application:,,,/BPASmartClient.CustomResource;component/Image/HBL.png" />
</ResourceDictionary>

</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

+ 90
- 2
BPASmartClient/App.xaml.cs Просмотреть файл

@@ -1,17 +1,105 @@
using System;
using BPASmartClient.Helper;
using BPASmartClient.Message;
using BPASmartClient.Model;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Forms;

namespace BPASmartClient
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
public partial class App : System.Windows.Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
SystemHelper.GetInstance.CreateDesktopShortcut();
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
MainWindow mainView = new MainWindow();
mainView.Show();
SplitScreenDisplay();
NoCompleteOrderInit();
}

/// <summary>
/// 分屏显示
/// </summary>
private void SplitScreenDisplay()
{
if (Screen.AllScreens.Length == 3)
{
//left = new MORKD_Window_Left();
//right = new MORKD_Window_Right();

//Screen[] screen = Screen.AllScreens;
//Rectangle[] rectangle = new Rectangle[screen.Length];
//Window[] windows = new Window[screen.Length];
//windows[0] = mainView;
//windows[1] = left;
//windows[2] = right;
//for (int i = 0; i < screen.Length; i++)
//{
// rectangle[i] = screen[i].WorkingArea;
// windows[i].Height = rectangle[i].Height;
// windows[i].Width = rectangle[i].Width;
// windows[i].Top = rectangle[i].Top;
// windows[i].Left = rectangle[i].Left;
//}

//left.Show();
//right.Show();
//windows[1].Owner = windows[0];
//windows[2].Owner = windows[0];
}
}

/// <summary>
/// 未完成订单初始化
/// </summary>
private void NoCompleteOrderInit()
{
if (Json<KeepDataBase>.Data.orderLists.Count > 0)
{
OrderListDialogView listDialogView = new OrderListDialogView();
listDialogView.ShowDialog();
}
}

private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
var ErroLog = e.ExceptionObject.ToString();
MessageLog.GetInstance.Show(ErroLog);
TextHelper.GetInstance.WriteTextInfo(ErroLog, "ErroLog");
//SqlHelper.GetInstance.Save();
//MainConsole.Main.GetInstance.DataSave();
//IotReport.GetInstance.HttpAddLog(new BPA.Message.API请求.LogTable
//{
// ClientId = InternetInfo.ClientId.ToString(),
// LogTime = DateTime.Now,
// LogType = "1",
// LogMessage = ErroLog,
// LogVla = "异常",
//});
// Process.Start($"{AppDomain.CurrentDomain.BaseDirectory}{AppDomain.CurrentDomain.FriendlyName}.exe");
}

protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
//IotReport.Close();
//SqlHelper.GetInstance.Save();
//MainConsole.Main.GetInstance.DataSave();
ThreadManage.GetInstance().Dispose();
System.Environment.Exit(0);

}
}
}

+ 1
- 0
BPASmartClient/BPASmartClient.csproj Просмотреть файл

@@ -5,6 +5,7 @@
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<StartupObject>BPASmartClient.App</StartupObject>
</PropertyGroup>



+ 103
- 0
BPASmartClient/Control/LogOrAlarmView.xaml Просмотреть файл

@@ -0,0 +1,103 @@
<UserControl x:Class="BPASmartClient.Control.LogOrAlarmView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.Control"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml"/>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<!--底部窗体栏-->
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="45"/>
<RowDefinition/>
</Grid.RowDefinitions>

<!--查询按钮栏-->
<StackPanel Orientation="Horizontal" Margin="10,0,10,0">
<ComboBox SelectedIndex="0" Width="80">
<ComboBoxItem>一般日志</ComboBoxItem>
<ComboBoxItem>错误日志</ComboBoxItem>
<ComboBoxItem>告警信息</ComboBoxItem>
</ComboBox>
<Button Margin="10,0,0,0">查询</Button>
<Button Margin="10,0,0,0">导出</Button>

<CheckBox Margin="10,0,0,0" IsChecked="True">实时模式</CheckBox>
<CheckBox Margin="10,0,0,0" IsChecked="True">定时清除</CheckBox>

</StackPanel>

<!--表格栏-->
<Grid Grid.Row="1">
<DataGrid x:Name="datagrid" Margin="10" ItemsSource="{Binding EquiPment1, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2">
<DataGrid.Columns>
<DataGridTemplateColumn Header="紧急程度" Width="2*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Ellipse Width="12" Height="12" ToolTip="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Fill="{Binding color, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="报警时间或恢复时间" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="类型" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="状态" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="变量名" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="报警值或恢复值" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="参考值" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="操作" Width="2*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Grid>
</UserControl>

+ 28
- 0
BPASmartClient/Control/LogOrAlarmView.xaml.cs Просмотреть файл

@@ -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 BPASmartClient.Control
{
/// <summary>
/// LogOrAlarmView.xaml 的交互逻辑
/// </summary>
public partial class LogOrAlarmView :UserControl
{
public LogOrAlarmView()
{
InitializeComponent();
}
}
}

+ 65
- 0
BPASmartClient/Control/LogView.xaml Просмотреть файл

@@ -0,0 +1,65 @@
<UserControl x:Class="BPASmartClient.Control.LogView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:vm="clr-namespace:BPASmartClient.ViewModel;assembly=BPASmartClient.ViewModel"
xmlns:local="clr-namespace:BPASmartClient.Control"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml"/>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<UserControl.DataContext>
<vm:LogViewModel></vm:LogViewModel>
</UserControl.DataContext>
<!--底部窗体栏-->
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="45"/>
<RowDefinition/>
</Grid.RowDefinitions>

<!--查询按钮栏-->
<StackPanel Orientation="Horizontal" Margin="10,0,10,0">
<CheckBox Margin="10,0,0,0" IsChecked="{Binding RealTimeModel, UpdateSourceTrigger=PropertyChanged}" >实时模式</CheckBox>
<CheckBox Margin="10,0,0,0" IsChecked="{Binding TimedClear, UpdateSourceTrigger=PropertyChanged}">定时清除</CheckBox>
<Button Margin="10,0,0,0" Cursor="Hand" Command="{Binding ExcelCommand}">导出</Button>
</StackPanel>

<!--表格栏-->
<Grid Grid.Row="1">
<DataGrid Margin="10" ItemsSource="{Binding LogDataGrid, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2">
<DataGrid.Columns>
<DataGridTemplateColumn Header="日志时间" Width="300">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding time, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="14" Foreground="{Binding foreground, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

<DataGridTemplateColumn Header="日志类型" Width="300">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding type, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="14" Foreground="{Binding foreground, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="日志内容" Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding message, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="14" Foreground="{Binding foreground, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Grid>
</UserControl>

+ 28
- 0
BPASmartClient/Control/LogView.xaml.cs Просмотреть файл

@@ -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 BPASmartClient.Control
{
/// <summary>
/// LogView.xaml 的交互逻辑
/// </summary>
public partial class LogView :UserControl
{
public LogView()
{
InitializeComponent();
}
}
}

+ 354
- 0
BPASmartClient/Control/OrderStatusView.xaml Просмотреть файл

@@ -0,0 +1,354 @@
<UserControl
x:Class="BPASmartClient.Control.OrderStatusView"
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:BPASmartClient.Control"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
Background="{x:Null}"
mc:Ignorable="d">

<UserControl.Resources>
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
<SolidColorBrush x:Key="CursorColor" Color="Aqua" />
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" />

<Style x:Key="TextBlockStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Background" Value="Transparent" />
<!--<Setter Property="Foreground" Value="{StaticResource FontColor}" />-->
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
</UserControl.Resources>

<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>

<!--#region 制作中的订单列表-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition />
</Grid.RowDefinitions>

<!--#region 表格标题栏设置-->
<Grid Background="#dd2AB2E7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0" />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.5*" />
</Grid.ColumnDefinitions>

<TextBlock
Grid.Column="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="取餐号" />

<Grid Grid.Column="1">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="商品名" />
<Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="1,0,1,0" />
</Grid>

<TextBlock
Grid.Column="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="开始时间" />

<Grid Grid.Column="3">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="结束时间" />
<Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="1,0,1,0" />
</Grid>

<Grid Grid.Column="5">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="制作状态" />
<Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="0,0,1,0" />
</Grid>

<TextBlock
Grid.Column="6"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="完成时间" />

</Grid>
<!--#endregion-->

<!--#region 表格数据显示-->
<ScrollViewer
Grid.Row="1"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden">
<ItemsControl ItemsSource="{Binding orderStatusLists}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Height="30">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0" />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.5*" />
</Grid.ColumnDefinitions>

<TextBlock
Grid.Column="0"
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="{Binding OrderPush.SortNum}" />

<Grid Grid.Column="1">
<TextBlock
Margin="5,0,0,0"
HorizontalAlignment="Left"
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="{Binding OrderPush.GoodsName}" />
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
</Grid>


<TextBlock
Grid.Column="2"
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="{Binding StartDate}" />

<Grid Grid.Column="3">
<TextBlock
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="{Binding EndDate}" />
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
</Grid>


<Grid Grid.Column="5">
<TextBlock
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="{Binding OrderStatus, Converter={StaticResource TextConverter}}" />
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="0,0,1,0" />
</Grid>

<Grid Grid.Column="6">
<TextBlock
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="{Binding CompleteDate}" />
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="0,0,1,0" />
</Grid>

<Border
Grid.ColumnSpan="8"
BorderBrush="{StaticResource BorderSolid}"
BorderThickness="1,0,1,1" />

</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<!--#endregion-->
</Grid>
<!--#endregion-->

<!--#region 等待取餐的订单列表-->
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition />
</Grid.RowDefinitions>

<!--#region 表格标题栏设置-->
<Grid Background="#dd2AB2E7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0" />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.5*" />
</Grid.ColumnDefinitions>

<TextBlock
Grid.Column="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="取餐号" />

<Grid Grid.Column="1">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="商品名" />
<Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="1,0,1,0" />
</Grid>

<TextBlock
Grid.Column="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="开始时间" />

<Grid Grid.Column="3">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="结束时间" />
<Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="1,0,1,0" />
</Grid>

<Grid Grid.Column="5">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="制作状态" />
<Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="0,0,1,0" />
</Grid>

<TextBlock
Grid.Column="6"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="完成时间" />

</Grid>
<!--#endregion-->

<!--#region 表格数据显示-->
<ScrollViewer
Grid.Row="1"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden">
<ItemsControl ItemsSource="{Binding WaitTakeMeal}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Height="30">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0" />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.5*" />
</Grid.ColumnDefinitions>

<TextBlock
Grid.Column="0"
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="{Binding OrderPush.SortNum}" />

<Grid Grid.Column="1">
<TextBlock
Margin="5,0,0,0"
HorizontalAlignment="Left"
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="{Binding OrderPush.GoodsName}" />
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
</Grid>


<TextBlock
Grid.Column="2"
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="{Binding StartDate}" />

<Grid Grid.Column="3">
<TextBlock
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="{Binding EndDate}" />
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
</Grid>


<Grid Grid.Column="5">
<TextBlock
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="{Binding OrderStatus, Converter={StaticResource TextConverter}}" />
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="0,0,1,0" />
</Grid>

<Grid Grid.Column="6">
<TextBlock
Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}"
Style="{StaticResource TextBlockStyle}"
Text="{Binding CompleteDate}" />
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="0,0,1,0" />
</Grid>

<Border
Grid.ColumnSpan="8"
BorderBrush="{StaticResource BorderSolid}"
BorderThickness="1,0,1,1" />

</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<!--#endregion-->
</Grid>
<!--#endregion-->

</Grid>


</UserControl>

+ 28
- 0
BPASmartClient/Control/OrderStatusView.xaml.cs Просмотреть файл

@@ -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 BPASmartClient.Control
{
/// <summary>
/// OrderStatusView.xaml 的交互逻辑
/// </summary>
public partial class OrderStatusView : UserControl
{
public OrderStatusView()
{
InitializeComponent();
}
}
}

+ 45
- 34
BPASmartClient/MainWindow.xaml Просмотреть файл

@@ -4,7 +4,9 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BPASmartClient"
xmlns:vm="clr-namespace:BPASmartClient.ViewModel;assembly=BPASmartClient.ViewModel"
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
Title="MainWindow" Width="1600"
Height="900"
AllowsTransparency="True"
@@ -19,9 +21,11 @@
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml"/>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Geometry x:Key="Icon_Desgin">M61.141068 400.532698L3.815672 725.688936l61.197513 74.337875 83.560965-473.80941H-0.067734zM79.169555 298.333642h74.315297l-61.208801-74.315297zM359.011862 660.653173l-13.095206 74.337875 53.566168 65.024474 13.095207-74.326586zM455.171319 484.138819v0.011289H287.959077l59.3687 72.068792L107.64034 716.398113 92.908233 800.015522l347.508401-232.259293 1.648189-9.302112h0.011289l13.106496-74.304009h-0.011289zM494.490806 261.181638H187.904926l-13.095207 74.315297 61.208802 74.315298 19.676677-111.478591h157.921418l-26.201702 148.641884h74.315297l32.771884-185.793888h-0.011289z M617.224501 400.543987l-57.359263 325.156238 61.23138 74.326586 83.527098-473.80941H556.00441zM635.23041 298.344931h74.315297L648.325616 224.018345zM982.783966 224.018345h-74.326586l-32.749306 185.805177H717.7415l30.626979 37.163293H869.137893l-62.224809 353.039996 87.410504-74.326586 49.140891-278.71341h74.315298l6.558892-37.163293h-74.326586z</Geometry>
</ResourceDictionary>
</Window.Resources>
<Window.DataContext>
<vm:MainViewModel></vm:MainViewModel>
</Window.DataContext>
<Border Style="{DynamicResource border主窗体背景}" x:Name="br" >
<Grid>
@@ -38,41 +42,43 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Style="{DynamicResource bordertop矩形}"></Border>
<Border Style="{DynamicResource bordertopL}"></Border>
<Image Margin="10,0,0,0" VerticalAlignment="Center" Style="{DynamicResource imagetop_Title}" ></Image>
<Image Margin="20,0,0,0" VerticalAlignment="Center" Style="{DynamicResource imagetop_Title}" ></Image>
<Grid Grid.Column="1">
<Menu >
<MenuItem Header="状态监视" >
<MenuItem Header="订单监视" FontSize="12" Command="{Binding NavChangedCommand}" CommandParameter="RealTimeDataControl" />
<MenuItem Header="日志监视" FontSize="12" Click="MenuItem_Click" Tag="LogView" />
<Separator/>
<MenuItem Header="设备监视" FontSize="12" Command="{Binding NavChangedCommand}" CommandParameter="RealTimeDataControl" />
<MenuItem Header="订单监视" FontSize="12" Click="MenuItem_Click" Tag="OrderStatusView" />
<Separator/>
<MenuItem Header="告警监视" FontSize="12" Command="{Binding NavChangedCommand}" CommandParameter="RealTimeDataControl" />
<MenuItem Header="设备监视" FontSize="12" Click="MenuItem_Click" Tag="RealTimeDataControl" />
<Separator/>
<MenuItem Header="IOT监视" FontSize="12" Command="{Binding NavChangedCommand}" CommandParameter="RealTimeDataControl" />
<MenuItem Header="告警监视" FontSize="12" Click="MenuItem_Click" Tag="RealTimeDataControl" />
<Separator/>
<MenuItem Header="IOT监视" FontSize="12" Click="MenuItem_Click" Tag="RealTimeDataControl" />
</MenuItem>
<MenuItem Header="综合查询">
<MenuItem Header="告警查询" FontSize="12" Command="{Binding NavChangedCommand}" CommandParameter="HistoryFaultControl"/>
<MenuItem Header="告警查询" FontSize="12" Click="MenuItem_Click" Tag="HistoryFaultControl"/>
<Separator/>
<MenuItem Header="日志查询" FontSize="12" Command="{Binding NavChangedCommand}" CommandParameter="MaintenanceNotificationControl"/>
<MenuItem Header="日志查询" FontSize="12" Click="MenuItem_Click" Tag="MaintenanceNotificationControl"/>
<Separator/>
<MenuItem Header="维护查询" FontSize="12" Command="{Binding NavChangedCommand}" CommandParameter="WorkorderManagementControl"/>
<MenuItem Header="维护查询" FontSize="12" Click="MenuItem_Click" Tag="WorkorderManagementControl"/>
</MenuItem>
<MenuItem Header="功能列表">
<MenuItem Header="加盟商管理" FontSize="10" Command="{Binding NavChangedCommand}" CommandParameter="OnOffControl"/>
<MenuItem Header="加盟商管理" FontSize="12" Click="MenuItem_Click" Tag="OnOffControl"/>
<Separator/>
<MenuItem Header="功能列表2" FontSize="12" Command="{Binding NavChangedCommand}" CommandParameter="SystemParameterControl" />
<MenuItem Header="功能列表2" FontSize="12" Click="MenuItem_Click" Tag="SystemParameterControl" />
</MenuItem>
<MenuItem Header="参数配置">
<MenuItem Header="参数设置" FontSize="12" Command="{Binding NavChangedCommand}" CommandParameter="OnOffControl"/>
<MenuItem Header="参数设置" FontSize="12" Click="MenuItem_Click" Tag="OnOffControl"/>
<Separator/>
<MenuItem Header="系统设置" FontSize="12" Command="{Binding NavChangedCommand}" CommandParameter="SystemParameterControl" />
<MenuItem Header="系统设置" FontSize="12" Click="MenuItem_Click" Tag="SystemParameterControl" />
<Separator/>
<MenuItem Header="退出程序" FontSize="12" Command="{Binding NavChangedCommand}" CommandParameter="RealTimevideoControl"/>
<MenuItem Header="退出程序" FontSize="12" Click="MenuItem_Click" Tag="RealTimevideoControl"/>
</MenuItem>
<MenuItem Header="系统帮助">
<MenuItem Header="版本更新历史" FontSize="12" Command="{Binding NavChangedCommand}" CommandParameter="OnOffControl"/>
<MenuItem Header="版本更新历史" FontSize="12" Click="MenuItem_Click" Tag="OnOffControl"/>
<Separator/>
<MenuItem Header="帮助文档" FontSize="12" Command="{Binding NavChangedCommand}" CommandParameter="SystemParameterControl" />
<MenuItem Header="帮助文档" FontSize="12" Click="MenuItem_Click" Tag="SystemParameterControl" />
</MenuItem>
</Menu>
</Grid>
@@ -83,34 +89,39 @@
<TextBlock FontSize="12">网</TextBlock>
<TextBlock FontSize="12">络</TextBlock>
</StackPanel>
<ToggleButton Margin="5" VerticalAlignment="Center" ToolTip="网络连接状态" HorizontalAlignment="Center" Style="{DynamicResource StatusBtnStyle网络连接状态}" DataContext="{Binding GaoJingMessage}" Cursor="Hand"/>
<ToggleButton Margin="5" VerticalAlignment="Center" ToolTip="网络连接状态" HorizontalAlignment="Center" Style="{DynamicResource StatusBtnStyle网络连接状态}" IsChecked="True" DataContext="{Binding GaoJingMessage}" Cursor="Hand"/>
<Border Style="{DynamicResource border竖线}" />
<ToggleButton VerticalAlignment="Center" ToolTip="告警消息" HorizontalAlignment="Center" Style="{DynamicResource StatusBtnStyle告警}" DataContext="{Binding GaoJingMessage}" Cursor="Hand"/>
<Border Style="{DynamicResource border竖线}" />
<Grid Margin="10,0,10,0" VerticalAlignment="Center" >
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Grid.Row="0">
<TextBlock x:Name="time" FontSize="16" Text="18:00:00"/>
<Image Style="{DynamicResource timeImage}" Margin="10,0,0,0"/>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal">
<TextBlock x:Name="dateRL" FontSize="10" >星期一</TextBlock>
<TextBlock x:Name="date" Margin="10,0,0,0" FontSize="10" >2021-11-13</TextBlock>
</StackPanel>
</Grid>
<control:DateTimeUI Margin="10,0,10,0" VerticalAlignment="Center"></control:DateTimeUI>
<Border Style="{DynamicResource border竖线}" />
<Button x:Name="ButClose" Grid.Column="4" Margin="10,0,20,0" Style="{DynamicResource CommonBtnStyle退出按钮}" VerticalAlignment="Center" ToolTip="退出程序" Cursor="Hand" Content="退出"/>
<Button x:Name="ButClose" Grid.Column="4" Margin="10,0,20,0" Style="{DynamicResource CommonBtn_返回}" VerticalAlignment="Center" ToolTip="退出程序" Cursor="Hand" Content="退出"/>
</StackPanel>
</Grid>

<!--底部窗体-->
<Grid Grid.Row="1" Margin="10">
<Button Grid.Row="2" Content="返回" Style="{DynamicResource CommonBtn_返回}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="Button_Click"/>
<Grid.RowDefinitions>
<RowDefinition Height="45"/>
<RowDefinition/>
</Grid.RowDefinitions>
<!--顶部装饰-->
<Border Grid.Row="0" Style="{DynamicResource border右下}" Grid.RowSpan="2" />
<Border Grid.Row="0" Style="{DynamicResource border左下}" Grid.RowSpan="2" />
<Border Grid.Row="0" Style="{DynamicResource border右上}" Grid.RowSpan="2" />
<Border Grid.Row="0" Style="{DynamicResource border左上}" Grid.RowSpan="2" />
<Grid Margin="10">
<Border Style="{DynamicResource borderFromTitle}" Width="600"></Border>
<Button Grid.Row="0" Content="返回" Style="{DynamicResource CommonBtn_返回}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="Button_Click" Cursor="Hand"/>
<TextBlock x:Name="Title" HorizontalAlignment="Center" FontSize="18" Foreground="#feffff">日志监控界面</TextBlock>
</Grid>
<!--#region 底部窗体栏-->

<ContentControl Grid.Row="1" x:Name="contentRegion"/>
<!--#endregion-->
<!--<Button Grid.Row="2" Content="返回" Style="{DynamicResource CommonBtn_返回}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="Button_Click"/>

<Button Grid.Row="2" Visibility="Collapsed" Content="测试" HorizontalAlignment="Left" Margin="153,123,0,0" VerticalAlignment="Top" Click="Button_Click"/>
<Button Grid.Row="2" Visibility="Collapsed" Content="测试" HorizontalAlignment="Left" Margin="153,123,0,0" VerticalAlignment="Top" Click="Button_Click"/>-->
</Grid>




+ 37
- 7
BPASmartClient/MainWindow.xaml.cs Просмотреть файл

@@ -2,12 +2,14 @@
using BPASmartClient.Business;
using BPASmartClient.EventBus;
using BPASmartClient.Helper;
using BPASmartClient.Message;
using BPASmartClient.Model;
using BPASmartClient.Model.冰淇淋.Enum;
using BPASmartClient.Model.咖啡机.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
@@ -30,8 +32,18 @@ namespace BPASmartClient
public MainWindow()
{
InitializeComponent();
this.ButClose.Click += (o, e) => { this.Close(); };
this.br.MouseLeftButtonDown += (o, e) =>
Initialize();
ThreadManage.GetInstance().Start(new Action(() =>
{
new MainConsole().Start();
}), "启动主控制台");

}

public void Initialize()
{
this.ButClose.Click += (o,e) => { this.Close(); };
this.br.MouseLeftButtonDown += (o,e) =>
{
if (e.ClickCount > 1)
{
@@ -42,11 +54,7 @@ namespace BPASmartClient
}
this.DragMove();
};
ThreadManage.GetInstance().Start(new Action(() =>
{
new MainConsole().Start();
}), "启动主控制台");

MenuItem_Click(new MenuItem() {Tag= "LogView",Header="日志监视" },null);
}

private void Button_Click(object sender, RoutedEventArgs e)
@@ -59,5 +67,27 @@ namespace BPASmartClient
var temp=BPAPackage.Make(morkOrderPush, 12, BPA.Message.Enum.DeviceClientType.MORKS);
Plugin.GetInstance().GetPlugin<MQTTMgr>().Publish("DOWN/MORKS/ORDER/12", temp.Serialize());
}

/// <summary>
/// 菜单切换栏
/// </summary>
private void MenuItem_Click(object sender,RoutedEventArgs e)
{
try
{
if (sender is MenuItem)
{
Type type = Type.GetType($"BPASmartClient.Control.{(sender as MenuItem).Tag?.ToString()}");
if (type == null) return;
ConstructorInfo cti = type.GetConstructor(System.Type.EmptyTypes);
contentRegion.Content = (FrameworkElement)cti.Invoke(null);
Title.Text = (sender as MenuItem).Header?.ToString()+"界面";
}
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"BPASmartClient 中引发错误,MainWindow.xaml.cs 类,描述:[{ex.Message}]");
}
}
}
}

+ 6
- 4
BPASmartClient/OrderListDialogView.xaml Просмотреть файл

@@ -20,14 +20,13 @@


<Window.DataContext>
<vm:OrderListDialogViewModel/>
<vm:OrderListDialogViewModel />
</Window.DataContext>

<Window.Resources>
<ResourceDictionary Source="pack://application:,,,/BPASmartClient.CustomResource;component/RecDictionarys/RecCheckBox.xaml">
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>

<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
@@ -35,6 +34,9 @@
<SolidColorBrush x:Key="TitleBorderColor" Color="#552AB2E7" />
<SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" />

<!--<con:ColorConverter x:Key="ColorConverter" />
<con:TextConverter x:Key="TextConverter" />-->

<Style x:Key="buttonStyle" TargetType="Button">
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="Width" Value="100" />
@@ -95,7 +97,7 @@
BorderBrush="#55ffffff"
BorderThickness="0,0,0,1">
<StackPanel Orientation="Horizontal">
<Image Margin="15,5,0,5" Source="pack://application:,,,/BPASmartClient.CustomResource;component/Image/HBL.png" />
<Image Margin="15,5,0,5" Source="pack://application:,,,/BPASmartClient.CustomResource;component/Image/HBL.png" />
<TextBlock
Name="tbTitle"
Margin="10,0"


+ 23
- 0
BPASmartClient/OrderListDialogView.xaml.cs Просмотреть файл

@@ -11,6 +11,8 @@ using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using BPASmartClient.ViewModel;
using Microsoft.Toolkit.Mvvm.Messaging;

namespace BPASmartClient
{
@@ -22,6 +24,27 @@ namespace BPASmartClient
public OrderListDialogView()
{
InitializeComponent();
this.MoveBorder.MouseLeftButtonDown += (o, e) =>
{
this.DragMove();
};

WeakReferenceMessenger.Default.Register<string, string>(this, "Close", (o, e) =>
{
App.Current.Dispatcher.Invoke(new Action(() =>
{
this.DialogResult = Convert.ToBoolean(e);
this.Close();
}));
});
}
int MoveCount = 0;
private void Window_MouseMove(object sender, MouseEventArgs e)
{
MoveCount += 1;
if (MoveCount >= 5) OrderListDialogViewModel.IsAutoClose = true;
}


}
}

Загрузка…
Отмена
Сохранить