'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.deviceType = localStorage.getItem("tjJxtGoldenlinkWork-deviceType"); self.goHref = function(obj) { if (self.deviceType == "pad") { window.top.jumpPageParent(obj.FLOWCODE, obj.CNAME, obj.FILEN + (obj.FILEN.indexOf("?") == - 1 ? "?params=" + params : "¶ms=" + params)); } else { window.top.sp.addTabNav(obj.FLOWCODE, obj.CNAME, obj.FILEN); } } self.goHref1 = function (obj) { window.open(obj.FILEN); } self.appList = [] self.deptList = [] var colors = ["#d5e7f5", "#d2f4e0", "#feedcf", "#fcdce1", "#e0f2f2", "#eae9f7"] self.getTop6 = function() { var data = { userid: self.userId } $http.post(apiurljs.login + "g2work/routeinfo/queryDataToDoFlowRouteCountDesktopByUseridGroup", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg) .success(function(obj) { var res = strToJson(s4.decryptData_CBC(obj.data)); self.ywblList = res.data; self.ywblList[2].CNAME = '业务分析' self.ywblList.splice(3, 0, { CNAME: '业务办理' }) self.ywblList.splice(2, 1) console.log('ywblList', self.ywblList) $.each(self.ywblList, function(index, item) { // if(item.CNAME=='业务办理'){ // item.CNAME='业务统计' // } item.background = { "background-color": "" + colors[index % 6] + "" }; item.news = { "background": "url(img/triangle" + (index % 6 + 1) + ".png) no-repeat center" } item.base = { "background": "url('img/base" + (index % 6 + 1) + ".png') no-repeat center center", "background-size": "110% 115%" }; item.circel = { "background": "url('img/icon" + (index % 6 + 1) + ".png') no-repeat center center rgba(74,156,247,0.6)" }; if (item.DESKTOP) { for (let i = 0; i < item.DESKTOP.length; i++) { let iitem = item.DESKTOP[i] if (iitem.FILEN) { iitem.show = true || iitem.FILEN.indexOf("shouwenbg") > - 1 || iitem.FILEN.indexOf("shixiangdb") > -1 || iitem .FILEN.indexOf("xinfangbg") > -1 } } } }) self.ywblCss = { "width": "100%", "height": self.deviceType == "pad" ? "120px" : "150px", "overflow": "hidden" } console.log(self.ywblList) }) } self.activeBottomObj = 1; self.secondAfter = 0; //记录左移右移次数 self.appDbCount = 0 self.getSecond = function(n) { $(".bottomObj").removeClass($(".bottomObj").attr("class").split(" ")[2]) $(".bottomObj").addClass("bottomObj" + (n + 1 > 7 ? 7 : n + 1)) self.activeBottomObj = n + 1 > 7 ? 7 : n + 1 } self.getTop6() $interval(function() { //self.getTop6() }, 20000) self.ywblMove = function(n) { var marginLeft = parseInt($(".List").css("margin-left").slice(0, $(".List").css("margin-left") .indexOf("px"))) + n * $(".Item").outerWidth(); if (marginLeft > 0) { $(".List").css("margin-left", 0) } else if (marginLeft < ($(".List").outerWidth() - $(".Item").outerWidth() * 7) * -1) { $(".List").css("margin-left", ($(".List").outerWidth() - $(".Item").outerWidth() * 7) * -1) } else { self.secondAfter = self.secondAfter + n; $(".List").css("margin-left", marginLeft) self.activeBottomObj = self.activeBottomObj + n * -1; if (self.activeBottomObj < 1) { self.activeBottomObj = 1 } else if (self.activeBottomObj > self.ywblList.length) { self.activeBottomObj = self.ywblList.length; } } } self.deviceType = localStorage.getItem("tjJxtGoldenlinkWork-deviceType"); self.addTabNav = function(obj, n) { self.deptAppList = [] self.nowDeptName = "" console.log((n + 1 + self.secondAfter)) self.activeBottomObj = n + 1 $(".bottomObj").removeClass($(".bottomObj").attr("class").split(" ")[2]) if (self.secondAfter != 0) { $(".bottomObj").addClass("bottomObj" + (n + 1 + self.secondAfter)) } else { $(".bottomObj").addClass("bottomObj" + (n + 1)) } if (self.activeBottomObj != 3) { window.parent[1].frameElement.height = '220px' //let iboxContent = document.getElementById("sjtsgzt") // iboxContent.style.height="100px" //console.log(iboxContent) } else { window.parent[1].frameElement.height = '229px' } } self.goParams = function(obj, params) { if (params != "" && params != undefined && params != null) { if (self.deviceType == "pad") { window.top.jumpPageParent(obj.FLOWCODE, obj.CNAME, obj.FILEN)// + (obj.FILEN.indexOf("?") == -1 ? "?params=" + params : "¶ms=" + params)); } else { window.top.sp.addTabNav(obj.FLOWCODE, obj.CNAME, obj.FILEN)// + (obj.FILEN.indexOf("?") ==-1 ? "?params=" + params : "¶ms=" + params)); } } else { if (self.deviceType == "pad") { window.top.jumpPageParent(obj.FLOWCODE, obj.CNAME, obj.FILEN); } else { window.top.sp.addTabNav(obj.FLOWCODE, obj.CNAME, obj.FILEN); } } event.stopPropagation() } self.goApp = function(obj) { if (obj.url.indexOf("@token") > -1) { window.top.sp.addTabNav(obj.appCode, obj.name, obj.url.replace("@token", localStorage .getItem("main-token"))); } else { window.top.sp.addTabNav(obj.appCode, obj.name, obj.url); } } self.goDeptApp = function(obj) { //sp.layerhide() if (obj.indexUrl.indexOf("?") > -1) { // window.top.sp.addTabNav(obj.appCode, obj.appName, obj.indexUrl + '&token=' + localStorage // .getItem("main-token")); window.open(obj.indexUrl + '&token=' + localStorage.getItem("main-token")); } else { // window.top.sp.addTabNav(obj.appCode, obj.appName, obj.indexUrl + '?token=' + localStorage // .getItem("main-token")); window.open(obj.indexUrl + '?token=' + localStorage.getItem("main-token")); } } self.deptAppList = [] self.nowDeptName = "" self.goDeptAppList = function(obj) { window.parent[1].frameElement.height = '290px' //window.parent.parent.deptClick_FJSKECMADWDSCBNHX(obj.deptId,obj.deptName) self.deptAppList = [] self.nowDeptName = obj.deptName //sp.layer("#dept-app-list") var dptCfg = { headers: { 'Content-Type': 'application/json', 'Access-Token': localStorage.getItem("main-token"), } }; $http.get( apiurljs.dpt + "auth/system/app-list-divisions?deptId=" + obj.deptId, dptCfg ).success(function(obj) { console.log(obj.result) self.deptAppList = obj.result }) } self.deptClick = function(deptId) { //console.log(self.parent) //window.top.sp.deptClick_FJSKECMADWDSCBNHX('123'); //sp.layer("#dept-app-list") //window.deptClick_FJSKECMADWDSCBNHX(deptId) } // self.sysappListOuter = function () { // let postCfg_ = { // headers: { // 'Content-Type': 'application/json', // 'Authorization': "Bearer " + self.get_AccessToken // } // }; // var data = { // token: localStorage.getItem("main-token"), // userid: self.userId, // type: 'oa', // portalShow: 1, // } // $http.post(apiurljs.login + "g2app/pluginkinds/sysappListOuter", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg_) // .success(function (obj) { // var res = strToJson(s4.decryptData_CBC(obj.data)); // let appList = [] // for (let i = 0; i < res.result.length; i++) { // let item = res.result[i] // for (let j = 0; j < item.appList.length; j++) { // let appItem = item.appList[j] // appList.push({ // name: appItem.appName, // url: appItem.indexUrl, // appCode: appItem.appCode // }) // } // } // self.appList = appList // self.appDbCount = 0 // for (let i = 0; i < self.appList.length; i++) { // let data_ = { // token: localStorage.getItem("main-token"), // userid: self.userId, // appCode: self.appList[i].appCode, // portalShow: 1, // } // $http.post(apiurljs.login + "g2app/pluginkinds/behalf", { data: s4.encryptData_CBC(JSON.stringify(data_)) }, postCfg_) // .success(function (objj) { // var ress = strToJson(s4.decryptData_CBC(objj.data)); // if (ress.result == '-1') { // self.appList[i].dbCount = 0 // } else { // self.appList[i].dbCount = +ress.result // } // self.appDbCount += self.appList[i].dbCount // }) // } // }) // } // self.sysappListOuter() self.sysappListOuter = function() { // appList.push({ // name:'房地产市场', // url:'http://10.149.1.56:8077/realEstate/newHouseTransactions?topTitle=房地产市场分析&muemType=1&token=@token&u=1171164793054724096', // appCode:'F0104', // }) // appList.push({ // name:'政务办件统计', // url:'http://10.149.1.76:31693/manager/server/b1105/index?u=1171164793054724097', // appCode:'F0108', // }) // self.appList = appList $http.post( apiurljs.login + "UserPower/PermissionsByMenuID", { data: s4.encryptData_CBC(JSON.stringify({ userid: self.userId, menuid: 'F04' })) }, postCfg ).success(function(obj) { var res = strToJson(s4.decryptData_CBC(obj.data)); let appList = [] res.data.rows.forEach(function(row) { row.C_H_I_L_D.forEach(function(item) { appList.push({ name: item.CNAME, url: item.FILEN, appCode: item.PKID, }) }) }) self.appList = appList }) } self.deptJc = [ { jx: "政务服务处", qc:"政务服务处" }, { jx: "投资计划处", qc:"投资计划处" }, { jx: "建筑市场处", qc:"建筑市场管理处" }, { jx: "标准设计处", qc:"标准设计处" }, { jx: "工程质量管理处", qc:"" }, { jx: "安全和应急处", qc:"工程安全和应急管理处" }, { jx: "房屋管理处", qc:"房屋管理处" }, { jx: "物业管理处", qc:"物业管理处" }, { jx: "房地产市场管理处", qc:"房地产市场管理处" }, { jx: "住房保障处", qc:"住房保障处" }, { jx: "住房改革处", qc:"住房改革发展处" }, { jx: "城市更新处", qc:"城市更新处" }, { jx: "村镇管理处", qc:"村镇建设处" }, { jx: "节能和绿色发展处", qc:"建筑节能和绿色发展促进处" }, { jx: "科技教育处", qc:"科技教育处" }, { jx: "消防验收处", qc:"建设工程消防验收处" }, { jx: "网信办", qc:"网络安全和信息化办公室" }, { jx: "执法总队", qc:"天津市住房和城乡建设综合行政执法总队" }, { jx: "建筑市场中心", qc:"天津市建筑市场服务中心" }, { jx: "住保中心", qc:"" }, { jx: "房管中心", qc:"" }, ] self.getDeptList = function() { self.deptList = [] var dptCfg = { headers: { 'Content-Type': 'application/json', 'Access-Token': localStorage.getItem("main-token"), } }; $http.get( apiurljs.dpt + "auth/permit/lead-offices", dptCfg ).success(function(obj) { //self.deptList.push({deptNameJx:"统计分析",deptName:"统计分析",deptId:"tjfx"}) console.log('dept',obj.result) for(let i=0;i 9 ? num : "0" + num; } function getWeek(date) { switch (new Date(date).getDay()) { case 0: return "星期日"; break; case 1: return "星期一"; break; case 2: return "星期二"; break; case 3: return "星期三"; break; case 4: return "星期四"; break; case 5: return "星期五"; break; case 6: return "星期六"; break; } } function getDate(str) { var year = str.getFullYear(); var month = str.getMonth(); var day = str.getDate(); return new Date(year, month, day).getTime() }