/// <summary> /// 获取数据点分页数据 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> private void getNodePageData(int pageIndex, int pageSize, bool isSearch, string searchInfo) { #if DEBUG System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); #endif pageRepuestParams = new PageRepuestParams(); if (isSearch) { FilterGroup filterGroup = new FilterGroup(FilterOperate.Or); FilterRule filterRuleName = new FilterRule("NodeName", searchInfo, FilterOperate.Contains); FilterRule filterRuleServer = new FilterRule("DeviceServerInfo.DeviceServerName", searchInfo, FilterOperate.Contains); FilterRule filterRuleUrl = new FilterRule("NodeUrl", searchInfo, FilterOperate.Contains); filterGroup.Rules.Add(filterRuleName); filterGroup.Rules.Add(filterRuleServer); filterGroup.Rules.Add(filterRuleUrl); pageRepuestParams.FilterGroup = filterGroup; } pageRepuestParams.SortField = GlobalData.SortField; pageRepuestParams.SortOrder = GlobalData.SortOrder; pageRepuestParams.PageIndex = pageIndex; pageRepuestParams.PageSize = pageSize; var result = Utility.Http.HttpClientHelper.PostResponse <OperationResult <PageResult <DeviceNodeModel> > >(GlobalData.ServerRootUri + "DeviceNode/PageData", Utility.JsonHelper.ToJson(pageRepuestParams)); #if DEBUG stopwatch.Stop(); Utility.LogHelper.Info("获取数据点列表用时(毫秒):" + stopwatch.ElapsedMilliseconds); Utility.LogHelper.Info("数据点列表内容:" + Utility.JsonHelper.ToJson(result)); #endif if (!Equals(result, null) && result.Successed) { Application.Current.Resources["UiMessage"] = result?.Message; LogHelper.Info(Application.Current.Resources["UiMessage"].ToString()); if (result.Data.Data.Any()) { NodeInfoList?.Clear(); foreach (var data in result.Data.Data) { DeviceNodeModel commOpcUaNode = new DeviceNodeModel(); commOpcUaNode = data; commOpcUaNode.PropertyChanged += OnPropertyChangedCommand; NodeInfoList.Add(commOpcUaNode); } //TotalCounts = result.Data.Total; } else { NodeInfoList?.Clear(); Application.Current.Resources["UiMessage"] = "未找到数据"; } } else { //操作失败,显示错误信息 NodeInfoList = new ObservableCollection <DeviceNodeModel>(); Application.Current.Resources["UiMessage"] = result?.Message ?? "查询数据点列表失败,请联系管理员!"; } }
/// <summary> /// 获取数据点分页数据 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> private void getNodePageData(int pageIndex, int pageSize) { #if DEBUG System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); #endif pageRepuestParams.SortField = GlobalData.SortField; pageRepuestParams.SortOrder = GlobalData.SortOrder; pageRepuestParams.PageIndex = pageIndex; pageRepuestParams.PageSize = pageSize; var result = Utility.Http.HttpClientHelper.PostResponse <OperationResult <PageResult <CommOpcUaNodeModel> > >(GlobalData.ServerRootUri + "CommOpcUaNode/PageData", Utility.JsonHelper.ToJson(pageRepuestParams)); #if DEBUG stopwatch.Stop(); Utility.LogHelper.Info("获取数据点列表用时(毫秒):" + stopwatch.ElapsedMilliseconds); Utility.LogHelper.Info("数据点列表内容:" + Utility.JsonHelper.ToJson(result)); #endif if (!Equals(result, null) && result.Successed) { Application.Current.Resources["UiMessage"] = result?.Message; LogHelper.Info(Application.Current.Resources["UiMessage"].ToString()); if (result.Data.Data.Any()) { NodeInfoList?.Clear(); foreach (var data in result.Data.Data) { CommOpcUaNodeModel commOpcUaNode = new CommOpcUaNodeModel(); commOpcUaNode = data; commOpcUaNode.PropertyChanged += OnPropertyChangedCommand; NodeInfoList.Add(commOpcUaNode); } //TotalCounts = result.Data.Total; } else { NodeInfoList?.Clear(); Application.Current.Resources["UiMessage"] = "未找到数据"; } } else { //操作失败,显示错误信息 NodeInfoList = new ObservableCollection <CommOpcUaNodeModel>(); Application.Current.Resources["UiMessage"] = result?.Message ?? "查询数据点列表失败,请联系管理员!"; } }