shjd.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. 'use strict';
  2. var app = angular.module('app', [
  3. 'angularUtils.directives.dirPagination'
  4. ]);
  5. app.controller("listCtrl", ["$scope", "$http", "$timeout", function ($scope, $http, $timeout) {
  6. var self = this;
  7. var s4 = new SM4Util();
  8. self.userId = $.cookie("GlWorkPlatform-userid");
  9. self.userName = $.cookie("GlWorkPlatform-chineseName");
  10. self.get_AccessToken = !localStorage.getItem("GlWorkPlatform-AccessToken") ? sp.getUrlName("token") : localStorage.getItem("GlWorkPlatform-AccessToken");
  11. self.get_lastReturnPageno = sp.getUrlName("lastReturnPageno");
  12. self.type = sp.getUrlName("type");
  13. var postCfg = {
  14. headers: {
  15. 'Content-Type': 'application/json',
  16. 'Authorization': "Bearer " + self.get_AccessToken
  17. }
  18. }
  19. self.noDataTip = 1;//没有数据时赋变量为0,先默认为1
  20. self.pageno = 1;
  21. self.total_count = 0;
  22. self.itemsPerPage = 10;
  23. self.pageOptions = [10, 20, 30, 40];
  24. self.getData1 = function () {
  25. self.list1 = [];
  26. var data = {
  27. ctype: self.search.ctype
  28. }
  29. $http.post(apiurljs.login + "js/shjd", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  30. .success(function (obj) {
  31. var res = strToJson(s4.decryptData_CBC(obj.data));
  32. self.list1 = res.data;
  33. })
  34. }
  35. //self.getData1()
  36. self.getData2 = function () {
  37. self.list2 = [];
  38. var data = {
  39. ctype: self.search.ctype
  40. }
  41. $http.post(apiurljs.login + "js/shjd", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  42. .success(function (obj) {
  43. var res = strToJson(s4.decryptData_CBC(obj.data));
  44. self.list2 = res.data;
  45. })
  46. }
  47. //self.getData2()
  48. self.getData3 = function () {
  49. self.list3 = [];
  50. var data = {
  51. ctype: self.search.ctype
  52. }
  53. $http.post(apiurljs.login + "js/shjd", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  54. .success(function (obj) {
  55. var res = strToJson(s4.decryptData_CBC(obj.data));
  56. self.list3 = res.data;
  57. })
  58. }
  59. //self.getData3()
  60. }])