123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- 'use strict';
- var app = angular.module('app', [
- 'angularUtils.directives.dirPagination',
- ]);
- app.controller("indexCtrl", ["$scope", "$http", "$interval", "$timeout", function ($scope, $http, $interval, $timeout) {
- 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
- }
- };
- var base64 = new Base64(); //声明base解码和编码类
- self.getDP = function () {
- var data = {
- userid: self.userId
- }
- $http.post(apiurljs.login + "g2app/richang/queryDpInfo", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.userDpName = res.data.length == 0 ? "" : res.data[0].SECTION;
- self.getTZGG();
- })
- }
- self.getTZGG = function () {
- var data = {
- tablename: "SX_TZGG",
- colums: "ID,GGBT,FBSJ,FBFW",
- order: "ID desc",
- sqlwhere: { FBZT: 1, GGBK: "C01" },
- sqlorwhere: "",
- sqlinwhere: "",
- sqllikewhere: ""
- }
- $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol",{ data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data))
- $.each(res.data, function (index, item) {
- if (item.FBFW == "全部" || item.FBFW.indexOf(self.userDpName) > -1 || item.FBFW.indexOf(self.userChineseName) > -1) {
- self.TZGG = item;
- return false
- }
- })
- if (self.TZGG.FJSC && self.TZGG.FJSC != "") {
- self.arrayFile = JSON.parse(self.TZGG.FJSC);
- }
- $timeout(function () {
- var height = 0;
- $(".content").siblings().each(function () {
- height = height + $(this).outerHeight(true);
- })
- $(".content").css("height", 300 - height)
- $(".content").html(base64.decode(self.TZGG.GGNR));
- },1)
- })
- }
- self.getDP()
- }])
|