From b544d5cccd76735e034c8055918a50927b437474 Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期二, 10 十一月 2026 08:29:04 +0800
Subject: [PATCH] fix: 维护模式重复进入失败与按钮灰死 + Broker 并发验证用例

---
 HMI.SettingControl/SettingControl.xaml.cs |   33 +++++++++++++++++----------------
 1 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/HMI.SettingControl/SettingControl.xaml.cs b/HMI.SettingControl/SettingControl.xaml.cs
index fceb973..322c614 100644
--- a/HMI.SettingControl/SettingControl.xaml.cs
+++ b/HMI.SettingControl/SettingControl.xaml.cs
@@ -1,13 +1,11 @@
-锘縰sing System;
+锘縰sing HMI.Base;
+using HMI.Core.Api;
+using HMI.Core.Util;
+using HMI.UI.Util;
+using System;
 using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Runtime.CompilerServices;
 using System.Windows;
 using System.Windows.Controls;
-using HMI.Base;
-using HMI.Core.Api;
-using HMI.UI.Util;
-using log4net;
 
 namespace HMI.SettingControl
 {
@@ -34,12 +32,14 @@
 
         private void UserControl_Loaded(object sender, RoutedEventArgs e)
         {
+            var item = new TabItem
+            {
+                Content = new SystemConfig()
+            };
+            item.SetValue(TabItem.HeaderProperty, new DynamicResourceExtension("Setting.SystemSetting").ProvideValue(null));
+
             TabItems = new ObservableCollection<TabItem>() {
-                new TabItem
-                {
-                    Header = "绯荤粺璁剧疆",
-                    Content = new SystemConfig()
-                }
+               item
             };
             foreach (var d in PluginLoader.Instance.Plugins)
             {
@@ -51,6 +51,7 @@
                     Content = d.SettingControl
                 });
             }
+            tabControl.SelectedIndex = 0;
             Loaded -= UserControl_Loaded;
         }
 
@@ -80,14 +81,14 @@
                     try
                     {
                         manager.SaveConfig();
+                        this.Success(this.lang("App.SaveSuccess"));
                     }
                     catch (Exception ex)
                     {
-                        MsgBoxHelper.Error(this, $"淇濆瓨{tabItem.Header}閰嶇疆澶辫触锛亄ex.Message}");
+                        MsgBoxHelper.Error(this, $"{tabItem.Header}{this.lang("App.SaveFailed")}: {ex.Message}");
                     }
                 }
             }
-            this.Success("淇濆瓨鎴愬姛");
         }
 
         private void SaveCurrentConfig()
@@ -101,7 +102,7 @@
                 }
                 catch (Exception ex)
                 {
-                    MsgBoxHelper.Error(this, $"淇濆瓨閰嶇疆澶辫触锛亄ex.Message}");
+                    MsgBoxHelper.Error(this, $"{this.lang("App.SaveFailed")}: {ex.Message}");
                 }
             }
         }
@@ -117,7 +118,7 @@
                 }
                 catch (Exception ex)
                 {
-                    MsgBoxHelper.Error(this, $"淇濆瓨閰嶇疆澶辫触锛亄ex.Message}");
+                    MsgBoxHelper.Error(this, $"{this.lang("App.SaveFailed")}: {ex.Message}");
                 }
             }
         }

--
Gitblit v1.9.1