change - 修改主页数据刷新

master
DESKTOP-G1UHLH2 1 month ago
parent ccd3d6ba30
commit a63e5ce3c2

@ -4,6 +4,7 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Numerics; using System.Numerics;
using System.Text; using System.Text;
using System.Threading.Tasks;
using System.Web; using System.Web;
using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
@ -190,7 +191,13 @@ namespace SlnMesnac.TouchSocket
log.ErrMsg=e.Message; log.ErrMsg=e.Message;
} }
_baseLogService.Insert(log); Task.Run(() =>
{
lock (string.Empty)
{
_baseLogService.Insert(log);
}
});
return new Back(); return new Back();

@ -143,6 +143,7 @@ namespace SlnMesnac.WPF.ViewModel
/// <summary> /// <summary>
/// 扫描记录 /// 扫描记录
/// </summary> /// </summary>
private List<ScanLogModel> scanLogModelsItems = new List<ScanLogModel>();
private ObservableCollection<ScanLogModel> _scanItems = new ObservableCollection<ScanLogModel>(); private ObservableCollection<ScanLogModel> _scanItems = new ObservableCollection<ScanLogModel>();
public ObservableCollection<ScanLogModel> ScanItems public ObservableCollection<ScanLogModel> ScanItems
{ {
@ -162,7 +163,9 @@ namespace SlnMesnac.WPF.ViewModel
TagCode = info.Rfid; TagCode = info.Rfid;
ImagePath = info.Url; ImagePath = info.Url;
ScanItems.Add(info); scanLogModelsItems.Add(info);
ScanItems = new ObservableCollection<ScanLogModel>(scanLogModelsItems.OrderByDescending(x=>x.CreateTime).ToList());
TagAmount++; TagAmount++;

Loading…
Cancel
Save