|
|
@ -32,11 +32,10 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
|
|
|
|
public MainWindowViewModel()
|
|
|
|
public MainWindowViewModel()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
UserContent = oldBoxFoamPage;
|
|
|
|
UserContent = oldBoxFoamPage;
|
|
|
|
// 创建一个DispatcherTimer对象
|
|
|
|
DispatcherTimer timer2 = new DispatcherTimer();
|
|
|
|
DispatcherTimer timer = new DispatcherTimer();
|
|
|
|
timer2.Interval = new TimeSpan(0, 0, 1); //间隔1秒
|
|
|
|
timer.Interval = TimeSpan.FromSeconds(1);
|
|
|
|
timer2.Tick += new EventHandler(timer_Tick);
|
|
|
|
timer.Tick += Timer_Tick;
|
|
|
|
timer2.Start();
|
|
|
|
timer.Start();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Task.Run(() =>
|
|
|
|
Task.Run(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -529,21 +528,15 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
|
|
|
|
set => SetProperty(ref _shiftStr, value);
|
|
|
|
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点";
|
|
|
|
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account}";
|
|
|
|
ShiftStr = $"夜班 20点-08点";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|