private void ExportCommandFunc()
        {
            if (!DeviceOperationLogViewModels.Any())
            {
                Messenger.Default.Send(new NotificationMessage("没有数据可以导出!"), Tokens.DeviceOperationLogPage_ShowNotification);
                return;
            }

            var dt = DataHelper <DeviceTrafficLogViewModel> .ListToDataTable(DeviceOperationLogViewModels.ToList());

            dt.Columns.Remove("LogID");
            dt.Columns.Remove("OperationUploadTime");
            dt.Columns.Remove("IsInDesignMode");
            dt.Columns.Remove("DeviceId");

            dt.Columns["DeviceCode"].SetOrdinal(0);
            dt.Columns["DeviceType"].SetOrdinal(1);
            dt.Columns["OperatorId"].SetOrdinal(2);
            dt.Columns["DeviceUserId"].SetOrdinal(3);
            dt.Columns["OperationType"].SetOrdinal(4);
            dt.Columns["OperationDescription"].SetOrdinal(5);
            dt.Columns["OperationContent"].SetOrdinal(6);
            dt.Columns["OperationTime"].SetOrdinal(7);

            dt.Columns["DeviceCode"].ColumnName           = "设备编号";
            dt.Columns["DeviceType"].ColumnName           = "设备类型";
            dt.Columns["OperatorId"].ColumnName           = "操作人员工号";
            dt.Columns["DeviceUserId"].ColumnName         = "人员工号";
            dt.Columns["OperationType"].ColumnName        = "操作类型";
            dt.Columns["OperationDescription"].ColumnName = "操作描述";
            dt.Columns["OperationContent"].ColumnName     = "操作内容";
            dt.Columns["OperationTime"].ColumnName        = "操作时间";

            Messenger.Default.Send(new OpenWindowMessage()
            {
                DataContext = dt
            }, Tokens.DeviceOperationLogPage_OpenExportView);
        }
        private void ProcessQueryPage(int pageIndex)
        {
            try
            {
                var conditions = new Hashtable();
                if (!TryGetConditions(pageIndex, PageSize, out conditions))
                {
                    return;
                }

                DispatcherHelper.CheckBeginInvokeOnUI(async() =>
                {
                    string message = "";

                    var controller = await DialogCoordinator.Instance.ShowProgressAsync(this, "查询数据", "查询数据中,请稍等");
                    controller.SetIndeterminate();

                    await Task.Run(() =>
                    {
                        try
                        {
                            Log.Info("同步数据中..");
                            var devices = new List <DeviceController>();
                            if (!string.IsNullOrWhiteSpace(DeviceCode))
                            {
                                var queriedDevice = ApplicationManager.GetInstance().AuthorizationDevices.First(x => x.Code == DeviceCode);
                                devices.Add(queriedDevice);
                            }
                            else
                            {
                                devices = ApplicationManager.GetInstance().AuthorizationDevices;
                            }

                            string[] messages;
                            var resultTypes = new DeviceServiceClient().SyncDeviceOperationLogs(devices.ToArray(), out messages);
                            message         = MessageHandler.GenerateDeviceMessage(resultTypes, messages, "同步数据成功!", "同步数据失败!");
                            Log.Info(message);
                        }
                        catch (Exception ex)
                        {
                            Log.Error(ex);
                        }

                        try
                        {
                            Log.Info("查询数据中..");
                            int totalCount = 0;
                            DeviceOperationLogViewModels = QueryData(conditions, out totalCount);
                            if (totalCount % PageSize == 0)
                            {
                                TotalPage = (totalCount / PageSize).ToString();
                            }
                            else
                            {
                                TotalPage = ((totalCount / PageSize) + 1).ToString();
                            }
                            RaisePropertyChanged(null);
                        }
                        catch (Exception ex)
                        {
                            Log.Error(ex);
                        }
                    });

                    await controller.CloseAsync();

                    if (!DeviceOperationLogViewModels.Any())
                    {
                        Messenger.Default.Send(new NotificationMessage("查询数据结果为空"), Tokens.DeviceOperationLogPage_ShowNotification);
                    }
                });
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }