From 499a261e08f452aa81c4b5a4bad81550ec2e179d Mon Sep 17 00:00:00 2001
From: C3204 <zhengyabo@lanpucloud.cn>
Date: 星期三, 31 十二月 2025 14:03:07 +0800
Subject: [PATCH] 优化相机运动控制界面设计显示1

---
 LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.cs          |  143 ++++++++++++++++++++++++++-
 LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.Designer.cs |  134 ++++++++++++--------------
 LB_SmartVision/VisionForm.Designer.cs                                            |    6 -
 3 files changed, 194 insertions(+), 89 deletions(-)

diff --git a/LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.Designer.cs b/LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.Designer.cs
index 4d4b002..564f17c 100644
--- a/LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.Designer.cs
+++ b/LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.Designer.cs
@@ -1,19 +1,22 @@
 锘�
 using ReaLTaiizor.Controls;
+using Sunny.UI;
+using System.Drawing.Printing;
+using System.Windows.Forms;
 
 namespace LB_SmartVision.Forms.Pages.UserManagementPage
 {
     partial class UserManagementEditPage
     {
-        /// <summary>
-        /// Required designer variable.
+        /// <summary> 
+        /// 蹇呴渶鐨勮璁″櫒鍙橀噺銆�
         /// </summary>
         private System.ComponentModel.IContainer components = null;
 
-        /// <summary>
-        /// Clean up any resources being used.
+        /// <summary> 
+        /// 娓呯悊鎵�鏈夋鍦ㄤ娇鐢ㄧ殑璧勬簮銆�
         /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        /// <param name="disposing">濡傛灉搴旈噴鏀炬墭绠¤祫婧愶紝涓� true锛涘惁鍒欎负 false銆�</param>
         protected override void Dispose(bool disposing)
         {
             if (disposing && (components != null))
@@ -23,17 +26,15 @@
             base.Dispose(disposing);
         }
 
-        #region Windows Form Designer generated code
+        #region 缁勪欢璁捐鍣ㄧ敓鎴愮殑浠g爜
 
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
+        /// <summary> 
+        /// 璁捐鍣ㄦ敮鎸佹墍闇�鐨勬柟娉� - 涓嶈淇敼
+        /// 浣跨敤浠g爜缂栬緫鍣ㄤ慨鏀规鏂规硶鐨勫唴瀹广��
         /// </summary>
         private void InitializeComponent()
         {
-            btn_Add = new HopeButton();
-            btn_Clear = new LostButton();
-            uiFlowLayoutPanel1 = new FlowLayoutPanel();
+            grpSetting = new ParrotGroupBox();
             tableLayoutPanel1 = new TableLayoutPanel();
             tableLayoutPanel2 = new TableLayoutPanel();
             tableLayoutPanel3 = new TableLayoutPanel();
@@ -56,68 +57,33 @@
             grpSetting.SuspendLayout();
             tableLayoutPanel1.SuspendLayout();
             tableLayoutPanel2.SuspendLayout();
+            tableLayoutPanel3.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)dataGridViewUM).BeginInit();
+            tableLayoutPanel4.SuspendLayout();
             SuspendLayout();
             // 
-            // btn_Add
+            // grpSetting
             // 
-            btn_Add.BorderColor = Color.FromArgb(220, 223, 230);
-            btn_Add.ButtonType = ReaLTaiizor.Util.HopeButtonType.Primary;
-            btn_Add.Cursor = Cursors.Hand;
-            btn_Add.DangerColor = Color.FromArgb(245, 108, 108);
-            btn_Add.DefaultColor = Color.FromArgb(255, 255, 255);
-            btn_Add.Dock = DockStyle.Fill;
-            btn_Add.Font = new Font("瀹嬩綋", 12F);
-            btn_Add.HoverTextColor = Color.FromArgb(48, 49, 51);
-            btn_Add.InfoColor = Color.FromArgb(144, 147, 153);
-            btn_Add.Location = new Point(503, 3);
-            btn_Add.MinimumSize = new Size(1, 1);
-            btn_Add.Name = "btn_Add";
-            btn_Add.PrimaryColor = Color.FromArgb(64, 158, 255);
-            btn_Add.Size = new Size(95, 38);
-            btn_Add.SuccessColor = Color.FromArgb(103, 194, 58);
-            btn_Add.TabIndex = 11;
-            btn_Add.Text = "澧炲姞";
-            btn_Add.TextColor = Color.White;
-            btn_Add.WarningColor = Color.FromArgb(230, 162, 60);
-            // 
-            // btn_Clear
-            // 
-            btn_Clear.BackColor = Color.FromArgb(45, 45, 48);
-            btn_Clear.Cursor = Cursors.Hand;
-            btn_Clear.Dock = DockStyle.Fill;
-            btn_Clear.Font = new Font("瀹嬩綋", 12F);
-            btn_Clear.ForeColor = Color.White;
-            btn_Clear.HoverColor = Color.DodgerBlue;
-            btn_Clear.Image = null;
-            btn_Clear.Location = new Point(403, 3);
-            btn_Clear.MinimumSize = new Size(1, 1);
-            btn_Clear.Name = "btn_Clear";
-            btn_Clear.Size = new Size(94, 38);
-            btn_Clear.TabIndex = 12;
-            btn_Clear.Text = "娓呴櫎";
-            // 
-            // uiFlowLayoutPanel1
-            // 
-            uiFlowLayoutPanel1.BackColor = Color.FromArgb(32, 41, 50);
-            uiFlowLayoutPanel1.Dock = DockStyle.Fill;
-            uiFlowLayoutPanel1.Font = new Font("瀹嬩綋", 12F);
-            uiFlowLayoutPanel1.ForeColor = SystemColors.Control;
-            uiFlowLayoutPanel1.Location = new Point(4, 5);
-            uiFlowLayoutPanel1.Margin = new Padding(4, 5, 4, 5);
-            uiFlowLayoutPanel1.MinimumSize = new Size(1, 1);
-            uiFlowLayoutPanel1.Name = "uiFlowLayoutPanel1";
-            uiFlowLayoutPanel1.Padding = new Padding(2);
-            uiFlowLayoutPanel1.Size = new Size(599, 293);
-            uiFlowLayoutPanel1.TabIndex = 10;
-            uiFlowLayoutPanel1.Text = "`";
+            grpSetting.BorderColor = Color.DodgerBlue;
+            grpSetting.BorderWidth = 1;
+            grpSetting.Controls.Add(tableLayoutPanel1);
+            grpSetting.Dock = DockStyle.Fill;
+            grpSetting.Font = new Font("瀹嬩綋", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
+            grpSetting.Location = new Point(0, 0);
+            grpSetting.Name = "grpSetting";
+            grpSetting.ShowText = true;
+            grpSetting.Size = new Size(866, 580);
+            grpSetting.TabIndex = 6;
+            grpSetting.TabStop = false;
+            grpSetting.Text = "鐢ㄦ埛绠$悊璁剧疆";
+            grpSetting.TextColor = Color.DodgerBlue;
             // 
             // tableLayoutPanel1
             // 
             tableLayoutPanel1.ColumnCount = 1;
             tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
-            tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 20F));
-            tableLayoutPanel1.Controls.Add(uiFlowLayoutPanel1, 0, 0);
-            tableLayoutPanel1.Controls.Add(tableLayoutPanel2, 0, 1);
+            tableLayoutPanel1.Controls.Add(tableLayoutPanel2, 0, 0);
+            tableLayoutPanel1.Controls.Add(tableLayoutPanel4, 0, 1);
             tableLayoutPanel1.Dock = DockStyle.Fill;
             tableLayoutPanel1.Location = new Point(3, 22);
             tableLayoutPanel1.Name = "tableLayoutPanel1";
