|
|
|
@ -20,6 +20,7 @@ using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Admin.Core.Model;
|
|
|
|
|
using Admin.Core.Tasks;
|
|
|
|
|
using static ICSharpCode.SharpZipLib.Zip.ExtendedUnixData;
|
|
|
|
|
using System.Windows.Threading;
|
|
|
|
|
|
|
|
|
|
namespace Aucma.Core.CodeBinding.ViewModels
|
|
|
|
|
{
|
|
|
|
@ -40,6 +41,14 @@ namespace Aucma.Core.CodeBinding.ViewModels
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
UserContent = firstPage;
|
|
|
|
|
|
|
|
|
|
// 创建一个DispatcherTimer对象
|
|
|
|
|
DispatcherTimer timer = new DispatcherTimer();
|
|
|
|
|
timer.Interval = TimeSpan.FromSeconds(1);
|
|
|
|
|
timer.Tick += Timer_Tick;
|
|
|
|
|
timer.Start();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Job_AllState_Quartz.RefreshStateEvent += RefreshStatus;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -402,5 +411,38 @@ namespace Aucma.Core.CodeBinding.ViewModels
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
public string _currentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
public string CurrentDateTime
|
|
|
|
|
{
|
|
|
|
|
get => _currentDateTime;
|
|
|
|
|
set => SetProperty(ref _currentDateTime, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string _shiftStr = string.Empty;
|
|
|
|
|
public string ShiftStr
|
|
|
|
|
{
|
|
|
|
|
get => _shiftStr;
|
|
|
|
|
set => SetProperty(ref _shiftStr, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Timer_Tick(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
DateTime now = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
// 判断当前是否是白班时间段
|
|
|
|
|
if (now.Hour >= 8 && now.Hour < 20)
|
|
|
|
|
{
|
|
|
|
|
ShiftStr = $"白班 08点-20点";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ShiftStr = $"夜班 20点-08点";
|
|
|
|
|
}
|
|
|
|
|
CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|