'use strict'; var app = angular.module('app', [ 'angularUtils.directives.dirPagination' ]); app.controller("listCtrl", ["$scope", "$http", "$timeout", function ($scope, $http, $timeout) { var self = this; var s4 = new SM4Util(); self.userId = $.cookie("GlWorkPlatform-userid"); self.userName = $.cookie("GlWorkPlatform-chineseName"); self.get_AccessToken = !localStorage.getItem("GlWorkPlatform-AccessToken") ? sp.getUrlName("token") : localStorage.getItem("GlWorkPlatform-AccessToken"); self.get_lastReturnPageno = sp.getUrlName("lastReturnPageno"); self.type = sp.getUrlName("type"); var postCfg = { headers: { 'Content-Type': 'application/json', 'Authorization': "Bearer " + self.get_AccessToken } } self.noDataTip = 1;//没有数据时赋变量为0,先默认为1 self.pageno = 1; self.total_count = 0; self.itemsPerPage = 10; self.pageOptions = [10, 20, 30, 40]; self.getData1 = function () { self.list1 = []; var data = { ctype: self.search.ctype } $http.post(apiurljs.login1 + "js/shjd", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg) .success(function (obj) { // var res = strToJson(s4.decryptData_CBC(obj.data)); var res = obj.data; self.list1 = res.data; }) } //self.getData1() self.getData2 = function () { self.list2 = []; var data = { ctype: self.search.ctype } $http.post(apiurljs.login1 + "js/shjd", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg) .success(function (obj) { // var res = strToJson(s4.decryptData_CBC(obj.data)); var res = obj.data; self.list2 = res.data; }) } //self.getData2() self.getData3 = function () { self.list3 = []; var data = { ctype: self.search.ctype } $http.post(apiurljs.login1 + "js/shjd", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg) .success(function (obj) { //var res = strToJson(s4.decryptData_CBC(obj.data)); var res = obj.data; self.list3 = res.data; }) } //self.getData3() }])