添加middleware
This commit is contained in:
102
middleware/zdhsys/UI/DataDeviceTabControl.xaml
Normal file
102
middleware/zdhsys/UI/DataDeviceTabControl.xaml
Normal file
@@ -0,0 +1,102 @@
|
||||
<UserControl x:Class="zdhsys.UI.DataDeviceTabControl"
|
||||
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:zdhsys.UI" xmlns:control="clr-namespace:zdhsys.Control"
|
||||
mc:Ignorable="d"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="60"/>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,0">
|
||||
<Grid Background="White">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="1" Margin="10,0,0,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.6*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Content="配方名称:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<control:DevTextBox x:Name="txt_option" Grid.Column="1"/>
|
||||
<Label Grid.Column="2" Content="生成物密度:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<control:DevTextBox x:Name="txt_density" Grid.Column="3"/>
|
||||
<Label Grid.Column="4" Content="PCR数值:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<control:DevTextBox x:Name="txt_PCR" Grid.Column="5"/>
|
||||
<Label Grid.Column="6" Content="创建时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<DatePicker Grid.Column="7" Height="30" VerticalContentAlignment="Center"/>
|
||||
<Label Grid.Column="8" Content="结束时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<DatePicker Grid.Column="9" Height="30" VerticalContentAlignment="Center"/>
|
||||
<control:DevButton1 Grid.Column="11" x:Name="btn_search" Height="40"/>
|
||||
<control:DevButton1 Grid.Column="12" x:Name="btn_clear" Height="40"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="2" Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,10">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="13*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<control:DevButton1 x:Name="btn_add" Grid.Column="0" Height="40" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="gd_header" Background="#F6F6F6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox Margin="0,10,0,0" HorizontalAlignment="Center">
|
||||
<CheckBox.LayoutTransform>
|
||||
<ScaleTransform ScaleX="1.5" ScaleY="1.5" />
|
||||
</CheckBox.LayoutTransform>
|
||||
</CheckBox>
|
||||
<Label Grid.Column="1" Content="配方名称" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="2" Content="生成物密度" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="3" Content="PCR数值" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="4" Content="创建时间" Style="{StaticResource CustomLabelStyle}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1" x:Name="gd_content">
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2">
|
||||
<control:DevPaging x:Name="pg" HorizontalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
41
middleware/zdhsys/UI/DataDeviceTabControl.xaml.cs
Normal file
41
middleware/zdhsys/UI/DataDeviceTabControl.xaml.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
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 zdhsys.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// DataDeviceTabControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DataDeviceTabControl : UserControl
|
||||
{
|
||||
public DataDeviceTabControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txt_option.SetUI("配方名称");
|
||||
txt_density.SetUI("输入密度值");
|
||||
txt_PCR.SetUI("输入数值");
|
||||
|
||||
|
||||
btn_search.SetUI("#027AFF", "#027AFF", "\\Image\\搜索.png", "#FFFFFF", "搜索");
|
||||
btn_clear.SetUI("#FFFFFF", "#027AFF", "\\Image\\重置.png", "#027AFF", "重置");
|
||||
|
||||
btn_add.SetUI("#E8F4FF", "#97D4FF", "\\Image\\add.png", "#1990FF", "导出");
|
||||
}
|
||||
}
|
||||
}
|
||||
100
middleware/zdhsys/UI/DataFlowTabControl.xaml
Normal file
100
middleware/zdhsys/UI/DataFlowTabControl.xaml
Normal file
@@ -0,0 +1,100 @@
|
||||
<UserControl x:Class="zdhsys.UI.DataFlowTabControl"
|
||||
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:zdhsys.UI" xmlns:control="clr-namespace:zdhsys.Control"
|
||||
mc:Ignorable="d"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="60"/>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,0">
|
||||
<Grid Background="White">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="1" Margin="10,0,0,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.6*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Content="配方名称:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<control:DevTextBox x:Name="txt_option" Grid.Column="1"/>
|
||||
|
||||
<Label Grid.Column="3" Content="创建时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<DatePicker Grid.Column="4" Height="30" VerticalContentAlignment="Center"/>
|
||||
<Label Grid.Column="5" Content="结束时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<DatePicker Grid.Column="6" Height="30" VerticalContentAlignment="Center"/>
|
||||
<control:DevButton1 Grid.Column="8" x:Name="btn_search" Height="40"/>
|
||||
<control:DevButton1 Grid.Column="9" x:Name="btn_clear" Height="40"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="2" Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,10">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="13*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<control:DevButton1 x:Name="btn_add" Grid.Column="0" Height="40" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="gd_header" Background="#F6F6F6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox Margin="0,10,0,0" HorizontalAlignment="Center">
|
||||
<CheckBox.LayoutTransform>
|
||||
<ScaleTransform ScaleX="1.5" ScaleY="1.5" />
|
||||
</CheckBox.LayoutTransform>
|
||||
</CheckBox>
|
||||
<Label Grid.Column="1" Content="配方名称" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="2" Content="流程模块" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="3" Content="机台位置" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="4" Content="状态" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="5" Content="生成物密度" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="6" Content="创建时间" Style="{StaticResource CustomLabelStyle}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1" x:Name="gd_content">
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2">
|
||||
<control:DevPaging x:Name="pg" HorizontalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
38
middleware/zdhsys/UI/DataFlowTabControl.xaml.cs
Normal file
38
middleware/zdhsys/UI/DataFlowTabControl.xaml.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
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 zdhsys.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// DataFlowTabControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DataFlowTabControl : UserControl
|
||||
{
|
||||
public DataFlowTabControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txt_option.SetUI("配方名称");
|
||||
|
||||
btn_search.SetUI("#027AFF", "#027AFF", "\\Image\\搜索.png", "#FFFFFF", "搜索");
|
||||
btn_clear.SetUI("#FFFFFF", "#027AFF", "\\Image\\重置.png", "#027AFF", "重置");
|
||||
|
||||
btn_add.SetUI("#E8F4FF", "#97D4FF", "\\Image\\add.png", "#1990FF", "导出");
|
||||
}
|
||||
}
|
||||
}
|
||||
102
middleware/zdhsys/UI/DataResultTabControl.xaml
Normal file
102
middleware/zdhsys/UI/DataResultTabControl.xaml
Normal file
@@ -0,0 +1,102 @@
|
||||
<UserControl x:Class="zdhsys.UI.DataResultTabControl"
|
||||
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:zdhsys.UI" xmlns:control="clr-namespace:zdhsys.Control"
|
||||
mc:Ignorable="d"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="60"/>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,0">
|
||||
<Grid Background="White">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="1" Margin="10,0,0,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.6*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Content="配方名称:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<control:DevTextBox x:Name="txt_option" Grid.Column="1"/>
|
||||
<Label Grid.Column="2" Content="生成物密度:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<control:DevTextBox x:Name="txt_density" Grid.Column="3"/>
|
||||
<Label Grid.Column="4" Content="PCR数值:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<control:DevTextBox x:Name="txt_PCR" Grid.Column="5"/>
|
||||
<Label Grid.Column="6" Content="创建时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<DatePicker Grid.Column="7" Height="30" VerticalContentAlignment="Center"/>
|
||||
<Label Grid.Column="8" Content="结束时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<DatePicker Grid.Column="9" Height="30" VerticalContentAlignment="Center"/>
|
||||
<control:DevButton1 Grid.Column="11" x:Name="btn_search" Height="40"/>
|
||||
<control:DevButton1 Grid.Column="12" x:Name="btn_clear" Height="40"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="2" Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,10">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="13*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<control:DevButton1 x:Name="btn_add" Grid.Column="0" Height="40" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="gd_header" Background="#F6F6F6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox Margin="0,10,0,0" HorizontalAlignment="Center">
|
||||
<CheckBox.LayoutTransform>
|
||||
<ScaleTransform ScaleX="1.5" ScaleY="1.5" />
|
||||
</CheckBox.LayoutTransform>
|
||||
</CheckBox>
|
||||
<Label Grid.Column="1" Content="配方名称" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="2" Content="生成物密度" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="3" Content="PCR数值" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="4" Content="创建时间" Style="{StaticResource CustomLabelStyle}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1" x:Name="gd_content">
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2">
|
||||
<control:DevPaging x:Name="pg" HorizontalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
41
middleware/zdhsys/UI/DataResultTabControl.xaml.cs
Normal file
41
middleware/zdhsys/UI/DataResultTabControl.xaml.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
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 zdhsys.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// DataResultTabControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DataResultTabControl : UserControl
|
||||
{
|
||||
public DataResultTabControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txt_option.SetUI("配方名称");
|
||||
txt_density.SetUI("输入密度值");
|
||||
txt_PCR.SetUI("输入数值");
|
||||
|
||||
|
||||
btn_search.SetUI("#027AFF", "#027AFF", "\\Image\\搜索.png", "#FFFFFF", "搜索");
|
||||
btn_clear.SetUI("#FFFFFF", "#027AFF", "\\Image\\重置.png", "#027AFF", "重置");
|
||||
|
||||
btn_add.SetUI("#E8F4FF", "#97D4FF", "\\Image\\add.png", "#1990FF", "导出");
|
||||
}
|
||||
}
|
||||
}
|
||||
97
middleware/zdhsys/UI/DeviceClassTabControl.xaml
Normal file
97
middleware/zdhsys/UI/DeviceClassTabControl.xaml
Normal file
@@ -0,0 +1,97 @@
|
||||
<UserControl x:Class="zdhsys.UI.DeviceClassTabControl"
|
||||
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:zdhsys.UI" xmlns:control="clr-namespace:zdhsys.Control"
|
||||
mc:Ignorable="d"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="60"/>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,0">
|
||||
<Grid Background="White">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="1" Margin="10,0,0,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Content="类别名称:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Column="2" Content="创建时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Column="4" Content="结束时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<control:DevTextBox x:Name="txt_option" Grid.Column="1"/>
|
||||
<DatePicker Grid.Column="3" Height="30" VerticalContentAlignment="Center"/>
|
||||
<DatePicker Grid.Column="5" Height="30" VerticalContentAlignment="Center"/>
|
||||
<control:DevButton1 Grid.Column="7" x:Name="btn_search" Height="40"/>
|
||||
<control:DevButton1 Grid.Column="8" x:Name="btn_clear" Height="40"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="2" Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,10">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="12*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<control:DevButton1 x:Name="btn_add" Grid.Column="0" Height="40" Width="120"/>
|
||||
<control:DevButton x:Name="btn_del" Grid.Column="1" Height="40" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="gd_header" Background="#F6F6F6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox Margin="0,10,0,0" HorizontalAlignment="Center">
|
||||
<CheckBox.LayoutTransform>
|
||||
<ScaleTransform ScaleX="1.5" ScaleY="1.5" />
|
||||
</CheckBox.LayoutTransform>
|
||||
</CheckBox>
|
||||
<Label Grid.Column="1" Content="序号" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="2" Content="设备类别" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="3" Content="创建时间" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="4" Content="操作" Style="{StaticResource CustomLabelStyle}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1" x:Name="gd_content">
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2">
|
||||
<control:DevPaging x:Name="pg" HorizontalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
39
middleware/zdhsys/UI/DeviceClassTabControl.xaml.cs
Normal file
39
middleware/zdhsys/UI/DeviceClassTabControl.xaml.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
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 zdhsys.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// DeviceClassTabControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DeviceClassTabControl : UserControl
|
||||
{
|
||||
public DeviceClassTabControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txt_option.SetUI("类别名称");
|
||||
|
||||
btn_search.SetUI("#027AFF", "#027AFF", "\\Image\\搜索.png", "#FFFFFF", "搜索");
|
||||
btn_clear.SetUI("#FFFFFF", "#027AFF", "\\Image\\重置.png", "#027AFF", "重置");
|
||||
|
||||
btn_add.SetUI("#E8F4FF", "#97D4FF", "\\Image\\add.png", "#1990FF", "创建");
|
||||
btn_del.SetUI("#F2F7FF", "#FF0000", "\\Image\\delete.png", "#FF0000", "批量删除");
|
||||
}
|
||||
}
|
||||
}
|
||||
115
middleware/zdhsys/UI/DeviceGroupTabControl.xaml
Normal file
115
middleware/zdhsys/UI/DeviceGroupTabControl.xaml
Normal file
@@ -0,0 +1,115 @@
|
||||
<UserControl x:Class="zdhsys.UI.DeviceGroupTabControl"
|
||||
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:zdhsys.UI" xmlns:control="clr-namespace:zdhsys.Control"
|
||||
mc:Ignorable="d"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="60"/>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,0">
|
||||
<Grid Background="White">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="1" Margin="10,0,0,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.6*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Content="设备组名称:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Column="2" Content="设备状态:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Column="4" Content="创建时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Column="6" Content="结束时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<control:DevTextBox x:Name="txt_option" Grid.Column="1"/>
|
||||
<ComboBox x:Name="cbb_status" Grid.Column="3" Height="30" VerticalContentAlignment="Center" Background="White"/>
|
||||
<DatePicker x:Name="dpStart" Grid.Column="5" Height="30" VerticalContentAlignment="Center"/>
|
||||
<DatePicker x:Name="dpEnd" Grid.Column="7" Height="30" VerticalContentAlignment="Center"/>
|
||||
<control:DevButton1 Grid.Column="9" x:Name="btn_search" Height="40"/>
|
||||
<control:DevButton1 Grid.Column="10" x:Name="btn_clear" Height="40"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="2" Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,10">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="130"/>
|
||||
<ColumnDefinition Width="130"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<control:DevButton1 x:Name="btn_add" Grid.Column="0" Height="40" Width="120"/>
|
||||
<control:DevButton x:Name="btn_del" Grid.Column="1" Height="40" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="gd_header" Background="#F6F6F6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox x:Name="cb_All" Checked="cb_All_Checked" Unchecked="cb_All_Checked" Margin="0,10,0,0" HorizontalAlignment="Center">
|
||||
<CheckBox.LayoutTransform>
|
||||
<ScaleTransform ScaleX="1.5" ScaleY="1.5" />
|
||||
</CheckBox.LayoutTransform>
|
||||
</CheckBox>
|
||||
<Label Grid.Column="1" Content="设备名称" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="2" Content="设备类别" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="3" Content="设备ID" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="4" Content="标签" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="5" Content="操作物体位置" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="6" Content="操作物体种类" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="7" Content="当前余量" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="8" Content="状态" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="9" Content="设备可操作量" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="10" Content="创建时间" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="11" Content="操作" Style="{StaticResource CustomLabelStyle}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1" x:Name="gd_content">
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2">
|
||||
<control:DevPaging x:Name="pg" HorizontalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
353
middleware/zdhsys/UI/DeviceGroupTabControl.xaml.cs
Normal file
353
middleware/zdhsys/UI/DeviceGroupTabControl.xaml.cs
Normal file
@@ -0,0 +1,353 @@
|
||||
using Newtonsoft.Json;
|
||||
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;
|
||||
using zdhsys.Bean;
|
||||
using zdhsys.Control;
|
||||
using zdhsys.Popup;
|
||||
using zdhsys.Unitils;
|
||||
|
||||
namespace zdhsys.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// DeviceGroupTabControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DeviceGroupTabControl : UserControl
|
||||
{
|
||||
public DeviceGroupTabControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
InitUI();
|
||||
}
|
||||
|
||||
private void InitUI()
|
||||
{
|
||||
btn_add.Click += Btn_add_Click;
|
||||
btn_del.Click += Btn_del_Click;
|
||||
|
||||
btn_search.Click += Btn_search_Click;
|
||||
btn_clear.Click += Btn_clear_Click;
|
||||
|
||||
|
||||
pg.SetNum(0);
|
||||
pg.Click += Pg_Click;
|
||||
}
|
||||
/// <summary>
|
||||
/// 清空查询条件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Btn_clear_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txt_option.SetText("");
|
||||
dpStart.Text = "";
|
||||
dpEnd.Text = "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页控件被触发
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Pg_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Btn_search_Click(null, null);
|
||||
//DataToPage();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量删除
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Btn_del_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
List<CheckBox> cbs = GridViewUnitls.FindCheckBoxesInGrid(gd_content);
|
||||
int num = 0;
|
||||
for (int i = 0; i < cbs.Count; i++)
|
||||
{
|
||||
if ((bool)cbs[i].IsChecked)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
if (num > 0)
|
||||
{
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
DeleteInfo info = new DeleteInfo(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
info.SetUI(":" + num + "个设备组");
|
||||
_ = info.ShowDialog();
|
||||
if (info.flagDelete)
|
||||
{
|
||||
for (int i = 0; i < cbs.Count; i++)
|
||||
{
|
||||
if ((bool)cbs[i].IsChecked)
|
||||
{
|
||||
DeviceGroupInfoModel dgi = cbs[i].Tag as DeviceGroupInfoModel;
|
||||
SqlHelper.Delete(dgi);
|
||||
}
|
||||
}
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<DeviceGroupInfoModel> vs = new List<DeviceGroupInfoModel>();
|
||||
private List<DeviceGroupInfoModel> vs2 = new List<DeviceGroupInfoModel>();
|
||||
/// <summary>
|
||||
/// 创建
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Btn_add_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
AddDeviceGroupInfo info = new AddDeviceGroupInfo(p.X, p.Y)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
_ = info.ShowDialog();
|
||||
//点击保存了。
|
||||
if (info.flag_save)
|
||||
{
|
||||
//转换字段列表为JSON
|
||||
string json = JsonConvert.SerializeObject(info.Dim.Dfms);
|
||||
info.Dim.FieldJson = json;
|
||||
//新增到数据库
|
||||
SqlHelper.Add(info.Dim);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txt_option.SetUI("设备组名称");
|
||||
|
||||
cbb_status.Items.Add("故障");
|
||||
cbb_status.Items.Add("正常");
|
||||
cbb_status.Items.Add("全部");
|
||||
cbb_status.SelectedIndex = 2;
|
||||
|
||||
btn_search.SetUI("#027AFF", "#027AFF", "\\Image\\搜索.png", "#FFFFFF", "搜索");
|
||||
btn_clear.SetUI("#FFFFFF", "#027AFF", "\\Image\\重置.png", "#027AFF", "重置");
|
||||
|
||||
btn_add.SetUI("#E8F4FF", "#97D4FF", "\\Image\\add.png", "#1990FF", "创建");
|
||||
btn_del.SetUI("#F2F7FF", "#FF0000", "\\Image\\delete.png", "#FF0000", "批量删除");
|
||||
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
/// <summary>
|
||||
/// 搜索
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Btn_search_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
int index = cbb_status.SelectedIndex;
|
||||
string start = "";
|
||||
if (!string.IsNullOrEmpty(dpStart.Text))
|
||||
{
|
||||
start = GlobalUnitils.GetNowTime(DateTime.Parse(dpStart.Text + " 00:00:00")).ToString();
|
||||
}
|
||||
string end = "";
|
||||
if (!string.IsNullOrEmpty(dpEnd.Text))
|
||||
{
|
||||
end = GlobalUnitils.GetNowTime(DateTime.Parse(dpEnd.Text + " 23:59:59")).ToString();
|
||||
}
|
||||
vs = SqlHelper.GetDeviceGroupInfoBy(txt_option.Text(), index, start, end);
|
||||
//刷新数量
|
||||
pg.SetNum(vs.Count);
|
||||
|
||||
DataToPage();
|
||||
}
|
||||
|
||||
private void DataToPage()
|
||||
{
|
||||
int limit = (pg.page - 1) * pg.getPageNum();
|
||||
int page = pg.getPageNum();
|
||||
vs2.Clear();
|
||||
for (int i = limit; i < limit + page; i++)
|
||||
{
|
||||
if (i + 1 > vs.Count) { break; }
|
||||
vs2.Add(vs[i]);
|
||||
}
|
||||
//把JSON转为对象
|
||||
for (int i = 0; i < vs2.Count; i++)
|
||||
{
|
||||
vs2[i].Dfms = JsonConvert.DeserializeObject<List<DeviceFieldsModel>>(vs2[i].FieldJson);
|
||||
}
|
||||
DataToUI();
|
||||
}
|
||||
|
||||
private void DataToUI()
|
||||
{
|
||||
gd_content.Children.Clear();
|
||||
gd_content.RowDefinitions.Clear();
|
||||
gd_content.ColumnDefinitions.Clear();
|
||||
for (int i = 0; i < vs2.Count; i++)
|
||||
{
|
||||
DataToGridView(vs2[i]);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示到GridView
|
||||
/// </summary>
|
||||
/// <param name="df"></param>
|
||||
private void DataToGridView(DeviceGroupInfoModel df)
|
||||
{
|
||||
// 创建新的行 - 固定行高:40
|
||||
GridViewUnitls.AddRow(gd_content);
|
||||
|
||||
// 创建并添加新的列到新行
|
||||
for (int i = 0; i < gd_header.ColumnDefinitions.Count; i++)
|
||||
{
|
||||
//当前行,添加1列 -- 列宽对应表头
|
||||
GridViewUnitls.AddColumn(gd_content, gd_header, i);
|
||||
|
||||
// 添加对应的控件到新的格子中
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
GridViewUnitls.AddCellCheck(gd_content, i, df);
|
||||
break;
|
||||
case 1:
|
||||
GridViewUnitls.AddCell(gd_content, i, df.DeviceName);
|
||||
break;
|
||||
case 2:
|
||||
GridViewUnitls.AddCell(gd_content, i, df.DeviceType + "");
|
||||
break;
|
||||
case 3:
|
||||
GridViewUnitls.AddCell(gd_content, i, df.DeviceId);
|
||||
break;
|
||||
case 4:
|
||||
GridViewUnitls.AddCell(gd_content, i, df.TagName);
|
||||
break;
|
||||
case 5:
|
||||
//物体位置
|
||||
string pos = "X:" + df.X + " Y:" + df.Y + " Z:" + df.Z;
|
||||
GridViewUnitls.AddCell(gd_content, i, pos);
|
||||
break;
|
||||
case 6:
|
||||
GridViewUnitls.AddCell(gd_content, i, df.Bottole == 0 ? "大瓶子" : "小瓶子");
|
||||
break;
|
||||
case 7:
|
||||
GridViewUnitls.AddCell(gd_content, i, string.IsNullOrEmpty(df.Remain) ? "-" : df.Remain);
|
||||
break;
|
||||
case 8:
|
||||
//状态
|
||||
GridViewUnitls.AddCellStatus(gd_content, i, df.DeviceStatus == 1 ? "正常" : "故障", df.DeviceStatus == 1 ? GridViewUnitls.ColorHexNormal : GridViewUnitls.ColorHexBreak);
|
||||
break;
|
||||
case 9:
|
||||
//可操作量
|
||||
string str = "";
|
||||
if (df.Dfms != null)
|
||||
{
|
||||
for (int k = 0; k < df.Dfms.Count; k++)
|
||||
{
|
||||
str += df.Dfms[k].FieldsName + ":" + df.Dfms[k].FieldsContent + " ";
|
||||
}
|
||||
}
|
||||
GridViewUnitls.AddCell(gd_content, i, string.IsNullOrEmpty(str) ? "-" : str);
|
||||
break;
|
||||
case 10:
|
||||
GridViewUnitls.AddCell(gd_content, i, GlobalUnitils.GetByLong(df.CreateTime).ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
break;
|
||||
case 11:
|
||||
DevOperation2 dev = new DevOperation2
|
||||
{
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
obj = df//绑定对象。用于详情,修改,删除之类的。
|
||||
};
|
||||
dev.Click_Update += Dev_Click_Update;
|
||||
dev.Click_Delete += Dev_Click_Delete;
|
||||
Grid.SetRow(dev, gd_content.RowDefinitions.Count - 1);
|
||||
Grid.SetColumn(dev, i);
|
||||
gd_content.Children.Add(dev);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
//每行再加一个分割线
|
||||
GridViewUnitls.AddSpLine(gd_content, gd_header);
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除记录
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Dev_Click_Delete(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DevOperation2 dev = sender as DevOperation2;
|
||||
DeviceGroupInfoModel df = dev.obj as DeviceGroupInfoModel;
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
DeleteInfo info = new DeleteInfo(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
info.SetUI("设备组:" + df.DeviceName);
|
||||
_ = info.ShowDialog();
|
||||
if (info.flagDelete)
|
||||
{
|
||||
SqlHelper.Delete(df);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改记录
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Dev_Click_Update(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DevOperation2 dev = sender as DevOperation2;
|
||||
DeviceGroupInfoModel df = dev.obj as DeviceGroupInfoModel;
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
AddDeviceGroupInfo info = new AddDeviceGroupInfo(p.X, p.Y)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
info.Dim = df;
|
||||
info.isUpdate = true;
|
||||
_ = info.ShowDialog();
|
||||
//点击保存了。
|
||||
if (info.flag_save)
|
||||
{
|
||||
info.Dim.FieldJson = JsonConvert.SerializeObject(info.Dim.Dfms);
|
||||
//修改缓存列表和数据库
|
||||
SqlHelper.Update(info.Dim);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 全选/取消全选
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void cb_All_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
bool flag = (bool)cb_All.IsChecked;
|
||||
GridViewUnitls.CheckBoxesInGrid(gd_content, flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
137
middleware/zdhsys/UI/DeviceTabControl.xaml
Normal file
137
middleware/zdhsys/UI/DeviceTabControl.xaml
Normal file
@@ -0,0 +1,137 @@
|
||||
<UserControl x:Class="zdhsys.UI.DeviceTabControl"
|
||||
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:zdhsys.UI"
|
||||
xmlns:control="clr-namespace:zdhsys.Control"
|
||||
mc:Ignorable="d"
|
||||
Background="Transparent"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="450" d:DesignWidth="1400" SizeChanged="UserControl_SizeChanged">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="110"/>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,0">
|
||||
<Grid Background="White">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="1" Margin="10,0,0,0">
|
||||
<control:SwitchButton x:Name="sb" Width="200" HorizontalAlignment="Left" Height="30" Margin="10,0,0,0"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="3" Margin="10,0,0,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Content="设备名称:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Column="2" Content="设备状态:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Column="4" Content="创建时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Column="6" Content="结束时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<control:DevTextBox x:Name="txt_option" Grid.Column="1"/>
|
||||
<ComboBox x:Name="cbb_status" Grid.Column="3" Height="30" VerticalContentAlignment="Center" Background="White"/>
|
||||
<DatePicker x:Name="dpStart" Grid.Column="5" Height="30" VerticalContentAlignment="Center"/>
|
||||
<DatePicker x:Name="dpEnd" Grid.Column="7" Height="30" VerticalContentAlignment="Center"/>
|
||||
<control:DevButton1 Grid.Column="9" x:Name="btn_search" Height="40"/>
|
||||
<control:DevButton1 Grid.Column="10" x:Name="btn_clear" Height="40"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="2" Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,10">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="130"/>
|
||||
<ColumnDefinition Width="130"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<control:DevButton1 x:Name="btn_add" Grid.Column="0" Height="40" Width="120"/>
|
||||
<control:DevButton x:Name="btn_del" Grid.Column="1" Height="40" Width="120"/>
|
||||
</Grid>
|
||||
<!--<ScrollViewer Width="1340" Grid.Row="1" HorizontalScrollBarVisibility="Auto">-->
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="gd_header" Background="#F6F6F6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="30"/>
|
||||
<ColumnDefinition Width="80"/>
|
||||
<ColumnDefinition Width="80"/>
|
||||
<ColumnDefinition Width="80"/>
|
||||
<ColumnDefinition Width="90"/>
|
||||
<ColumnDefinition Width="80"/>
|
||||
<ColumnDefinition Width="100"/>
|
||||
<ColumnDefinition Width="100"/>
|
||||
<ColumnDefinition Width="80"/>
|
||||
<ColumnDefinition Width="50"/>
|
||||
<ColumnDefinition Width="60"/>
|
||||
<ColumnDefinition Width="50"/>
|
||||
<ColumnDefinition Width="50"/>
|
||||
<ColumnDefinition Width="50"/>
|
||||
<ColumnDefinition Width="10*"/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox x:Name="cb_All" Checked="cb_All_Checked" Unchecked="cb_All_Checked" Margin="0,10,0,0" HorizontalAlignment="Center">
|
||||
<CheckBox.LayoutTransform>
|
||||
<ScaleTransform ScaleX="1.5" ScaleY="1.5" />
|
||||
</CheckBox.LayoutTransform>
|
||||
</CheckBox>
|
||||
<Label Grid.Column="1" Content="设备名称" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="2" Content="设备类别" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="3" Content="设备ID" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="4" Content="设备类型" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="5" Content="标签" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="6" Content="操作物体位置" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="7" Content="操作物体种类" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="8" Content="当前余量" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="9" Content="状态" Style="{StaticResource CustomLabelStyle}"/>
|
||||
|
||||
<Label Grid.Column="10" Content="PCR值" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="11" Content="浓度" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="12" Content="密度" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="13" Content="重量" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="14" Content="设备可操作量" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<!--<Label Grid.Column="15" Content="点位列表" Style="{StaticResource CustomLabelStyle}"/>-->
|
||||
<Label Grid.Column="15" Content="操作" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="16" Content="排序" Style="{StaticResource CustomLabelStyle}"/>
|
||||
</Grid>
|
||||
<ScrollViewer Grid.Row="1">
|
||||
<Grid x:Name="gd_content"/>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
<!--</ScrollViewer>-->
|
||||
<Grid Grid.Row="2">
|
||||
<control:DevPaging x:Name="pg" HorizontalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
464
middleware/zdhsys/UI/DeviceTabControl.xaml.cs
Normal file
464
middleware/zdhsys/UI/DeviceTabControl.xaml.cs
Normal file
@@ -0,0 +1,464 @@
|
||||
using Newtonsoft.Json;
|
||||
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;
|
||||
using zdhsys.Bean;
|
||||
using zdhsys.Control;
|
||||
using zdhsys.Popup;
|
||||
using zdhsys.Unitils;
|
||||
|
||||
namespace zdhsys.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// DeviceTabControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DeviceTabControl : UserControl
|
||||
{
|
||||
public DeviceTabControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
btn_add.Click += Btn_add_Click;
|
||||
btn_del.Click += Btn_del_Click;
|
||||
btn_search.Click += Btn_search_Click;
|
||||
btn_clear.Click += Btn_clear_Click;
|
||||
pg.SetNum(0);
|
||||
pg.Click += Pg_Click;
|
||||
sb.Click += Sb_Click;
|
||||
}
|
||||
|
||||
private void Sb_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!sb.flagLeft)
|
||||
{
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
RobotInfo robot = new RobotInfo(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
_ = robot.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void Pg_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
|
||||
private void Btn_clear_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txt_option.SetText("");
|
||||
dpStart.Text = "";
|
||||
dpEnd.Text = "";
|
||||
}
|
||||
|
||||
private List<DeviceInfoModel> vs = new List<DeviceInfoModel>();
|
||||
private List<DeviceInfoModel> vs2 = new List<DeviceInfoModel>();
|
||||
|
||||
private void Btn_search_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
int index = cbb_status.SelectedIndex;
|
||||
string start = "";
|
||||
if (!string.IsNullOrEmpty(dpStart.Text))
|
||||
{
|
||||
start = GlobalUnitils.GetNowTime(DateTime.Parse(dpStart.Text + " 00:00:00")).ToString();
|
||||
}
|
||||
string end = "";
|
||||
if (!string.IsNullOrEmpty(dpEnd.Text))
|
||||
{
|
||||
end = GlobalUnitils.GetNowTime(DateTime.Parse(dpEnd.Text + " 23:59:59")).ToString();
|
||||
}
|
||||
vs = SqlHelper.GetDeviceInfoBy(txt_option.Text(), index, start, end);
|
||||
//刷新数量
|
||||
pg.SetNum(vs.Count);
|
||||
int limit = (pg.page - 1) * pg.getPageNum();
|
||||
int page = pg.getPageNum();
|
||||
vs2.Clear();
|
||||
for (int i = limit; i < limit + page; i++)
|
||||
{
|
||||
if (i + 1 > vs.Count) { break; }
|
||||
vs2.Add(vs[i]);
|
||||
}
|
||||
//把JSON转为对象
|
||||
for (int i = 0; i < vs2.Count; i++)
|
||||
{
|
||||
vs2[i].Dfms = JsonConvert.DeserializeObject<List<DeviceFieldsModel>>(vs2[i].FieldJson);
|
||||
}
|
||||
DataToUI();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量删除
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Btn_del_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
List<CheckBox> cbs = GridViewUnitls.FindCheckBoxesInGrid(gd_content);
|
||||
int num = 0;
|
||||
for (int i = 0; i < cbs.Count; i++)
|
||||
{
|
||||
if ((bool)cbs[i].IsChecked)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
if (num > 0)
|
||||
{
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
DeleteInfo info = new DeleteInfo(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
info.SetUI(":" + num + "个设备");
|
||||
_ = info.ShowDialog();
|
||||
if (info.flagDelete)
|
||||
{
|
||||
for (int i = 0; i < cbs.Count; i++)
|
||||
{
|
||||
if ((bool)cbs[i].IsChecked)
|
||||
{
|
||||
DeviceInfoModel dgi = cbs[i].Tag as DeviceInfoModel;
|
||||
SqlHelper.Delete(dgi);
|
||||
}
|
||||
}
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Btn_add_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
//if (SqlHelper.CountDeviceGroupInfo() == 0)
|
||||
//{
|
||||
// MessageInfo msg = new MessageInfo(p)
|
||||
// {
|
||||
// Width = ActualWidth,
|
||||
// Height = ActualHeight
|
||||
// };
|
||||
// msg.SetUI("请先添加设备组!!!");
|
||||
// _ = msg.ShowDialog();
|
||||
// return;
|
||||
//}
|
||||
AddDeviceInfo info = new AddDeviceInfo(p.X, p.Y)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
_ = info.ShowDialog();
|
||||
//点击保存了。
|
||||
if (info.flag_save)
|
||||
{
|
||||
SqlHelper.Add(info.Dim);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txt_option.SetUI("设备名称");
|
||||
|
||||
cbb_status.Items.Add("故障");
|
||||
cbb_status.Items.Add("正常");
|
||||
cbb_status.Items.Add("全部");
|
||||
cbb_status.SelectedIndex = 2;
|
||||
|
||||
btn_search.SetUI("#027AFF", "#027AFF", "\\Image\\搜索.png", "#FFFFFF", "搜索");
|
||||
btn_clear.SetUI("#FFFFFF", "#027AFF", "\\Image\\重置.png", "#027AFF", "重置");
|
||||
|
||||
btn_add.SetUI("#E8F4FF", "#97D4FF", "\\Image\\add.png", "#1990FF", "创建");
|
||||
btn_del.SetUI("#F2F7FF", "#FF0000", "\\Image\\delete.png", "#FF0000", "批量删除");
|
||||
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
|
||||
private void DataToUI()
|
||||
{
|
||||
gd_content.Children.Clear();
|
||||
gd_content.RowDefinitions.Clear();
|
||||
gd_content.ColumnDefinitions.Clear();
|
||||
for (int i = 0; i < vs2.Count; i++)
|
||||
{
|
||||
DataToGridView(vs2[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private void DataToGridView(DeviceInfoModel df)
|
||||
{
|
||||
// 创建新的行 - 固定行高:40
|
||||
GridViewUnitls.AddRow(gd_content);
|
||||
|
||||
// 创建并添加新的列到新行
|
||||
for (int i = 0; i < gd_header.ColumnDefinitions.Count; i++)
|
||||
{
|
||||
//当前行,添加1列 -- 列宽对应表头
|
||||
GridViewUnitls.AddColumn(gd_content, gd_header, i);
|
||||
|
||||
// 添加对应的控件到新的格子中
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
GridViewUnitls.AddCellCheck(gd_content, i, df);
|
||||
break;
|
||||
case 1:
|
||||
GridViewUnitls.AddCell(gd_content, i, df.DeviceName);
|
||||
break;
|
||||
case 2:
|
||||
GridViewUnitls.AddCell(gd_content, i, df.DeviceType == 1 ? "转移类设备" : "反应类设备");
|
||||
break;
|
||||
case 3:
|
||||
GridViewUnitls.AddCell(gd_content, i, df.DeviceId);
|
||||
break;
|
||||
case 4:
|
||||
string deviceGroupName = "";
|
||||
if (!string.IsNullOrEmpty(df.DeviceGroupId))
|
||||
{
|
||||
int em = int.Parse(df.DeviceGroupId);
|
||||
GlobalEnum.UnitDeviceType udt = (GlobalEnum.UnitDeviceType)em;
|
||||
deviceGroupName = udt.ToString();
|
||||
}
|
||||
GridViewUnitls.AddCell(gd_content, i, deviceGroupName);
|
||||
break;
|
||||
case 5:
|
||||
GridViewUnitls.AddCell(gd_content, i, df.TagName);
|
||||
break;
|
||||
case 6:
|
||||
//物体位置
|
||||
string pos = "X:" + df.X + " Y:" + df.Y + " Z:" + df.Z;
|
||||
GridViewUnitls.AddCell(gd_content, i, pos);
|
||||
break;
|
||||
case 7:
|
||||
GridViewUnitls.AddCell(gd_content, i, df.Bottole == 0 ? "大瓶子" : "小瓶子");
|
||||
break;
|
||||
case 8:
|
||||
GridViewUnitls.AddCell(gd_content, i, string.IsNullOrEmpty(df.Remain) ? "-" : df.Remain);
|
||||
break;
|
||||
case 9:
|
||||
//状态
|
||||
GridViewUnitls.AddCellStatus(gd_content, i, df.DeviceStatus == 1 ? "正常" : "故障", df.DeviceStatus == 1 ? GridViewUnitls.ColorHexNormal : GridViewUnitls.ColorHexBreak);
|
||||
break;
|
||||
case 10:
|
||||
GridViewUnitls.AddCell(gd_content, i, string.IsNullOrEmpty(df.PCR) ? "-" : df.Remain);
|
||||
break;
|
||||
case 11:
|
||||
GridViewUnitls.AddCell(gd_content, i, string.IsNullOrEmpty(df.Concentration) ? "-" : df.Concentration);
|
||||
break;
|
||||
case 12:
|
||||
GridViewUnitls.AddCell(gd_content, i, string.IsNullOrEmpty(df.Density) ? "-" : df.Density);
|
||||
break;
|
||||
case 13:
|
||||
GridViewUnitls.AddCell(gd_content, i, string.IsNullOrEmpty(df.Weight) ? "-" : df.Weight);
|
||||
break;
|
||||
case 14:
|
||||
//可操作量
|
||||
string str = "";
|
||||
if (df.Dfms != null)
|
||||
{
|
||||
for (int k = 0; k < df.Dfms.Count; k++)
|
||||
{
|
||||
str += df.Dfms[k].FieldsName + ":" + df.Dfms[k].FieldsContent + " ";
|
||||
}
|
||||
}
|
||||
GridViewUnitls.AddCell(gd_content, i, string.IsNullOrEmpty(str) ? "-" : str);
|
||||
break;
|
||||
case 15:
|
||||
DevOperation2 dev = new DevOperation2
|
||||
{
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
obj = df//绑定对象。用于详情,修改,删除之类的。
|
||||
};
|
||||
dev.Click_Update += Dev_Click_Update;
|
||||
dev.Click_Delete += Dev_Click_Delete;
|
||||
Grid.SetRow(dev, gd_content.RowDefinitions.Count - 1);
|
||||
Grid.SetColumn(dev, i);
|
||||
_ = gd_content.Children.Add(dev);
|
||||
break;
|
||||
case 16:
|
||||
DevOperation3 dev3 = new DevOperation3
|
||||
{
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
obj = df//绑定对象。用于详情,修改,删除之类的。
|
||||
};
|
||||
dev3.Click_Up += Dev3_Click_Up;
|
||||
dev3.Click_Down += Dev3_Click_Down;
|
||||
Grid.SetRow(dev3, gd_content.RowDefinitions.Count - 1);
|
||||
Grid.SetColumn(dev3, i);
|
||||
_ = gd_content.Children.Add(dev3);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
//每行再加一个分割线
|
||||
GridViewUnitls.AddSpLine(gd_content, gd_header);
|
||||
}
|
||||
|
||||
private void Dev3_Click_Down(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Console.WriteLine("向下移动");
|
||||
DevOperation3 dev = sender as DevOperation3;
|
||||
DeviceInfoModel df = dev.obj as DeviceInfoModel;
|
||||
List<DeviceInfoModel> vs = SqlHelper.GetDeviceInfo();
|
||||
int index = df.Sort + 1;
|
||||
DeviceInfoModel df2 = GetDeviceInfoModelBySort(vs, index);
|
||||
while(df2 == null)
|
||||
{
|
||||
index++;
|
||||
df2 = GetDeviceInfoModelBySort(vs, index);
|
||||
if (df2 != null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
//大于最大排序。说明不能再下去了。
|
||||
if (index > vs[vs.Count - 1].Sort)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (df2 != null)
|
||||
{
|
||||
// 交换他们两的位置
|
||||
df.Sort = df2.Sort;
|
||||
df2.Sort = df.Sort;
|
||||
SqlHelper.Update(df);
|
||||
SqlHelper.Update(df2);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
private DeviceInfoModel GetDeviceInfoModelBySort(List<DeviceInfoModel> vs, int sort)
|
||||
{
|
||||
for(int i = 0; i < vs.Count; i++)
|
||||
{
|
||||
if (vs[i].Sort == sort)
|
||||
{
|
||||
return vs[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void Dev3_Click_Up(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Console.WriteLine("向上移动");
|
||||
DevOperation3 dev = sender as DevOperation3;
|
||||
DeviceInfoModel df = dev.obj as DeviceInfoModel;
|
||||
List<DeviceInfoModel> vs = SqlHelper.GetDeviceInfo();
|
||||
if (df.Sort > 1)
|
||||
{
|
||||
int index = df.Sort - 1;
|
||||
DeviceInfoModel df2 = GetDeviceInfoModelBySort(vs, index);
|
||||
while (df2 == null)
|
||||
{
|
||||
if (index > 1)
|
||||
{
|
||||
index--;
|
||||
df2 = GetDeviceInfoModelBySort(vs, index);
|
||||
if (df2 != null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (df2 == null)
|
||||
{
|
||||
// 本身就是最小了。所以不能再向上了。
|
||||
Console.WriteLine("本身就是最小了。所以不能再向上了。");
|
||||
}
|
||||
else
|
||||
{
|
||||
// 交换他们两的位置
|
||||
int sort = df.Sort;
|
||||
df.Sort = df2.Sort;
|
||||
df2.Sort = sort;
|
||||
SqlHelper.Update(df);
|
||||
SqlHelper.Update(df2);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Dev_Click_Delete(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DevOperation2 dev = sender as DevOperation2;
|
||||
DeviceInfoModel df = dev.obj as DeviceInfoModel;
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
DeleteInfo info = new DeleteInfo(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
info.SetUI("设备:" + df.DeviceName);
|
||||
_ = info.ShowDialog();
|
||||
if (info.flagDelete)
|
||||
{
|
||||
SqlHelper.Delete(df);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
private void Dev_Click_Update(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DevOperation2 dev = sender as DevOperation2;
|
||||
DeviceInfoModel df = dev.obj as DeviceInfoModel;
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
AddDeviceInfo info = new AddDeviceInfo(p.X, p.Y)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
info.Dim = df;
|
||||
info.isUpdate = true;
|
||||
_ = info.ShowDialog();
|
||||
//点击保存了。
|
||||
if (info.flag_save)
|
||||
{
|
||||
info.Dim.FieldJson = JsonConvert.SerializeObject(info.Dim.Dfms);
|
||||
//修改缓存列表和数据库
|
||||
SqlHelper.Update(info.Dim);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 全选/取消全选
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void cb_All_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
bool flag = (bool)cb_All.IsChecked;
|
||||
GridViewUnitls.CheckBoxesInGrid(gd_content, flag);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自适应大小
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||
{
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
103
middleware/zdhsys/UI/FlowTab.xaml
Normal file
103
middleware/zdhsys/UI/FlowTab.xaml
Normal file
@@ -0,0 +1,103 @@
|
||||
<UserControl x:Class="zdhsys.UI.FlowTab"
|
||||
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:zdhsys.UI" xmlns:control="clr-namespace:zdhsys.Control"
|
||||
mc:Ignorable="d"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="60"/>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,0">
|
||||
<Grid Background="White">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="1" Margin="10,0,0,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.6*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Content="流程名称:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Column="2" Content="流程状态:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Column="4" Content="开始时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Column="6" Content="结束时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<control:DevTextBox x:Name="txt_option" Grid.Column="1"/>
|
||||
<ComboBox x:Name="cbb_status" Grid.Column="3" Height="30" VerticalContentAlignment="Center" Background="White"/>
|
||||
<DatePicker x:Name="dpStart" Grid.Column="5" Height="30" VerticalContentAlignment="Center"/>
|
||||
<DatePicker x:Name="dpEnd" Grid.Column="7" Height="30" VerticalContentAlignment="Center"/>
|
||||
<control:DevButton1 Grid.Column="9" x:Name="btn_search" Height="40"/>
|
||||
<control:DevButton1 Grid.Column="10" x:Name="btn_clear" Height="40"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="2" Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,10">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="130"/>
|
||||
<ColumnDefinition Width="130"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<control:DevButton1 x:Name="btn_add" Grid.Column="0" Height="40" Width="120"/>
|
||||
<control:DevButton x:Name="btn_del" Grid.Column="1" Height="40" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="gd_header" Background="#F6F6F6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox x:Name="cb_All" Checked="cb_All_Checked" Unchecked="cb_All_Checked" Margin="0,10,0,0" HorizontalAlignment="Center">
|
||||
<CheckBox.LayoutTransform>
|
||||
<ScaleTransform ScaleX="1.5" ScaleY="1.5" />
|
||||
</CheckBox.LayoutTransform>
|
||||
</CheckBox>
|
||||
<Label Grid.Column="1" Content="流程名称" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="2" Content="流程编号" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="3" Content="状态" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="4" Content="创建时间" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="5" Content="操作" Style="{StaticResource CustomLabelStyle}"/>
|
||||
</Grid>
|
||||
<ScrollViewer Grid.Row="1">
|
||||
<Grid x:Name="gd_content"/>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2">
|
||||
<control:DevPaging x:Name="pg" HorizontalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
311
middleware/zdhsys/UI/FlowTab.xaml.cs
Normal file
311
middleware/zdhsys/UI/FlowTab.xaml.cs
Normal file
@@ -0,0 +1,311 @@
|
||||
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;
|
||||
using zdhsys.Bean;
|
||||
using zdhsys.Control;
|
||||
using zdhsys.Popup;
|
||||
using zdhsys.Unitils;
|
||||
|
||||
namespace zdhsys.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// FlowTab.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class FlowTab : UserControl
|
||||
{
|
||||
public FlowTab()
|
||||
{
|
||||
InitializeComponent();
|
||||
InitUI();
|
||||
}
|
||||
private void InitUI()
|
||||
{
|
||||
btn_add.Click += Btn_add_Click;
|
||||
btn_del.Click += Btn_del_Click;
|
||||
|
||||
btn_search.Click += Btn_search_Click;
|
||||
btn_clear.Click += Btn_clear_Click;
|
||||
|
||||
pg.SetNum(0);
|
||||
pg.Click += Pg_Click;
|
||||
}
|
||||
/// <summary>
|
||||
/// 清空查询条件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Btn_clear_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txt_option.SetText("");
|
||||
dpStart.Text = "";
|
||||
dpEnd.Text = "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页控件被触发
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Pg_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量删除
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Btn_del_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
List<CheckBox> cbs = GridViewUnitls.FindCheckBoxesInGrid(gd_content);
|
||||
int num = 0;
|
||||
for (int i = 0; i < cbs.Count; i++)
|
||||
{
|
||||
if ((bool)cbs[i].IsChecked)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
if (num > 0)
|
||||
{
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
DeleteInfo info = new DeleteInfo(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
info.SetUI(":" + num + "个流程");
|
||||
_ = info.ShowDialog();
|
||||
if (info.flagDelete)
|
||||
{
|
||||
for (int i = 0; i < cbs.Count; i++)
|
||||
{
|
||||
if ((bool)cbs[i].IsChecked)
|
||||
{
|
||||
FlowModel dgi = cbs[i].Tag as FlowModel;
|
||||
SqlHelper.Delete(dgi);
|
||||
}
|
||||
}
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<FlowModel> vs = new List<FlowModel>();
|
||||
private List<FlowModel> vs2 = new List<FlowModel>();
|
||||
/// <summary>
|
||||
/// 创建
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Btn_add_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
AddFlowImg info = new AddFlowImg(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
_ = info.ShowDialog();
|
||||
//点击保存了。
|
||||
if (info.isSave)
|
||||
{
|
||||
//新增到数据库
|
||||
SqlHelper.Add(info.Fm);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txt_option.SetUI("流程名称");
|
||||
|
||||
cbb_status.Items.Add("未执行");
|
||||
cbb_status.Items.Add("已执行");
|
||||
cbb_status.Items.Add("全部");
|
||||
cbb_status.SelectedIndex = 2;
|
||||
|
||||
btn_search.SetUI("#027AFF", "#027AFF", "\\Image\\搜索.png", "#FFFFFF", "搜索");
|
||||
btn_clear.SetUI("#FFFFFF", "#027AFF", "\\Image\\重置.png", "#027AFF", "重置");
|
||||
|
||||
btn_add.SetUI("#E8F4FF", "#97D4FF", "\\Image\\add.png", "#1990FF", "创建");
|
||||
btn_del.SetUI("#F2F7FF", "#FF0000", "\\Image\\delete.png", "#FF0000", "批量删除");
|
||||
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
/// <summary>
|
||||
/// 搜索
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Btn_search_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
int index = cbb_status.SelectedIndex;
|
||||
string start = "";
|
||||
if (!string.IsNullOrEmpty(dpStart.Text))
|
||||
{
|
||||
start = GlobalUnitils.GetNowTime(DateTime.Parse(dpStart.Text + " 00:00:00")).ToString();
|
||||
}
|
||||
string end = "";
|
||||
if (!string.IsNullOrEmpty(dpEnd.Text))
|
||||
{
|
||||
end = GlobalUnitils.GetNowTime(DateTime.Parse(dpEnd.Text + " 23:59:59")).ToString();
|
||||
}
|
||||
vs = SqlHelper.GetFlowDataInfoBy(txt_option.Text(), index, start, end);
|
||||
//刷新数量
|
||||
pg.SetNum(vs.Count);
|
||||
|
||||
DataToPage();
|
||||
}
|
||||
|
||||
private void DataToPage()
|
||||
{
|
||||
int limit = (pg.page - 1) * pg.getPageNum();
|
||||
int page = pg.getPageNum();
|
||||
vs2.Clear();
|
||||
for (int i = limit; i < limit + page; i++)
|
||||
{
|
||||
if (i + 1 > vs.Count) { break; }
|
||||
vs2.Add(vs[i]);
|
||||
}
|
||||
DataToUI();
|
||||
}
|
||||
|
||||
private void DataToUI()
|
||||
{
|
||||
gd_content.Children.Clear();
|
||||
gd_content.RowDefinitions.Clear();
|
||||
gd_content.ColumnDefinitions.Clear();
|
||||
for (int i = 0; i < vs2.Count; i++)
|
||||
{
|
||||
DataToGridView(vs2[i]);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示到GridView
|
||||
/// </summary>
|
||||
/// <param name="df"></param>
|
||||
private void DataToGridView(FlowModel df)
|
||||
{
|
||||
// 创建新的行 - 固定行高:40
|
||||
GridViewUnitls.AddRow(gd_content);
|
||||
|
||||
// 创建并添加新的列到新行
|
||||
for (int i = 0; i < gd_header.ColumnDefinitions.Count; i++)
|
||||
{
|
||||
//当前行,添加1列 -- 列宽对应表头
|
||||
GridViewUnitls.AddColumn(gd_content, gd_header, i);
|
||||
|
||||
// 添加对应的控件到新的格子中
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
GridViewUnitls.AddCellCheck(gd_content, i, df);
|
||||
break;
|
||||
case 1:
|
||||
GridViewUnitls.AddCell(gd_content, i, df.FlowName);
|
||||
break;
|
||||
case 2:
|
||||
GridViewUnitls.AddCell(gd_content, i, df.FlowNO);
|
||||
break;
|
||||
case 3:
|
||||
//状态
|
||||
GridViewUnitls.AddCellStatus(gd_content, i, df.Status == 0 ? "未执行" : "已执行", df.Status == 1 ? GridViewUnitls.ColorHexNormal : GridViewUnitls.ColorHexBreak);
|
||||
break;
|
||||
case 4:
|
||||
GridViewUnitls.AddCell(gd_content, i, GlobalUnitils.GetByLong(df.CreateTime).ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
break;
|
||||
case 5:
|
||||
DevOperation2 dev = new DevOperation2
|
||||
{
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
obj = df//绑定对象。用于详情,修改,删除之类的。
|
||||
};
|
||||
dev.Click_Update += Dev_Click_Update;
|
||||
dev.Click_Delete += Dev_Click_Delete;
|
||||
Grid.SetRow(dev, gd_content.RowDefinitions.Count - 1);
|
||||
Grid.SetColumn(dev, i);
|
||||
gd_content.Children.Add(dev);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
//每行再加一个分割线
|
||||
GridViewUnitls.AddSpLine(gd_content, gd_header);
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除记录
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Dev_Click_Delete(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DevOperation2 dev = sender as DevOperation2;
|
||||
FlowModel df = dev.obj as FlowModel;
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
DeleteInfo info = new DeleteInfo(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
info.SetUI("流程:" + df.FlowName);
|
||||
_ = info.ShowDialog();
|
||||
if (info.flagDelete)
|
||||
{
|
||||
SqlHelper.Delete(df);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改记录
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Dev_Click_Update(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DevOperation2 dev = sender as DevOperation2;
|
||||
FlowModel df = dev.obj as FlowModel;
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
AddFlowImg info = new AddFlowImg(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
info.Fm = df;
|
||||
info.isUpdate = true;
|
||||
_ = info.ShowDialog();
|
||||
//点击保存了。
|
||||
if (info.isSave)
|
||||
{
|
||||
//修改缓存列表和数据库
|
||||
SqlHelper.Update(info.Fm);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 全选/取消全选
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void cb_All_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
bool flag = (bool)cb_All.IsChecked;
|
||||
GridViewUnitls.CheckBoxesInGrid(gd_content, flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
61
middleware/zdhsys/UI/OptionCreateControl.xaml
Normal file
61
middleware/zdhsys/UI/OptionCreateControl.xaml
Normal file
@@ -0,0 +1,61 @@
|
||||
<UserControl x:Class="zdhsys.UI.OptionCreateControl"
|
||||
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:zdhsys.UI" xmlns:local1="clr-namespace:zdhsys.Control"
|
||||
mc:Ignorable="d"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid Background="White">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="80"/>
|
||||
<ColumnDefinition Width="20"/>
|
||||
<ColumnDefinition Width="10*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50"/>
|
||||
<RowDefinition Height="50"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Button Grid.Row="0" Grid.Column="0" Margin="10,0,0,0" Content="配方管理" FontSize="15" Foreground="#999999" VerticalAlignment="Center" Style="{StaticResource NoBorderButtonStyle0}"/>
|
||||
<Label Grid.Row="0" Grid.Column="1" Content=">" FontSize="15" Foreground="#999999" VerticalAlignment="Center"/>
|
||||
<Label Grid.Row="0" Grid.Column="2" Content="创建配方" FontSize="15" Foreground="#999999" VerticalAlignment="Center"/>
|
||||
|
||||
<Label Grid.Row="1" Grid.Column="0" Margin="10,0,0,0" Content="配方名称" FontSize="15" Foreground="#000000" VerticalAlignment="Center"/>
|
||||
<Grid Grid.Row="1" Grid.Column="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="300"/>
|
||||
<ColumnDefinition Width="160"/>
|
||||
<ColumnDefinition Width="160"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<local1:DevTextBox x:Name="txt_option" Width="250" HorizontalAlignment="Left"/>
|
||||
<local1:DevButton1 x:Name="Btn_Add" Grid.Column="1" Width="150" HorizontalAlignment="Left" Height="40"/>
|
||||
<local1:DevButton1 x:Name="Btn_Save" Grid.Column="2" Width="150" HorizontalAlignment="Left" Height="40"/>
|
||||
<local1:DevButton1 x:Name="Btn_Close" Grid.Column="2" Width="150" HorizontalAlignment="Left" Height="40"/>
|
||||
</Grid>
|
||||
<Label Grid.Row="2" Grid.Column="0" Margin="10,10,0,0" Content="选择内容" FontSize="15" Foreground="#000000" VerticalAlignment="Top"/>
|
||||
<Grid Grid.Row="2" Grid.Column="2" Margin="0,10,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="gd_header" Background="#F6F6F6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Content="标签" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="1" Content="对应于指定设备编号" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="2" Content="数值" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="3" Content="操作" Style="{StaticResource CustomLabelStyle}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1" x:Name="gd_content">
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
82
middleware/zdhsys/UI/OptionCreateControl.xaml.cs
Normal file
82
middleware/zdhsys/UI/OptionCreateControl.xaml.cs
Normal file
@@ -0,0 +1,82 @@
|
||||
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;
|
||||
using zdhsys.Popup;
|
||||
using zdhsys.Unitils;
|
||||
|
||||
namespace zdhsys.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// OptionCreateControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class OptionCreateControl : UserControl
|
||||
{
|
||||
public OptionCreateControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
InitUI();
|
||||
}
|
||||
|
||||
//返回上一个窗口
|
||||
public event RoutedEventHandler Click;
|
||||
|
||||
private void InitUI()
|
||||
{
|
||||
Btn_Add.Click += Btn_Add_Click;
|
||||
Btn_Save.Click += Btn_Save_Click;
|
||||
Btn_Close.Click += Btn_Close_Click;
|
||||
}
|
||||
|
||||
private void Btn_Close_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (Click != null)
|
||||
{
|
||||
Click.Invoke(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txt_option.SetUI("输入配方名称");
|
||||
|
||||
Btn_Add.SetUI("#E8F4FF", "#97D4FF", "\\Image\\add.png", "#1990FF", "增加");
|
||||
Btn_Save.SetUI("#E8F4FF", "#97D4FF", "\\Image\\save.png", "#1990FF", "保存");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存当前配方
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Btn_Save_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 新增配方内容
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Btn_Add_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
AddOptionInfo info = new AddOptionInfo(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
_ = info.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
100
middleware/zdhsys/UI/OptionTab.xaml
Normal file
100
middleware/zdhsys/UI/OptionTab.xaml
Normal file
@@ -0,0 +1,100 @@
|
||||
<UserControl x:Class="zdhsys.UI.OptionTab"
|
||||
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:zdhsys.UI" xmlns:local1="clr-namespace:zdhsys.Control"
|
||||
mc:Ignorable="d"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid x:Name="gd">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="10*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,10">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.6*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Content="配方名称:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Column="2" Content="配方状态:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Column="4" Content="创建时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Column="6" Content="结束时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<local1:DevTextBox x:Name="txt_option" Grid.Column="1"/>
|
||||
<ComboBox x:Name="cbb_status" Grid.Column="3" Height="30" VerticalContentAlignment="Center" Background="White"/>
|
||||
<DatePicker Name="dpStart" Grid.Column="5" Height="30" VerticalContentAlignment="Center"/>
|
||||
<DatePicker x:Name="dpEnd" Grid.Column="7" Height="30" VerticalContentAlignment="Center"/>
|
||||
<local1:DevButton1 Grid.Column="9" x:Name="btn_search" Height="40"/>
|
||||
<local1:DevButton1 Grid.Column="10" x:Name="btn_clear" Height="40"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="1" Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,10">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="130"/>
|
||||
<ColumnDefinition Width="130"/>
|
||||
<ColumnDefinition Width="130"/>
|
||||
<ColumnDefinition Width="130"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<local1:DevButton1 x:Name="btn_add" Click="btn_add_Click" Grid.Column="0" Height="40" Width="120"/>
|
||||
<local1:DevButton x:Name="btn_del" Click="btn_del_Click" Grid.Column="1" Height="40" Width="120"/>
|
||||
<local1:DevButton x:Name="btn_import" Click="btn_import_Click" Grid.Column="2" Height="40" Width="120"/>
|
||||
<local1:DevButton x:Name="btn_model" Click="btn_model_Click" Grid.Column="3" Height="40" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="gd_header" Background="#F6F6F6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox x:Name="cb_All" Checked="cb_All_Checked" Unchecked="cb_All_Checked" Margin="0,10,0,0" HorizontalAlignment="Center">
|
||||
<CheckBox.LayoutTransform>
|
||||
<ScaleTransform ScaleX="1.5" ScaleY="1.5" />
|
||||
</CheckBox.LayoutTransform>
|
||||
</CheckBox>
|
||||
<Label Grid.Column="1" Content="序号" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="2" Content="配方名称" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="3" Content="创建时间" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="4" Content="状态" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="5" Content="操作" Style="{StaticResource CustomLabelStyle}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1" x:Name="gd_content">
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2">
|
||||
<local1:DevPaging x:Name="pg" HorizontalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
422
middleware/zdhsys/UI/OptionTab.xaml.cs
Normal file
422
middleware/zdhsys/UI/OptionTab.xaml.cs
Normal file
@@ -0,0 +1,422 @@
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
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;
|
||||
using zdhsys.Bean;
|
||||
using zdhsys.Control;
|
||||
using zdhsys.Popup;
|
||||
using zdhsys.Unitils;
|
||||
|
||||
namespace zdhsys.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// UCOption.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class OptionTab : UserControl
|
||||
{
|
||||
public OptionTab()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
btn_search.Click += Btn_search_Click;
|
||||
btn_clear.Click += Btn_clear_Click;
|
||||
pg.Click += Pg_Click;
|
||||
}
|
||||
/// <summary>
|
||||
/// 分页控件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Pg_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
/// <summary>
|
||||
/// 重置
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Btn_clear_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txt_option.SetText("");
|
||||
dpStart.Text = "";
|
||||
dpEnd.Text = "";
|
||||
}
|
||||
/// <summary>
|
||||
/// 搜索
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Btn_search_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
int index = cbb_status.SelectedIndex;
|
||||
string start = "";
|
||||
if (!string.IsNullOrEmpty(dpStart.Text))
|
||||
{
|
||||
start = GlobalUnitils.GetNowTime(DateTime.Parse(dpStart.Text + " 00:00:00")).ToString();
|
||||
}
|
||||
string end = "";
|
||||
if (!string.IsNullOrEmpty(dpEnd.Text))
|
||||
{
|
||||
end = GlobalUnitils.GetNowTime(DateTime.Parse(dpEnd.Text + " 23:59:59")).ToString();
|
||||
}
|
||||
vs = SqlHelper.GetOptionsInfoBy(txt_option.Text(), index, start, end);
|
||||
//刷新数量
|
||||
pg.SetNum(vs.Count);
|
||||
DataToUI();
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txt_option.SetUI("配方名称");
|
||||
|
||||
_ = cbb_status.Items.Add("正常");
|
||||
_ = cbb_status.Items.Add("已作废");
|
||||
_ = cbb_status.Items.Add("全部");
|
||||
cbb_status.SelectedIndex = 0;
|
||||
|
||||
btn_search.SetUI("#027AFF", "#027AFF", "\\Image\\搜索.png", "#FFFFFF", "搜索");
|
||||
btn_clear.SetUI("#FFFFFF", "#027AFF", "\\Image\\重置.png", "#027AFF", "重置");
|
||||
|
||||
btn_add.SetUI("#E8F4FF", "#97D4FF", "\\Image\\add.png", "#1990FF", "创建");
|
||||
btn_del.SetUI("#F2F7FF", "#FF0000", "\\Image\\delete.png", "#FF0000", "批量删除");
|
||||
btn_import.SetUI("#E8F4FF", "#97D4FF", "\\Image\\import.png", "#1990FF", "导入模板");
|
||||
btn_model.SetUI("#E8F4FF", "#97D4FF", "\\Image\\model.png", "#1990FF", "编辑模板");
|
||||
|
||||
//gd_content.MouseLeftButtonUp += Gd_content_MouseLeftButtonUp;
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
|
||||
private List<Options> vs = new List<Options>();
|
||||
private List<Options> vs2 = new List<Options>();
|
||||
|
||||
/// <summary>
|
||||
/// 哪个单元内容被单击了。 -- 暂时没啥用。
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Gd_content_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
Grid grid = (Grid)sender;
|
||||
Point clickPosition = e.GetPosition(grid);
|
||||
|
||||
int row = -1;
|
||||
int column = -1;
|
||||
|
||||
for (int i = 0; i < grid.RowDefinitions.Count; i++)
|
||||
{
|
||||
if (clickPosition.Y >= grid.RowDefinitions[i].Offset && clickPosition.Y <= grid.RowDefinitions[i].ActualHeight + grid.RowDefinitions[i].Offset)
|
||||
{
|
||||
row = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < grid.ColumnDefinitions.Count; i++)
|
||||
{
|
||||
if (clickPosition.X >= grid.ColumnDefinitions[i].Offset && clickPosition.X <= grid.ColumnDefinitions[i].ActualWidth + grid.ColumnDefinitions[i].Offset)
|
||||
{
|
||||
column = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 输出被单击的行和列
|
||||
Console.WriteLine("被单击的行:{0}", row);
|
||||
Console.WriteLine("被单击的列:{0}", column);
|
||||
|
||||
// 遍历并设置 Grid 的每一行的背景色
|
||||
}
|
||||
|
||||
private void DataToUI()
|
||||
{
|
||||
gd_content.Children.Clear();
|
||||
gd_content.RowDefinitions.Clear();
|
||||
gd_content.ColumnDefinitions.Clear();
|
||||
//处理分页
|
||||
int limit = (pg.page - 1) * pg.getPageNum();
|
||||
int page = pg.getPageNum();
|
||||
vs2.Clear();
|
||||
for (int i = limit; i < limit + page; i++)
|
||||
{
|
||||
if (i + 1 > vs.Count) { break; }
|
||||
vs2.Add(vs[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < vs2.Count; i++)
|
||||
{
|
||||
DataToGridView(vs2[i],i);
|
||||
}
|
||||
}
|
||||
|
||||
private void DataToGridView(Options opt, int index)
|
||||
{
|
||||
// 创建新的行- 固定行高:40
|
||||
GridViewUnitls.AddRow(gd_content);
|
||||
|
||||
// 创建并添加新的列到新行
|
||||
for (int i = 0; i < gd_header.ColumnDefinitions.Count; i++)
|
||||
{
|
||||
GridViewUnitls.AddColumn(gd_content, gd_header, i);
|
||||
|
||||
// 添加对应的控件到新的格子中
|
||||
if (i == 0)
|
||||
{
|
||||
GridViewUnitls.AddCellCheck(gd_content, i, opt);
|
||||
}
|
||||
else if (i == 1)
|
||||
{
|
||||
GridViewUnitls.AddCell(gd_content, i, index + 1 + "");
|
||||
}
|
||||
else if (i == 2)
|
||||
{
|
||||
GridViewUnitls.AddCell(gd_content, i, opt.OptionName);
|
||||
}
|
||||
else if (i == 3)
|
||||
{
|
||||
GridViewUnitls.AddCell(gd_content, i, GlobalUnitils.GetByLong2(opt.CreateTime));
|
||||
}
|
||||
|
||||
else if (i == 4)
|
||||
{
|
||||
if (opt.Status == 0)
|
||||
{
|
||||
GridViewUnitls.AddCellStatus(gd_content, i, "正常", GridViewUnitls.ColorHexNormal);
|
||||
}
|
||||
else
|
||||
{
|
||||
GridViewUnitls.AddCellStatus(gd_content, i, "已作废", GridViewUnitls.ColorHexBreak);
|
||||
}
|
||||
}
|
||||
else if (i == 5)
|
||||
{
|
||||
DevOperation dev = new DevOperation
|
||||
{
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
obj = opt//绑定对象。用于详情,修改,删除之类的。
|
||||
};
|
||||
dev.Click_Details += Dev_Click_Details;
|
||||
dev.Click_Update += Dev_Click_Update;
|
||||
dev.Click_Delete += Dev_Click_Delete;
|
||||
Grid.SetRow(dev, gd_content.RowDefinitions.Count - 1);
|
||||
Grid.SetColumn(dev, i);
|
||||
gd_content.Children.Add(dev);
|
||||
}
|
||||
}
|
||||
//每行再加一个分割线
|
||||
GridViewUnitls.AddSpLine(gd_content, gd_header);
|
||||
}
|
||||
/// <summary>
|
||||
/// 配方详情
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Dev_Click_Details(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DevOperation dev = sender as DevOperation;
|
||||
Options df = dev.obj as Options;
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
AddOptionNew win = new AddOptionNew(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
win.opt = df;
|
||||
win.isSee = true;
|
||||
win.isUpdate = true;
|
||||
_ = win.ShowDialog();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 单个删除
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Dev_Click_Delete(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DevOperation dev = sender as DevOperation;
|
||||
Options df = dev.obj as Options;
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
DeleteInfo info = new DeleteInfo(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
info.SetUI("配方:" + df.OptionName);
|
||||
_ = info.ShowDialog();
|
||||
if (info.flagDelete)
|
||||
{
|
||||
SqlHelper.Delete(df);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改配方
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Dev_Click_Update(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DevOperation dev = sender as DevOperation;
|
||||
Options df = dev.obj as Options;
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
AddOptionNew win = new AddOptionNew(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
win.opt = df;
|
||||
win.isUpdate = true;
|
||||
_ = win.ShowDialog();
|
||||
//点击保存了。
|
||||
if (win.flag_Save)
|
||||
{
|
||||
//修改缓存列表和数据库
|
||||
SqlHelper.Update(win.opt);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 新增配方
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btn_add_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
|
||||
SelectFlowData2 sfd = new SelectFlowData2(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
_ = sfd.ShowDialog();
|
||||
if (sfd.flag_Save)
|
||||
{
|
||||
AddOptionNew win = new AddOptionNew(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight,
|
||||
fm = sfd.fm
|
||||
};
|
||||
_ = win.ShowDialog();
|
||||
if (win.flag_Save)
|
||||
{
|
||||
SqlHelper.Add(win.opt);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量删除
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btn_del_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
List<CheckBox> cbs = GridViewUnitls.FindCheckBoxesInGrid(gd_content);
|
||||
int num = 0;
|
||||
for (int i = 0; i < cbs.Count; i++)
|
||||
{
|
||||
if ((bool)cbs[i].IsChecked)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
if (num > 0)
|
||||
{
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
DeleteInfo info = new DeleteInfo(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
info.SetUI(":" + num + "个配方");
|
||||
_ = info.ShowDialog();
|
||||
if (info.flagDelete)
|
||||
{
|
||||
for (int i = 0; i < cbs.Count; i++)
|
||||
{
|
||||
if ((bool)cbs[i].IsChecked)
|
||||
{
|
||||
Options dgi = cbs[i].Tag as Options;
|
||||
SqlHelper.Delete(dgi);
|
||||
}
|
||||
}
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导入配方
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btn_import_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
openFileDialog.Filter = "Text Files (*.txt)|*.txt";
|
||||
if (openFileDialog.ShowDialog() == true)
|
||||
{
|
||||
string filePath = openFileDialog.FileName;
|
||||
// 在这里使用 filePath 处理所选文件
|
||||
Console.WriteLine("path=" + filePath);
|
||||
string ret = File.ReadAllText(filePath);
|
||||
Console.WriteLine(ret);
|
||||
if (string.IsNullOrEmpty(ret)) return;
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
OptionNewModel win = new OptionNewModel(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
win.isUpdate = true;
|
||||
win.jsonOption = ret;
|
||||
_ = win.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 模板
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btn_model_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
OptionNewModel win = new OptionNewModel(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
_ = win.ShowDialog();
|
||||
}
|
||||
/// <summary>
|
||||
/// 全选/取消全选
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void cb_All_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
bool flag = (bool)cb_All.IsChecked;
|
||||
GridViewUnitls.CheckBoxesInGrid(gd_content, flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
93
middleware/zdhsys/UI/SubOptionTab.xaml
Normal file
93
middleware/zdhsys/UI/SubOptionTab.xaml
Normal file
@@ -0,0 +1,93 @@
|
||||
<UserControl x:Class="zdhsys.UI.SubOptionTab"
|
||||
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:zdhsys.UI" xmlns:local1="clr-namespace:zdhsys.Control"
|
||||
mc:Ignorable="d"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="450" d:DesignWidth="1000">
|
||||
<Grid>
|
||||
<Grid x:Name="gd">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="10*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,10">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.6*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Content="配方名称:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Column="2" Content="创建时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Column="4" Content="结束时间:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<local1:DevTextBox x:Name="txt_option" Grid.Column="1"/>
|
||||
<DatePicker x:Name="dpStart" Grid.Column="3" Height="30" VerticalContentAlignment="Center"/>
|
||||
<DatePicker x:Name="dpEnd" Grid.Column="5" Height="30" VerticalContentAlignment="Center"/>
|
||||
<local1:DevButton1 Grid.Column="7" x:Name="btn_search" Height="40"/>
|
||||
<local1:DevButton1 Grid.Column="8" x:Name="btn_clear" Height="40"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="1" Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,10">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="130"/>
|
||||
<ColumnDefinition Width="130"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<local1:DevButton1 x:Name="btn_add" Click="btn_add_Click" Grid.Column="0" Height="40" Width="120"/>
|
||||
<local1:DevButton x:Name="btn_del" Click="btn_del_Click" Grid.Column="1" Height="40" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="12*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="gd_header" Background="#F6F6F6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox x:Name="cb_All" Checked="cb_All_Checked" Unchecked="cb_All_Checked" Margin="0,10,0,0" HorizontalAlignment="Center">
|
||||
<CheckBox.LayoutTransform>
|
||||
<ScaleTransform ScaleX="1.5" ScaleY="1.5" />
|
||||
</CheckBox.LayoutTransform>
|
||||
</CheckBox>
|
||||
<Label Grid.Column="1" Content="序号" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="2" Content="配方名称" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="3" Content="创建时间" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="4" Content="状态" Style="{StaticResource CustomLabelStyle}"/>
|
||||
<Label Grid.Column="5" Content="操作" Style="{StaticResource CustomLabelStyle}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1" x:Name="gd_content">
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2">
|
||||
<local1:DevPaging x:Name="pg" HorizontalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
327
middleware/zdhsys/UI/SubOptionTab.xaml.cs
Normal file
327
middleware/zdhsys/UI/SubOptionTab.xaml.cs
Normal file
@@ -0,0 +1,327 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using zdhsys.Bean;
|
||||
using zdhsys.Control;
|
||||
using zdhsys.Popup;
|
||||
using zdhsys.Unitils;
|
||||
|
||||
namespace zdhsys.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// UCOption.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SubOptionTab : UserControl
|
||||
{
|
||||
public SubOptionTab()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
btn_search.Click += Btn_search_Click;
|
||||
btn_clear.Click += Btn_clear_Click;
|
||||
pg.Click += Pg_Click;
|
||||
}
|
||||
/// <summary>
|
||||
/// 分页控件事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Pg_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
/// <summary>
|
||||
/// 重置
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Btn_clear_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txt_option.SetText("");
|
||||
dpStart.Text = "";
|
||||
dpEnd.Text = "";
|
||||
}
|
||||
/// <summary>
|
||||
/// 搜索
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Btn_search_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string start = "";
|
||||
if (!string.IsNullOrEmpty(dpStart.Text))
|
||||
{
|
||||
start = GlobalUnitils.GetNowTime(DateTime.Parse(dpStart.Text + " 00:00:00")).ToString();
|
||||
}
|
||||
string end = "";
|
||||
if (!string.IsNullOrEmpty(dpEnd.Text))
|
||||
{
|
||||
end = GlobalUnitils.GetNowTime(DateTime.Parse(dpEnd.Text + " 23:59:59")).ToString();
|
||||
}
|
||||
vs = SqlHelper.GetSubOptionInfoBy(txt_option.Text(), start, end);
|
||||
//刷新数量
|
||||
pg.SetNum(vs.Count);
|
||||
DataToUI();
|
||||
}
|
||||
|
||||
private List<SubOptionModel> vs = new List<SubOptionModel>();
|
||||
private List<SubOptionModel> vs2 = new List<SubOptionModel>();
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txt_option.SetUI("配方名称");
|
||||
|
||||
btn_search.SetUI("#027AFF", "#027AFF", "\\Image\\搜索.png", "#FFFFFF", "搜索");
|
||||
btn_clear.SetUI("#FFFFFF", "#027AFF", "\\Image\\重置.png", "#027AFF", "重置");
|
||||
|
||||
btn_add.SetUI("#E8F4FF", "#97D4FF", "\\Image\\add.png", "#1990FF", "创建");
|
||||
btn_del.SetUI("#F2F7FF", "#FF0000", "\\Image\\delete.png", "#FF0000", "批量删除");
|
||||
|
||||
//gd_content.MouseLeftButtonUp += Gd_content_MouseLeftButtonUp;
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 哪个单元内容被单击了。 -- 暂时没啥用。
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Gd_content_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
Grid grid = (Grid)sender;
|
||||
Point clickPosition = e.GetPosition(grid);
|
||||
|
||||
int row = -1;
|
||||
int column = -1;
|
||||
|
||||
for (int i = 0; i < grid.RowDefinitions.Count; i++)
|
||||
{
|
||||
if (clickPosition.Y >= grid.RowDefinitions[i].Offset && clickPosition.Y <= grid.RowDefinitions[i].ActualHeight + grid.RowDefinitions[i].Offset)
|
||||
{
|
||||
row = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < grid.ColumnDefinitions.Count; i++)
|
||||
{
|
||||
if (clickPosition.X >= grid.ColumnDefinitions[i].Offset && clickPosition.X <= grid.ColumnDefinitions[i].ActualWidth + grid.ColumnDefinitions[i].Offset)
|
||||
{
|
||||
column = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 输出被单击的行和列
|
||||
Console.WriteLine("被单击的行:{0}", row);
|
||||
Console.WriteLine("被单击的列:{0}", column);
|
||||
|
||||
// 遍历并设置 Grid 的每一行的背景色
|
||||
}
|
||||
|
||||
private void DataToUI()
|
||||
{
|
||||
gd_content.Children.Clear();
|
||||
gd_content.RowDefinitions.Clear();
|
||||
gd_content.ColumnDefinitions.Clear();
|
||||
//处理点分页问题
|
||||
int limit = (pg.page - 1) * pg.getPageNum();
|
||||
int page = pg.getPageNum();
|
||||
vs2.Clear();
|
||||
for (int i = limit; i < limit + page; i++)
|
||||
{
|
||||
if (i + 1 > vs.Count) { break; }
|
||||
vs2.Add(vs[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < vs2.Count; i++)
|
||||
{
|
||||
DataToGridView(vs2[i], i);
|
||||
}
|
||||
}
|
||||
|
||||
private void DataToGridView(SubOptionModel som,int index)
|
||||
{
|
||||
// 创建新的行- 固定行高:40
|
||||
GridViewUnitls.AddRow(gd_content);
|
||||
|
||||
// 创建并添加新的列到新行
|
||||
for (int i = 0; i < gd_header.ColumnDefinitions.Count; i++)
|
||||
{
|
||||
GridViewUnitls.AddColumn(gd_content, gd_header, i);
|
||||
|
||||
// 添加对应的控件到新的格子中
|
||||
if (i == 0)
|
||||
{
|
||||
GridViewUnitls.AddCellCheck(gd_content, i, som);
|
||||
}
|
||||
else if (i == 1)
|
||||
{
|
||||
// 例如:TextBlock
|
||||
GridViewUnitls.AddCell(gd_content, i, index + 1 + "");
|
||||
}
|
||||
else if (i == 2)
|
||||
{
|
||||
// 例如:TextBlock
|
||||
GridViewUnitls.AddCell(gd_content, i, som.SubOptionName);
|
||||
}
|
||||
else if (i == 3)
|
||||
{
|
||||
// 例如:TextBlock
|
||||
GridViewUnitls.AddCell(gd_content, i, GlobalUnitils.GetByLong2(som.CreateTime));
|
||||
}
|
||||
else if (i == 4)
|
||||
{
|
||||
if (som.Status == 0)
|
||||
{
|
||||
GridViewUnitls.AddCellStatus(gd_content, i, "正常", GridViewUnitls.ColorHexNormal);
|
||||
}
|
||||
else
|
||||
{
|
||||
GridViewUnitls.AddCellStatus(gd_content, i, "已作废", GridViewUnitls.ColorHexBreak);
|
||||
}
|
||||
}
|
||||
else if (i == 5)
|
||||
{
|
||||
DevOperation2 dev = new DevOperation2
|
||||
{
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
obj = som //绑定对象。用于详情,修改,删除之类的。
|
||||
};
|
||||
dev.Click_Update += Dev_Click_Update;
|
||||
dev.Click_Delete += Dev_Click_Delete;
|
||||
Grid.SetRow(dev, gd_content.RowDefinitions.Count - 1);
|
||||
Grid.SetColumn(dev, i);
|
||||
gd_content.Children.Add(dev);
|
||||
}
|
||||
}
|
||||
//每行再加一个分割线
|
||||
GridViewUnitls.AddSpLine(gd_content, gd_header);
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除单个记录
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Dev_Click_Delete(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DevOperation2 dev = sender as DevOperation2;
|
||||
SubOptionModel df = dev.obj as SubOptionModel;
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
DeleteInfo info = new DeleteInfo(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
info.SetUI("子配方:" + df.SubOptionName);
|
||||
_ = info.ShowDialog();
|
||||
if (info.flagDelete)
|
||||
{
|
||||
SqlHelper.Delete(df);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 记录更新
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Dev_Click_Update(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DevOperation2 dev = sender as DevOperation2;
|
||||
SubOptionModel df = dev.obj as SubOptionModel;
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
AddSubOptionNew win = new AddSubOptionNew(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
win.opt = df;
|
||||
win.isUpdate = true;
|
||||
_ = win.ShowDialog();
|
||||
//点击保存了。
|
||||
if (win.flag_Save)
|
||||
{
|
||||
//修改缓存列表和数据库
|
||||
SqlHelper.Update(win.opt);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增配方
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btn_add_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
AddSubOptionNew win = new AddSubOptionNew(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
_ = win.ShowDialog();
|
||||
if (win.flag_Save)
|
||||
{
|
||||
SqlHelper.Add(win.opt);
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量删除
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btn_del_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
List<CheckBox> cbs = GridViewUnitls.FindCheckBoxesInGrid(gd_content);
|
||||
int num = 0;
|
||||
for (int i = 0; i < cbs.Count; i++)
|
||||
{
|
||||
if ((bool)cbs[i].IsChecked)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
if (num > 0)
|
||||
{
|
||||
Point p = GetParentWindows.GetPoint(this);
|
||||
DeleteInfo info = new DeleteInfo(p)
|
||||
{
|
||||
Width = ActualWidth,
|
||||
Height = ActualHeight
|
||||
};
|
||||
info.SetUI(":" + num + "个子配方");
|
||||
_ = info.ShowDialog();
|
||||
if (info.flagDelete)
|
||||
{
|
||||
for (int i = 0; i < cbs.Count; i++)
|
||||
{
|
||||
if ((bool)cbs[i].IsChecked)
|
||||
{
|
||||
SubOptionModel dgi = cbs[i].Tag as SubOptionModel;
|
||||
SqlHelper.Delete(dgi);
|
||||
}
|
||||
}
|
||||
Btn_search_Click(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 全选/取消全选
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void cb_All_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
bool flag = (bool)cb_All.IsChecked;
|
||||
GridViewUnitls.CheckBoxesInGrid(gd_content, flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
29
middleware/zdhsys/UI/UCData.xaml
Normal file
29
middleware/zdhsys/UI/UCData.xaml
Normal file
@@ -0,0 +1,29 @@
|
||||
<UserControl x:Class="zdhsys.UI.UCData"
|
||||
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:zdhsys.UI" xmlns:control="clr-namespace:zdhsys.Control"
|
||||
mc:Ignorable="d"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,0">
|
||||
<Grid Background="White">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="300"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<control:DeviceTab x:Name="tab_dev" Height="30"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Grid Grid.Row="1" Margin="0,10,0,0">
|
||||
<ContentControl x:Name="dcc" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
64
middleware/zdhsys/UI/UCData.xaml.cs
Normal file
64
middleware/zdhsys/UI/UCData.xaml.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
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 zdhsys.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// UCData.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class UCData : UserControl
|
||||
{
|
||||
public UCData()
|
||||
{
|
||||
InitializeComponent();
|
||||
InitUI();
|
||||
}
|
||||
|
||||
private void InitUI()
|
||||
{
|
||||
tab_dev.str_1 = "结果数据";
|
||||
tab_dev.str_2 = "设备数据";
|
||||
tab_dev.str_3 = "流程数据";
|
||||
|
||||
tab_dev.Click_Class += Tab_dev_Click_Class;
|
||||
tab_dev.Click_Device += Tab_dev_Click_Device;
|
||||
tab_dev.Click_DeviceGroup += Tab_dev_Click_DeviceGroup;
|
||||
}
|
||||
|
||||
private void Tab_dev_Click_DeviceGroup(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DataDeviceTabControl ddt = new DataDeviceTabControl();
|
||||
dcc.Content = ddt;
|
||||
}
|
||||
|
||||
private void Tab_dev_Click_Device(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DataResultTabControl drt = new DataResultTabControl();
|
||||
dcc.Content = drt;
|
||||
}
|
||||
|
||||
private void Tab_dev_Click_Class(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DataFlowTabControl dft = new DataFlowTabControl();
|
||||
dcc.Content = dft;
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DataResultTabControl drt = new DataResultTabControl();
|
||||
dcc.Content = drt;
|
||||
}
|
||||
}
|
||||
}
|
||||
30
middleware/zdhsys/UI/UCDevice.xaml
Normal file
30
middleware/zdhsys/UI/UCDevice.xaml
Normal file
@@ -0,0 +1,30 @@
|
||||
<UserControl x:Class="zdhsys.UI.UCDevice"
|
||||
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:zdhsys.UI"
|
||||
xmlns:control="clr-namespace:zdhsys.Control"
|
||||
mc:Ignorable="d"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,0">
|
||||
<Grid Background="White">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="300"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<control:DeviceTab x:Name="tab_dev" Height="30"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Grid Grid.Row="1" Margin="0,10,0,0">
|
||||
<ContentControl x:Name="dcc" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
75
middleware/zdhsys/UI/UCDevice.xaml.cs
Normal file
75
middleware/zdhsys/UI/UCDevice.xaml.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
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;
|
||||
using zdhsys.Control;
|
||||
|
||||
namespace zdhsys.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// UCDevice.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class UCDevice : UserControl
|
||||
{
|
||||
public UCDevice()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
InitUI();
|
||||
}
|
||||
|
||||
private void InitUI()
|
||||
{
|
||||
tab_dev.Click_Class += Tab_dev_Click_Class;
|
||||
tab_dev.Click_Device += Tab_dev_Click_Device;
|
||||
tab_dev.Click_DeviceGroup += Tab_dev_Click_DeviceGroup;
|
||||
}
|
||||
/// <summary>
|
||||
/// 设备组管理
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Tab_dev_Click_DeviceGroup(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DeviceGroupTabControl dgt = new DeviceGroupTabControl();
|
||||
dcc.Content = dgt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 设备管理
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Tab_dev_Click_Device(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DeviceTabControl dtc = new DeviceTabControl();
|
||||
dcc.Content = dtc;
|
||||
}
|
||||
/// <summary>
|
||||
/// 类别管理
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Tab_dev_Click_Class(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DeviceClassTabControl dct = new DeviceClassTabControl();
|
||||
dcc.Content = dct;
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//默认加载设备管理
|
||||
DeviceTabControl dtc = new DeviceTabControl();
|
||||
dcc.Content = dtc;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
middleware/zdhsys/UI/UCFlow.xaml
Normal file
13
middleware/zdhsys/UI/UCFlow.xaml
Normal file
@@ -0,0 +1,13 @@
|
||||
<UserControl x:Class="zdhsys.UI.UCFlow"
|
||||
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:zdhsys.UI"
|
||||
mc:Ignorable="d"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<ContentControl x:Name="dcc" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
34
middleware/zdhsys/UI/UCFlow.xaml.cs
Normal file
34
middleware/zdhsys/UI/UCFlow.xaml.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
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 zdhsys.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// UCFlow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class UCFlow : UserControl
|
||||
{
|
||||
public UCFlow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
FlowTab tab = new FlowTab();
|
||||
dcc.Content = tab;
|
||||
}
|
||||
}
|
||||
}
|
||||
176
middleware/zdhsys/UI/UCHome.xaml
Normal file
176
middleware/zdhsys/UI/UCHome.xaml
Normal file
@@ -0,0 +1,176 @@
|
||||
<UserControl x:Class="zdhsys.UI.UCHome"
|
||||
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:zdhsys.UI" xmlns:local1="clr-namespace:zdhsys.Control"
|
||||
mc:Ignorable="d"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="600" d:DesignWidth="800">
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="320"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Background="#F8F8F8" Margin="10,101,10,101">
|
||||
<Border Margin="0,50,0,50" BorderBrush="#C4D1FF" BorderThickness="10" CornerRadius="10">
|
||||
<Border CornerRadius="10">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="8*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<local1:DevLiquid x:Name="dev_liquid_1" Grid.Column="0" Margin="10,0,10,0"/>
|
||||
<local1:DevButton1 x:Name="Btn_Peiye" Content="配液启动" Margin="20,0,0,30" Width="80" Height="20" VerticalAlignment="Bottom" HorizontalAlignment="Left" Loaded="Btn_Peiye_Loaded" Click="Btn_Peiye_Click" FontSize="15" />
|
||||
|
||||
<local1:DevLiquid x:Name="dev_liquid_2" Grid.Column="1" />
|
||||
<local1:DevLiquid x:Name="dev_liquid_3" Grid.Column="2" Margin="10,0,10,0"/>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="8*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<local1:ClearDevice x:Name="dev_clear"/>
|
||||
<Grid Grid.Column="1" Margin="10,0,10,0" Name="gd_robot" VerticalAlignment="Center">
|
||||
<Border x:Name="bd_robot" Background="#C4D1FF" Height="10" CornerRadius="6"></Border>
|
||||
<Canvas >
|
||||
<local1:DevRobot x:Name="dev_robot" Width="100" Height="100" Canvas.Left="0" Canvas.Top="-50"/>
|
||||
</Canvas>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="8*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<local1:ClearDevice x:Name="dev_weigh"/>
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<local1:DeviceGroup x:Name="dev_reactivity" Margin="10,0,0,0"/>
|
||||
|
||||
<local1:DeviceGroup x:Name="dev_pipetting" Grid.Column="1" Margin="10,0,10,0"/>
|
||||
<local1:DevButton1 x:Name="Btn_Workstation" Content="工作站启动" Margin="220,0,0,40" Width="100" Height="20" VerticalAlignment="Top" HorizontalAlignment="Left" Loaded="Btn_Peiye_Loaded" Click="Btn_Workstation_Click" FontSize="15" />
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Border>
|
||||
</Grid>
|
||||
<Grid Grid.Column="1" Margin="10,0,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border CornerRadius="10" Background="White">
|
||||
<Grid >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="设备数据:" Margin="10,10,0,0" Style="{StaticResource CommonStyleBold}"/>
|
||||
<Border Grid.Row="1" Margin="8" CornerRadius="5" Background="#F8F8F8">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="90"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Row="0" Content="当前设备:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Row="1" Content="设备状态:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Row="2" Content="设备数据:" Style="{StaticResource CommonStyleRight}"/>
|
||||
<Label Grid.Row="3" Content="执行指令:" Style="{StaticResource CommonStyleRight}"/>
|
||||
|
||||
<Label Grid.Column="1" Grid.Row="0" Content="机械臂" Style="{StaticResource CommonStyleLeft}" Foreground="#FF0000"/>
|
||||
<Label Grid.Column="1" Grid.Row="1" Content="正常" Style="{StaticResource CommonStyleLeft}" Foreground="#00FF00" />
|
||||
<Label Grid.Column="1" Grid.Row="2" Content="位置(01)" Style="{StaticResource CommonStyleLeft}" />
|
||||
<Label Grid.Column="1" Grid.Row="3" Content="转到位置01处" Style="{StaticResource CommonStyleLeft}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="1" CornerRadius="10" Margin="0,10,0,0" Background="White">
|
||||
<Grid >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="配方数据:" Margin="10,10,0,0" Style="{StaticResource CommonStyleBold}"/>
|
||||
<Border Grid.Row="1" Margin="8,0,8,0" CornerRadius="5" Background="#F8F8F8">
|
||||
<ListView x:Name="lvOption" Height="auto" Background="Transparent" BorderBrush="Transparent" Grid.IsSharedSizeScope="True">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Column1}" Width="55" Margin="4"/>
|
||||
<TextBlock Text="{Binding Column2}" Width="100" Margin="4"/>
|
||||
<TextBlock Text="{Binding Column3}" Width="50" Margin="4"/>
|
||||
<!--<TextBlock Text="{Binding Column4}" Width="50" />-->
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</Border>
|
||||
<Label Grid.Row="2" Content="运行编号: 202308071410001" FontSize="15" Margin="10,2,0,0" Foreground="#333333"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="2" CornerRadius="10" Margin="0,10,0,0" Background="White">
|
||||
<Grid >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<local1:DevButton1 x:Name="Btn_AutoCheck" Width="100" Height="50" Grid.Column="0" />
|
||||
<local1:DevButton x:Name="Btn_Init" Width="100" Height="50" Grid.Column="1" />
|
||||
<local1:DevButton x:Name="Btn_FlowLoad" Width="100" Height="50" Grid.Column="2" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<local1:DevButton1 x:Name="Btn_run" Width="120" Height="50" Grid.Column="0" Grid.Row="0" Loaded="Btn_run_Loaded"/>
|
||||
<local1:DevButton1 x:Name="Btn_Recover" Width="120" Height="50" Grid.Column="1" Grid.Row="0"/>
|
||||
<local1:DevButton1 x:Name="Btn_Stop" Width="120" Height="50" Grid.Column="0" Grid.Row="1"/>
|
||||
<local1:DevButton1 x:Name="Btn_Scram" Width="120" Height="50" Grid.Column="1" Grid.Row="1"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
1349
middleware/zdhsys/UI/UCHome.xaml.cs
Normal file
1349
middleware/zdhsys/UI/UCHome.xaml.cs
Normal file
File diff suppressed because it is too large
Load Diff
29
middleware/zdhsys/UI/UCOption.xaml
Normal file
29
middleware/zdhsys/UI/UCOption.xaml
Normal file
@@ -0,0 +1,29 @@
|
||||
<UserControl x:Class="zdhsys.UI.UCOption"
|
||||
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:zdhsys.UI" xmlns:control="clr-namespace:zdhsys.Control"
|
||||
mc:Ignorable="d"
|
||||
Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border Style="{StaticResource ShadowBorderStyle}" Margin="10,0,10,0">
|
||||
<Grid Background="White">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="300"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<control:OptionTab x:Name="tab_opt" Height="30"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Grid Grid.Row="1" Margin="0,10,0,0">
|
||||
<ContentControl x:Name="dcc" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
49
middleware/zdhsys/UI/UCOption.xaml.cs
Normal file
49
middleware/zdhsys/UI/UCOption.xaml.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
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 zdhsys.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// UCOption.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class UCOption : UserControl
|
||||
{
|
||||
public UCOption()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
tab_opt.Click_Option += Tab_opt_Click_Option;
|
||||
tab_opt.Click_SubOption += Tab_opt_Click_SubOption;
|
||||
}
|
||||
|
||||
private void Tab_opt_Click_SubOption(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SubOptionTab tab = new SubOptionTab();
|
||||
dcc.Content = tab;
|
||||
}
|
||||
|
||||
private void Tab_opt_Click_Option(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OptionTab tab = new OptionTab();
|
||||
dcc.Content = tab;
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OptionTab tab = new OptionTab();
|
||||
dcc.Content = tab;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user