szyw.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. self.login="http://192.168.3.152:8088/glwork1/";
  12. var postCfg = {
  13. headers: {
  14. 'Content-Type': 'application/json',
  15. 'Authorization': "Bearer " + self.get_AccessToken
  16. }
  17. };
  18. self.getDP = function () {
  19. var data = {
  20. userid: self.userId
  21. }
  22. $http.post(apiurljs.login + "g2app/richang/queryDpInfo", data, postCfg)
  23. .success(function (obj) {
  24. // var res = strToJson(s4.decryptData_CBC(obj.data));
  25. var res = obj;
  26. self.userDpName = res.data.length == 0 ? "" : res.data[0].SECTION;
  27. self.userDpCode = res.data.length == 0 ? "" : res.data[0].CODE;
  28. self.getData();
  29. })
  30. }
  31. self.getData = function (pageno) {
  32. self.list = [];
  33. self.loading = false;
  34. self.pageno = pageno;
  35. $scope.__default__currentPage = self.pageno; //设置页面样式在第几页
  36. var data = {
  37. tablename: "WJFB_CB",
  38. pagesize: 10,
  39. pageno: 1,
  40. colums: "ID,WJBT,FBRQ",
  41. order: "FBRQ desc",
  42. sqlwhere: { LX: "P010207", FBZT: "1" },
  43. sqlorwhere: "",
  44. sqlinwhere: "",
  45. sqllikewhere: ""
  46. };
  47. $http.post(apiurljs.login + "g2app/dataabase/queryDataByColWithPage", data, postCfg)
  48. .success(function (obj) {
  49. // var res = strToJson(s4.decryptData_CBC(obj.data));
  50. var res = obj;
  51. self.loading = false;
  52. if (res.data == null || res.data == undefined || res.data == "") {
  53. self.noDataTip = 0;
  54. } else {
  55. self.noDataTip = 1;
  56. self.list = res.data;
  57. self.total_count = res.totalCount;
  58. }
  59. })
  60. }
  61. self.getDP()
  62. self.deviceType = localStorage.getItem("tjJxtGoldenlinkWork-deviceType");
  63. self.openTab = function (item) {
  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. }])