@@ -135,7 +101,7 @@
             tableLayoutPanel2.Controls.Add(tableLayoutPanel3, 0, 0);
             tableLayoutPanel2.Controls.Add(dataGridViewUM, 1, 0);
             tableLayoutPanel2.Dock = DockStyle.Fill;
-            tableLayoutPanel2.Location = new Point(3, 306);
+            tableLayoutPanel2.Location = new Point(3, 3);
             tableLayoutPanel2.Name = "tableLayoutPanel2";
             tableLayoutPanel2.RowCount = 1;
             tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
@@ -374,22 +340,42 @@
             // UserManagementEditPage
             // 
             BackColor = Color.FromArgb(32, 41, 50);
-            Controls.Add(tableLayoutPanel1);
-            ForeColor = SystemColors.Control;
+            Controls.Add(grpSetting);
             Name = "UserManagementEditPage";
-            Size = new Size(607, 353);
-            Paint += MESEditPage_Paint;
+            Size = new Size(866, 580);
+            grpSetting.ResumeLayout(false);
+            grpSetting.PerformLayout();
             tableLayoutPanel1.ResumeLayout(false);
             tableLayoutPanel2.ResumeLayout(false);
+            tableLayoutPanel3.ResumeLayout(false);
+            tableLayoutPanel3.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)dataGridViewUM).EndInit();
+            tableLayoutPanel4.ResumeLayout(false);
             ResumeLayout(false);
         }
 
         #endregion
 
