ywbl1.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. 'use strict';
  2. var app = angular.module('app', [
  3. 'angularUtils.directives.dirPagination',
  4. ]);
  5. app.controller("indexCtrl", ["$scope", "$http", "$interval", "$timeout", function ($scope, $http, $interval, $timeout) {
  6. var self = this;
  7. self.userId = $.cookie("GlWorkPlatform-userid");
  8. self.userName = $.cookie("GlWorkPlatform-username");
  9. self.userChineseName = $.cookie("GlWorkPlatform-chineseName")
  10. self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
  11. var postCfg = {
  12. headers: {
  13. 'Content-Type': 'application/json',
  14. 'Authorization': "Bearer " + self.get_AccessToken
  15. }
  16. };
  17. self.num = {
  18. dwfw: 0,
  19. xzfw: 0,
  20. sxdb: 0,
  21. yzgl: 0,
  22. hysq: 0,
  23. clpq: 0
  24. }
  25. self.getData1 = function () {
  26. var data = { "flowid": "AA18|AA16|AA02|AA17", "userid": self.userId, "pageno": 0, "pagesize": 0 }
  27. $http.post(apiurljs.login + "g2work/routeinfo/queryDataTodoWithPage", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  28. .success(function (obj) {
  29. var res = strToJson(s4.decryptData_CBC(obj.data));
  30. self.num.swbl = res.meta.totalCount;
  31. self.getData2()
  32. })
  33. }
  34. self.getData2 = function () {
  35. var data = { "flowid": "AA20|AA03|AA10|AA57|AA08|AA23|AA77|AA06|AA63|AA80", "userid": self.userId, "pageno": 0, "pagesize": 0 }
  36. $http.post(apiurljs.login + "g2work/routeinfo/queryDataTodoWithPage", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  37. .success(function (obj) {
  38. var res = strToJson(s4.decryptData_CBC(obj.data));
  39. self.num.xzfw = res.meta.totalCount;
  40. self.getData3()
  41. })
  42. }
  43. self.getData3 = function () {
  44. var data = { "flowid": "AA88|AA89|AA46|AA22|AA54|AA58", "userid": self.userId, "pageno": 0, "pagesize": 0 }
  45. $http.post(apiurljs.login + "g2work/routeinfo/queryDataTodoWithPage", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  46. .success(function (obj) {
  47. var res = strToJson(s4.decryptData_CBC(obj.data));
  48. self.num.dwfw = res.meta.totalCount;
  49. self.getData4()
  50. })
  51. }
  52. self.getData4 = function () {
  53. var data = { "flowid": "AA73|AA82", "userid": self.userId, "pageno": 0, "pagesize": 0 }
  54. $http.post(apiurljs.login + "g2work/routeinfo/queryDataTodoWithPage", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  55. .success(function (obj) {
  56. var res = strToJson(s4.decryptData_CBC(obj.data));
  57. self.num.sxdb = res.meta.totalCount;
  58. self.getData5()
  59. })
  60. }
  61. self.getData5 = function () {
  62. var data = { "flowid": "AA27|AA71|AA72", "userid": self.userId, "pageno": 0, "pagesize": 0 }
  63. $http.post(apiurljs.login + "g2work/routeinfo/queryDataTodoWithPage", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  64. .success(function (obj) {
  65. var res = strToJson(s4.decryptData_CBC(obj.data));
  66. self.num.xfbl = res.meta.totalCount;
  67. })
  68. }
  69. self.getData1()
  70. self.deviceType = "";
  71. window.addEventListener('message', function (event) {
  72. //通过origin属性判断消息来源地址
  73. if (event.data.name == "deviceType") {
  74. //jzsetLat(event.data.arg);
  75. var getJson = event.data.arg;
  76. self.deviceType = getJson.ctype;
  77. }
  78. }, false);
  79. self.openTab = function (n) {
  80. if (self.deviceType == "pad") {
  81. if (n == 1) {
  82. window.top.jumpPageParent('FZC02', '党委发文', 'tpl/shouwenbg/list.html')
  83. } else if (n == 2) {
  84. window.top.jumpPageParent('FZC01', '行政发文', 'tpl/fawenbg/list.html')
  85. } else if (n == 3) {
  86. window.top.jumpPageParent('FZC02', '党委发文', 'tpl/fawendw/list.html')
  87. } else if (n == 4) {
  88. window.top.jumpPageParent('FZD01', '事项督办', 'tpl/shixiangdb/list.html')
  89. } else if (n == 5) {
  90. window.top.jumpPageParent("http://192.168.2.126/Portal/polish/Login");
  91. } else {
  92. window.top.jumpPageParent('FZI02', '信访办理', 'tpl/xinfangbg/list.html')
  93. }
  94. } else {
  95. if (n == 1) {
  96. window.top.sp.addTabNav('FZC02', '党委发文', 'tpl/shouwenbg/list.html')
  97. } else if (n == 2) {
  98. window.top.sp.addTabNav('FZC01', '行政发文', 'tpl/fawenbg/list.html')
  99. } else if (n == 3) {
  100. window.top.sp.addTabNav('FZC02', '党委发文', 'tpl/fawendw/list.html')
  101. } else if (n == 4) {
  102. window.top.sp.addTabNav('FZD01', '事项督办', 'tpl/shixiangdb/list.html')
  103. } else if (n == 5) {
  104. window.open('http://192.168.2.126/Portal/polish/Login', 'newwindow', 'toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')
  105. } else {
  106. window.top.sp.addTabNav('FZI02', '信访办理', 'tpl/xinfangbg/list.html')
  107. }
  108. }
  109. }
  110. }])