arbitration.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. $(function() {
  2. var ww = $(window).width();
  3. var wh = $(window).height();
  4. var mainbox = $('.ui_mainbox');
  5. if (wh - 76 < 425) {
  6. mainbox.height(425);
  7. } else {
  8. mainbox.height(wh - 76);
  9. }
  10. if (ww > 1600) {
  11. mainbox.width(1600);
  12. $('.ui_button').width(1580);
  13. } else {
  14. mainbox.width(1200);
  15. $('.ui_button').width(1180);
  16. }
  17. //$('.cb,.rb').inputbox();
  18. $(window).resize(function() {
  19. ww = $(window).width();
  20. wh = $(window).height();
  21. if (wh - 76 < 425) {
  22. mainbox.height(425);
  23. } else {
  24. mainbox.height(wh - 76);
  25. }
  26. if (ww > 1600) {
  27. mainbox.width(1600);
  28. } else {
  29. mainbox.width(1200);
  30. }
  31. });
  32. });
  33. angular.module('app',[]).controller('arbitrationExpertCtrl',function($scope,$http){
  34. //获取评审列表
  35. $scope.arbitrationParm = {
  36. "pageIndex":1,
  37. "pageSize":20
  38. }
  39. $scope.getReviewTasksData = function(){
  40. $http.get(main_host + '/api/EvalStudentZCTasks',{params:$scope.arbitrationParm}).success(function(data){
  41. if(data.success){
  42. $scope.arbitrationlists = data.map.data.list;
  43. $scope.pageData = {
  44. "pageIndex": data.map.data.pageIndex,
  45. "pageSize": data.map.data.pageSize,
  46. "totalCounts": data.map.data.totalCounts,
  47. "totalPages": data.map.data.totalPages
  48. }
  49. }
  50. });
  51. }
  52. }).factory('frameAjaxInterceptor', function($q, $rootScope) {
  53. return {
  54. 'request': function(config) {
  55. return config;
  56. },
  57. 'requestError': function(rejection) {
  58. return $q.reject(rejection);
  59. },
  60. 'response': function(response) {
  61. return response;
  62. },
  63. 'responseError': function(rejection) {
  64. if (rejection.status == 504) {
  65. var d = dialog({
  66. title: '错误提示',
  67. content: "您超时间未操作,请重新登录本系统",
  68. ok: function() {
  69. document.location.href = '';
  70. },
  71. okValue: '确定'
  72. });
  73. d.showModal();
  74. return $q.reject(rejection);
  75. } else {
  76. return $q.reject(rejection);
  77. }
  78. }
  79. };
  80. }).config(['$httpProvider', function($httpProvider) {
  81. $httpProvider.interceptors.push('frameAjaxInterceptor');
  82. }]);