djgz.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. 'use strict';
  2. var app = angular.module('app', [
  3. 'angularUtils.directives.dirPagination',
  4. ]);
  5. app.controller("indexCtrl", ["$scope", "$http", "$interval", "$timeout", "$sce", function ($scope, $http, $interval, $timeout, $sce) {
  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.getDP = function () {
  18. var data = {
  19. userid: self.userId
  20. }
  21. $http.post(apiurljs.login + "g2app/richang/queryDpInfo", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  22. .success(function (obj) {
  23. var res = strToJson(s4.decryptData_CBC(obj.data));
  24. self.userDpName = res.data.length == 0 ? "" : res.data[0].SECTION;
  25. self.userDpCode = res.data.length == 0 ? "" : res.data[0].CODE;
  26. self.getData();
  27. })
  28. }
  29. self.getData = function (pageno) {
  30. self.list = [];
  31. self.loading = false;
  32. self.pageno = pageno;
  33. $scope.__default__currentPage = self.pageno; //设置页面样式在第几页
  34. var data = {
  35. tablename: "WJFB_CB",
  36. pagesize: 10,
  37. pageno: 1,
  38. colums: "ID,WJBT,FBRQ",
  39. order: "FBRQ desc",
  40. sqlwhere: { LX: "P010206" },
  41. sqlorwhere: "",
  42. sqlinwhere: "",
  43. sqllikewhere: ""
  44. };
  45. $http.post(apiurljs.login + "g2app/dataabase/queryDataByColWithPage", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  46. .success(function (obj) {
  47. var res = strToJson(s4.decryptData_CBC(obj.data));
  48. self.loading = false;
  49. if (res.data == null || res.data == undefined || res.data == "") {
  50. self.noDataTip = 0;
  51. } else {
  52. self.noDataTip = 1;
  53. self.list = res.data;
  54. self.total_count = res.totalCount;
  55. }
  56. })
  57. }
  58. self.getDP()
  59. self.deviceType = localStorage.getItem("tjJxtGoldenlinkWork-deviceType");
  60. self.openTab = function (item) {
  61. if (self.deviceType == "pad") {
  62. sp.openNewWindow("../../tpl/wenjianbg/WJFBB/detail.html?id=" + item.ID, "党建工作(学习园地)")
  63. } else {
  64. sp.openNewWindow("../../tpl/wenjianbg/WJFBB/detail.html?id=" + item.ID, "党建工作(学习园地)")
  65. }
  66. }
  67. }])