add -添加工艺信息弹窗

main
frankiecao 1 year ago
commit 7eb016e5f6

@ -239,7 +239,19 @@
</Grid>
</Border>
<Border Grid.Row="2">
<TextBlock Text="工单明细" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.Column="1">
<TextBlock Text="工单明细" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="2">
<Button Content="工艺信息" x:Name="TechnologicalInformation" Command="{Binding TechnologicalInformationCommand}" Style="{StaticResource BUTTON_AGREE}" FontSize="15" FontWeight="Bold" Background="#009999" BorderBrush="#FF36B5C1" Margin="40,16,40,16" Click="ChangeShifts_Click"/>
</Border>
</Grid>
</Border>
<Border Grid.Row="3">
<DataGrid Name="dataGridPlanDetail" ItemsSource="{Binding ProdPLanDetailDataGrid}" Background="Transparent"

@ -61,6 +61,11 @@ namespace SlnMesnac.WPF.ViewModel
/// </summary>
public ICommand ProductionReportCommand { get; private set; }
/// <summary>
/// 工艺信息命令
/// </summary>
public ICommand TechnologicalInformationCommand { get; private set; }
/// <summary>
/// 执行命令
/// </summary>
@ -89,6 +94,7 @@ namespace SlnMesnac.WPF.ViewModel
StationCode = configuration.GetSection("AppConfig")["ProductLineCode"];
HandoverCommand = new RelayCommand(Handover);
ProductionReportCommand = new RelayCommand(ProductionReport);
TechnologicalInformationCommand = new RelayCommand(TechnologicalInformation);
SearchCommand = new RelayCommand(Search);
ExecuteCommand = new RelayCommand(Execute);
ProductionReportViewModel.RefreshDelegateEvent += Refresh;
@ -101,8 +107,10 @@ namespace SlnMesnac.WPF.ViewModel
private void Handover()
{
var handOverWin = new HandOverWin();
handOverWin.Owner = Application.Current.MainWindow; // 设置父窗口为当前主窗口
handOverWin.WindowStartupLocation = WindowStartupLocation.CenterScreen; // 让窗体出现在屏幕中央
handOverWin.ShowDialog();//窗体出现后禁止后面的用户控件
}
/// <summary>
@ -111,10 +119,31 @@ namespace SlnMesnac.WPF.ViewModel
private void ProductionReport()
{
var reportWin = new ProductionReportWin();
reportWin.Owner = Application.Current.MainWindow; // 设置父窗口为当前主窗口
reportWin.WindowStartupLocation = WindowStartupLocation.CenterScreen; // 让窗体出现在屏幕中央
reportWin.ShowDialog();//窗体出现后禁止后面的用户控件
}
/// <summary>
/// 工艺信息弹窗,单例模式保证只显示一个
/// </summary>
private static TechnologicalWin instance;
private void TechnologicalInformation()
{
if (instance == null)
{
instance = new TechnologicalWin();
instance.WindowStartupLocation = WindowStartupLocation.CenterScreen;
instance.Closed += (sender, e) => { instance = null; }; // 窗口关闭时重置instance为null以便下次可以重新打开窗口
instance.Show();
}
else
{
instance.Focus(); // 如果窗口已经存在,则将焦点放在该窗口上
}
}
/// <summary>
/// 检索事件
/// </summary>

@ -0,0 +1,84 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace SlnMesnac.WPF.ViewModel
{
public class TechnologicalViewModel : INotifyPropertyChanged
{
/// <summary>
/// 按钮文字转换事件
/// </summary>
public event PropertyChangedEventHandler PropertyChanged = delegate { };
public TechnologicalViewModel()
{
Information1 = "001";
Information2 = "002";
Information3 = "003";
Information4 = "004";
Information5 = "005";
}
#region
/// <summary>
/// 信息1
/// </summary>
private string information1;
public string Information1
{
get { return information1; }
set { information1 = value; OnPropertyChanged("Information1"); }
}
/// <summary>
/// 信息2
/// </summary>
private string information2;
public string Information2
{
get { return information2; }
set { information2 = value; OnPropertyChanged("Information2"); }
}
/// <summary>
/// 信息3
/// </summary>
private string information3;
public string Information3
{
get { return information3; }
set { information3 = value; OnPropertyChanged("Information3"); }
}
/// <summary>
/// 信息4
/// </summary>
private string information4;
public string Information4
{
get { return information4; }
set { information4 = value; OnPropertyChanged("Information4"); }
}
/// <summary>
/// 信息5
/// </summary>
private string information5;
public string Information5
{
get { return information5; }
set { information5 = value; OnPropertyChanged("Information5"); }
}
#endregion
public void OnPropertyChanged([CallerMemberName] string propertyName = "")
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}

@ -0,0 +1,42 @@
<Window x:Class="SlnMesnac.WPF.Views.TechnologicalWin"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SlnMesnac.WPF.Views"
WindowStartupLocation="CenterOwner" Background="Transparent" ResizeMode="NoResize" FontWeight="ExtraLight"
mc:Ignorable="d"
Title="TechnologicalWin" Height="1000" Width="600">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="工艺信息" FontSize="40" FontWeight="Bold" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<Border Grid.Row="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="信息1" FontSize="30" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Information1}" FontSize="30" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<TextBlock Grid.Row="1" Grid.Column="0" Text="信息2" FontSize="30" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Information2}" FontSize="30" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<TextBlock Grid.Row="2" Grid.Column="0" Text="信息3" FontSize="30" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Information3}" FontSize="30" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<TextBlock Grid.Row="3" Grid.Column="0" Text="信息4" FontSize="30" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding Information4}" FontSize="30" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<TextBlock Grid.Row="4" Grid.Column="0" Text="信息5" FontSize="30" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding Information5}" FontSize="30" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
</Grid>
</Border>
</Grid>
</Window>

@ -0,0 +1,29 @@
using SlnMesnac.WPF.ViewModel;
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.Shapes;
namespace SlnMesnac.WPF.Views
{
/// <summary>
/// TechnologicalWin.xaml 的交互逻辑
/// </summary>
public partial class TechnologicalWin : Window
{
public TechnologicalWin()
{
InitializeComponent();
this.DataContext = new TechnologicalViewModel();
}
}
}
Loading…
Cancel
Save