123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- '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
- }
- };
- self.num = {
- dwfw: 0,
- xzfw: 0,
- sxdb: 0,
- yzgl: 0,
- hysq: 0,
- clpq: 0
- }
- self.getData1 = function () {
- var data = { "flowid": "AA18|AA16|AA02|AA17", "userid": self.userId, "pageno": 0, "pagesize": 0 }
- $http.post(apiurljs.login + "g2work/routeinfo/queryDataTodoWithPage", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.num.swbl = res.meta.totalCount;
- self.getData2()
- })
- }
- self.getData2 = function () {
- var data = { "flowid": "AA20|AA03|AA10|AA57|AA08|AA23|AA77|AA06|AA63|AA80", "userid": self.userId, "pageno": 0, "pagesize": 0 }
- $http.post(apiurljs.login + "g2work/routeinfo/queryDataTodoWithPage", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.num.xzfw = res.meta.totalCount;
- self.getData3()
- })
- }
- self.getData3 = function () {
- var data = { "flowid": "AA88|AA89|AA46|AA22|AA54|AA58", "userid": self.userId, "pageno": 0, "pagesize": 0 }
- $http.post(apiurljs.login + "g2work/routeinfo/queryDataTodoWithPage", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.num.dwfw = res.meta.totalCount;
- self.getData4()
- })
- }
- self.getData4 = function () {
- var data = { "flowid": "AA73|AA82", "userid": self.userId, "pageno": 0, "pagesize": 0 }
- $http.post(apiurljs.login + "g2work/routeinfo/queryDataTodoWithPage", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.num.sxdb = res.meta.totalCount;
- self.getData5()
- })
- }
- self.getData5 = function () {
- var data = { "flowid": "AA27|AA71|AA72", "userid": self.userId, "pageno": 0, "pagesize": 0 }
- $http.post(apiurljs.login + "g2work/routeinfo/queryDataTodoWithPage", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.num.xfbl = res.meta.totalCount;
- })
- }
- self.getData1()
- self.deviceType = "";
- window.addEventListener('message', function (event) {
- //通过origin属性判断消息来源地址
- if (event.data.name == "deviceType") {
- //jzsetLat(event.data.arg);
- var getJson = event.data.arg;
- self.deviceType = getJson.ctype;
- }
- }, false);
- self.openTab = function (n) {
- if (self.deviceType == "pad") {
- if (n == 1) {
- window.top.jumpPageParent('FZC02', '党委发文', 'tpl/shouwenbg/list.html')
- } else if (n == 2) {
- window.top.jumpPageParent('FZC01', '行政发文', 'tpl/fawenbg/list.html')
- } else if (n == 3) {
- window.top.jumpPageParent('FZC02', '党委发文', 'tpl/fawendw/list.html')
- } else if (n == 4) {
- window.top.jumpPageParent('FZD01', '事项督办', 'tpl/shixiangdb/list.html')
- } else if (n == 5) {
- window.top.jumpPageParent("http://192.168.2.126/Portal/polish/Login");
- } else {
- window.top.jumpPageParent('FZI02', '信访办理', 'tpl/xinfangbg/list.html')
- }
- } else {
- if (n == 1) {
- window.top.sp.addTabNav('FZC02', '党委发文', 'tpl/shouwenbg/list.html')
- } else if (n == 2) {
- window.top.sp.addTabNav('FZC01', '行政发文', 'tpl/fawenbg/list.html')
- } else if (n == 3) {
- window.top.sp.addTabNav('FZC02', '党委发文', 'tpl/fawendw/list.html')
- } else if (n == 4) {
- window.top.sp.addTabNav('FZD01', '事项督办', 'tpl/shixiangdb/list.html')
- } else if (n == 5) {
- window.open('http://192.168.2.126/Portal/polish/Login', 'newwindow', 'toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')
- } else {
- window.top.sp.addTabNav('FZI02', '信访办理', 'tpl/xinfangbg/list.html')
- }
- }
- }
- }])
|