'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"); self.login="http://192.168.3.152:8088/glwork1/"; 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 (pageno) { self.list = []; self.loading = false; self.pageno = pageno; $scope.__default__currentPage = self.pageno; //设置页面样式在第几页 var data = { tablename: "WJFB_CB", pagesize: 10, pageno: 1, colums: "ID,WJBT,FBRQ", order: "FBRQ desc", sqlwhere: { LX: "P010207", FBZT: "1" }, 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, "时政要闻") } } }])