Browse Source

77777

样式分支
fyf 2 years ago
parent
commit
8f083f9acd
2 changed files with 5 additions and 5 deletions
  1. +4
    -4
      BPASmartClient.ViewModel/LogOrAlarmViewModel.cs
  2. +1
    -1
      BPASmartClient.ViewModel/LogViewModel.cs

+ 4
- 4
BPASmartClient.ViewModel/LogOrAlarmViewModel.cs View File

@@ -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"))
});
}
}


+ 1
- 1
BPASmartClient.ViewModel/LogViewModel.cs View File

@@ -233,7 +233,7 @@ namespace BPASmartClient.ViewModel
if (_type == value)
return;
_type = value;
if (_type == "Error") foreground = new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#ed0032"));
if (_type == "Error" || _type == "Error".ToUpper() || _type == "DeviceAlarm".ToUpper() || _type == "DeviceAlarm") foreground = new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#ed0032"));

OnPropertyChanged("type");
OnPropertyChanged("foreground");


Loading…
Cancel
Save