From fd943321fb38972769369b4f1e786495482483bb Mon Sep 17 00:00:00 2001 From: tfarcraw <123211521@163.com> Date: Mon, 20 Jul 2026 23:44:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=BB=E6=AD=A2=E7=AA=97=E5=8F=A3=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=BC=B9=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PLCSharpWpf/VVMs/MainWindow/MainWindow.xaml | 2 +- .../VVMs/MainWindow/MainWindowViewModel.cs | 34 +++++++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/PLCSharpWpf/VVMs/MainWindow/MainWindow.xaml b/PLCSharpWpf/VVMs/MainWindow/MainWindow.xaml index 2a20824..9e19d2b 100644 --- a/PLCSharpWpf/VVMs/MainWindow/MainWindow.xaml +++ b/PLCSharpWpf/VVMs/MainWindow/MainWindow.xaml @@ -212,7 +212,7 @@ Background="Transparent" BorderBrush="{x:Null}" Command="{Binding ShowDialog}" - CommandParameter="Config" Cursor="Hand" ToolTip="配置"> + CommandParameter="SystemConfig" Cursor="Hand" ToolTip="配置"> diff --git a/PLCSharpWpf/VVMs/MainWindow/MainWindowViewModel.cs b/PLCSharpWpf/VVMs/MainWindow/MainWindowViewModel.cs index abd3be8..25371c2 100644 --- a/PLCSharpWpf/VVMs/MainWindow/MainWindowViewModel.cs +++ b/PLCSharpWpf/VVMs/MainWindow/MainWindowViewModel.cs @@ -162,6 +162,12 @@ namespace PLCSharp.VVMs.MainWindow void ExecuteShowDialog(string param) { + + if (showList.Contains(param)) + { + return; + } + switch (param) { case "Login": @@ -170,35 +176,33 @@ namespace PLCSharp.VVMs.MainWindow { if (r.Result == ButtonResult.Yes) { - + } - - if (r.Result == ButtonResult.Retry) + else if (r.Result == ButtonResult.Retry) { _dialogService.ShowDialog("UserManage", new DialogParameters($"message={"message:管理"}"), r => { }); } }); } break; - case "Config": + case "SystemConfig": { - if (Login.CurrentUser == null || Login.CurrentUser.Authority )(r => + _dialogService.Show("SystemConfig", new DialogParameters($"message={"message:系统设置"}"), r => { - - })); + showList.Remove("SystemConfig"); + }); } break; case "ErrorLogs": { - if (showList.Contains("ErrorLogs")) - { - return; - } + showList.Add("ErrorLogs"); _dialogService.Show("ErrorLogs", new DialogParameters($"message={"message:错误日志"}"), (Action)(r => { @@ -210,7 +214,7 @@ namespace PLCSharp.VVMs.MainWindow } } - + /// /// _EventAggregator /// @@ -226,7 +230,7 @@ namespace PLCSharp.VVMs.MainWindow { Target = "Exit" }); - + } }