|
|
@@ -158,8 +158,8 @@ namespace BPASmartClient.ViewModel |
|
|
|
LogDataGrid.Clear(); |
|
|
|
//2.根据选中查询日志 |
|
|
|
DataTable dataTable = ReadFile(path); |
|
|
|
DataRow[] datas = dataTable.Select(sql); |
|
|
|
if (datas.Count() <= 0) |
|
|
|
List<DataRow> datas = dataTable.Select($"({sql})").OrderByDescending(o => o["TIME"])?.ToList(); |
|
|
|
if (datas==null || datas.Count() <= 0) |
|
|
|
{ |
|
|
|
NoticeDemoViewModel.OpenMsg(EnumPromptType.Info, MainViewModel.GetInstance().window, "提示", $"查询结果为空!"); |
|
|
|
return; |
|
|
@@ -170,8 +170,8 @@ namespace BPASmartClient.ViewModel |
|
|
|
{ |
|
|
|
time = item["TIME"].ToString(), |
|
|
|
type = item["LOGGER"].ToString(), |
|
|
|
message = item["MESSAGE"].ToString(), |
|
|
|
foreground = (item["LOGGER"].ToString() == "Error" || item["LOGGER"].ToString() == "DeviceAlarm") ? new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#ed0032")) : new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#21bb2e")) |
|
|
|
message = item["MESSAGE"].ToString() |
|
|
|
// foreground = (item["LOGGER"].ToString() == "ERROR" || item["LOGGER"].ToString() == "DEVICEALARM") ? new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#ed0032")) : new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#21bb2e")) |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|