12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568 |
- sp.setCssSkin(); //皮肤换色GlWorkPlatform-username
- var get_userid = $.cookie("GlWorkPlatform-userid"); //获取userid
- var get_username = $.cookie("GlWorkPlatform-username"); //获取英文名
- var get_chineseName = decodeURI($.cookie("GlWorkPlatform-chineseName")); //获取中文名
- var UserRole = "";
- document.addEventListener("visibilitychange", function () {
- //if (document.visibilityState == "visible") {
- // if ($("#spanAdminUserId").val() != $.cookie("GlWorkPlatform-userid")) {
- // var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span></span>";
- // var dialogBody = "<div class=\"sp-dialog-body\">有新用户登入,当前用户为" + decodeURI($.cookie("GlWorkPlatform-chineseName")) + "!</div>";
- // var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /></div>";
- // $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
- // sp.openDLTX(".sp-dialog");
- // $("#delDataTrue").click(function () {
- // window.location.reload()
- // });
- // }
- //}
- })
- if (get_userid == null || get_userid == "" || get_userid == "undefined") {
- window.location.href = "login.html";
- }
- //判断从哪里进来,只有从登录页进来才可以
- var get_sessionStorage = sessionStorage.getItem("GlWorkPlatform-LoginFrom");
- if (get_sessionStorage == null || get_sessionStorage == "" || get_sessionStorage == "undefined") {
- window.location.href = "login.html";
- } else {
- $("#spanAdminUserId").val(get_userid);
- $("#spanAdminUserName").text(get_chineseName);
- }
- //退出
- function btnLoginOut() {
- $.cookie("GlWorkPlatform-userid", null, {path: '/', expires: -1});
- $.cookie("GlWorkPlatform-username", null, {path: '/', expires: -1});
- $.cookie("GlWorkPlatform-chineseName", null, {path: '/', expires: -1});
- $.cookie("GlWorkPlatform-photo", null, { path: '/', expires: -1 });
- $.cookie("GlWorkPlatform-onlineUsers", null, { path: '/', expires: -1 });
- sessionStorage.removeItem("GlWorkPlatform-LoginFrom");
- localStorage.removeItem("GlWorkPlatform-openfileArray"); ////清空保存菜单文件的变量
- localStorage.removeItem("GlWorkPlatform-setLeftBarClickID");
- localStorage.removeItem("GlWorkPlatform-userInfoJsonStr");
- //socket.close()
- window.location.href = "login.html"//"http://10.233.22.218/sy/#/sso?token=" + localStorage.getItem("main-token");
- };
- //判断是否是第一次进入这个系统,即是否为空库
- function checkIsEmptyDatabase() {
- $.ajax({
- type: "get",
- url: apiurljs.login + "connect/isemptydatabase",
- //data: { action: "fadetail", userid: userid, routeinfoid: routeinfoid },
- dataType: "json",
- ContentType: 'application/x-www-form-urlencoded',
- success: function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- //console.log(JSON.stringify(res.data));
- document.getElementsByTagName("title")[0].innerText = res.data.SYSNAME;
- //$(".sp-wrapper-head-title span").html(res.data.SYSNAME);
- $.cookie("GlWorkPlatform-SYSNAME", res.data.SECTION, {path: '/', expires: 1});
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- console.log(errorThrown);
- }
- });
- };
- //为保证页面显示效果,判断浏览器版本是否过低
- function checkIEVersion() {
- var getjson = sp.getExplorerInfo();
- if (getjson.type == "IE") {
- if (getjson.version == "8.0" || getjson.version == "7.0" || getjson.version == "6.0") {
- $("#checkIEVersionDiv").text("您当前使用的是" + getjson.type + "浏览器 版本:" + getjson.version + ",版本过低,请更新IE浏览器或使用其他浏览器");
- $("#checkIEVersionDiv").show();
- //然后跳到需要连接的下载网站
- //window.location.href="http://jiaoxueyun.com/download.jsp";
- }
- }
- }
- //20分钟不操作退出登录
- //$(function () {
- // var TimeNum = new Date().getTime();
- // //mousedown() 监听鼠标是否使用 keydown() 监听键盘是否可用
- // $(document).mousedown(function () {
- // TimeNum = new Date().getTime();
- // }).keydown(function () {
- // TimeNum = new Date().getTime();
- // }).mousemove(function () {
- // TimeNum = new Date().getTime();
- // });
- // //setInterval用来判断 当前时间之差
- // setInterval(function () {
- // if ($.cookie("GlWorkPlatform-TimeNum") != '' && $.cookie("GlWorkPlatform-TimeNum") != null) {
- // TimeNum = new Date($.cookie("GlWorkPlatform-TimeNum")).getTime();
- // }
- // //这里判断按键或鼠标 事件是否触发了
- // var TimeCount = new Date().getTime();
- // console.log(TimeCount,TimeNum)
- // //var minutes = Math.floor((TimeCount - TimeNum) / (60 * 1000));
- // var minutes = Math.floor((TimeCount - TimeNum) / (1 * 1000));
- // //如果两个时间差大于20分钟
- // if (minutes >= 20 || $.cookie("GlWorkPlatform-userid")==null||$.cookie("GlWorkPlatform-userid")==undefined) {
- // var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span></span>";
- // var dialogBody = "<div class=\"sp-dialog-body\">您已经20秒没有操作了,请重新登录!</div>";
- // var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /></div>";
- // $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
- // //sp.openDLTX(".sp-dialog");
- // ///取消按钮
- // $('.sp-closeDialog').click(function (event) {
- // sp.closeCenter(".sp-dialog");
- // event.preventDefault();
- // event.stopPropagation();
- // });
- // //post消息的id
- // $("#delDataTrue").click(function () {
- // sp.closeCenter(".sp-dialog");
- // //$.cookie("GlWorkPlatform-userid", null, { path: '/', expires: -1 });
- // //$.cookie("GlWorkPlatform-username", null, { path: '/', expires: -1 });
- // //$.cookie("GlWorkPlatform-chineseName", null, { path: '/', expires: -1 });
- // //$.cookie("GlWorkPlatform-photo", null, { path: '/', expires: -1 });
- // //$.cookie("GlWorkPlatform-onlineUsers", null, { path: '/', expires: -1 });
- // //sessionStorage.removeItem("GlWorkPlatform-LoginFrom");
- // //localStorage.removeItem("GlWorkPlatform-openfileArray");
- // //localStorage.removeItem("GlWorkPlatform-setLeftBarClickID");
- // //localStorage.removeItem("GlWorkPlatform-userInfoJsonStr");
- // ////socket.close()
- // //window.location.href = 'login.html';
- // });
- // }
- // }, 1000);
- //})
- checkIsEmptyDatabase();
- checkIEVersion();
- //被邀请加入共享沟通
- var userMsg = {userid: get_userid, username: get_chineseName};
- if (apiurljs.meetingFlag == true) {
- var socket = io.connect(apiurljs.wsio, {path: apiurljs.wspath})
- window.socket = socket;
- var meetingData = new Object;
- socket.emit('userReg', userMsg);
- socket.on('error', function (data) {
- console.log(JSON.stringify(data) + ' - error');
- });
- socket.on('disconnect', function (data) {
- //失去连接的事件
- console.log(JSON.stringify(data) + ' - disconnect');
- });
- socket.on('reconnect', function (data) {
- //重新连接的事件
- console.log(JSON.stringify(data) + ' - reconnect');
- socket.emit('userReg', userMsg);
- });
- socket.on('invitemeeting', function (data) {
- meetingData = data;
- $("#meetingMsg").html("<a title='【" + meetingData.title + "】的沟通会议邀请' onclick='joinMeeting()'>【" + meetingData.title + "】的沟通会议邀请</a>");
- $("#meetingMsg").show();
- var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">系统提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
- var dialogBody = "<div class=\"sp-dialog-body\">您有一个【" + meetingData.title + "】的沟通会议邀请,确认后跳转到沟通会议室。<br/>如暂时不进入会议室,可以稍后在个人消息列表中选择进入。</div>";
- var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='joinInMeet' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle closeDialog' /></div>";
- $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
- sp.openCenter(".sp-dialog");
- $(".closeDialog").click(function (event) {
- sp.closeCenter(".sp-dialog");
- event.preventDefault();
- event.stopPropagation();
- });
- $("#joinInMeet").click(function () {
- sp.dialoghide();
- joinMeeting();
- });
- });
- }
- function joinMeeting() {
- $("#meetingMsg").hide();
- var data = meetingData;
- var time = new Date().valueOf();
- $.cookie("wb_data" + time, JSON.stringify({
- meetingid: data.meetingid,
- masterid: data.masterid,
- mastername: data.mastername,
- userid: data.touserid,
- username: data.tousername,
- title: data.title,
- pdf: data.pdf,
- wsio: apiurljs.wsio,
- wspath: apiurljs.wspath,
- uploadUrl: data.uploadUrl,
- AccessToken: data.AccessToken,
- routeinfoid: data.routeinfoid
- }), {path: '/', expires: 1});
- window.sp.addTabNav("GXGT", "共享沟通", "meeting/chat.html?wb_ts=" + time);
- setTimeout(function () {
- $.cookie("wb_data" + time, null, {path: '/', expires: -1});
- //document.getElementById('wrapper_tabs_box_col_GXGT').childNodes[0].contentWindow.postMessage({
- // masterid: data.masterid,
- // touserid: data.touserid,
- // tousername: data.tousername,
- // title: data.title,
- // pdf: data.pdf,
- // meetingid: data.meetingid,
- // uploadUrl: data.uploadUrl,
- // AccessToken: data.AccessToken,
- // routeinfoid: data.routeinfoid
- //}, "*")
- }, 5000)
- }
- // 消息弹窗
- function openModal(num) {
- console.log(num)
- var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">系统提示</span><span id='closeModal' class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
- var dialogBody = "<div class=\"sp-dialog-body\" style='height: 300px'>当前在线人数已超过" + num + "人!</div>";
- var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='okModal' type='button' value='确 认' class='sp-dialog-btnTrue' /></div>";
- $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
- // $('#spWrapperTabsPart').html("<div class='sp-dialog'>" + dialogHead + dialogBody + dialogFoot + "</div>");
- $('.sp-dialog').css('width', '600px');
- sp.openCenter(".sp-dialog");
- $(".closeDialog").click(function (event) {
- sp.closeCenter(".sp-dialog");
- event.preventDefault();
- event.stopPropagation();
- });
- //关闭
- $("#closeModal").click(function () {
- sp.dialoghide();
- });
- // 下一步操作
- $("#okModal").click(function () {
- sp.dialoghide();
- // 后续逻辑
- });
- }
- window.onmessage = function (event) {
- if (event.data == "close") {
- $("#wrapper_tabs_menu_li_GXGT").prev("li").addClass("sp-wrapper-tabs-current").show();
- $("#wrapper_tabs_box_col_GXGT").prev(".sp-wrapper-tabs-box-col").addClass("sp-wrapper-tabs-box-current").show();
- $("#wrapper_tabs_menu_li_GXGT").remove();
- $("#wrapper_tabs_box_col_GXGT").remove();
- }
- if (typeof (event.data) == "object") {
- console.log(event.data);
- sp.addTabNav(event.data.id, event.data.title, event.data.src)
- }
- }
- //左侧的动态新动态菜单采用angularJS的方式渲染
- var app = angular.module('app', []);
- app.controller("leftPartCtrl", ["$scope", "$http", "$interval", "$timeout", function ($scope, $http, $interval, $timeout) {
- var self = this;
- var s4 = new SM4Util();
- self.userId = $.cookie("GlWorkPlatform-userid");
- self.engName = $.cookie("GlWorkPlatform-username");
- self.userName = $.cookie("GlWorkPlatform-chineseName");
- self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
- self.ctime = $.cookie("CrossPage-ctime");
- self.outToken = localStorage.getItem("main-token");
- $interval(function(){
- var data = {
- token: self.outToken
- }
- $http.post(apiurljs.login + "g2app/usercertification/loginToken", JSON.stringify(data), postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success == true) {
- localStorage.setItem("main-token", res.data)
- }
- })
- }, 21600000)
- ///增加设备标识
- localStorage.setItem("tjJxtGoldenlinkWork-deviceType", "pc");
-
- //左侧动态赋值高度
- var bodyHeight = $(window).height();
- $(".sp-menu-list").height(bodyHeight - 115);
- ///20230222--修改左侧菜单
- self.bindSetMenuSwitch = function () {
-
- if ($(".sp-menu-switch").hasClass("hasClick")) {
- $(".sp-menu-switch").removeClass("hasClick");
- $(".sp-menu-list").fadeIn(200);
- } else {
- $(".sp-menu-switch").addClass("hasClick");
- $(".sp-menu-list").fadeOut(200);
- }
-
- };
- /////点击桌面设置,打开并跨域发送消息打开设置弹出层--zyg--20230426
- self.btnSetDesktop = function () {
- ////sp.addTabNav('FZ0', '工作桌面', 'tpl/_indexgmt/index_2.html');
- var id = 'FZ0';
- var setID = "wrapper_tabs_box_col_" + id;
-
- $("#spWrapperTabsPart ul li").removeClass("sp-wrapper-tabs-current");
- $(".sp-wrapper-tabs-box-current").hide();
- $("#spWrapperTabsPart .sp-wrapper-tabs-box .sp-wrapper-tabs-box-col").removeClass("sp-wrapper-tabs-box-current");
- $("#wrapper_tabs_menu_li_" + id).addClass("sp-wrapper-tabs-current").show();
- $("#" + setID).addClass("sp-wrapper-tabs-box-current").show();
- $timeout(function () {
- var ifr = document.getElementById('iframe_wrapper_tabs_box_col_FZ0');
- var json = {};
- var func = { name: "openLayerSetting", arg: json };//传输name名称以及json串
- ifr.contentWindow.postMessage(func, '*');
- }, 200);
-
- };
- var postCfg = {
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + self.get_AccessToken
- }
- };
- self.set_imgurl = "";
- self.get_userInfoJsonStr = {};
- self.getReloadUserData = function () {
- var postData = { };
- //console.log(postData);
- //console.log(postData); s4.encryptData_CBC(JSON.stringify(postData))
- $http.post(apiurljs.login + "api/User/UserInfo", JSON.stringify(postData), postCfg)
- .success(function (obj) {
- var res1 = strToJson(s4.decryptData_CBC(obj.data));
- localStorage.setItem("GlWorkPlatform-userInfoJsonStr", s4.encryptData_CBC(JSON.stringify(res1.data)));
- self.get_userInfoJsonStr = res1.data;
- ////加载背景图片*******************************************************************************************
- if (apiurljs.login.indexOf("http://139.129.27.3:85") != -1) {
- self.set_imgurl = "http://139.129.27.3:8511/web/UploadAttach";
- } else {
- self.set_imgurl = apiurljs.login.split("glwork")[0] + "glworkweb/UploadAttach";
- }
- $(".sp-wrapper-tabs .sp-wrapper-tabs-head").css("background-image", "url(" + self.set_imgurl + self.get_userInfoJsonStr.bkimageurl + ")");
- self.getData_bkimage();///背景图片
- self.getHomePage();///
- self.getUserFavoriteFunc();
- self.getUserRecentFunc();
- //首页上隐藏一张图链接按钮
- self.hideOnePic();
- self.getRole();
- })
- .error(function (XMLHttpRequest, textStatus, errorThrown) {
- if (textStatus != 200) {
- self.loading = false;
- }
- })
- }
- self.getReloadUserData();
- self.getRole = function () {
- var data = {
- userid: self.userId
- };
- $http.post(apiurljs.login + "g2work/datazu/queryDataUserAuth", data, postCfg)
- .success(function (res) {
- for (var i = 0; i < res.data[0].auths.length; i++) {
- if (res.data[0].auths[i].ZID == "AA08" && res.data[0].auths[i].AUTH == "1") {
- $(".gzxt").css("cursor","pointer")
- $(".gzxt").on("click",function(){
- window.open("http://172.1.8.126:8008/#/ywxtxt/ugly?hideMenus=true&token="+self.outToken)
- })
- }
- }
- });
- }
- //根据登录人员返回是否显示一张图链接按钮
- self.hideOnePic = function () {
- var data = {
- userid: self.userId
- };
- $http.post(apiurljs.login + "g2work/datazu/queryDataUserAuth", data, postCfg)
- .success(function (res) {
- var mark = true;
- for (var i = 0; i < res.data[0].auths.length; i++) {
- if (res.data[0].auths[i].ZID == "AA84" && res.data[0].auths[i].AUTH == "1") {
- mark = false;
- break;
- }
- }
- $scope.hideOnePic = mark;
- });
- };
-
- self.imgColActive_code_bkimage = "";
- self.bkimageArray = [];
- self.bkimageArray_active = {};
- self.ifHasDefault_bkimage = 0;
- self.getData_bkimage = function () {
- var postData = { "userid": self.userId };
- //console.log(postData);
- //console.log(postData); s4.encryptData_CBC(JSON.stringify(postData))
- $http.post(apiurljs.login + "g2work/bkimage/queryDataUserByUserid", JSON.stringify(postData), postCfg)
- .success(function (obj) {
- //var res = strToJson(s4.decryptData_CBC(obj.data));
- var res = obj;
- //console.log(JSON.stringify(res));
- if (res.success) {
- self.bkimageArray = res.data;
-
- angular.forEach(self.bkimageArray, function (item) {
- item.URL_set = self.set_imgurl + item.URL;
- });
- } else {
- self.loading = false;
- self.bkimageArray = [];
- self.bkimageArray_active = {};
- }
- })
- .error(function (XMLHttpRequest, textStatus, errorThrown) {
- if (textStatus != 200) {
- self.loading = false;
- }
- })
- };
-
- $timeout(function () {
- //选择底图
- if ($("body").find(".sp-desk-img").length > 0) {
- $(".sp-desk-img").each(function () {
- $(this).click(function () {
- var get_url = $(this).attr('data-url');
- var get_code = $(this).attr('data-code');
- $(this).addClass("sp-desk-current").siblings().removeClass("sp-desk-current");
- $("#wrapper_tabs_box_col_FZ0").find("iframe").contents().find("body").css("background-image", "url(" + get_url + ")")
- $("#wrapper_tabs_box_col_FZ0").find("iframe").contents().find("body").css("background-repeat", "no-repeat")
- $("#wrapper_tabs_box_col_FZ0").find("iframe").contents().find("body").css("background-size", "cover")
- $("#wrapper_tabs_box_col_FZ0").find("iframe").contents().find("body").css("background-position", "0 -30px")
- $(".sp-wrapper-tabs .sp-wrapper-tabs-head").css("background-image", "url(" + get_url + ")");
- var postData_2 = {
- "userid": self.userId,
- "code": get_code
- };
- $http.post(apiurljs.login + "g2work/bkimage/updateDataUserDefault", JSON.stringify(postData_2), postCfg)
- .success(function (obj_2) {
- //var res = strToJson(s4.decryptData_CBC(obj.data));
- var res_2 = obj_2;
- //console.log(JSON.stringify(res));
- if (res_2.success) {
- console.log("背景图片修改成功");
- } else {
- sp.dialog(res_2.message);
- }
- })
- .error(function (XMLHttpRequest, textStatus, errorThrown) {
- if (textStatus != 200) {
- self.loading = false;
- }
- })
- });
- });
- }
- }, 1000);
- ////加载背景图片*******************************************************************************************
- self.func = {
- normalTitle: "全部",
- favoriteTitle: "常用功能",
- recentTitle: "最近访问",
- favoriteList: [],
- recentList: [],
- keyWord: "",
- keyCondition: "",
- keyShow: false,
- keyPartList: [], //当前模块下所有符合关键字的模块列表
- keyPartListCopy: [], //当前模块下前12个符合关键字的模块列表
- keyAllList: [], //全局模块下所有符合关键字的模块列表
- keyAllListCopy: [], //全局模块下前12个符合关键字的模块列表
- keyPartShow: false,
- keyPartHide: false,
- keyAllShow: false,
- keyAllHide: false,
- allFuncList: [], //存储最全的功能防止遗漏
- nowFuncName: "",
- nowFuncCode: ""
- }
- //声明一个左侧的功能列表
- self.userFuncList = [];
- //首选获取当前用户的个人桌面
- self.getHomePage = function () {
- self.userFuncList = [];
- var postData = {
- userid: self.userId
- }
- $http.post(apiurljs.login + "g2work/desktop/queryDesktopMarkT", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- //console.log(JSON.stringify(res));
-
- //console.log(get_userInfoJsonStr);
- var homePageObj = {
- CNAME: "工作桌面",
- C_H_I_L_D: [],
- COPYCHILD: [],
- ///FILEN: res.data.tenantcode,
- FILEN: self.get_userInfoJsonStr.desktopurl,
- FUNCSCOPE: "ADMINISTATOR|ADMIN",
- LEAF: 0,
- LEVELS: 1,
- OPENTYPE: "0",
- PARENTID: "0",
- PKID: "FZ0",
- SORTID: 1,
- SRCIMG: "",
- SRCIMG32: "",
- WINDOWS: "",
- IMGBox: "box0",
- }
- $.cookie("GlWorkPlatform-userTypeEng", res.data.data, {path: '/', expires: 1});
- if (res.data.data == "USER") {
- $.cookie("GlWorkPlatform-userType", "普通用户", {path: '/', expires: 1})
- } else if (res.data.data == "SYSADMIN") {
- $.cookie("GlWorkPlatform-userType", "系统管理员", {path: '/', expires: 1})
- } else if (res.data.data == "SECADMIN") {
- $.cookie("GlWorkPlatform-userType", "安全管理员", {path: '/', expires: 1})
- } else if (res.data.data == "AUDITADMIN") {
- $.cookie("GlWorkPlatform-userType", "审计管理员", {path: '/', expires: 1})
- } else if (res.data.data == "ADMIN") {
- $.cookie("GlWorkPlatform-userType", "总管理员", {path: '/', expires: 1})
- }
-
- ////20230423--zyg-修改,变更成加载图片base64编码,判断是否为base64图片,是直接加载,否设置图片路径;
-
- if (res.data.imgsrc.indexOf("data:image") != -1) {
- ///base64图片格式直接加载
- $("#spanAdminPhoto").attr("src", res.data.imgsrc);
- self.usercard.img = res.data.imgsrc;
- } else if(res.data.imgsrc.indexOf("files") != -1){
- ///服务器图片路径
- $("#spanAdminPhoto").attr("src", apiurljs.login + "g2work/files/" + res.data.imgsrc.slice(7));
- } else {
- ///路径图片,赋值
- $("#spanAdminPhoto").attr("src", "AFrontEnd/css/icons/photo/" + res.data.imgsrc);
- self.usercard.img = "AFrontEnd/css/icons/photo/" + res.data.imgsrc;
- }
- $.cookie("GlWorkPlatform-photo", $("#spanAdminPhoto").attr("src"), { path: '/', expires: 1 })
- self.userFuncList.push(homePageObj);
- self.getUserFunc();
- var data = {
- tablename: "SYS_CLICKLOG",
- data: {
- CTIME: self.ctime,
- TITLE: "系统登录",
- REQUESTURL: window.location.pathname,
- REQUESTHEADERURL: window.location.origin,
- LOGTYPE: "登录登出",
- USERTYPE: $.cookie("GlWorkPlatform-userType"),
- ADMIN: $.cookie("GlWorkPlatform-userTypeEng"),
- CLIENTIP: sp.myIP(),
- PCNAME: sp.detectOS(),
- BROWSERNAME: sp.browser(),
- RESPONSETIME: sp.getLocalDate1(),
- USERID: self.userId,
- USERNAME: self.userName
- }
- }
- $http.post(apiurljs.login + "g2app/dataabase/insertFormData", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
- .success(function (res) {
- $.cookie("CrossPage-ctime", null, {path: '/', expires: -1});
- })
- })
- }
- //获取用户的功能列表
- self.getUserFunc = function () {
- $http.post(apiurljs.login + "UserPower/PermissionsDecrypt", {data: s4.encryptData_CBC("")}, postCfg)
- .success(function (obj) {
- //var res = strToJson(s4.decryptData_CBC(obj.data));
- var res = obj;
- res.data.rows.forEach(function (item) {
- item.showRightMenu = false;
- if (item.C_H_I_L_D.length == 0) {
- item.IMGBox = "box0";
- } else if (item.C_H_I_L_D.length > 0 && item.C_H_I_L_D.length <= 4) {
- item.IMGBox = "box4";
- } else if (item.C_H_I_L_D.length > 4) {
- item.IMGBox = "box9";
- }
- let array = angular.copy(item.C_H_I_L_D);
- if (array.length > 12) {
- item.COPYCHILD = array.slice(0, 12);
- item.hideFunc = true;
- item.showFunc = false;
- } else {
- item.COPYCHILD = array;
- item.hideFunc = false;
- item.showFunc = false;
- }
- self.userFuncList.push(item);
- })
- //记录全部功能模块列表
- res.data.rows.forEach(function (item) {
- item.C_H_I_L_D.forEach(function (item2) {
- self.func.allFuncList.push(item2);
- })
- })
- //默认打开工作桌面
- var title = self.userFuncList[0].CNAME;
- var id = self.userFuncList[0].PKID;
- var src = self.userFuncList[0].FILEN;
- sp.addhometabnav(id, title, src);
- CrossPage = {
- cname: "",
- ctime: sp.getLocalDate(),
- type: 0
- }
- // if (getParameter("openPage") == "") {
- // //sp.loadmenufiles();//加载记录菜单文件
- // }
- // if (getParameter("openPage") != "") {
- // self.secondMenu = "全部/";
- // self.func.normalList.forEach(function (item) {
- // if (item.PKID == getParameter("PKID")) {
- // self.CrossPage(item)
- // }
- // })
- // sp.addTabNav(getParameter("PKID"), decodeURI(getParameter("CNAME")), getParameter("openPage"))
- // }
- })
- }
- //获取用户常用功能列表
- self.getUserFavoriteFunc = function () {
- var postData = {
- userid: self.userId,
- ntops: "4"
- }
- $http.post(apiurljs.login + "g2work/desktop/queryFavoriteFunc", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.func.favoriteList = res.data;
- })
- }
- //获取用户最近访问列表
- self.getUserRecentFunc = function () {
- var postData = {
- userid: self.userId,
- ntops: "4"
- }
- $http.post(apiurljs.login + "g2work/desktop/queryRecentFunc", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.func.recentList = res.data;
- })
- }
-
- //固定二级菜单标志
- self.tabFixed = false;
- //固定二级菜单函数
- self.setTabFixed = function () {
- self.tabFixed = true;
- }
- //取消固定二级菜单函数
- self.cancelTabFixed = function () {
- self.tabFixed = false;
- }
- //鼠标放入执行的事件
- self.openRightMenu = function (index) {
- //self.initSearchFunc();
- self.userFuncList.forEach(function (item) {
- item.showRightMenu = false;
- })
- self.func.normalTitle = self.userFuncList[index].CNAME;
- self.func.nowFuncCode = self.userFuncList[index].PKID;
- self.func.nowFuncName = self.userFuncList[index].CNAME;
- self.userFuncList[index].showRightMenu = true;
- }
- //鼠标移除执行的事件
- self.closeRightMenu = function () {
- if (self.tabFixed) {
- } else {
- //self.initSearchFunc();
- self.userFuncList.forEach(function (item) {
- item.showRightMenu = false;
- })
- self.func.nowFuncCode = "";
- self.func.nowFuncName = "";
- }
- }
- self.openMenuTab = function (code, cname) {
- if (code == self.func.nowFuncCode && cname == self.func.nowFuncName) {
- return;
- //$(".sp-menu-tab").hide();
- //self.func.keyWord = "";
- //self.func.keyCondition = "";
- //self.func.nowFuncCode = "close";
- //self.func.nowFuncName = "close";
- } else {
- //code传空表示查看全部功能
- self.func.keyWord = "";
- self.func.keyCondition = "";
- self.func.nowFuncCode = code;
- self.func.nowFuncName = cname;
- var array = [];
- if (code == "") {
- self.func.normalTitle = "全部";
- self.func.normalList = [];
- self.func.allFuncList.forEach(function (item, index) {
- array.push(item);
- })
- } else {
- self.func.normalTitle = cname;
- self.func.normalList = [];
- self.func.allFuncList.forEach(function (item) {
- if (item.PARENTID == code) {
- array.push(item);
- }
- })
- }
- if (array.length > 12) {
- self.func.normalList = array.slice(0, 12);
- self.func.hideFunc = true;
- self.func.showFunc = false;
- } else {
- self.func.normalList = array;
- self.func.hideFunc = false;
- self.func.showFunc = false;
- }
- self.secondMenu = cname == "" ? "全部/" : cname + "/";
- $(".sp-menu-tab").show();
- }
- }
- self.closeMenuTab = function () {
- self.func.keyWord = "";
- self.func.keyCondition = "";
- //self.func.nowFuncCode = "close";
- //self.func.nowFuncName = "close";
- $(".sp-menu-tab").hide();
- }
- self.selectMenu = function (item) {
- if (item.FILEN != undefined && item.FILEN != '' && item.FILEN != null) {
- sp.addTabNav(item.PKID, item.CNAME, item.FILEN);
- }
- }
- //初始化搜索
- self.initSearchFunc = function () {
- self.func.keyWord = "";
- self.func.keyCondition = "";
- self.func.keyShow = false;
- self.func.keyPartList = []; //当前模块下所有符合关键字的模块列表
- self.func.keyPartListCopy = []; //当前模块下前12个符合关键字的模块列表
- self.func.keyAllList = []; //全局模块下所有符合关键字的模块列表
- self.func.keyAllListCopy = []; //全局模块下前12个符合关键字的模块列表
- self.func.keyPartShow = false;
- self.func.keyPartHide = false;
- self.func.keyAllShow = false;
- self.func.keyAllHide = false;
- }
- self.keyWordFunc = function () {
- console.log(self.func.allFuncList);
- if (self.func.keyWord == "") {
- self.initSearchFunc();
- } else {
- self.func.keyCondition = " 【关键字: " + self.func.keyWord + " 】";
- self.func.keyShow = true;
- var resultArray1 = [];
- var resultArray2 = [];
- self.func.allFuncList.forEach(function (item) {
- var index = item.CNAME.indexOf(self.func.keyWord);
- if (self.func.nowFuncCode == "") {
- } else {
- //当前模块下的筛选结果
- if (index >=0 && item.PARENTID == self.func.nowFuncCode) {
- resultArray1.push(item);
- }
- //其他模块下的全局筛选结果
- if (index >= 0 && item.PARENTID != self.func.nowFuncCode) {
- resultArray2.push(item);
- }
- }
- })
- self.func.keyPartList=angular.copy(resultArray1);
- self.func.keyAllList=angular.copy(resultArray2);
- if (resultArray1.length > 12) {
- self.func.keyPartListCopy = resultArray1.slice(0, 12);
- self.func.keyPartHide = true;
- self.func.keyPartShow = false;
- } else {
- self.func.keyPartListCopy = resultArray1;
- self.func.keyPartHide = false;
- self.func.keyPartShow = false;
- }
- if (resultArray2.length > 12) {
- self.func.keyAllListCopy = resultArray2.slice(0, 12);
- self.func.keyAllHide = true;
- self.func.keyAllShow = false;
- } else {
- self.func.keyAllListCopy = resultArray2;
- self.func.keyAllHide = false;
- self.func.keyAllShow = false;
- }
- }
- }
- self.clearKeyWordFunc = function () {
- self.func.keyWord = "";
- self.func.keyCondition = "";
- var resultArray = [];
- self.func.allFuncList.forEach(function (item) {
- if (self.func.nowFuncName == "") {
- resultArray.push(item);
- } else {
- if (item.PARENTID == self.func.nowFuncCode) {
- resultArray.push(item);
- }
- }
- })
- if (resultArray.length > 12) {
- self.func.normalList = resultArray.slice(0, 12);
- self.func.hideFunc = true;
- self.func.showFunc = false;
- } else {
- self.func.normalList = resultArray;
- self.func.hideFunc = false;
- self.func.showFunc = false;
- }
- }
- self.selectItemFunc = function (item) {
- //console.log(item.CNAME);
- //console.log(item.FILEN);
- //if (item.FILEN.indexOf("@token") > -1) {
- // sp.addTabNav(item.PKID, item.CNAME, item.FILEN.replace("@token", self.outToken));
- // self.addRecode(item.CNAME, item.FILEN.replace("@token", self.outToken));
- //} else {
- // sp.addTabNav(item.PKID, item.CNAME, item.FILEN);
- // self.addRecode(item.CNAME, item.FILEN);
- //}
- if (item.OPENTYPE == "1") {
- if (item.FILEN.indexOf("@token") > -1) {
- window.open(item.FILEN.replace("@token", self.outToken));
- } else {
- window.open(item.FILEN);
- }
- } else {
- if (item.FILEN.indexOf("@token") > -1) {
- sp.addTabNav(item.PKID, item.CNAME, item.FILEN.replace("@token", self.outToken));
- } else {
- sp.addTabNav(item.PKID, item.CNAME, item.FILEN);
- }
- }
- self.addRecode(item.CNAME, item.FILEN);
- self.CrossPage(item);
- self.getUserRecentFunc();
- self.getUserFavoriteFunc();
- ////关闭左侧菜单
- $(".sp-menu-switch").addClass("hasClick");
- $(".sp-menu-list").fadeOut(200);
- }
- self.loadAllKindFunc = function (index) {
- //console.log(index);
- let array = angular.copy(self.userFuncList[index].C_H_I_L_D);
- self.userFuncList[index].COPYCHILD = array;
- self.userFuncList[index].hideFunc = false;
- self.userFuncList[index].showFunc = true;
- }
- self.loadPartKindFunc = function (index) {
- //console.log(index);
- let array = angular.copy(self.userFuncList[index].C_H_I_L_D);
- self.userFuncList[index].COPYCHILD = array.slice(0, 12);
- self.userFuncList[index].hideFunc = true;
- self.userFuncList[index].showFunc = false;
- }
- self.showKeyPartFunc=function(){
- self.func.keyPartListCopy=angular.copy(self.func.keyPartList);
- self.func.keyPartHide=false;
- self.func.keyPartShow=true;
- }
- self.hideKeyPartFunc=function(){
- self.func.keyPartListCopy=angular.copy(self.func.keyPartList).slice(0, 12);
- self.func.keyPartHide=true;
- self.func.keyPartShow=false;
- }
- self.showKeyAllFunc=function(){
- self.func.keyAllListCopy=angular.copy(self.func.keyAllList);
- self.func.keyAllHide=false;
- self.func.keyAllShow=true;
- }
- self.hideKeyAllFunc=function(){
- self.func.keyAllListCopy=angular.copy(self.func.keyAllList).slice(0, 12);
- self.func.keyAllHide=true;
- self.func.keyAllShow=false;
- }
- //桌面自定义流程人员初始化
- self.InitUser = function () {
- var data = {"userid": [], "mark": "1"}
- $http.post(apiurljs.login + "g2work/desktop/InitWorkflowCandoCustom", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success) {
- sp.dialog("初始化成功!")
- $timeout(function () {
- sp.dialoghide()
- }, 1000)
- }
- })
- }
- self.usercard = {
- id: 0,
- userid: self.userId,
- username: self.userName,
- img: "AFrontEnd/css/icons/photo/02.jpg",
- DEPNAME: "",
- SBTIME: "",
- XBTIME: ""
- }
- self.addRecode=function (name,url) {
- var postData = {
- tablename: "SYS_LOG",
- data: {
- LOGTIME: sp.dateFtt("yyyy-MM-dd hh:mm:ss",new Date()),
- LOGIP: sp.myIP(),
- LOGUSER:self.userName,
- LOGFUNC:name,
- LOGFUNCURL:url,
- LOGAPI:"insertFormData输入参数",
- LOGAPIURL:"g2app/dataabase/insertFormData",
- LOGAPIPOST:"",
- REMARK:""
- }
- }
- var apiData={
- data:s4.encryptData_CBC(JSON.stringify(postData))
- }
- postData.data.LOGAPIPOST=JSON.stringify(apiData);
- $http.post(apiurljs.login + "g2app/Data/insertByDataid", { data: s4.encryptData_CBC(JSON.stringify(postData)) }, postCfg)
- .success(function (obj) {
- })
- }
- //跨页面记录日志参数
- self.CrossPage = function (obj) {
- CrossPage = {
- cname: obj.CNAME,
- ctime: sp.getLocalDate1(),
- type: 0
- }
- }
- //获取上传附件文件格式限制----20230517
- uploadformat = [];
- function getUploadFormat() {
- var data = { tablename: "CODE_UPLOADFORMAT" }
- $http.post(apiurljs.login + "g2app/DangAn/queryCodeData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- uploadformat = res.data;
- })
- };
- getUploadFormat()
- ////头部关键字搜索---20230905
- self.headBtnSearchKeyword = "";
- self.headSearchResult = [];
- self.headSearchResult_view = false;
- self.headBtnSearch = function () {
- if (sp.isval(self.headBtnSearchKeyword)) {
- if(self.dtslPlaceholder == "图上查"){
- //self.headSearchResult = [];
- var data = {
- "url": "/basic/api/StatSelect/selectCodeList",
- "data": { "keyWord": self.headBtnSearchKeyword }
- }
- //console.log(JSON.stringify(data));
- $http.post(apiurljs.login + "g2app/yizhangtu/selectCodeList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- console.log('map',res.data);
- self.headSearchResult = res.data.build;
- console.log(self.headSearchResult[0])
- //if (sp.isval(self.headSearchResult)&&sp.isval(self.headBtnSearchKeyword)) {
- // self.headSearchResult_view = true;
- //} else {
- // self.headSearchResult_view = false;
- //}
- })
- }else if(self.dtslPlaceholder == "查一查"){
- // var dptCfg = {
- // headers: {
- // 'Content-Type': 'application/json',
- // 'Access-Token': localStorage.getItem("main-token"),
- // }
- // };
- // $http.get(
- // apiurljs.dpt + `graph/open/api/search/appoint/graph/info?name=${self.headBtnSearchKeyword}&modelId=4881885d8a74562f018a81eb2ff02c42&startEntityCodes=jck_qyk_qyjcxx`,
- // dptCfg
- // ).success(function(obj) {
- // if(obj.result&&sp.isval(self.headBtnSearchKeyword)){
- // for(let i=0;i<obj.result.length;i++){
- // obj.result[i].type = "企业"
- // }
- // self.headSearchResult = obj.result;
- // self.headSearchResult_view = true;
- // }else{
- // self.headSearchResult_view = false;
- // }
- // })
- }else if(self.dtslPlaceholder=="查项目"){
- //window.open(`http://10.149.1.35:8003/#/drms/know-application/enterprise-search/SearchResult?hideMenus=true&name=${self.headBtnSearchKeyword}&type=project&token=${localStorage.getItem("main-token")}`)
-
- // var dptCfg = {
- // headers: {
- // 'Content-Type': 'application/json',
- // 'Access-Token': localStorage.getItem("main-token"),
- // }
- // };
- // $http.get(
- // apiurljs.dpt + `graph/open/api/search/appoint/graph/info?name=${self.headBtnSearchKeyword}&modelId=488188578b3367d0018b375db06e2507&startEntityCodes=jck_xmk_jsgcxm`,
- // dptCfg
- // ).success(function(obj) {
- // if(obj.result&&sp.isval(self.headBtnSearchKeyword)){
- // for(let i=0;i<obj.result.length;i++){
- // obj.result[i].type = "项目"
- // }
- // self.headSearchResult = obj.result;
- // self.headSearchResult_view = true;
- // }else{
- // self.headSearchResult_view = false;
- // }
- // })
- }
- } else {
- self.headSearchResult_view = false;
- }
- };
- self.headBtnSearchhc = function(e){
- if(e.keyCode==13){
- if(self.dtslPlaceholder == "图上查"){
- self.headKeywordPage(self.headBtnSearchKeyword)
- //$timeout(function(){
- // self.headKeywordPage(self.headSearchResult[0])
- //},1000)
- }else if(self.dtslPlaceholder == "查一查"){
- //let set_url = `http://10.149.1.35:8003/#/drms/know-application/enterprise-search/company-detail?hideTitle=true&hideMenus=true&name=${itemdata.name}&id=${itemdata.id}&type=company&token=${localStorage.getItem("main-token")}`
- //let set_url = `http://10.149.1.35:8003/#/drms/know-application/enterprise-search/SearchResult?hideTitle=true&hideMenus=true&name=${self.headBtnSearchKeyword}&type=company&token=${localStorage.getItem("main-token")}`
- let set_url = `http://10.149.1.35:8003/cyc/#/drms/know-application/enterprise-search/SearchResult?hideMenus=true&name=${self.headBtnSearchKeyword}&hideTitle=true&Access-Token=${localStorage.getItem("main-token")}`
- sp.addTabNav("dtsscqy", "查一查", set_url);
- }
- //else if(self.dtslPlaceholder == "查项目"){
- // let set_url = `http://10.149.1.35:8003/#/drms/know-application/enterprise-search/SearchResult?hideTitle=true&hideMenus=true&name=${self.headBtnSearchKeyword}&type=project&token=${localStorage.getItem("main-token")}`
- // sp.addTabNav("dtsscxm", "查项目", set_url);
- // }
- self.headBtnSearchKeyword = ""
- }
- }
- self.headKeywordPage = function (itemdata) {
- if(self.dtslPlaceholder == "图上查"){
- var get_token = localStorage.getItem("main-token");
- //var set_url = apiurljs.onePic + "wholeProcessPage?token=" + get_token + "&name=" + itemdata.name + "&type=" + itemdata.type + "&id=" + itemdata.id + "";
- var set_url = apiurljs.onePic + "pureOneMap?token=" + get_token + "&name=" + itemdata + "&type=&id=";
- sp.addTabNav(itemdata.id, '图上查', set_url);
- }else if(self.dtslPlaceholder == "查一查"){
- //window.open(`http://10.149.1.35:8003/#/drms/know-application/enterprise-search/company-detail?hideTitle=false&hideMenus=true&name=${itemdata.name}&id=${itemdata.id}&type=company&token=${localStorage.getItem("main-token")}`)
- //let set_url = `http://10.149.1.35:8003/#/drms/know-application/enterprise-search/company-detail?hideTitle=true&hideMenus=true&name=${itemdata.name}&id=${itemdata.id}&type=company&token=${localStorage.getItem("main-token")}`
- let set_url = `http://10.149.1.35:8003/cyc/#/drms/know-application/enterprise-search/SearchResult?hideMenus=true&name=${self.headBtnSearchKeyword}&hideTitle=true&Access-Token=${localStorage.getItem("main-token")}`
- sp.addTabNav(itemdata.id, itemdata.name, set_url);
- }
- //else if(self.dtslPlaceholder == "查项目"){
- // //window.open(`http://10.149.1.35:8003/#/drms/know-application/enterprise-search/project-detail?hideMenus=true&name=${itemdata.name}&id=${itemdata.id}&type=project&token=${localStorage.getItem("main-token")}`)
- // let set_url = `http://10.149.1.35:8003/#/drms/know-application/enterprise-search/project-detail?hideTitle=true&hideMenus=true&name=${itemdata.name}&id=${itemdata.id}&type=project&token=${localStorage.getItem("main-token")}`
- // sp.addTabNav(itemdata.id, itemdata.name, set_url);
- //}
- self.headSearchResult_view = false;
- self.headBtnSearchKeyword = ""
- };
- //获取未读消息数量
- self.msgNum = 0;
- self.newMsg = 0
- self.getMsgNum = function (type) {
- var data = {
- userid: self.userId,
- msgkind: "公文事项办理",
- mark: "未读"
- }
- $http.post(apiurljs.login+"g2work/routeinfo/queryDataMessageCount",{ data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- // self.newMsg = 200 - self.msgNum;
- self.newMsg = res.data.MSGCOUNT - self.msgNum;
- self.msgNum = res.data.MSGCOUNT;
- $("#onlineUsers").html(res.data.ONLINEUSER + "人");
- $.cookie("GlWorkPlatform-onlineUsers", res.data.ONLINEUSER);
- console.log(res.data)
- // 当人数超过100人时,出现弹窗
- /*var num = 100
- if(res.data.ONLINEUSER > num){
- var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">系统提示</span><span id='closeModal' class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
- var dialogBody = "<div class=\"sp-dialog-body\" style='height: 300px'>当前在线人数已超过" + num + "人!</div>";
- var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='okModal' type='button' value='确 认' class='sp-dialog-btnTrue' /></div>";
- $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
- $('.sp-dialog').css('width', '600px');
- sp.openCenter(".sp-dialog");
- $(".closeDialog").click(function (event) {
- sp.closeCenter(".sp-dialog");
- event.preventDefault();
- event.stopPropagation();
- });
- //关闭
- $("#closeModal").click(function () {
- sp.dialoghide();
- });
- // 下一步操作
- $("#okModal").click(function () {
- sp.dialoghide();
- // 后续逻辑
- });
- }*/
- if(!type){
- // console.log('type', self.newMsg)
- for (var i = 0; (i < self.newMsg && i <5); i++) {
- var popupId = "popup" + i;
- var closeId ="closeModalMsg"+i
- var popupContent = "<div id='" + popupId + "' style='width:600px; height: 150px; background-color: #f5f5f5; ; border: 1px solid #ccc; box-shadow: 0 0 10px rgba(0 0 0 0.3);' class='popupItem'>" +
- "<span class='closeModalMsg' style='cursor:pointer; font-size: 27px;position: absolute;right:20px;display:inline-block;padding:2px;'>×</span>" +
- "<p style='padding: 30px;cursor:pointer;margin-top:32px' class='messageTz'>当前有新消息,请查看</p >" +"</div>";
- $("#popupContainer").append(popupContent);
- }
- $("#popupContainer").fadeIn(500);
- //关闭
- // console.log("所有的关闭标签", $('.closeModalMsg'))
-
- // 三秒后隐藏弹窗
- setTimeout(function() {
- $("#popupContainer").fadeOut(1000);
- // 移除新增的弹窗项
- $(".popupItem").remove();
- }, 5000);
- }
- $('.closeModalMsg').each(function (index) {
- $(this).on('click', function () {
- console.log("xxxxxx>>", index);
- closeFunc(index)
- // console.log("close")
- })
- })
- function closeFunc(index) {
- $('#popup' + index).remove()
- }
- $('.messageTz').each(function (index) {
- $(this).on('click', function () {
- console.log("跳转页面>>>>", index);
- self.openMsg()
- })
- })
- })
- }
- self.getMsgNum(1)
- $interval(function () {
- self.getMsgNum()
- }, 60000)
- self.openMsg = function () {
- sp.addTabNav("XXJL","消息记录","tpl/deskunit/msgListChat.html")
- }
- //获取上班下班时间规则
- // self.queryRules = function () {
- // var data = {
- // sqlwhere: {}
- // }
- // $http.post(apiurljs.login + "g2app/Attendance/queryRules", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
- // .success(function (obj) {
- // var res = strToJson(s4.decryptData_CBC(obj.data));
- // self.CARDSTART = res.data.STARTTIEM;
- // self.CARDEND = res.data.ENDTIME;
- // self.getDEPART()
- // })
- // }
- //获得当前人部门
- // self.getDEPART = function () {
- // var data = {
- // userid: self.usercard.userid
- // }
- // $http.post(apiurljs.login + "g2app/dataabase/queryDpName", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
- // .success(function (obj) {
- // var res = strToJson(s4.decryptData_CBC(obj.data));
- // self.usercard.DEPNAME = res.data.length == 0 ? "" : res.data[0].SECTION;
- // })
- // }
- // self.queryRules()
- // self.card = function (n) {
- // var data = {
- // tablename: "ATTENDANCEMAN",
- // colums: "*,TO_CHAR(SBTIME,'hh24:mi:ss') as SBTIME1,TO_CHAR(XBTIME,'hh24:mi:ss') as XBTIME1",
- // order: "ID",
- // sqlwhere: {
- // CDATE: sp.format(sp.getLocalDate()),
- // CUSERID: self.usercard.userid
- // },
- // sqlinwhere: "",
- // sqllikewhere: ""
- // }
- // $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
- // .success(function (obj) {
- // var res = strToJson(s4.decryptData_CBC(obj.data));
- // if (res.data.length != 0) {
- // self.usercard = {
- // id: res.data[0].ID,
- // userid: self.usercard.userid,
- // username: self.usercard.username,
- // DEPNAME: self.usercard.DEPNAME,
- // SBTIME: res.data[0].SBTIME ? res.data[0].SBTIME1 : "",
- // XBTIME: res.data[0].XBTIME ? res.data[0].XBTIME1 : "",
- // DKSTATUS: res.data[0].DKSTATUS.split(",")[0]
- // }
- // }
- // $(".cardtime").html(sp.getLocalDate().slice(11, 19))
- // $interval(function () {
- // $(".cardtime").html(sp.getLocalDate().slice(11, 19))
- // }, 1000)
- // if (n == 0) {
- // sp.layer("#layer_card")
- // }
- // })
- // }
- // self.clickstatus = false;
- // self.clickCard = function () {
- // if (self.clickstatus == true || (self.usercard.SBTIME != '' && self.usercard.XBTIME != '')) {
- // return;
- // }
- // self.clickstatus = true;
- // if (self.usercard.id == 0) {
- // var data = {
- // tablename: "ATTENDANCEMAN",
- // data: {
- // CDATE: sp.format(sp.getLocalDate()),
- // CNAME: self.usercard.username,
- // CUSERID: self.usercard.userid,
- // DEPNAME: self.usercard.DEPNAME,
- // SBTIME: sp.format(sp.getLocalDate()) + " " + $(".cardtime").html(),
- // DKSTATUS: getDKSTATUS($(".cardtime").html(), 1)
- // }
- // }
- // $http.post(apiurljs.login + "g2app/dataabase/insertFormData", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
- // .success(function (obj) {
- // var res = strToJson(s4.decryptData_CBC(obj.data));
- // self.clickstatus = false;
- // if (res.success == true) {
- // self.card(1)
- // } else {
- // sp.layerhide()
- // sp.dialog(res.message)
- // }
- // })
- // } else {
- // var data = {
- // id: self.usercard.id,
- // tablename: "ATTENDANCEMAN",
- // data: {
- // CNAME: self.usercard.username,
- // CUSERID: self.usercard.userid,
- // DEPNAME: self.usercard.DEPNAME,
- // XBTIME: sp.format(sp.getLocalDate()) + " " + $(".cardtime").html(),
- // DKSTATUS: self.usercard.DKSTATUS + "," + getDKSTATUS($(".cardtime").html(), 2)
- // }
- // }
- // $http.post(apiurljs.login + "g2app/dataabase/upFormData", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
- // .success(function (obj) {
- // var res = strToJson(s4.decryptData_CBC(obj.data));
- // self.clickstatus = false;
- // if (res.success == true) {
- // self.card(1)
- // } else {
- // sp.layerhide()
- // sp.dialog(res.message)
- // }
- // })
- // }
- // }
- //获取服务器时间
- // self.getServerTime = function () {
- // var data = {
- // param: "yyyy-MM-dd HH:mm:ss"
- // }
- // $http.post(apiurljs.login + "g2app/calendar/queryServiceDate", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
- // .success(function (obj) {
- // var res = strToJson(s4.decryptData_CBC(obj.data));
- // self.ServerTime = res.data;
- // self.getREMINDTIME()
- // })
- // }
- //获取提醒时间
- // self.getREMINDTIME = function () {
- // var data = {
- // tablename: "CODE_REMINDTIME",
- // colums: "*",
- // order: "ID",
- // sqlwhere: "",
- // sqlinwhere: "",
- // sqllikewhere: ""
- // };
- // $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
- // .success(function (obj) {
- // var res = strToJson(s4.decryptData_CBC(obj.data));
- // self.REMINDTIME = res.data;
- // self.getFREQUENCY()
- // })
- // }
- //获取提醒频率
- // self.getFREQUENCY = function () {
- // var data = {
- // tablename: "CODE_FREQUENCY",
- // colums: "*",
- // order: "ID",
- // sqlwhere: "",
- // sqlinwhere: "",
- // sqllikewhere: ""
- // };
- // $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
- // .success(function (obj) {
- // var res = strToJson(s4.decryptData_CBC(obj.data));
- // self.FREQUENCY = res.data;
- // self.getRemindList()
- // })
- // }
- // self.getRemindList = function () {
- // self.remindlist = []
- // var data = {
- // STRATDATE: sp.dateFtt("yyyy-MM-dd", new Date()),
- // USERID: self.engName
- // }
- // $http.post(apiurljs.login + "g2app/calendar/queryDayData", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
- // .success(function (obj) {
- // var res = strToJson(s4.decryptData_CBC(obj.data));
- // if (res.data.Items[0].task == null || res.data.Items[0].task == undefined || res.data.Items[0].task == "") {
- // } else {
- // self.remindlist = res.data.Items[0].task;
- //
- // self.remindlist.forEach(function (item) {
- // self.REMINDTIME.forEach(function (item1) {
- // if (item.REMINDTIME == item1.CODE) {
- // item.REMINDTIME = item1.NUM * 3600000
- // }
- // })
- // self.FREQUENCY.forEach(function (item1) {
- // if (item.FREQUENCY == item1.CODE) {
- // item.FREQUENCY = item1.NUM
- // }
- // })
- // })
- //
- // //生成事项提醒循环
- // var remindStart = [];
- // $.each(self.remindlist, function (index, item) {
- // remindStart[index] = $interval(function () {
- // remindGoing(index);
- // }, 1000)
- // })
- // var remindGoing = function (n) {
- // remindWarning(self.remindlist[n], n)
- // //判断循环是否停止
- // if (self.ServerTime >= self.remindlist[n].STARTIME) {
- // $interval.cancel(remindStart[n]);
- // }
- // }
- // //到时提醒
- // var remindWarning = function (obj, n) {
- // var n = obj.FREQUENCY - 1;
- // if (self.ServerTime == TimeToDate(obj.STARTIME, obj.REMINDTIME * n)) {
- // sp.dialog(obj.MEETINGNAME + "第" + (obj.FREQUENCY - n) + "次提醒");
- // $timeout(function () {
- // n--
- // sp.dialoghide()
- // }, 5000)
- // remindStart[obj.id + "times"] = $interval(function () {
- // sp.dialog(obj.MEETINGNAME + "第" + (obj.FREQUENCY - n) + "次提醒");
- // $timeout(function () {
- // n--
- // sp.dialoghide()
- // }, 5000)
- // }, obj.REMINDTIME, n)
- // }
- // }
- // }
- // });
- // }
- //self.getServerTime()
- self.onePic = function () {
- self.headBtnSearchhc({keyCode:13})
- //if(self.dtslPlaceholder == "图上查"){
- // sp.addTabNav("DTSS", "图上查", apiurljs.onePic + "wholeProcessPage?token=" + self.outToken)
- // }else{
- // self.headBtnSearchhc({keyCode:13})
- // }
- }
- self.deptAppList = []
- window.deptClick_FJSKECMADWDSCBNHX = function(deptId,deptName){
- self.deptAppListTitle = deptName
- if(deptId){
- self.deptAppList = []
- 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="+deptId,
- dptCfg
- ).success(function (obj) {
- console.log(obj.result)
- self.deptAppList = obj.result
- })
- }
- }
- self.goApp = function(obj){
- sp.layerhide()
- if (obj.indexUrl.indexOf("?") > -1) {
- window.top.sp.addTabNav(obj.appCode, obj.appName, obj.indexUrl+'&token='+localStorage.getItem("main-token"));
- } else {
- window.top.sp.addTabNav(obj.appCode, obj.appName, obj.indexUrl+'?token='+localStorage.getItem("main-token"));
- }
- }
- self.dtslPlaceholder = "图上查"
- self.ZhcxMapList = ['图上查']//'查房屋','查从业人员','查项目','查企业',
- self.getZhcxMaoList = function(){
- var dptCfg = {
- headers: {
- 'Content-Type': 'application/json',
- 'Access-Token': localStorage.getItem("main-token"),
- }
- };
- $http.get(
- apiurljs.dpt+"auth/system/app-list-outer?portalShow=1&type=oa",
- dptCfg
- ).success(function (obj) {
- if(obj.result&&obj.result.length>0){
- let appBkList = obj.result
- for(let i=0;i<appBkList.length;i++){
- let appList = appBkList[i].appList
- if(appList&&appList.length>0){
- appList.forEach((appItem)=>{
- if(appItem.appCode =='xmqyxx'){
- //self.ZhcxMapList.unshift('查项目')
- self.ZhcxMapList.push('查一查')
- //self.dtslPlaceholder = "查一查"
- }
- })
- }
- }
- }
- })
- }
- self.getZhcxMaoList()
- //综合查询移入
- self.zhxcOnclick = function(){
- let el_zhcxList = document.getElementById("zhcx-map-list")
- if(el_zhcxList.style.display == 'block'){
- el_zhcxList.style.display = 'none'
- }else{
- el_zhcxList.style.display = 'block'
- }
- }
- self.zhxcOnmouseenter = function(){
- let el_zhcxList = document.getElementById("zhcx-map-list")
- el_zhcxList.style.display = 'block'
- }
- self.zhxcOnmouseleave = function () {
- let el_zhcxList = document.getElementById("zhcx-map-list")
- el_zhcxList.style.display = 'none';
- }
- self.zhcxMapClick = function(item){
- if(item != self.dtslPlaceholder){
- self.headSearchResult_view = false;
- self.headBtnSearchKeyword = ""
- self.dtslPlaceholder = item
- }
- }
- //顶部工具栏跳转一张图
- self.GoOnePic=function(){
- var get_token = localStorage.getItem("main-token");
- //sp.addTabNav('F0102', '一张图', apiurljs.onePic + "wholeProcessPage?token=" + get_token + "&name=&type=&id=");
- //sp.addTabNav('F0102', '一张图', apiurljs.onePic + "digitalHousingUrbanRuralCommission?token=" + get_token + "&name=&type=&id=");
- window.open(apiurljs.onePic + "digitalHousingUrbanRuralCommission?token=" + get_token + "&name=&type=&id=", "_blank");
- }
- }])
- var CrossPage = new Object();
|