-        private ReaLTaiizor.Controls.HopeButton btn_Add;
-        private ReaLTaiizor.Controls.LostButton btn_Clear;
-        private FlowLayoutPanel uiFlowLayoutPanel1;
+        private ParrotGroupBox grpSetting;
         private TableLayoutPanel tableLayoutPanel1;
         private TableLayoutPanel tableLayoutPanel2;
+        private TableLayoutPanel tableLayoutPanel3;
+        private Label labelUsername;
+        private TextBox textBoxUsername;
+        private TextBox textBoxEmployeeID;
+        private Label labelEmployeeID;
+        private TextBox textBoxName;
+        private Label labelName;
+        private Label labelPermission;
+        private TextBox textBoxPassword;
+        private Label labelPassword;
+        private ComboBox comboBoxPermission;
+        private DataGridView dataGridViewUM;
+        private TableLayoutPanel tableLayoutPanel4;
+        private HopeButton btnDel;
+        private HopeButton btnEdit;
+        private HopeButton btnFind;
+        private ForeverButton btnAdd;
     }
+
 }
\ No newline at end of file
diff --git a/LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.cs b/LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.cs
index 5bcb882..0cd133d 100644
--- a/LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.cs
+++ b/LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.cs
@@ -1,28 +1,153 @@
-锘縰sing LB_VisionControl;
-using OpenCvSharp.Flann;
-using System;
+锘縰sing LB_SmartVision.Forms.Pages.ProcessPage;
+using LB_SmartVision.ProcessRun;
+using LB_VisionControl;
+using LB_VisionProcesses;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Serialization;
 using System.Collections.Concurrent;
+using System.Data;
+using System.Text;
+using VisionControl.Forms;
+using LB_SmartVision.Forms.Pages.SettingPage;
+using LB_SmartVisionCommon;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
+using LB_SmartVision.Forms.Pages.CameraPage;
+using System.Security.Principal;
 using System.Windows.Forms;
