123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- 'use strict';
- var app = angular.module('app', [
- 'angularUtils.directives.dirPagination',
- ]);
- app.controller("indexCtrl", ["$scope", "$http", "$interval", "$timeout", "$sce", function ($scope, $http, $interval, $timeout, $sce) {
- var self = this;
- self.userId = $.cookie("GlWorkPlatform-userid");
- self.userName = $.cookie("GlWorkPlatform-username");
- self.userChineseName = $.cookie("GlWorkPlatform-chineseName")
- self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
-
- var postCfg = {
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + self.get_AccessToken
- }
- };
- self.getDP = function () {
- var data = {
- userid: self.userId
- }
- $http.post(apiurljs.login + "g2app/richang/queryDpInfo", data, postCfg)
- .success(function (obj) {
- //var res = strToJson(s4.decryptData_CBC(obj.data));
- var res = obj;
- self.userDpName = res.data.length == 0 ? "" : res.data[0].SECTION;
- self.userDpCode = res.data.length == 0 ? "" : res.data[0].CODE;
- self.getData();
- })
- }
- self.getData = function () {
- self.list = [];
- self.loading = false;
- var data = {
- tablename: "WJFB_CB",
- pagesize: 8,
- pageno: 1,
- colums: "ID,WJBT,FBRQ",
- order: "FBRQ desc",
- sqlwhere: { LX: "P010206" },
- sqlorwhere: "",
- sqlinwhere: "",
- sqllikewhere: ""
- };
- $http.post(apiurljs.login + "g2app/dataabase/queryDataByColWithPage", data, postCfg)
- .success(function (obj) {
- // var res = strToJson(s4.decryptData_CBC(obj.data));
- var res = obj;
- self.loading = false;
- if (res.data == null || res.data == undefined || res.data == "") {
- self.noDataTip = 0;
- } else {
- self.noDataTip = 1;
- self.list = res.data;
- self.total_count = res.totalCount;
- }
- })
- }
- self.getDP()
- self.deviceType = localStorage.getItem("tjJxtGoldenlinkWork-deviceType");
- self.openTab = function (item) {
- if (self.deviceType == "pad") {
- sp.openNewWindow("../../tpl/wenjianbg/WJFBB/detail.html?id=" + item.ID, "党建工作(学习园地)")
- } else {
- sp.openNewWindow("../../tpl/wenjianbg/WJFBB/detail.html?id=" + item.ID, "党建工作(学习园地)")
- }
- }
- }])
|