From d837271cee6e69864898963cc0c3bd694b732d9f Mon Sep 17 00:00:00 2001
From: C3031 <shitiangui@lanpucloud.cn>
Date: 星期一, 05 一月 2026 12:30:13 +0800
Subject: [PATCH] 新增了历史数据查询界面优化了了历史数据查询界面操作逻辑Merge branch 'master' of http://lanpucloud.cn:1111/r/~zhengyabo/LB_TyreAppearanceInspectionSoftware
---
LB_SmartVisionLoginUI/MainWindow.xaml | 31 ++-----
LB_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.cs | 77 ++++++++++++++++++
LB_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.Designer.cs | 19 +++-
LB_SmartVision/Program.cs | 25 +++--
LB_SmartVisionLoginUI/LB_SmartVisionLoginUI.csproj | 73 ++++++++++++++++++
5 files changed, 185 insertions(+), 40 deletions(-)
diff --git a/LB_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.Designer.cs b/LB_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.Designer.cs
index be5221e..dffa1cc 100644
--- a/LB_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.Designer.cs
+++ b/LB_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.Designer.cs
@@ -106,7 +106,6 @@
tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
tableLayoutPanel2.Size = new Size(854, 500);
tableLayoutPanel2.TabIndex = 0;
- tableLayoutPanel2.Paint += tableLayoutPanel2_Paint;
//
// tableLayoutPanel3
//
@@ -120,8 +119,8 @@
tableLayoutPanel3.RowCount = 3;
tableLayoutPanel3.RowStyles.Add(new RowStyle(SizeType.Absolute, 45F));
tableLayoutPanel3.RowStyles.Add(new RowStyle(SizeType.Absolute, 90F));
- tableLayoutPanel3.RowStyles.Add(new RowStyle(SizeType.Absolute, 200F));
- tableLayoutPanel3.Size = new Size(334, 305);
+ tableLayoutPanel3.RowStyles.Add(new RowStyle(SizeType.Absolute, 45F));
+ tableLayoutPanel3.Size = new Size(334, 180);
tableLayoutPanel3.TabIndex = 0;
//
// tableLayoutPanelSN
@@ -135,7 +134,7 @@
tableLayoutPanelSN.Name = "tableLayoutPanelSN";
tableLayoutPanelSN.RowCount = 1;
tableLayoutPanelSN.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
- tableLayoutPanelSN.Size = new Size(328, 45);
+ tableLayoutPanelSN.Size = new Size(328, 39);
tableLayoutPanelSN.TabIndex = 7;
//
// labelSN
@@ -145,7 +144,7 @@
labelSN.ForeColor = SystemColors.Control;
labelSN.Location = new Point(3, 0);
labelSN.Name = "labelSN";
- labelSN.Size = new Size(129, 45);
+ labelSN.Size = new Size(129, 39);
labelSN.TabIndex = 6;
labelSN.Text = "SN鍙�";
labelSN.TextAlign = ContentAlignment.MiddleLeft;
@@ -195,6 +194,7 @@
comboBoxSearchBasis.Name = "comboBoxSearchBasis";
comboBoxSearchBasis.Size = new Size(187, 28);
comboBoxSearchBasis.TabIndex = 1;
+ comboBoxSearchBasis.SelectedIndexChanged += comboBoxSearchBasis_SelectedIndexChanged;
//
// contentContainer
//
@@ -227,6 +227,8 @@
dateTimePickerEnd.Dock = DockStyle.Fill;
dateTimePickerEnd.Location = new Point(138, 50);
dateTimePickerEnd.Margin = new Padding(3, 5, 3, 3);
+ dateTimePickerEnd.MaxDate = new DateTime(2100, 1, 1, 0, 0, 0, 0);
+ dateTimePickerEnd.MinDate = new DateTime(2020, 1, 1, 0, 0, 0, 0);
dateTimePickerEnd.Name = "dateTimePickerEnd";
dateTimePickerEnd.Size = new Size(187, 30);
dateTimePickerEnd.TabIndex = 9;
@@ -236,9 +238,12 @@
dateTimePickerStart.Dock = DockStyle.Fill;
dateTimePickerStart.Location = new Point(138, 5);
dateTimePickerStart.Margin = new Padding(3, 5, 3, 3);
+ dateTimePickerStart.MaxDate = new DateTime(2100, 1, 1, 0, 0, 0, 0);
+ dateTimePickerStart.MinDate = new DateTime(2020, 1, 1, 0, 0, 0, 0);
dateTimePickerStart.Name = "dateTimePickerStart";
dateTimePickerStart.Size = new Size(187, 30);
dateTimePickerStart.TabIndex = 8;
+ dateTimePickerStart.ValueChanged += dateTimePickerStart_ValueChanged;
//
// labelEndTime
//
@@ -362,11 +367,11 @@
private ReaLTaiizor.Controls.HopeButton hopeButton2;
private TableLayoutPanel tableLayoutPanel5;
private Label labelSearchBasis;
- private ComboBox comboBoxSearchBasis;
- private Panel contentContainer;
private TableLayoutPanel tableLayoutPanelSN;
private Label labelSN;
private TextBox textBoxSN;
+ private ComboBox comboBoxSearchBasis;
+ private Panel contentContainer;
private TableLayoutPanel tableLayoutPanelTimeSearch;
private DateTimePicker dateTimePickerEnd;
private DateTimePicker dateTimePickerStart;
diff --git a/LB_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.cs b/LB_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.cs
index d4c539d..7e2178f 100644
--- a/LB_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.cs
+++ b/LB_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.cs
@@ -15,17 +15,26 @@
{
public Action<string, LogInfoType> LogInfo;
- private Panel currentContentPanel;
+ private int row2OriginalHeight;
+ private int row3OriginalHeight;
public HistoricalDataEditPage()
{
Name = "HistoricalDataEditPage";
Text = "鍘嗗彶鏁版嵁鏌ヨ";
InitializeComponent();
+
+ // 淇濆瓨鍘熷琛岄珮搴�
+ row2OriginalHeight = (int)tableLayoutPanel3.RowStyles[1].Height;
+ row3OriginalHeight = (int)tableLayoutPanel3.RowStyles[2].Height;
+
InitializeDataGridView();
InitializeComboBox();
}
+ /// <summary>
+ /// 鏁版嵁鏄剧ず琛ㄦ牸鍒濆鍖�
+ /// </summary>
private void InitializeDataGridView()
{
// 璁剧疆DataGridView鍒楀
@@ -65,6 +74,9 @@
dataGridViewHD.RowHeadersVisible = true;
}
+ /// <summary>
+ /// 閫夋嫨渚濇嵁涓嬫媺妗嗗垵濮嬪寲
+ /// </summary>
private void InitializeComboBox()
{
comboBoxSearchBasis.Items.Add("鏃ユ湡");
@@ -74,9 +86,70 @@
comboBoxSearchBasis.SelectedIndex = 0;
}
- private void tableLayoutPanel2_Paint(object sender, PaintEventArgs e)
+ /// <summary>
+ /// 涓嬫媺妗嗘帶鍒堕�夐」瑙嗗浘鍙樻崲
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void comboBoxSearchBasis_SelectedIndexChanged(object sender, EventArgs e)
{
+ ComboBox cb = sender as ComboBox;
+ if (cb.SelectedIndex == 0)
+ {
+ ShowRow2();
+ }
+ else if (cb.SelectedIndex == 1)
+ {
+ ShowRow3();
+ }
+ }
+
+ private void ShowRow2()
+ {
+ // 鏄剧ずRow2锛堟仮澶嶉珮搴︼級
+ tableLayoutPanel3.RowStyles[1].SizeType = SizeType.Absolute;
+ tableLayoutPanel3.RowStyles[1].Height = row2OriginalHeight;
+
+ // 闅愯棌Row3锛堥珮搴﹁涓�0锛�
+ tableLayoutPanel3.RowStyles[2].SizeType = SizeType.Absolute;
+ tableLayoutPanel3.RowStyles[2].Height = 0;
+
+ // 鏄剧ずRow2涓殑鎺т欢
+ foreach (Control ctrl in tableLayoutPanel3.Controls)
+ {
+ int row = tableLayoutPanel3.GetRow(ctrl);
+ if (row == 1)
+ ctrl.Visible = true;
+ else if (row == 2)
+ ctrl.Visible = false;
+ }
+ }
+
+ private void ShowRow3()
+ {
+ // 闅愯棌Row2锛堥珮搴﹁涓�0锛�
+ tableLayoutPanel3.RowStyles[1].SizeType = SizeType.Absolute;
+ tableLayoutPanel3.RowStyles[1].Height = 0;
+
+ // 鏄剧ずRow3锛堟仮澶嶉珮搴︼級
+ tableLayoutPanel3.RowStyles[2].SizeType = SizeType.Absolute;
+ tableLayoutPanel3.RowStyles[2].Height = row3OriginalHeight;
+
+ // 鏄剧ずRow3涓殑鎺т欢
+ foreach (Control ctrl in tableLayoutPanel3.Controls)
+ {
+ int row = tableLayoutPanel3.GetRow(ctrl);
+ if (row == 1)
+ ctrl.Visible = false;
+ else if (row == 2)
+ ctrl.Visible = true;
+ }
+ }
+
+ private void dateTimePickerStart_ValueChanged(object sender, EventArgs e)
+ {
+ dateTimePickerEnd.MinDate = dateTimePickerStart.Value;
}
}
}
diff --git a/LB_SmartVision/Program.cs b/LB_SmartVision/Program.cs
index 1885513..d27db66 100644
--- a/LB_SmartVision/Program.cs
+++ b/LB_SmartVision/Program.cs
@@ -24,21 +24,26 @@
System.Threading.Mutex mutex = new System.Threading.Mutex(true, System.Windows.Forms.Application.ProductName, out ret);
if (ret)
{
+ ////登录验证权限
MainWindow.InstanceLoginandConfirmation().ShowDialog();
if (!MainWindow.InstanceLoginandConfirmation().isQuit && MainWindow.InstanceLoginandConfirmation().correctUser)
{
MainWindow.InstanceLoginandConfirmation().closeLoginFrm();
- Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
- System.Windows.Forms.Application.EnableVisualStyles();
- System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
- System.Windows.Forms.Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
- System.Windows.Forms.Application.ThreadException += (sender, e) => HandleException(e.Exception);
- AppDomain.CurrentDomain.UnhandledException += (sender, e) => HandleException(e.ExceptionObject as Exception);
- // To customize application configuration such as set high DPI settings or default font,
- // see https://aka.ms/applicationconfiguration.
- System.Windows.Forms.Application.Run(new VisionForm());
}
- // Main 为你程序的主窗体,如果是控制台程序不用这句
+ else
+ {
+ MainWindow.InstanceLoginandConfirmation().closeLoginFrm();
+ }
+ //// Main 为你程序的主窗体,如果是控制台程序不用这句
+ Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
+ System.Windows.Forms.Application.EnableVisualStyles();
+ System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
+ System.Windows.Forms.Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
+ System.Windows.Forms.Application.ThreadException += (sender, e) => HandleException(e.Exception);
+ AppDomain.CurrentDomain.UnhandledException += (sender, e) => HandleException(e.ExceptionObject as Exception);
+ //// To customize application configuration such as set high DPI settings or default font,
+ //// see https://aka.ms/applicationconfiguration.
+ System.Windows.Forms.Application.Run(new VisionForm());
mutex.ReleaseMutex();
}
else
diff --git a/LB_SmartVisionLoginUI/LB_SmartVisionLoginUI.csproj b/LB_SmartVisionLoginUI/LB_SmartVisionLoginUI.csproj
index 87e27cb..9c26aca 100644
--- a/LB_SmartVisionLoginUI/LB_SmartVisionLoginUI.csproj
+++ b/LB_SmartVisionLoginUI/LB_SmartVisionLoginUI.csproj
@@ -10,7 +10,80 @@
</PropertyGroup>
<ItemGroup>
+ <None Remove="favicon.ico" />
+ <None Remove="images\01.JPG" />
+ <None Remove="images\02.png" />
+ <None Remove="images\03.png" />
+ <None Remove="images\04.png" />
+ <None Remove="images\05.png" />
+ <None Remove="images\06.png" />
+ <None Remove="images\07.png" />
+ <None Remove="images\favicon.ico" />
+ <None Remove="images\lanbao.jpg" />
+ <None Remove="images\logo.ico" />
+ <None Remove="images\logo_h.png" />
+ <None Remove="images\閿洏.ico" />
+ <None Remove="lanbao.jpg" />
+ <None Remove="logo.ico" />
+ <None Remove="logo_h.png" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Resource Include="favicon.ico">
+ <CopyToOutputDirectory></CopyToOutputDirectory>
+ </Resource>
+ <Resource Include="images\01.JPG">
+ <CopyToOutputDirectory></CopyToOutputDirectory>
+ </Resource>
+ <Resource Include="images\02.png">
+ <CopyToOutputDirectory></CopyToOutputDirectory>
+ </Resource>
+ <Resource Include="images\03.png">
+ <CopyToOutputDirectory></CopyToOutputDirectory>
+ </Resource>
+ <Resource Include="images\04.png">
+ <CopyToOutputDirectory></CopyToOutputDirectory>
+ </Resource>
+ <Resource Include="images\05.png">
+ <CopyToOutputDirectory></CopyToOutputDirectory>
+ </Resource>
+ <Resource Include="images\06.png">
+ <CopyToOutputDirectory></CopyToOutputDirectory>
+ </Resource>
+ <Resource Include="images\07.png">
+ <CopyToOutputDirectory></CopyToOutputDirectory>
+ </Resource>
+ <Resource Include="images\favicon.ico">
+ <CopyToOutputDirectory></CopyToOutputDirectory>
+ </Resource>
+ <Resource Include="images\lanbao.jpg">
+ <CopyToOutputDirectory></CopyToOutputDirectory>
+ </Resource>
+ <Resource Include="images\logo.ico">
+ <CopyToOutputDirectory></CopyToOutputDirectory>
+ </Resource>
+ <Resource Include="images\logo_h.png">
+ <CopyToOutputDirectory></CopyToOutputDirectory>
+ </Resource>
+ <Resource Include="images\閿洏.ico">
+ <CopyToOutputDirectory></CopyToOutputDirectory>
+ </Resource>
+ </ItemGroup>
+
+ <ItemGroup>
<ProjectReference Include="..\LB_SmartVisionCommon\LB_SmartVisionCommon.csproj" />
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="lanbao.jpg">
+ <CopyToOutputDirectory></CopyToOutputDirectory>
+ </Resource>
+ <Resource Include="logo.ico">
+ <CopyToOutputDirectory></CopyToOutputDirectory>
+ </Resource>
+ <Resource Include="logo_h.png">
+ <CopyToOutputDirectory></CopyToOutputDirectory>
+ </Resource>
+ </ItemGroup>
+
</Project>
diff --git a/LB_SmartVisionLoginUI/MainWindow.xaml b/LB_SmartVisionLoginUI/MainWindow.xaml
index 911a04d..6480596 100644
--- a/LB_SmartVisionLoginUI/MainWindow.xaml
+++ b/LB_SmartVisionLoginUI/MainWindow.xaml
@@ -13,36 +13,25 @@
<Grid x:Name="test" Width="800" Height="460" Opacity="1.0">
<Grid.Background>
- <ImageBrush ImageSource="./images/lanbao.jpg"
- Stretch="UniformToFill"/>
+ <ImageBrush ImageSource="lanbao.jpg"/>
</Grid.Background>
+ <!--<Grid.Background>
+ <ImageBrush ImageSource="/lanbao.jpg"
+ Stretch="UniformToFill"/>
+ </Grid.Background>-->
<!--鏍囬-->
<Border BorderBrush="LightBlue" BorderThickness="3" Height="60" VerticalAlignment="Top" CornerRadius="30" Margin="116,2,102,0" Background="#72F5DEB3">
<Label x:Name="Lbl_Title" BorderBrush="Red" Background="Transparent" Content="杞儙澶栬瑙嗚妫�娴嬬郴缁�" HorizontalAlignment="Center" Foreground="Black" FontFamily="妤蜂綋" FontSize="36" Margin="31,2,91,-2" Width="454"></Label>
</Border>
<!--鍏抽棴绯荤粺-->
- <Image Source="./images/05.png" Height="30" MouseDown="test_Close" Margin="644,15,116,415" ToolTip="鍏抽棴绯荤粺" />
+ <Image Source="/05.png" Height="30" MouseDown="test_Close" Margin="644,15,116,415" ToolTip="鍏抽棴绯荤粺" />
<!--鏈�灏忓寲绯荤粺-->
- <Image Source="./images/06.png" Height="30" Margin="603,15,157,415" MouseDown="test_Min" ToolTip="鏈�灏忓寲"/>
+ <Image Source="/06.png" Height="30" Margin="603,15,157,415" MouseDown="test_Min" ToolTip="鏈�灏忓寲"/>
<Border BorderBrush="LightBlue" Width="700" Height="325" Background="Transparent" BorderThickness="3" CornerRadius="80" Padding="13" >
<Border Width="655" BorderThickness="3" CornerRadius="80" BorderBrush="LightBlue" Padding="23" >
- <!--<Border.Background>
- <ImageBrush ImageSource="./images/lanbao.jpg" Stretch="UniformToFill"/>
- </Border.Background>-->
- <!--<Image Height="161" Width="162" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="-5,40,0,0" RenderTransformOrigin="0.5,0.5" Stretch="Fill" Source="./images/logo.ico"/>-->
- <!--<Image Source="/images/logo_h.png" Height="161" Width="162" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="-5,40,0,0" RenderTransformOrigin="0.5,0.5" Stretch="Fill" Visibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Auto" StretchDirection="DownOnly">-->
- <!--<Image.RenderTransform>
- <TransformGroup>
- <ScaleTransform/>
- <SkewTransform AngleX="0.149"/>
- <RotateTransform/>
- <TranslateTransform X="-0.469"/>
- </TransformGroup>
- </Image.RenderTransform>
- </Image>-->
</Border>
</Border>
@@ -56,9 +45,9 @@
</TransformGroup>
</Border.RenderTransform>
<Button x:Name="Btn_KeyBoard" Margin="283,67,-16,67" Content="" FontFamily="妤蜂綋" FontSize="36" Foreground="Black" Click="Btn_KeyBoard_Click" Visibility="Hidden" >
- <Button.Background>
- <ImageBrush ImageSource="images/閿洏.ico"/>
- </Button.Background>
+ <!--<Button.Background>
+ --><!--<ImageBrush ImageSource="images/閿洏.ico"/>--><!--
+ </Button.Background>-->
</Button>
</Border>
<!--鐢ㄦ埛瀵嗙爜鏍囩鍔犳枃鏈-->
--
Gitblit v1.9.3