From 9efa0eef0aee92b9bb5a3ad7d457cf8af4d65c23 Mon Sep 17 00:00:00 2001 From: liuwf Date: Sat, 11 May 2024 11:57:15 +0800 Subject: [PATCH] =?UTF-8?q?change-=E7=99=BB=E5=BD=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/MainWindowViewModel.cs | 21 +++------------ .../Views/LoginPageView.xaml.cs | 3 ++- .../ViewModels/MainWindowViewModel.cs | 1 + .../Views/LoginPageView.xaml.cs | 3 ++- .../ViewModels/MainWindowViewModel.cs | 1 + .../Views/LoginPageView.xaml.cs | 3 ++- .../ViewModels/MainWindowViewModel.cs | 27 +++++++------------ .../Views/LoginPageView.xaml.cs | 3 ++- .../ViewModels/MainWindowViewModel.cs | 1 + .../Views/LoginPageView.xaml.cs | 3 ++- .../ViewModels/MainWindowViewModel.cs | 1 + .../Views/LoginPageView.xaml.cs | 3 ++- .../ViewModels/MainWindowViewModel.cs | 1 + .../Views/LoginPageView.xaml.cs | 3 ++- .../ViewModels/MainWindowViewModel.cs | 1 + .../Views/LoginPageView.xaml.cs | 3 ++- .../ViewModels/MainWindowViewModel.cs | 1 + .../Views/LoginPageView.xaml.cs | 3 ++- 18 files changed, 38 insertions(+), 44 deletions(-) diff --git a/Aucma.Core.BoxFoam/ViewModels/MainWindowViewModel.cs b/Aucma.Core.BoxFoam/ViewModels/MainWindowViewModel.cs index 3bd278f4..b711a5ef 100644 --- a/Aucma.Core.BoxFoam/ViewModels/MainWindowViewModel.cs +++ b/Aucma.Core.BoxFoam/ViewModels/MainWindowViewModel.cs @@ -529,24 +529,9 @@ namespace Aucma.Core.BoxFoam.ViewModels { System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => { - if (startflag) - { - startflag = false; - try - { - DateTime now = DateTime.Now; - CurrentDateTime = now.ToString("yyyy-MM-dd HH:mm:ss"); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message); - } - finally - { - startflag = true; - } - } - + TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account}"; + CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + })); } diff --git a/Aucma.Core.BoxFoam/Views/LoginPageView.xaml.cs b/Aucma.Core.BoxFoam/Views/LoginPageView.xaml.cs index ccae57b1..172a9f23 100644 --- a/Aucma.Core.BoxFoam/Views/LoginPageView.xaml.cs +++ b/Aucma.Core.BoxFoam/Views/LoginPageView.xaml.cs @@ -64,7 +64,8 @@ namespace Aucma.Core.BoxFoam.Views return; } // 登录校验 - + txtUserName.Text = ""; + txtPassword.Password = ""; loginViewModel.Login(teamMembers,userName, passWord,this); } diff --git a/Aucma.Core.CodeBinding/ViewModels/MainWindowViewModel.cs b/Aucma.Core.CodeBinding/ViewModels/MainWindowViewModel.cs index ed5756e5..4ccb5cd5 100644 --- a/Aucma.Core.CodeBinding/ViewModels/MainWindowViewModel.cs +++ b/Aucma.Core.CodeBinding/ViewModels/MainWindowViewModel.cs @@ -571,6 +571,7 @@ namespace Aucma.Core.CodeBinding.ViewModels { System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => { + TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account}"; CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); })); diff --git a/Aucma.Core.CodeBinding/Views/LoginPageView.xaml.cs b/Aucma.Core.CodeBinding/Views/LoginPageView.xaml.cs index 017b1663..d3ccafc6 100644 --- a/Aucma.Core.CodeBinding/Views/LoginPageView.xaml.cs +++ b/Aucma.Core.CodeBinding/Views/LoginPageView.xaml.cs @@ -64,7 +64,8 @@ namespace Aucma.Core.CodeBinding.Views return; } // 登录校验 - + txtUserName.Text = ""; + txtPassword.Password = ""; loginViewModel.Login(teamMembers,userName, passWord,this); } diff --git a/Aucma.Core.DoorFoam/ViewModels/MainWindowViewModel.cs b/Aucma.Core.DoorFoam/ViewModels/MainWindowViewModel.cs index d87fb382..59c4c954 100644 --- a/Aucma.Core.DoorFoam/ViewModels/MainWindowViewModel.cs +++ b/Aucma.Core.DoorFoam/ViewModels/MainWindowViewModel.cs @@ -561,6 +561,7 @@ namespace Aucma.Core.DoorFoam.ViewModels { System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => { + TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account}"; CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); })); diff --git a/Aucma.Core.DoorFoam/Views/LoginPageView.xaml.cs b/Aucma.Core.DoorFoam/Views/LoginPageView.xaml.cs index 61e0b663..44092320 100644 --- a/Aucma.Core.DoorFoam/Views/LoginPageView.xaml.cs +++ b/Aucma.Core.DoorFoam/Views/LoginPageView.xaml.cs @@ -63,7 +63,8 @@ namespace Aucma.Core.DoorFoam.Views return; } // 登录校验 - + txtUserName.Text = ""; + txtPassword.Password = ""; loginViewModel.Login(teamMembers,userName, passWord,this); } diff --git a/Aucma.Core.OldBoxFoam/ViewModels/MainWindowViewModel.cs b/Aucma.Core.OldBoxFoam/ViewModels/MainWindowViewModel.cs index d1ceb3ee..74e4685f 100644 --- a/Aucma.Core.OldBoxFoam/ViewModels/MainWindowViewModel.cs +++ b/Aucma.Core.OldBoxFoam/ViewModels/MainWindowViewModel.cs @@ -32,11 +32,10 @@ namespace Aucma.Core.OldBoxFoam.ViewModels public MainWindowViewModel() { UserContent = oldBoxFoamPage; - // 创建一个DispatcherTimer对象 - DispatcherTimer timer = new DispatcherTimer(); - timer.Interval = TimeSpan.FromSeconds(1); - timer.Tick += Timer_Tick; - timer.Start(); + DispatcherTimer timer2 = new DispatcherTimer(); + timer2.Interval = new TimeSpan(0, 0, 1); //间隔1秒 + timer2.Tick += new EventHandler(timer_Tick); + timer2.Start(); Task.Run(() => { @@ -529,21 +528,15 @@ namespace Aucma.Core.OldBoxFoam.ViewModels set => SetProperty(ref _shiftStr, value); } - private void Timer_Tick(object sender, EventArgs e) + void timer_Tick(object sender, EventArgs e) { - DateTime now = DateTime.Now; - - // 判断当前是否是白班时间段 - if (now.Hour >= 8 && now.Hour < 20) - { - ShiftStr = $"白班 08点-20点"; - } - else + System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => { + TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account}"; + CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + + })); - ShiftStr = $"夜班 20点-08点"; - } - CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } } } diff --git a/Aucma.Core.OldBoxFoam/Views/LoginPageView.xaml.cs b/Aucma.Core.OldBoxFoam/Views/LoginPageView.xaml.cs index 659de2a0..e4f62adc 100644 --- a/Aucma.Core.OldBoxFoam/Views/LoginPageView.xaml.cs +++ b/Aucma.Core.OldBoxFoam/Views/LoginPageView.xaml.cs @@ -62,7 +62,8 @@ namespace Aucma.Core.OldBoxFoam.Views return; } // 登录校验 - + txtUserName.Text = ""; + txtPassword.Password = ""; loginViewModel.Login(teamMembers,userName, passWord,this); } diff --git a/Aucma.Core.Palletiz/ViewModels/MainWindowViewModel.cs b/Aucma.Core.Palletiz/ViewModels/MainWindowViewModel.cs index 74e47863..8b8eebe6 100644 --- a/Aucma.Core.Palletiz/ViewModels/MainWindowViewModel.cs +++ b/Aucma.Core.Palletiz/ViewModels/MainWindowViewModel.cs @@ -474,6 +474,7 @@ namespace Aucma.Core.Palletiz.ViewModels { System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => { + TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account} 条码系统: {appConfig.BarCodeAccount}"; CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); })); diff --git a/Aucma.Core.Palletiz/Views/LoginPageView.xaml.cs b/Aucma.Core.Palletiz/Views/LoginPageView.xaml.cs index f87f83c6..c1375194 100644 --- a/Aucma.Core.Palletiz/Views/LoginPageView.xaml.cs +++ b/Aucma.Core.Palletiz/Views/LoginPageView.xaml.cs @@ -63,7 +63,8 @@ namespace Aucma.Core.Palletiz.Views return; } // 登录校验 - + txtUserName.Text = ""; + txtPassword.Password = ""; loginViewModel.Login(teamMembers,userName, passWord,this); } diff --git a/Aucma.Core.PalletizCX1/ViewModels/MainWindowViewModel.cs b/Aucma.Core.PalletizCX1/ViewModels/MainWindowViewModel.cs index 4e2d31cc..3d7faea9 100644 --- a/Aucma.Core.PalletizCX1/ViewModels/MainWindowViewModel.cs +++ b/Aucma.Core.PalletizCX1/ViewModels/MainWindowViewModel.cs @@ -475,6 +475,7 @@ namespace Aucma.Core.PalletizCX1.ViewModels { System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => { + TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account} 条码系统: {appConfig.BarCodeAccount}"; CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); })); diff --git a/Aucma.Core.PalletizCX1/Views/LoginPageView.xaml.cs b/Aucma.Core.PalletizCX1/Views/LoginPageView.xaml.cs index 06ccf17d..42940820 100644 --- a/Aucma.Core.PalletizCX1/Views/LoginPageView.xaml.cs +++ b/Aucma.Core.PalletizCX1/Views/LoginPageView.xaml.cs @@ -63,7 +63,8 @@ namespace Aucma.Core.PalletizCX1.Views return; } // 登录校验 - + txtUserName.Text = ""; + txtPassword.Password = ""; loginViewModel.Login(teamMembers,userName, passWord,this); } diff --git a/Aucma.Core.PrintTo/ViewModels/MainWindowViewModel.cs b/Aucma.Core.PrintTo/ViewModels/MainWindowViewModel.cs index 95c268dd..ed070efa 100644 --- a/Aucma.Core.PrintTo/ViewModels/MainWindowViewModel.cs +++ b/Aucma.Core.PrintTo/ViewModels/MainWindowViewModel.cs @@ -268,6 +268,7 @@ namespace Aucma.Core.PrintTo.ViewModels { System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => { + TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account} 条码系统: {appConfig.BarCodeAccount}"; CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); })); diff --git a/Aucma.Core.PrintTo/Views/LoginPageView.xaml.cs b/Aucma.Core.PrintTo/Views/LoginPageView.xaml.cs index 64e59045..a9f2433a 100644 --- a/Aucma.Core.PrintTo/Views/LoginPageView.xaml.cs +++ b/Aucma.Core.PrintTo/Views/LoginPageView.xaml.cs @@ -62,7 +62,8 @@ namespace Aucma.Core.PrintTo.Views return; } // 登录校验 - + txtUserName.Text = ""; + txtPassword.Password = ""; loginViewModel.Login(teamMembers,userName, passWord,this); } diff --git a/Aucma.Core.ProductOffLine/ViewModels/MainWindowViewModel.cs b/Aucma.Core.ProductOffLine/ViewModels/MainWindowViewModel.cs index 2b8f9035..5158c926 100644 --- a/Aucma.Core.ProductOffLine/ViewModels/MainWindowViewModel.cs +++ b/Aucma.Core.ProductOffLine/ViewModels/MainWindowViewModel.cs @@ -383,6 +383,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels { System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => { + TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account} 条码系统: {appConfig.BarCodeAccount}"; CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); })); diff --git a/Aucma.Core.ProductOffLine/Views/LoginPageView.xaml.cs b/Aucma.Core.ProductOffLine/Views/LoginPageView.xaml.cs index e54c85ad..a6c0c741 100644 --- a/Aucma.Core.ProductOffLine/Views/LoginPageView.xaml.cs +++ b/Aucma.Core.ProductOffLine/Views/LoginPageView.xaml.cs @@ -83,7 +83,8 @@ namespace Aucma.Core.ProductOffLine.Views return; } } - + txtUserName.Text = ""; + txtPassword.Password = ""; loginViewModel.Login(teamMembers, barCode,userName, passWord, this); } diff --git a/Aucma.Core.ProductOffLineCX1/ViewModels/MainWindowViewModel.cs b/Aucma.Core.ProductOffLineCX1/ViewModels/MainWindowViewModel.cs index f0a140b8..381b9d4f 100644 --- a/Aucma.Core.ProductOffLineCX1/ViewModels/MainWindowViewModel.cs +++ b/Aucma.Core.ProductOffLineCX1/ViewModels/MainWindowViewModel.cs @@ -87,6 +87,7 @@ namespace Aucma.Core.ProductOffLineCX1.ViewModels { System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => { + TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account} 条码系统: {appConfig.BarCodeAccount}"; CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); })); diff --git a/Aucma.Core.ProductOffLineCX1/Views/LoginPageView.xaml.cs b/Aucma.Core.ProductOffLineCX1/Views/LoginPageView.xaml.cs index 48008687..0c237fe6 100644 --- a/Aucma.Core.ProductOffLineCX1/Views/LoginPageView.xaml.cs +++ b/Aucma.Core.ProductOffLineCX1/Views/LoginPageView.xaml.cs @@ -80,7 +80,8 @@ namespace Aucma.Core.ProductOffLineCX1.Views return; } } - + txtUserName.Text = ""; + txtPassword.Password = ""; loginViewModel.Login(teamMembers, barCode,userName, passWord, this); }