ywbl1.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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, postCfg)
  28. .success(function (obj) {
  29. // var res = strToJson(s4.decryptData_CBC(obj.data));
  30. var res = obj;
  31. self.num.swbl = res.meta.totalCount;
  32. self.getData2()
  33. })
  34. }
  35. self.getData2 = function () {
  36. var data = { "flowid": "AA20|AA03|AA10|AA57|AA08|AA23|AA77|AA06|AA63|AA80", "userid": self.userId, "pageno": 0, "pagesize": 0 }
  37. $http.post(apiurljs.login + "g2work/routeinfo/queryDataTodoWithPage", data, postCfg)
  38. .success(function (obj) {
  39. // var res = strToJson(s4.decryptData_CBC(obj.data));
  40. var res = obj;
  41. self.num.xzfw = res.meta.totalCount;
  42. self.getData3()
  43. })
  44. }
  45. self.getData3 = function () {
  46. var data = { "flowid": "AA88|AA89|AA46|AA22|AA54|AA58", "userid": self.userId, "pageno": 0, "pagesize": 0 }
  47. $http.post(apiurljs.login + "g2work/routeinfo/queryDataTodoWithPage", data, postCfg)
  48. .success(function (obj) {
  49. // var res = strToJson(s4.decryptData_CBC(obj.data));
  50. var res = obj;
  51. self.num.dwfw = res.meta.totalCount;
  52. self.getData4()
  53. })
  54. }
  55. self.getData4 = function () {
  56. var data = { "flowid": "AA73|AA82", "userid": self.userId, "pageno": 0, "pagesize": 0 }
  57. $http.post(apiurljs.login + "g2work/routeinfo/queryDataTodoWithPage", data, postCfg)
  58. .success(function (obj) {
  59. // var res = strToJson(s4.decryptData_CBC(obj.data));
  60. var res = obj;
  61. self.num.sxdb = res.meta.totalCount;
  62. self.getData5()
  63. })
  64. }
  65. self.getData5 = function () {
  66. var data = { "flowid": "AA27|AA71|AA72", "userid": self.userId, "pageno": 0, "pagesize": 0 }
  67. $http.post(apiurljs.login + "g2work/routeinfo/queryDataTodoWithPage", data, postCfg)
  68. .success(function (obj) {
  69. //var res = strToJson(s4.decryptData_CBC(obj.data));
  70. var res = obj;
  71. self.num.xfbl = res.meta.totalCount;
  72. })
  73. }
  74. self.getData1()
  75. self.deviceType = "";
  76. window.addEventListener('message', function (event) {
  77. //通过origin属性判断消息来源地址
  78. if (event.data.name == "deviceType") {
  79. //jzsetLat(event.data.arg);
  80. var getJson = event.data.arg;
  81. self.deviceType = getJson.ctype;
  82. }
  83. }, false);
  84. self.openTab = function (n) {
  85. if (self.deviceType == "pad") {
  86. if (n == 1) {
  87. window.top.jumpPageParent('FZC02', '党委发文', 'tpl/shouwenbg/list.html')
  88. } else if (n == 2) {
  89. window.top.jumpPageParent('FZC01', '行政发文', 'tpl/fawenbg/list.html')
  90. } else if (n == 3) {
  91. window.top.jumpPageParent('FZC02', '党委发文', 'tpl/fawendw/list.html')
  92. } else if (n == 4) {
  93. window.top.jumpPageParent('FZD01', '事项督办', 'tpl/shixiangdb/list.html')
  94. } else if (n == 5) {
  95. window.top.jumpPageParent("http://192.168.2.126/Portal/polish/Login");
  96. } else {
  97. window.top.jumpPageParent('FZI02', '信访办理', 'tpl/xinfangbg/list.html')
  98. }
  99. } else {
  100. if (n == 1) {
  101. window.top.sp.addTabNav('FZC02', '党委发文', 'tpl/shouwenbg/list.html')
  102. } else if (n == 2) {
  103. window.top.sp.addTabNav('FZC01', '行政发文', 'tpl/fawenbg/list.html')
  104. } else if (n == 3) {
  105. window.top.sp.addTabNav('FZC02', '党委发文', 'tpl/fawendw/list.html')
  106. } else if (n == 4) {
  107. window.top.sp.addTabNav('FZD01', '事项督办', 'tpl/shixiangdb/list.html')
  108. } else if (n == 5) {
  109. window.open('http://192.168.2.126/Portal/polish/Login', 'newwindow', 'toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')
  110. } else {
  111. window.top.sp.addTabNav('FZI02', '信访办理', 'tpl/xinfangbg/list.html')
  112. }
  113. }
  114. }
  115. }])