123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- 'use strict';
- var app = angular.module('app', [
- 'angularUtils.directives.dirPagination'
- ]);
- app.controller("plugCtrl", ["$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");
- self.get_lastReturnPageno = sp.getUrlName("lastReturnPageno") || 1;
- self.leaf = sp.getUrlName("leaf") | 0;
- var postCfg = {
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + self.get_AccessToken
- }
- }
- self.CrossPage = window.parent.CrossPage;
- self.loading = false;
-
- //党建工作
- self.tab_dangjian = [
- //{ "CNAME": "党建工作", "CODE": "P010201" }, { "CNAME": "机关党务公开", "CODE": "P010202" },
- //{ "CNAME": "巡察工作", "CODE": "P010203" }, { "CNAME": "领导讲话", "CODE": "P010204" },
- //{ "CNAME": "党委会会议纪要", "CODE": "P010205" }, { "CNAME": "党建工作(学习园地)", "CODE": "P010206" },
- //{ "CNAME": "时政要闻", "CODE": "P010207" }
- ];
- self.tab_dangjian_active = "";
- ///委发文件
- self.tab_weiFaWenJian = [
- //{ "CNAME": "党委文件", "CODE": "P010301" },{ "CNAME": "委发规范性文件", "CODE": "P010302" }
- ];
- self.tab_weiFaWenJian_active = "";
- ///行政工作
- self.tab_xingZhengGongZuo = [
- //{ "CNAME": "住建工作动态", "CODE": "P010101" }, { "CNAME": "督查专报", "CODE": "P010102" },
- //{ "CNAME": "主任办公会会议纪要", "CODE": "P010103" }
- ];
- self.tab_xingZhengGongZuo_active = "";
- ///相关知识
- self.tab_xiangGuanZhiShi = [
- //{ "CNAME": "国家安全和保密工作", "CODE": "P010401" }, { "CNAME": "网信知识", "CODE": "P010402" }
- ];
- self.tab_xiangGuanZhiShi_active = "";
- ///学习园地
- self.tab_xueXiYuanDi = [
- { "CNAME": "学习园地", "CODE": "P010206" }
- ];
-
- self.getLM = function () {
- var data = {
- tablename: "CODE_LM"
- }
- $http.post(apiurljs.login + "g2app/filepublishing/getTreeListByTablename", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- //console.log(JSON.stringify(res.data[0].C_H_I_L_D_DATA));
- self.LM = res.data[0].C_H_I_L_D_DATA;
-
-
- self.LM.forEach(function (item) {
- if (item.CODE == "P0102") {
- ///党建工作
- var set_array = [];
- item.C_H_I_L_D_DATA.forEach(function (item1) {
- if (item1.CODE != "P010201" && item1.CODE != "P010206" && item1.CODE != "P010207") {
- var setjson = { "CNAME": item1.CNAME, "CODE": item1.CODE };
- set_array.push(setjson);
- }
- //var setjson = { "CNAME": item1.CNAME, "CODE": item1.CODE };
- //set_array.push(setjson);
- })
- self.tab_dangjian = set_array;
- //console.log("党建工作:" + JSON.stringify(set_array));
- self.getData_up(self.get_lastReturnPageno, "P0102");
- self.getData(self.get_lastReturnPageno, self.tab_dangjian[0].CODE, 3);
- self.tab_dangjian_active = self.tab_dangjian[0].CODE;
- }
- if (item.CODE == "P0103") {
- ///委发文件
- var set_array = [];
- item.C_H_I_L_D_DATA.forEach(function (item1) {
- if (item1.CODE != "P010301") {
- var setjson = { "CNAME": item1.CNAME, "CODE": item1.CODE };
- set_array.push(setjson);
- }
- })
- self.tab_weiFaWenJian = set_array;
- //console.log("委发文件:" + JSON.stringify(set_array));
- self.getData_up(self.get_lastReturnPageno, "P0103");
- self.getData(self.get_lastReturnPageno, self.tab_weiFaWenJian[0].CODE, 3);
- self.tab_weiFaWenJian_active = self.tab_weiFaWenJian[0].CODE;
- }
- if (item.CODE == "P0101") {
- ///行政工作
- var set_array = [];
- item.C_H_I_L_D_DATA.forEach(function (item1) {
- if (item1.CODE != "P010101") {
- var setjson = { "CNAME": item1.CNAME, "CODE": item1.CODE };
- set_array.push(setjson);
- }
- })
- self.tab_xingZhengGongZuo = set_array;
- //console.log("行政工作:" + JSON.stringify(set_array));
- self.getData_up(self.get_lastReturnPageno, "P0101");
- self.getData(self.get_lastReturnPageno, self.tab_xingZhengGongZuo[0].CODE, 3);
- self.tab_xingZhengGongZuo_active = self.tab_xingZhengGongZuo[0].CODE;
- }
- if (item.CODE == "P0104") {
- ///相关知识
- var set_array = [];
- item.C_H_I_L_D_DATA.forEach(function (item1) {
- if (item1.CODE != "P010401") {
- var setjson = { "CNAME": item1.CNAME, "CODE": item1.CODE };
- set_array.push(setjson);
- }
- })
- self.tab_xiangGuanZhiShi = set_array;
- //console.log("相关知识:" + JSON.stringify(set_array));
- self.getData_up(self.get_lastReturnPageno, "P0104");
- self.getData(self.get_lastReturnPageno, self.tab_xiangGuanZhiShi[0].CODE, 3);
- self.tab_xiangGuanZhiShi_active = self.tab_xiangGuanZhiShi[0].CODE;
- }
-
- });
-
-
- })
- }
- self.getLM();
- ///顶部一级及第二级的第一个
- self.list_dangjian_up = []; self.noDataTip_dangjian_up = 1;
- self.list_weifa_up = []; self.noDataTip_weifa_up = 1;
- self.list_xingZheng_up = []; self.noDataTip_xingZheng_up = 1;
- self.list_zhiShi_up = []; self.noDataTip_zhiShi_up = 1;
- self.getData_up = function (pageno, codestr) {
- var CODE = ["'" + codestr + "'", "'" + codestr + "01'"];
- self.loading = false;
-
- var sqlwhere = { FBZT: "1" };
- var data = {
- tablename: "SX_FBLIST",
- pagesize: 3,
- pageno: 1,
- colums: "*",
- order: "FBRQ",
- sqlwhere: " and LM in(" + CODE.join(",") + ") and gkfw ISNULL OR gkfw LIKE '" + self.userId + "'"
- };
- //console.log(JSON.stringify(data))
- $http.post(apiurljs.login + "g2app/dataabase/queryDataByColWithPage3", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- //console.log(JSON.stringify(res.data))
- self.loading = false;
- if (codestr == "P0102") {
- if(sp.isval(res.data)){
- self.list_dangjian_up = res.data;
- self.noDataTip_dangjian_up = 1;
- }else{
- self.list_dangjian_up = [];
- self.noDataTip_dangjian_up = 0;
- }
- }
- if (codestr == "P0103") {
- if (sp.isval(res.data)) {
- self.list_weifa_up = res.data;
- self.noDataTip_weifa_up = 1;
- } else {
- self.list_weifa_up = [];
- self.noDataTip_weifa_up = 0;
- }
- }
- if (codestr == "P0101") {
- if (sp.isval(res.data)) {
- self.list_xingZheng_up = res.data;
- self.noDataTip_xingZheng_up = 1;
- } else {
- self.list_xingZheng_up = [];
- self.noDataTip_xingZheng_up = 0;
- }
- }
- if (codestr == "P0104") {
- if (sp.isval(res.data)) {
- self.list_zhiShi_up = res.data;
- self.noDataTip_zhiShi_up = 1;
- } else {
- self.list_zhiShi_up = [];
- self.noDataTip_zhiShi_up = 0;
- }
- }
- })
- }
- ////底部分栏目
- self.list_dangjian_foot = []; self.noDataTip_dangjian_foot = 1;
- self.list_weifa_foot = []; self.noDataTip_weifa_foot = 1;
- self.list_xingZheng_foot = []; self.noDataTip_xingZheng_foot = 1;
- self.list_zhiShi_foot = []; self.noDataTip_zhiShi_foot = 1;
- self.list_xuexiYuandi_foot = []; self.noDataTip_xuexiYuandi_foot = 1;
- self.getData = function (pageno, codestr, pagesize) {
- var CODE = ["'" + codestr + "'"];
- self.loading = false;
- var sqlwhere = { FBZT: "1" };
- var data = {
- tablename: "SX_FBLIST",
- pagesize: pagesize,
- pageno: 1,
- colums: "*",
- order: "FBRQ",
- sqlwhere: " and LM in(" + CODE.join(",") + ") and gkfw ISNULL OR gkfw LIKE '" + self.userId + "'"
- };
- //console.log(JSON.stringify(data))
- $http.post(apiurljs.login + "g2app/dataabase/queryDataByColWithPage3", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- //console.log(JSON.stringify(res.data))
- self.loading = false;
- if (codestr != "P010206" && codestr.indexOf("P0102") != -1) {
- if (sp.isval(res.data)) {
- self.list_dangjian_foot = res.data;
- self.noDataTip_dangjian_foot = 1;
- } else {
- self.list_dangjian_foot = [];
- self.noDataTip_dangjian_foot = 0;
- }
- }
- if (codestr.indexOf("P0103") != -1) {
- if (sp.isval(res.data)) {
- self.list_weifa_foot = res.data;
- self.noDataTip_weifa_foot = 1;
- } else {
- self.list_weifa_foot = [];
- self.noDataTip_weifa_foot = 0;
- }
- }
- if (codestr.indexOf("P0101") != -1) {
- if (sp.isval(res.data)) {
- self.list_xingZheng_foot = res.data;
- self.noDataTip_xingZheng_foot = 1;
- } else {
- self.list_xingZheng_foot = [];
- self.noDataTip_xingZheng_foot = 0;
- }
- }
- if (codestr.indexOf("P0104") != -1) {
- if (sp.isval(res.data)) {
- self.list_zhiShi_foot = res.data;
- self.noDataTip_zhiShi_foot = 1;
- } else {
- self.list_zhiShi_foot = [];
- self.noDataTip_zhiShi_foot = 0;
- }
- }
- if (codestr == "P010206") {
- if (sp.isval(res.data)) {
- self.list_xuexiYuandi_foot = res.data;
- self.noDataTip_xuexiYuandi_foot = 1;
- } else {
- self.list_xuexiYuandi_foot = [];
- self.noDataTip_xuexiYuandi_foot = 0;
- }
- }
- })
- }
- self.getData(self.get_lastReturnPageno, self.tab_xueXiYuanDi[0].CODE, 6);
- self.tabClick_dangjian = function (codestr) {
- self.getData(self.get_lastReturnPageno, codestr,3);
- self.tab_dangjian_active = codestr;
- };
- self.tabClick_weifa = function (codestr) {
- self.getData(self.get_lastReturnPageno, codestr, 3);
- self.tab_weiFaWenJian_active = codestr;
- }
- self.tabClick_xingZhengGongZuo = function (codestr) {
- self.getData(self.get_lastReturnPageno, codestr, 3);
- self.tab_xingZhengGongZuo_active = codestr;
- }
- self.tabClick_xiangGuanZhiShi = function (codestr) {
- self.getData(self.get_lastReturnPageno, codestr, 3);
- self.tab_xiangGuanZhiShi_active = codestr;
- }
-
-
- ///其他四个更多点击跳转地址
- self.goZL = function (codestr) {
- sp.openNewWindow("list1.html?code=" + codestr + "&leaf=0" + "&code1=", "")
- //window.location.href = "list1.html?code=" + item.CODE + "&leaf=" + (self.leaf + 1) + "&code1=";
- }
- self.goUrl = function (item, codestr) {
- //if (self.tablename == "WJFB_CB") {
- // window.location.href = "../../tpl/wenjianbg/WJFBB/detail.html?id=" + item.ID + "&formPage=wenjianshow&&tablename=" + self.tablename + "&code=" + self.code + "&val=" + self.val
- //} else {
- // window.location.href = "../../tpl/tongzhibg/TZGG/detail.html?id=" + item.ID + "&formPage=wenjianshow&&tablename=" + self.tablename + "&code=" + self.code + "&val=" + self.val
- //}
- sp.openNewWindow("detail.html?id=" + item.ID + "&code=" + codestr + "&code1=" + "&lastReturnPageno=1" + (self.leaf ? "&leaf=1" : ""), item.WJBT)
- //window.location.href = "detail.html?id=" + item.ID + "&code=" + self.code + "&code1=" + self.code1 + "&lastReturnPageno=" + self.pageno + (self.leaf ? "&leaf=1" : "");
- }
- ///list4.html?lastReturnPageno=1
- self.goPageYuanDi = function () {
- sp.openNewWindow("list4.html?lastReturnPageno=1", "学习园地")
- }
- self.goPageYuanDiDetail = function (item) {
- sp.openNewWindow("../../tpl/wenjianbg/WJFBB/detail.html?id=" + item.ID, "学习园地")
- }
- }])
|