123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- 'use strict';
- var app = angular.module('app', [
- 'angularUtils.directives.dirPagination'
- ]);
- app.controller("listCtrl", ["$scope", "$http", "$timeout", "$interval", "$sce", function ($scope, $http, $timeout, $interval, $sce) {
- var self = this;
- var s4 = new SM4Util();
- self.userId = $.cookie("GlWorkPlatform-userid");
- self.userName = $.cookie("GlWorkPlatform-chineseName");
- self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
- var postCfg = {
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + self.get_AccessToken
- }
- };
- self.loading = false;
- self.searchFlag = false;
- self.search = {
- keyword: ""
- }
- self.keyLogin = function () {
- if (event.keyCode == 13) {
- self.getData()
- }
- }
- self.noDataTip = 1;
- self.pageno = 1;
- self.total_count = 0;
- self.itemsPerPage = 10;
- self.pageOptions = [10, 20, 30, 40, 50];
- self.getData = function () {
- self.loading = true;
- self.searchFlag = true;
- var data = {
- value: self.search.keyword
- }
- $http.post(apiurljs.login + "g2app/d2es/queryShouWenData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.loading = false;
- if (res.data == null || res.data == undefined || res.data == "") {
- self.list = []
- } else {
- self.noDataTip = 1;
- self.list = res.data;
- self.total_count = res.data.totalCount;
- self.list.forEach(function (item) {
- item.LWRQ = sp.format(item.LWRQ);
- })
- }
- })
- }
- }])
|