添加项目文件。
This commit is contained in:
112
SamplePreSystem.UI/Views/SOPManager/chirld/NewActionWindow.xaml
Normal file
112
SamplePreSystem.UI/Views/SOPManager/chirld/NewActionWindow.xaml
Normal file
@@ -0,0 +1,112 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.ParamManager.chirld.NewActionWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="新增动作"
|
||||
Width="400"
|
||||
Height="300"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="50" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<!--<RowDefinition/>
|
||||
<RowDefinition/>-->
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock VerticalAlignment="Center" Text="名称:" />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysAction.action_name}" />
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
VerticalAlignment="Center"
|
||||
Text="备注:" />
|
||||
<TextBox
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysAction.remark}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
VerticalAlignment="Center"
|
||||
Text="动作单元:" />
|
||||
<ComboBox
|
||||
x:Name="cmbDataType"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
DisplayMemberPath="data_type"
|
||||
ItemsSource="{Binding ActionUnits}"
|
||||
SelectedItem="{Binding SelectSysDict}"
|
||||
SelectedValuePath="id" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
Text="PLC映射:" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysAction.plc_type}" />
|
||||
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="0,10,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnOK"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnOK_Click"
|
||||
Content="确定" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnCancel_Click"
|
||||
Content="取消" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,53 @@
|
||||
using Models.Models;
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.Child;
|
||||
using SamplePreSystem.UI.ViewModel.SopManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
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 SamplePre.UIWpf.ParamManager.chirld
|
||||
{
|
||||
/// <summary>
|
||||
/// NewStandParmWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NewActionWindow : BaseWindow
|
||||
{
|
||||
ActionManagerViewModel actionManagerVM;
|
||||
public NewActionWindow(ActionManagerViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = new NewActionViewModel();
|
||||
|
||||
this.actionManagerVM = viewModel;
|
||||
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var vm = this.DataContext as NewActionViewModel;
|
||||
|
||||
if (vm.SaveNewData() < 0) return;
|
||||
|
||||
this.DialogResult = true;
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DialogResult = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.ParamManager.chirld.NewStandParmWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="参数编辑"
|
||||
Width="400"
|
||||
Height="350"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="50" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock VerticalAlignment="Center" Text="名称:" />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysParm.title}" />
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
Text="值:" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysParm.data_value}" />
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
VerticalAlignment="Center"
|
||||
Text="单位:" />
|
||||
<ComboBox
|
||||
x:Name="cmbUnit"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalContentAlignment="Center"
|
||||
DisplayMemberPath="data_type"
|
||||
ItemsSource="{Binding Units}"
|
||||
SelectedValuePath="id"
|
||||
Text="{Binding SysParm.unit}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
VerticalAlignment="Center"
|
||||
Text="数据类型:" />
|
||||
<ComboBox
|
||||
x:Name="cmbDataType"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysParm.data_type}">
|
||||
<ComboBoxItem Content="数值" />
|
||||
<ComboBoxItem Content="字符串" />
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="4"
|
||||
VerticalAlignment="Center"
|
||||
Text="PLC映射:" />
|
||||
<TextBox
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysParm.plc_type}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="5"
|
||||
VerticalAlignment="Center"
|
||||
Text="参数类型:" />
|
||||
<ComboBox
|
||||
x:Name="cmbParamType"
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysParm.param_type}">
|
||||
<ComboBoxItem Content="通用" />
|
||||
<ComboBoxItem Content="耗材" />
|
||||
<ComboBoxItem Content="液体" />
|
||||
</ComboBox>
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="0,10,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnOK"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnOK_Click"
|
||||
Content="确定" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnCancel_Click"
|
||||
Content="取消" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,52 @@
|
||||
using Models.Models;
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.SopManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
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 SamplePre.UIWpf.ParamManager.chirld
|
||||
{
|
||||
/// <summary>
|
||||
/// NewStandParmWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NewStandParmWindow : BaseWindow
|
||||
{
|
||||
ParamManagerViewModel viewModel;
|
||||
public NewStandParmWindow(ParamManagerViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = viewModel;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var v= this.DataContext as ParamManagerViewModel;
|
||||
|
||||
if (!v.SaveParam()) return;
|
||||
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.ParamManager.chirld.SelectParmListWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="选择参数"
|
||||
Width="600"
|
||||
Height="450"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="40" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="参数类型:" />
|
||||
<ComboBox
|
||||
x:Name="cmbDataType"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
ItemsSource="{Binding DataTypes}"
|
||||
SelectedItem="{Binding FilterType}" />
|
||||
</StackPanel>
|
||||
<DataGrid
|
||||
x:Name="dg_params"
|
||||
Grid.Row="1"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="True"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding Parms}"
|
||||
SelectedItem="{Binding SelectParm}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding title}"
|
||||
Header="标题" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding unit}"
|
||||
Header="PLC单位" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_type}"
|
||||
Header="数据类型" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_value}"
|
||||
Header="值" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding plc_type}"
|
||||
Header="PLC映射" />
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Margin="0,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnOK"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Command="{Binding BtnOKClickCommand}"
|
||||
Content="确定" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Command="{Binding BtnCancelClickCommand}"
|
||||
Content="取消" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,53 @@
|
||||
using Models.Models;
|
||||
using SamplePre.Models.Ext;
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.Child;
|
||||
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 SamplePre.UIWpf.ParamManager.chirld
|
||||
{
|
||||
/// <summary>
|
||||
/// SelectParmListWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SelectParmListWindow : BaseWindow
|
||||
{
|
||||
public SelectParmListWindow(sys_standard_action_ext sysStandardAction)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var vm = new SelectParmListViewModel(sysStandardAction);
|
||||
|
||||
//关闭窗口委托
|
||||
vm.CloseAction = (val) => DialogResult = val;
|
||||
|
||||
this.DataContext = vm;
|
||||
}
|
||||
|
||||
public SelectParmListWindow(sys_action_ext sysStandardAction)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var vm = new SelectParmListViewModel(sysStandardAction);
|
||||
|
||||
//关闭窗口委托
|
||||
vm.CloseAction = (val) => DialogResult = val;
|
||||
|
||||
this.DataContext = vm;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user