|
|
@@ -1,4 +1,5 @@ |
|
|
|
using BPASmartClient.Helper; |
|
|
|
using BPASmartClient.Business; |
|
|
|
using BPASmartClient.Helper; |
|
|
|
using BPASmartClient.IoT; |
|
|
|
using BPASmartClient.Message; |
|
|
|
using BPASmartClient.Model; |
|
|
@@ -30,9 +31,9 @@ namespace BPASmartClient.ViewModel |
|
|
|
public DispatcherTimer UpDataFileTimer; |
|
|
|
//定时清除界面日志 |
|
|
|
public DispatcherTimer dispatcherTimer; |
|
|
|
public string ClientId = System.Configuration.ConfigurationManager.AppSettings["ClientId"].ToString(); |
|
|
|
//public string ClientId = System.Configuration.ConfigurationManager.AppSettings["ClientId"].ToString(); |
|
|
|
public ObservableCollection<LogModel> LogDataGridData { get; set; } |
|
|
|
private ObservableCollection<LogModel> _LogModels;public ObservableCollection<LogModel> LogDataGrid |
|
|
|
private ObservableCollection<LogModel> _LogModels; public ObservableCollection<LogModel> LogDataGrid |
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
@@ -46,7 +47,7 @@ namespace BPASmartClient.ViewModel |
|
|
|
OnPropertyChanged("LogDataGrid"); |
|
|
|
} |
|
|
|
} |
|
|
|
private bool _RealTimeModel = true;public bool RealTimeModel |
|
|
|
private bool _RealTimeModel = true; public bool RealTimeModel |
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
@@ -60,7 +61,7 @@ namespace BPASmartClient.ViewModel |
|
|
|
OnPropertyChanged("RealTimeModel"); |
|
|
|
} |
|
|
|
} |
|
|
|
private bool _TimedClear = true;public bool TimedClear |
|
|
|
private bool _TimedClear = true; public bool TimedClear |
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
@@ -192,7 +193,7 @@ namespace BPASmartClient.ViewModel |
|
|
|
logHelper.GetLogConfigInstance().WriteLog(LogLevel.ERROR, s); |
|
|
|
DataVClient.GetInstance().HttpAddLog(new LogTable |
|
|
|
{ |
|
|
|
ClientId = ClientId, |
|
|
|
ClientId = Plugin.GetInstance().GetPlugin<ConfigMgr>().ClientId.ToString(), |
|
|
|
LogTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
|
|
|
LogType = "严重", |
|
|
|
LogMessage = s, |
|
|
@@ -225,7 +226,7 @@ namespace BPASmartClient.ViewModel |
|
|
|
{ |
|
|
|
if (LogDataGridData.Count > 200) |
|
|
|
{ |
|
|
|
LogModel logModel= LogDataGridData.Last(); |
|
|
|
LogModel logModel = LogDataGridData.Last(); |
|
|
|
DeleteLog(logModel); |
|
|
|
LogDataGridData.Remove(logModel); |
|
|
|
} |
|
|
@@ -247,7 +248,7 @@ namespace BPASmartClient.ViewModel |
|
|
|
/// </summary> |
|
|
|
public void AddLog(LogModel logModel) |
|
|
|
{ |
|
|
|
BookEx book= SelectBookExs?.ToList().Find(par => par.IsChecked && par.BookN.Tag == logModel.type); |
|
|
|
BookEx book = SelectBookExs?.ToList().Find(par => par.IsChecked && par.BookN.Tag == logModel.type); |
|
|
|
if (book != null) |
|
|
|
{ |
|
|
|
LogDataGrid.Insert(0, logModel); |
|
|
@@ -260,7 +261,8 @@ namespace BPASmartClient.ViewModel |
|
|
|
public void RefreshLog() |
|
|
|
{ |
|
|
|
LogDataGrid.Clear(); |
|
|
|
LogDataGridData?.ToList().ForEach(b => { |
|
|
|
LogDataGridData?.ToList().ForEach(b => |
|
|
|
{ |
|
|
|
|
|
|
|
BookEx book = SelectBookExs?.ToList().Find(par => par.IsChecked && par.BookN.Tag == b.type); |
|
|
|
if (book != null) |
|
|
@@ -268,15 +270,15 @@ namespace BPASmartClient.ViewModel |
|
|
|
LogDataGrid.Add(b); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 删除日志 |
|
|
|
/// </summary> |
|
|
|
public void DeleteLog(LogModel logModel) |
|
|
|
{ |
|
|
|
LogModel log= LogDataGrid?.ToList().Find(par => par == logModel); |
|
|
|
if(log!=null) LogDataGrid.Remove(log); |
|
|
|
LogModel log = LogDataGrid?.ToList().Find(par => par == logModel); |
|
|
|
if (log != null) LogDataGrid.Remove(log); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
@@ -344,7 +346,7 @@ namespace BPASmartClient.ViewModel |
|
|
|
SelectBookExs.Clear(); |
|
|
|
foreach (BookEx item in bookExs) |
|
|
|
{ |
|
|
|
builder.Append(item.BookN.Name.Replace("日志","") + ","); |
|
|
|
builder.Append(item.BookN.Name.Replace("日志", "") + ","); |
|
|
|
SelectBookExs.Add((BookEx)item); |
|
|
|
} |
|
|
|
SelectedText = builder == null ? string.Empty : builder.ToString(); |
|
|
|