diff --git a/Admin.Core.Common/Helper/OSKHelper.cs b/Admin.Core.Common/Helper/OSKHelper.cs new file mode 100644 index 00000000..6cea8e21 --- /dev/null +++ b/Admin.Core.Common/Helper/OSKHelper.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Aucma.Core.ProductOffLine.Common +{ + public class OSKHelper + { + #region 打开软盘 + /// + /// 打开软盘 + /// + public static void OpenOsk() + { + try + { + Process proc = new Process(); + proc.StartInfo.FileName = @"C:\Windows\System32\osk.exe"; + proc.StartInfo.UseShellExecute = true; + proc.StartInfo.Verb = "runas"; + proc.Start(); + } + catch + { + } + } + #endregion + + + #region 关闭软盘 + /// + /// 关闭软盘 + /// + public static void CloseOsk() + { + try + { + // 查找并关闭 osk.exe 进程 + foreach (Process proc in Process.GetProcessesByName("osk")) + { + proc.Kill(); + } + } + catch + { + // 可以在这里处理异常情况 + } + } + #endregion + } +} diff --git a/Aucma.Core.ProductOffLine/ViewModels/LoginPageViewModel.cs b/Aucma.Core.ProductOffLine/ViewModels/LoginPageViewModel.cs index 0cc7b7af..daf79ce4 100644 --- a/Aucma.Core.ProductOffLine/ViewModels/LoginPageViewModel.cs +++ b/Aucma.Core.ProductOffLine/ViewModels/LoginPageViewModel.cs @@ -20,7 +20,7 @@ using Aucma.Core.ProductOffLine; using Aucma.Core.ProductOffLine.Models; using Aucma.Core.ProductOffLine.Views; -namespace Aucma.Core.PrintTo.ViewModels +namespace Aucma.Core.ProductOffLine.ViewModels { public partial class LoginPageViewModel : ObservableObject { diff --git a/Aucma.Core.ProductOffLine/ViewModels/MainWindowViewModel.cs b/Aucma.Core.ProductOffLine/ViewModels/MainWindowViewModel.cs index a3cdac25..776ab9d2 100644 --- a/Aucma.Core.ProductOffLine/ViewModels/MainWindowViewModel.cs +++ b/Aucma.Core.ProductOffLine/ViewModels/MainWindowViewModel.cs @@ -46,7 +46,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels // 箱壳扫码器ip private static string ShellScannerIp = allScanners.First(x => x.Name == "外侧扫码器2").Ip; - ISysUserInfoServices _sysUserInfoServices; + private static readonly log4net.ILog log = LogManager.GetLogger(typeof(MainWindowViewModel)); private IndexPageView firstPage = new IndexPageView();//首页 @@ -72,26 +72,26 @@ namespace Aucma.Core.ProductOffLine.ViewModels { UserContent = firstPage; - _sysUserInfoServices = App.ServiceProvider.GetService(); - //Task.Run(async () => - //{ - // await RefreshTeamTime();//班组时间 - //}); - InitUserInfo(); - + TouchSocketService.RefreshStateEvent += RefreshScanner; + MesDbState(true); + PlcState(false); + + Scanner1State(false); + Scanner2State(false); + + InitHikRobotAndGun(); + init(); + }); } - private void InitUserInfo() - { - TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account} 条码系统: {appConfig.BarCodeAccount}"; - } + #region 初始化班组刷新定时任务 public void init() { - - TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account}"; + + TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account} 条码系统: {appConfig.BarCodeAccount}"; // 设备状态刷新定时器 System.Timers.Timer timer = new System.Timers.Timer(1000 * 5); timer.Elapsed += new System.Timers.ElapsedEventHandler(RefreshStatus); diff --git a/Aucma.Core.ProductOffLine/Views/LoginPageView.xaml.cs b/Aucma.Core.ProductOffLine/Views/LoginPageView.xaml.cs index bb7891ea..0273e07d 100644 --- a/Aucma.Core.ProductOffLine/Views/LoginPageView.xaml.cs +++ b/Aucma.Core.ProductOffLine/Views/LoginPageView.xaml.cs @@ -1,8 +1,8 @@ using Admin.Core.Model.Model_New; using Aucma.Core.PrintTo.Common; -using Aucma.Core.PrintTo.ViewModels; using Aucma.Core.ProductOffLine.Common; using Aucma.Core.ProductOffLine.Config; +using Aucma.Core.ProductOffLine.ViewModels; using System; using System.Collections.Generic; using System.Linq; diff --git a/Aucma.Core.ProductOffLineCX1/App.xaml b/Aucma.Core.ProductOffLineCX1/App.xaml index fca91f0e..8111c0f8 100644 --- a/Aucma.Core.ProductOffLineCX1/App.xaml +++ b/Aucma.Core.ProductOffLineCX1/App.xaml @@ -22,8 +22,15 @@ - - + + + + + diff --git a/Aucma.Core.ProductOffLineCX1/App.xaml.cs b/Aucma.Core.ProductOffLineCX1/App.xaml.cs index 0481b780..1e98f4db 100644 --- a/Aucma.Core.ProductOffLineCX1/App.xaml.cs +++ b/Aucma.Core.ProductOffLineCX1/App.xaml.cs @@ -25,10 +25,29 @@ namespace Aucma.Core.ProductOffLineCX1 var host = CreateHostBuilder(e.Args).Build();//生成宿主。 ServiceProvider = host.Services; - host.Services.GetRequiredService()?.Show(); - await host.StartAsync(); + + try + { + var loginWindow = host.Services.GetRequiredService(); + if (loginWindow != null && !loginWindow.IsActive) + { + loginWindow.Show(); + await host.StartAsync(); + } + else + { + // 处理窗口已关闭的情况 + // 可以选择重新创建主窗口或者退出应用程序 + Application.Current.Shutdown(); + } + } + catch (Exception ex) + { + Application.Current.Shutdown(); + } } + /// /// CreateHostBuilder /// diff --git a/Aucma.Core.ProductOffLineCX1/Assets/Images/login-background.png b/Aucma.Core.ProductOffLineCX1/Assets/Images/login-background.png new file mode 100644 index 00000000..40909f97 Binary files /dev/null and b/Aucma.Core.ProductOffLineCX1/Assets/Images/login-background.png differ diff --git a/Aucma.Core.ProductOffLineCX1/Aucma.Core.ProductOffLineCX1.csproj b/Aucma.Core.ProductOffLineCX1/Aucma.Core.ProductOffLineCX1.csproj index 07dfcf0f..691ba84b 100644 --- a/Aucma.Core.ProductOffLineCX1/Aucma.Core.ProductOffLineCX1.csproj +++ b/Aucma.Core.ProductOffLineCX1/Aucma.Core.ProductOffLineCX1.csproj @@ -28,6 +28,7 @@ + @@ -53,6 +54,9 @@ + + + diff --git a/Aucma.Core.ProductOffLineCX1/Business/offLineBusiness.cs b/Aucma.Core.ProductOffLineCX1/Business/offLineBusiness.cs index 05941f34..f4fdbe4e 100644 --- a/Aucma.Core.ProductOffLineCX1/Business/offLineBusiness.cs +++ b/Aucma.Core.ProductOffLineCX1/Business/offLineBusiness.cs @@ -414,7 +414,7 @@ namespace Aucma.Core.ProductOffLineCX1.Business // 产线 info11.ProductLineCode = appConfig.ProductlineCode.ToString(); info11.SaveRetuenInfo = TempOffLineInfo.MsgInfo; - info11.LoginTeam = appConfig.LoginTeam; + info11.LoginTeam = appConfig.TeamName; info11.PlcResult = 1; // 查询本地数据库是否有数据 OffLineInfo offLineInfo = _offLineInfoServices.FirstAsync(x => x.ProductSNCode == TempOffLineInfo.ProductSNCode).Result; diff --git a/Aucma.Core.ProductOffLineCX1/Common/OSKHelper.cs b/Aucma.Core.ProductOffLineCX1/Common/OSKHelper.cs new file mode 100644 index 00000000..4b8f1439 --- /dev/null +++ b/Aucma.Core.ProductOffLineCX1/Common/OSKHelper.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Aucma.Core.ProductOffLineCX1.Common +{ + public class OSKHelper + { + #region 打开软盘 + /// + /// 打开软盘 + /// + public static void OpenOsk() + { + try + { + Process proc = new Process(); + proc.StartInfo.FileName = @"C:\Windows\System32\osk.exe"; + proc.StartInfo.UseShellExecute = true; + proc.StartInfo.Verb = "runas"; + proc.Start(); + } + catch + { + } + } + #endregion + + + #region 关闭软盘 + /// + /// 关闭软盘 + /// + public static void CloseOsk() + { + try + { + // 查找并关闭 osk.exe 进程 + foreach (Process proc in Process.GetProcessesByName("osk")) + { + proc.Kill(); + } + } + catch + { + // 可以在这里处理异常情况 + } + } + #endregion + } +} diff --git a/Aucma.Core.ProductOffLineCX1/Config/AppConfig.cs b/Aucma.Core.ProductOffLineCX1/Config/AppConfig.cs index a8215739..100e08f1 100644 --- a/Aucma.Core.ProductOffLineCX1/Config/AppConfig.cs +++ b/Aucma.Core.ProductOffLineCX1/Config/AppConfig.cs @@ -48,15 +48,7 @@ namespace Aucma.Core.ProductOffLineCX1.Config set { iniHelper.IniWriteValue("system", "ProductlineCode", value); } } - /// - /// 当前登录班组 - /// - public string LoginTeam - { - get { return iniHelper.IniReadValue("system", "LoginTeam"); } - set { iniHelper.IniWriteValue("system", "LoginTeam", value); } - } - + /// /// 扫码枪放行方向,0外侧,1内侧,-1都未选中 /// @@ -115,5 +107,33 @@ namespace Aucma.Core.ProductOffLineCX1.Config } + /// + /// 班组代码 + /// + public string TeamCode + { + get { return iniHelper.IniReadValue("system", "TeamCode"); } + set { iniHelper.IniWriteValue("system", "TeamCode", value); } + } + + /// + /// 班组名称 + /// + public string TeamName + { + get { return iniHelper.IniReadValue("system", "TeamName"); } + set { iniHelper.IniWriteValue("system", "TeamName", value); } + } + + /// + /// 用户名 + /// + public string Account + { + get { return iniHelper.IniReadValue("system", "Account"); } + set { iniHelper.IniWriteValue("system", "Account", value); } + } + + } } diff --git a/Aucma.Core.ProductOffLineCX1/Models/Result.cs b/Aucma.Core.ProductOffLineCX1/Models/Result.cs new file mode 100644 index 00000000..4989f4e8 --- /dev/null +++ b/Aucma.Core.ProductOffLineCX1/Models/Result.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Aucma.Core.ProductOffLineCX1.Models +{ + /** + * 登录返回结果 + * */ + public class Result + { + /// + /// 返回结果 + /// + public string msg { get; set; } + /// + /// 返回状态 + /// + public int code { get; set; } + /// + /// 返回令牌 + /// + public string token { get; set; } + } +} diff --git a/Aucma.Core.ProductOffLineCX1/ViewModels/IndexPageViewModel.cs b/Aucma.Core.ProductOffLineCX1/ViewModels/IndexPageViewModel.cs index 55161ee0..a64daca3 100644 --- a/Aucma.Core.ProductOffLineCX1/ViewModels/IndexPageViewModel.cs +++ b/Aucma.Core.ProductOffLineCX1/ViewModels/IndexPageViewModel.cs @@ -62,18 +62,31 @@ namespace Aucma.Core.ProductOffLineCX1.ViewModels public IndexPageViewModel() { + _offLineInfoServices = App.ServiceProvider.GetService(); + _baseBomInfoServices = App.ServiceProvider.GetService(); + OffLineBusiness.RefreshScanMateriaCodeEvent += ModelToPage; OffLineBusiness.RefreshChartsEvent += RefreshCharts; MainWindowViewModel.RefreshFirstPageChartsEvent += RefreshCharts; - _offLineInfoServices = App.ServiceProvider.GetService(); - _baseBomInfoServices = App.ServiceProvider.GetService(); - - RefreshCharts(); - listTime = _baseBomInfoServices.getWorkTime().Result; + InitializeAsync(); + + } + private async void InitializeAsync() + { + await Task.Run(() => + { + + RefreshCharts(); + + listTime = _baseBomInfoServices.getWorkTime().Result; + + }); } + + /// /// 刷新页面展示图表 /// diff --git a/Aucma.Core.ProductOffLineCX1/ViewModels/LoginPageViewModel.cs b/Aucma.Core.ProductOffLineCX1/ViewModels/LoginPageViewModel.cs new file mode 100644 index 00000000..4f99bb9c --- /dev/null +++ b/Aucma.Core.ProductOffLineCX1/ViewModels/LoginPageViewModel.cs @@ -0,0 +1,139 @@ +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using log4net; +using System.Windows; +using Admin.Core.Common; +using Admin.Core.IService; +using Admin.Core.Service; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.ObjectModel; +using Admin.Core.Model.Model_New; +using StackExchange.Profiling.Internal; +using System; +using System.Text.Json; +using System.Windows.Input; +using MaterialDesignThemes.Wpf; + +using NPOI.Util.Collections; +using Aucma.Core.ProductOffLineCX1.Config; +using Aucma.Core.ProductOffLineCX1; +using Aucma.Core.ProductOffLineCX1.Models; +using Aucma.Core.ProductOffLineCX1.Views; + +namespace Aucma.Core.ProductOffLineCX1.ViewModels +{ + public partial class LoginPageViewModel : ObservableObject + { + private static readonly log4net.ILog log = LogManager.GetLogger(typeof(LoginPageViewModel)); + protected readonly IBaseTeamMembersServices _baseTeamMembersServices; + private AppConfig appConfig = AppConfig.Instance; + + public LoginPageViewModel() { + _baseTeamMembersServices = App.ServiceProvider.GetService(); + AddTeamData(); + } + + #region 登录 + /// + /// 登录 + /// + /// 选择的班组信息 + /// 用户名 + /// 密码 + public void Login(BaseTeamMembers team, string barCode,string userName, string passWord,object parameter) + { + try + { + //获取Token + string url = $"http://10.100.72.10:8080/login"; + var content = new + { + username = userName, + password = passWord + }; + + var loginResult = HttpHelper.Post(url, content.ToJson());//发送用户名密码给API + Result result = JsonSerializer.Deserialize(loginResult); + if (result == null) + { + MessageBox.Show("登录失败!", "系统提醒"); + return; + } + if (result.code == 200) + { + // 存储账号信息 + appConfig.TeamCode = team.TeamCode; + appConfig.TeamName = team.TeamName; + appConfig.Account = userName; + appConfig.BarCodeAccount = barCode; + //跳转 + var window = parameter as LoginPageView; + + if (window == null) return; + window.Hide(); + MainWindow mainPage = new MainWindow(); + mainPage.Show(); + + window.Close(); + } + else + { + MessageBox.Show($"登录失败!{result.msg}", "系统提醒"); + return; + } + } + catch (Exception ex) + { + log.Error($"登录异常:{ex.Message}"); + } + } + #endregion + + #region 关闭当前界面 + /// + /// 关闭当前界面 + /// + /// + + public void CloseWindow(object parameter) + { + var window = parameter as Window; + if (window == null) return; + + window.Close(); + } + + #endregion + + #region 班组数据 + /// + /// 班组数据 + /// + private ObservableCollection _teamMembersList = new ObservableCollection(); + public ObservableCollection TeamMembersList + { + get + { + return this._teamMembersList; + } + set + { + SetProperty(ref _teamMembersList, value); + } + } + #endregion + + #region 班组添加到集合中 + public void AddTeamData() + { + var baseTeamMembersList = _baseTeamMembersServices.QueryAsync(d => d.ProductLineCode.Contains("CX_02")).Result; + if (baseTeamMembersList == null) return; + foreach (var item in baseTeamMembersList) + { + TeamMembersList.Add(item); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Aucma.Core.ProductOffLineCX1/ViewModels/LoginViewModel.cs b/Aucma.Core.ProductOffLineCX1/ViewModels/LoginViewModel.cs deleted file mode 100644 index ddcd7c15..00000000 --- a/Aucma.Core.ProductOffLineCX1/ViewModels/LoginViewModel.cs +++ /dev/null @@ -1,118 +0,0 @@ -using Admin.Core.IService; -using Admin.Core.Model; -using Admin.Core.Service; -using Aucma.Core.ProductOffLineCX1.Config; -using Aucma.Core.ProductOffLineCX1.Models; -using CommunityToolkit.Mvvm.ComponentModel; -using CommunityToolkit.Mvvm.Input; -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; - -namespace Aucma.Core.ProductOffLineCX1.ViewModels -{ - public partial class LoginViewModel : ObservableObject - { - private AppConfig appConfig = AppConfig.Instance; - - public RelayCommand CloseWindowCommand { get; set; } - - public RelayCommand SaveCommand { get; set; } - - - public LoginViewModel() - { - _barcodeAccount = appConfig.BarCodeAccount; - // SelectedMaterialType.Content = appConfig.LoginTeam; - CloseWindowCommand = new RelayCommand(t => CloseWindow(t)); - SaveCommand = new RelayCommand(Login); - - } - - - //关闭窗口 - private void CloseWindow(object parameter) - { - var window = parameter as Window; - if (window != null) - { - window.Close(); - } - - } - - private async void Login() - { - - if (SelectedMaterialType == null) - { - MessageBox.Show("未选择班组"); - - return; - - } - if (_barcodeAccount =="") - { - MessageBox.Show("未设置条码系统账号"); - - return; - - } - else - { - MessageBoxResult result = MessageBox.Show("确认登录吗?", "确认", MessageBoxButton.YesNo, MessageBoxImage.Question); - if (result == MessageBoxResult.Yes) - { - appConfig.BarCodeAccount = _barcodeAccount; - appConfig.LoginTeam = SelectedMaterialType.Content.ToString(); - MessageBox.Show("登录成功"); - // CloseWindow(); - } - - - } - - - } - - - - /// - /// 班组,二线白班,二线夜班 - /// - /// private string _selectedMaterialType; - private ComboBoxItem _selectedMaterialType; - public ComboBoxItem SelectedMaterialType - { - get { return _selectedMaterialType; } - set - { - if (_selectedMaterialType != value) - { - _selectedMaterialType = value; - OnPropertyChanged(nameof(SelectedMaterialType)); - } - } - } - - #region 条码系统账号 - private string _barcodeAccount; - public string BarcodeAccount - { - get { return _barcodeAccount; } - set - { - _barcodeAccount = value; - OnPropertyChanged(nameof(BarcodeAccount)); - } - } - #endregion - - - } -} diff --git a/Aucma.Core.ProductOffLineCX1/ViewModels/MainWindowViewModel.cs b/Aucma.Core.ProductOffLineCX1/ViewModels/MainWindowViewModel.cs index 239f2d37..c94b525e 100644 --- a/Aucma.Core.ProductOffLineCX1/ViewModels/MainWindowViewModel.cs +++ b/Aucma.Core.ProductOffLineCX1/ViewModels/MainWindowViewModel.cs @@ -18,6 +18,8 @@ using Aucma.Core.ProductOffLineCX1.Config; using Admin.Core.Socket; using Aucma.Core.Scanner; using System.Collections.Generic; +using Admin.Core.IService; +using Microsoft.Extensions.DependencyInjection; namespace Aucma.Core.ProductOffLineCX1.ViewModels { @@ -44,8 +46,7 @@ namespace Aucma.Core.ProductOffLineCX1.ViewModels // 箱壳扫码器ip private static string ShellScannerIp = allScanners.First(x => x.Name == "外侧扫码器2").Ip; - - + private static readonly log4net.ILog log = LogManager.GetLogger(typeof(MainWindowViewModel)); private IndexPageView firstPage = new IndexPageView();//首页 private StatisticsPageView recordPage = new StatisticsPageView(); // 统计页面 @@ -53,28 +54,50 @@ namespace Aucma.Core.ProductOffLineCX1.ViewModels public MainWindowViewModel() { - UserContent = firstPage; - // 创建一个DispatcherTimer对象 + InitializeAsync(); DispatcherTimer timer = new DispatcherTimer(); - timer.Interval = TimeSpan.FromSeconds(1); - timer.Tick += Timer_Tick; + timer.Interval = new TimeSpan(0, 0, 1); //间隔1秒 + timer.Tick += new EventHandler(timer_Tick); timer.Start(); - // MvCodeHelper.RefreshStateEvent += RefreshScanner; - TouchSocketService.RefreshStateEvent += RefreshScanner; - MesDbState(true); - PlcState(false); - //PlcState(true); - Scanner1State(false); - Scanner2State(false); + } + + private async void InitializeAsync() + { + await Task.Run(() => + { + UserContent = firstPage; - // Job_AllState_Quartz.RefreshStateEvent += RefreshStatus; - InitHikRobotAndGun(); - init(); + TouchSocketService.RefreshStateEvent += RefreshScanner; + MesDbState(true); + PlcState(false); + + Scanner1State(false); + Scanner2State(false); + + InitHikRobotAndGun(); + init(); + + }); } + + + #region 定时刷新时间 + void timer_Tick(object sender, EventArgs e) + { + System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => + { + CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + + })); + + } + #endregion + #region 初始化班组刷新定时任务 public void init() { + TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account} 条码系统: {appConfig.BarCodeAccount}"; // 设备状态刷新定时器 System.Timers.Timer timer = new System.Timers.Timer(1000 * 5); timer.Elapsed += new System.Timers.ElapsedEventHandler(RefreshStatus); @@ -240,15 +263,7 @@ namespace Aucma.Core.ProductOffLineCX1.ViewModels string controlType = obj as string; switch (controlType) { - // 关闭当前窗口 - case "Exit": - if (System.Windows.MessageBox.Show("确定要退出系统吗?", "系统提醒", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes) - { - Application.Current.Shutdown(); - Environment.Exit(0); - } - - break; + // 打开软盘 case "TabTip": @@ -284,6 +299,35 @@ namespace Aucma.Core.ProductOffLineCX1.ViewModels } #endregion + + #region 关闭当前界面 + /// + /// 关闭当前界面 + /// + /// + [RelayCommand] + public void CloseWindow(object parameter) + { + var window = parameter as Window; + if (window == null) return; + + if (MessageBox.Show("确定要退出系统吗?", "系统提醒", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes) + { + appConfig.TeamCode = ""; + appConfig.TeamName = ""; + appConfig.Account = ""; + + window.Hide(); + //跳转到登录页 + LoginPageView login = new LoginPageView(); + login.Show(); + window.Close(); + } + } + + #endregion + + #region 打开软盘 /// /// 打开软盘 @@ -548,44 +592,39 @@ namespace Aucma.Core.ProductOffLineCX1.ViewModels } - public string _currentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + #region 刷新时间 + + public string _currentDateTime; public string CurrentDateTime { get => _currentDateTime; set => SetProperty(ref _currentDateTime, value); } + #endregion - public string _shiftStr = string.Empty; - public string ShiftStr + #region 班组信息 + /// + /// 班组信息 + /// + public string _teamName; + public string TeamName { - get => _shiftStr; - set => SetProperty(ref _shiftStr, value); + get => _teamName; + set => SetProperty(ref _teamName, value); } + #endregion - private void Timer_Tick(object sender, EventArgs e) + #region 登陆人信息 + /// + /// 班组信息 + /// + public string account; + public string Account { - DateTime now = DateTime.Now; - if (appConfig.LoginTeam == "") - { - ShiftStr = $"未登录"; - } - else - { - ShiftStr = appConfig.LoginTeam; - } - - // 判断当前是否是白班时间段 - //if (now.Hour >= 8 && now.Hour < 20) - //{ - // ShiftStr = $"白班 08点-20点"; - //} - //else - //{ - - // ShiftStr = $"夜班 20点-08点"; - //} - CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + get => account; + set => SetProperty(ref account, value); } + #endregion diff --git a/Aucma.Core.ProductOffLineCX1/Views/Login.xaml b/Aucma.Core.ProductOffLineCX1/Views/Login.xaml deleted file mode 100644 index 39948a8a..00000000 --- a/Aucma.Core.ProductOffLineCX1/Views/Login.xaml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -