sysLog.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. app.controller('sysLogCtrl', ['$scope', '$http', '$timeout', '$state', '$interval', 'uiGridConstants', 'i18nService', 'toaster', function ($scope, $http, $timeout, $state, $interval, uiGridConstants, i18nService, toaster) {
  2. i18nService.setCurrentLang("zh-cn");
  3. moment.locale('zh-cn');
  4. $scope.startTimeOpen = false;
  5. $scope.endTimeOpen = false;
  6. $scope.timeChange = function (newDate, oldDate) {
  7. $scope.startTimeOpen = false;
  8. $scope.endTimeOpen = false;
  9. };
  10. //查询条件
  11. $scope.query = {
  12. searchKey:"",
  13. startTime: moment().format("YYYY-MM-DD"),
  14. endTime: moment().format("YYYY-MM-DD"),
  15. };
  16. // angular 事件绑定
  17. $scope.ngEvent = {
  18. quickTime: function (event, passDay) {
  19. $scope.query.startTime = moment().add("day", -(passDay - 1)).format("YYYY-MM-DD");
  20. $scope.query.endTime = moment().format("YYYY-MM-DD");
  21. },
  22. //查询
  23. query: function () {
  24. if ($scope.query.startTime > $scope.query.endTime) {
  25. toaster.pop("info", "提示", "开始时间必须小于结束时间!");
  26. return;
  27. }
  28. $scope.getPagedDataAsync();
  29. },
  30. };
  31. $scope.getPagedDataAsync = function () {
  32. $scope.$broadcast("refreshTableData");
  33. };
  34. }]);