-using System.Xml.Linq;
 
 namespace LB_SmartVision.Forms.Pages.UserManagementPage
 {
     public partial class UserManagementEditPage : UserControl
     {
         public Action<string, LogInfoType> LogInfo;
-
-
+        RunSettingPage RunSettingPage = new RunSettingPage();
+        LayoutPage LayoutPage = new LayoutPage();
+        CsvPage CsvPage = new CsvPage();
         public UserManagementEditPage()
         {
             Name = "UserManagementEditPage"; 
             Text = "鐢ㄦ埛绠$悊璁剧疆";
+
+            InitializeComponent();
+            InitializeDataGridView();
+            InitializeComboBox();
         }
 
-        private void MESEditPage_Paint(object sender, PaintEventArgs e)
+        private void InitializeDataGridView()
         {
-            uiFlowLayoutPanel1.Controls.Clear();
+            // 璁剧疆DataGridView鍒楀
+            dataGridViewUM.ColumnCount = 5;
+
+            int totalWidth = dataGridViewUM.ClientSize.Width;
+            int columnCount = dataGridViewUM.ColumnCount;
+            int columnWidth = totalWidth / columnCount;
+
+            // 璁剧疆鏈�灏忓搴�
+            int minWidth = 100; // 鏈�灏忓搴�
+            if (columnWidth < minWidth)
+            {
+                columnWidth = minWidth;
+            }
+
+            for (int i = 0; i < columnCount; i++)
+            {
+                dataGridViewUM.Columns[i].Width = columnWidth;
+            }
+
+            // 璁剧疆鍒楁爣棰�
+            dataGridViewUM.Columns[0].Name = "鐢ㄦ埛鍚�";
+            dataGridViewUM.Columns[1].Name = "瀵嗙爜";
+            dataGridViewUM.Columns[2].Name = "濮撳悕";
+            dataGridViewUM.Columns[3].Name = "宸ュ彿";
+            dataGridViewUM.Columns[4].Name = "鏉冮檺";
+
+            dataGridViewUM.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
+
+            // 绂佹缂栬緫鍗曞厓鏍硷紙鍙�夛級
+            dataGridViewUM.ReadOnly = true;
+
+            // 鍏佽澶氳閫夋嫨锛堝彲閫夛級
+            dataGridViewUM.MultiSelect = false;
+
+            // 鏄剧ず琛屾爣棰橈紙鍙�夛級
+            dataGridViewUM.RowHeadersVisible = true;
         }
 
-         
+        private void InitializeComboBox()
+        {
+            // 娣诲姞鏉冮檺閫夐」
+            comboBoxPermission.Items.Add("绠$悊鍛�");
+            comboBoxPermission.Items.Add("鎿嶄綔鍛�");
+
+            // 璁剧疆榛樿閫夋嫨椤�
+            comboBoxPermission.SelectedIndex = 1;
+        }
+
+        private void ClearInputFields()
+        {
+            textBoxUsername.Clear();
+            textBoxPassword.Clear();
+            textBoxName.Clear();
+            textBoxEmployeeID.Clear();
+            comboBoxPermission.SelectedIndex = 1;
+            textBoxUsername.Focus(); // 灏嗙劍鐐硅缃洖鐢ㄦ埛鍚嶈緭鍏ユ
+        }
+        private void btnAdd_Click(object sender, EventArgs e)
+        {
+            // 楠岃瘉杈撳叆
+            if (string.IsNullOrWhiteSpace(textBoxUsername.Text) ||
+                string.IsNullOrWhiteSpace(textBoxPassword.Text) ||
+                string.IsNullOrWhiteSpace(textBoxName.Text) ||
+                string.IsNullOrWhiteSpace(textBoxEmployeeID.Text))
+            {
+                MessageBox.Show("璇峰~鍐欐墍鏈夊繀濉瓧娈碉紒", "鎻愮ず",
+                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                return;
+            }
+
+            // 鍒涘缓鏂拌鏁版嵁
+            string[] row = new string[]
+            {
+                textBoxUsername.Text,
+                textBoxPassword.Text, // 瀹為檯搴旂敤涓瘑鐮佸簲璇ュ姞瀵�
+                textBoxName.Text,
+                textBoxEmployeeID.Text,
+                comboBoxPermission.SelectedItem.ToString()
+            };
+
+            // 璁剧疆鏁翠釜DataGridView鐨勯粯璁ゅ瓧浣撳拰棰滆壊
+            dataGridViewUM.DefaultCellStyle.Font = new Font("瀹嬩綋", 12);
+            dataGridViewUM.DefaultCellStyle.ForeColor = Color.Black;  // 瀛椾綋棰滆壊
+            dataGridViewUM.DefaultCellStyle.BackColor = Color.White;   // 鑳屾櫙棰滆壊
+
+            // 娣诲姞鏂拌鍒癉ataGridView
+            dataGridViewUM.Rows.Add(row);
+
+            // 娓呯┖杈撳叆妗�
+            ClearInputFields();
+        }
+
+        private void btnDel_Click(object sender, EventArgs e)
+        {
+            if (dataGridViewUM.SelectedRows.Count > 0)
+            {
+                // 纭鍒犻櫎
+                DialogResult result = MessageBox.Show("纭畾瑕佸垹闄ら�変腑鐨勮鍚楋紵",
+                    "纭鍒犻櫎", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
+
+                if (result == DialogResult.Yes)
+                {
+                    foreach (DataGridViewRow row in dataGridViewUM.SelectedRows)
+                    {
+                        dataGridViewUM.Rows.Remove(row);
+                    }
+                }
+            }
+            else
+            {
+                MessageBox.Show("璇峰厛閫夋嫨瑕佸垹闄ょ殑琛岋紒", "鎻愮ず",
+                    MessageBoxButtons.OK, MessageBoxIcon.Information);
+            }
+        }
     }
 }
diff --git a/LB_SmartVision/VisionForm.Designer.cs b/LB_SmartVision/VisionForm.Designer.cs
index bfbf818..03ab3bc 100644
--- a/LB_SmartVision/VisionForm.Designer.cs
+++ b/LB_SmartVision/VisionForm.Designer.cs
@@ -108,12 +108,6 @@
             tlp_MainView.Size = new Size(1132, 478);
             tlp_MainView.TabIndex = 1;
             tlp_MainView.TagString = null;
-            // 
-            sc_VisionMainViewer.Panel2.Controls.Add(materialTabControl);
-            sc_VisionMainViewer.Size = new Size(1776, 873);
-            sc_VisionMainViewer.SplitterDistance = 124;
-            sc_VisionMainViewer.SplitterWidth = 5;
-            sc_VisionMainViewer.TabIndex = 0;
             // materialTabControl
             // 
             materialTabControl.AccessibleRole = AccessibleRole.Sound;

--
Gitblit v1.9.3