Browse Source

配置修改

样式分支
pry 2 years ago
parent
commit
73f2a17f0d
2 changed files with 16 additions and 15 deletions
  1. +15
    -13
      BPASmartClient.ViewModel/LogViewModel.cs
  2. +1
    -2
      BPASmartClient/App.config

+ 15
- 13
BPASmartClient.ViewModel/LogViewModel.cs View File

@@ -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();


+ 1
- 2
BPASmartClient/App.config View File

@@ -3,9 +3,8 @@
<appSettings>

<!--通用配置-->
<add key="ClientId" value="43"/>
<!--<add key="ClientId" value="43"/>-->
<add key="IsEnableTest" value="false"/>
<add key="IsVerify" value="false"/>

<!--开发环境-->
<!--<add key="apollouri" value="http://10.2.1.21:28080/"/>


Loading…
Cancel
Save