djgz1.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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, postCfg)
  22. .success(function (obj) {
  23. //var res = strToJson(s4.decryptData_CBC(obj.data));
  24. var res = obj;
  25. self.userDpName = res.data.length == 0 ? "" : res.data[0].SECTION;
  26. self.userDpCode = res.data.length == 0 ? "" : res.data[0].CODE;
  27. self.getData();
  28. })
  29. }
  30. self.getData = function (pageno) {
  31. self.list = [];
  32. self.loading = false;
  33. self.pageno = pageno;
  34. $scope.__default__currentPage = self.pageno; //设置页面样式在第几页
  35. var data = {
  36. tablename: "WJFB_CB",
  37. pagesize: 10,
  38. pageno: 1,
  39. colums: "ID,WJBT,FBRQ",
  40. order: "SORTID ASC,FBRQ desc",
  41. sqlwhere: { LX: "P010206" },
  42. sqlorwhere: "",
  43. sqlinwhere: "",
  44. sqllikewhere: ""
  45. };
  46. $http.post(apiurljs.login + "g2app/dataabase/queryDataByColWithPage", data, postCfg)
  47. .success(function (obj) {
  48. // var res = strToJson(s4.decryptData_CBC(obj.data));
  49. var res = obj;
  50. self.loading = false;
  51. if (res.data == null || res.data == undefined || res.data == "") {
  52. self.noDataTip = 0;
  53. } else {
  54. self.noDataTip = 1;
  55. self.list = res.data;
  56. self.total_count = res.totalCount;
  57. }
  58. })
  59. }
  60. self.getDP()
  61. self.deviceType = localStorage.getItem("tjJxtGoldenlinkWork-deviceType");
  62. self.openTab = function (item) {
  63. item.style = { "color": "blue", "font-size": "16px" }
  64. if (self.deviceType == "pad") {
  65. sp.openNewWindow("../../tpl/wenjianbg/WJFBB/detail.html?id=" + item.ID, "党建工作(学习园地)")
  66. } else {
  67. sp.openNewWindow("../../tpl/wenjianbg/WJFBB/detail.html?id=" + item.ID, "党建工作(学习园地)")
  68. }
  69. }
  70. }])