[UI.Client]
修正Operation Log查询窗口中,如果Filter Condition的System选项全部不选时,点击Filter按钮导致界面中的按钮全部被禁用的问题。
This commit is contained in:
parent
631a041f25
commit
da148b0c65
|
@ -15,6 +15,8 @@ using System.Threading.Tasks;
|
|||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media.Imaging;
|
||||
using Caliburn.Micro.Core;
|
||||
using OpenSEMI.ClientBase;
|
||||
using Sicentury.Core.Collections;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.DataLogs.Event
|
||||
|
@ -736,7 +738,7 @@ namespace MECF.Framework.UI.Client.CenterViews.DataLogs.Event
|
|||
|
||||
if (SearchBeginTime > SearchEndTime)
|
||||
{
|
||||
MessageBox.Show("Time range invalid, start time should be early than end time");
|
||||
DialogBox.ShowError("Time range invalid, start time should be early than end time");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -745,55 +747,67 @@ namespace MECF.Framework.UI.Client.CenterViews.DataLogs.Event
|
|||
{
|
||||
var searchingResult = new List<EventItem>();
|
||||
|
||||
// 查询开始
|
||||
_progUpdateQueryStatus.Report(true);
|
||||
|
||||
if (page <= QUERY_FIRST_TIME) // Query按钮按下,或首次加载界面
|
||||
try
|
||||
{
|
||||
// 统计总页数
|
||||
var rowCount = QueryRowAmount(isIncludeFilter);
|
||||
// 查询开始
|
||||
_progUpdateQueryStatus.Report(true);
|
||||
|
||||
var totalPage = (int)Math.Ceiling(rowCount / (double)SelectedPaginationCapacity);
|
||||
|
||||
// 首次查询第一页
|
||||
searchingResult = QueryEventLogs(1, isIncludeFilter);
|
||||
|
||||
if (isIncludeFilter == false)
|
||||
if (page <= QUERY_FIRST_TIME) // Query按钮按下,或首次加载界面
|
||||
{
|
||||
// 构造Event Sources列表,仅在首次查询时构造
|
||||
var eventSources = QueryEventSources();
|
||||
_progConstructEventSourcesList.Report(eventSources);
|
||||
// 统计总页数
|
||||
var rowCount = QueryRowAmount(isIncludeFilter);
|
||||
|
||||
var totalPage = (int)Math.Ceiling(rowCount / (double)SelectedPaginationCapacity);
|
||||
|
||||
// 首次查询第一页
|
||||
searchingResult = QueryEventLogs(1, isIncludeFilter);
|
||||
|
||||
if (isIncludeFilter == false)
|
||||
{
|
||||
// 构造Event Sources列表,仅在首次查询时构造
|
||||
var eventSources = QueryEventSources();
|
||||
_progConstructEventSourcesList.Report(eventSources);
|
||||
}
|
||||
|
||||
// 更新页面信息
|
||||
_progUpdatePaginationInfo.Report(new Tuple<int, int>(1, totalPage));
|
||||
|
||||
|
||||
}
|
||||
else if (page == QUERY_FOR_EXCEL_EXPORT)
|
||||
{
|
||||
|
||||
// 更新页面信息
|
||||
_progUpdatePaginationInfo.Report(new Tuple<int, int>(1, totalPage));
|
||||
}
|
||||
else if (page >= 1)
|
||||
{
|
||||
// 翻页按钮按下
|
||||
searchingResult = QueryEventLogs(page, isIncludeFilter);
|
||||
|
||||
// 更新页面信息
|
||||
_progUpdatePaginationInfo.Report(new Tuple<int, int>(page, -1));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(page), "invalid page number.");
|
||||
}
|
||||
}
|
||||
else if (page == QUERY_FOR_EXCEL_EXPORT)
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
searchingResult.Clear();
|
||||
Execute.OnUIThread(() =>
|
||||
{
|
||||
DialogBox.ShowError($"Failed to query event log, {ex.Message}");
|
||||
});
|
||||
}
|
||||
else if (page >= 1)
|
||||
finally
|
||||
{
|
||||
// 翻页按钮按下
|
||||
searchingResult = QueryEventLogs(page, isIncludeFilter);
|
||||
|
||||
// 更新页面信息
|
||||
_progUpdatePaginationInfo.Report(new Tuple<int, int>(page, -1));
|
||||
// 显示结果
|
||||
_progShowSearchingResult.Report(searchingResult);
|
||||
|
||||
// 查询完毕
|
||||
_progUpdateQueryStatus.Report(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(page), "invalid page number.");
|
||||
}
|
||||
|
||||
// 显示结果
|
||||
_progShowSearchingResult.Report(searchingResult);
|
||||
|
||||
// 查询完毕
|
||||
_progUpdateQueryStatus.Report(false);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue