indexhd.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. sp.setCssSkin(); //皮肤换色GlWorkPlatform-username
  2. var get_userid = $.cookie("GlWorkPlatform-userid"); //获取userid
  3. var get_username = $.cookie("GlWorkPlatform-username"); //获取英文名
  4. var get_chineseName = decodeURI($.cookie("GlWorkPlatform-chineseName")); //获取中文名
  5. var UserRole = "";
  6. document.addEventListener("visibilitychange", function () {
  7. if (document.visibilityState == "visible") {
  8. if ($("#spanAdminUserId").val() != $.cookie("GlWorkPlatform-userid")) {
  9. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span></span>";
  10. var dialogBody = "<div class=\"sp-dialog-body\">有新用户登入,当前用户为" + decodeURI($.cookie("GlWorkPlatform-chineseName")) + "!</div>";
  11. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /></div>";
  12. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  13. sp.openDLTX(".sp-dialog");
  14. $("#delDataTrue").click(function () {
  15. window.location.reload()
  16. });
  17. }
  18. }
  19. })
  20. if (get_userid == null || get_userid == "" || get_userid == "undefined") {
  21. window.location.href = "login.html";
  22. }
  23. //判断从哪里进来,只有从登录页进来才可以
  24. var get_sessionStorage = sessionStorage.getItem("GlWorkPlatform-LoginFrom");
  25. if (get_sessionStorage == null || get_sessionStorage == "" || get_sessionStorage == "undefined") {
  26. window.location.href = "login.html";
  27. } else {
  28. $("#spanAdminUserId").val(get_userid);
  29. $("#spanAdminUserName").text(get_chineseName);
  30. }
  31. //退出
  32. function btnLoginOut() {
  33. window.location.href = "login.html";
  34. //window.location.href = "http://10.233.22.218/sy/#/sso?token=" + localStorage.getItem("main-token");
  35. $.cookie("GlWorkPlatform-userid", null, { path: '/', expires: -1 });
  36. $.cookie("GlWorkPlatform-username", null, { path: '/', expires: -1 });
  37. $.cookie("GlWorkPlatform-chineseName", null, { path: '/', expires: -1 });
  38. $.cookie("GlWorkPlatform-photo", null, { path: '/', expires: -1 });
  39. sessionStorage.removeItem("GlWorkPlatform-LoginFrom");
  40. localStorage.removeItem("GlWorkPlatform-openfileArray"); ////清空保存菜单文件的变量
  41. localStorage.removeItem("GlWorkPlatform-setLeftBarClickID");
  42. localStorage.removeItem("GlWorkPlatform-userInfoJsonStr");
  43. };
  44. //判断是否是第一次进入这个系统,即是否为空库
  45. function checkIsEmptyDatabase() {
  46. $.ajax({
  47. type: "get",
  48. url: apiurljs.login + "connect/isemptydatabase",
  49. //data: { action: "fadetail", userid: userid, routeinfoid: routeinfoid },
  50. dataType: "json",
  51. ContentType: 'application/x-www-form-urlencoded',
  52. success: function (obj) {
  53. var res = strToJson(s4.decryptData_CBC(obj.data));
  54. //console.log(JSON.stringify(res.data));
  55. document.getElementsByTagName("title")[0].innerText = res.data.SYSNAME;
  56. //$(".sp-wrapper-head-title span").html(res.data.SYSNAME);
  57. $.cookie("GlWorkPlatform-SYSNAME", res.data.SECTION, { path: '/', expires: 1 });
  58. },
  59. error: function (XMLHttpRequest, textStatus, errorThrown) {
  60. console.log(errorThrown);
  61. }
  62. });
  63. };
  64. //为保证页面显示效果,判断浏览器版本是否过低
  65. function checkIEVersion() {
  66. var getjson = sp.getExplorerInfo();
  67. if (getjson.type == "IE") {
  68. if (getjson.version == "8.0" || getjson.version == "7.0" || getjson.version == "6.0") {
  69. $("#checkIEVersionDiv").text("您当前使用的是" + getjson.type + "浏览器 版本:" + getjson.version + ",版本过低,请更新IE浏览器或使用其他浏览器");
  70. $("#checkIEVersionDiv").show();
  71. //然后跳到需要连接的下载网站
  72. //window.location.href="http://jiaoxueyun.com/download.jsp";
  73. }
  74. }
  75. }
  76. checkIsEmptyDatabase();
  77. checkIEVersion();
  78. //被邀请加入共享沟通
  79. var userMsg = { userid: get_userid, username: get_chineseName };
  80. if (apiurljs.meetingFlag == true) {
  81. var socket = io.connect(apiurljs.wsio, { path: apiurljs.wspath })
  82. window.socket = socket;
  83. var meetingData = new Object;
  84. socket.emit('userReg', userMsg);
  85. socket.on('error', function (data) {
  86. console.log(JSON.stringify(data) + ' - error');
  87. });
  88. socket.on('disconnect', function (data) {
  89. //失去连接的事件
  90. console.log(JSON.stringify(data) + ' - disconnect');
  91. });
  92. socket.on('reconnect', function (data) {
  93. //重新连接的事件
  94. console.log(JSON.stringify(data) + ' - reconnect');
  95. socket.emit('userReg', userMsg);
  96. });
  97. socket.on('invitemeeting', function (data) {
  98. meetingData = data;
  99. $("#meetingMsg").html("<a title='【" + meetingData.title + "】的沟通会议邀请' onclick='joinMeeting()'>【" + meetingData.title + "】的沟通会议邀请</a>");
  100. $("#meetingMsg").show();
  101. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">系统提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  102. var dialogBody = "<div class=\"sp-dialog-body\">您有一个【" + meetingData.title + "】的沟通会议邀请,确认后跳转到沟通会议室。<br/>如暂时不进入会议室,可以稍后在个人消息列表中选择进入。</div>";
  103. 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>";
  104. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  105. sp.openCenter(".sp-dialog");
  106. $(".closeDialog").click(function (event) {
  107. sp.closeCenter(".sp-dialog");
  108. event.preventDefault();
  109. event.stopPropagation();
  110. });
  111. $("#joinInMeet").click(function () {
  112. sp.dialoghide();
  113. joinMeeting();
  114. });
  115. });
  116. }
  117. function joinMeeting() {
  118. $("#meetingMsg").hide();
  119. var data = meetingData;
  120. var time = new Date().valueOf();
  121. $.cookie("wb_data" + time, JSON.stringify({
  122. meetingid: data.meetingid,
  123. masterid: data.masterid,
  124. mastername: data.mastername,
  125. userid: data.touserid,
  126. username: data.tousername,
  127. title: data.title,
  128. pdf: data.pdf,
  129. wsio: apiurljs.wsio,
  130. wspath: apiurljs.wspath,
  131. uploadUrl: data.uploadUrl,
  132. AccessToken: data.AccessToken,
  133. routeinfoid: data.routeinfoid
  134. }), { path: '/', expires: 1 });
  135. window.sp.addTabNav("GXGT", "共享沟通", "meeting/chat.html?wb_ts=" + time);
  136. setTimeout(function () {
  137. $.cookie("wb_data" + time, null, { path: '/', expires: -1 });
  138. //document.getElementById('wrapper_tabs_box_col_GXGT').childNodes[0].contentWindow.postMessage({
  139. // masterid: data.masterid,
  140. // touserid: data.touserid,
  141. // tousername: data.tousername,
  142. // title: data.title,
  143. // pdf: data.pdf,
  144. // meetingid: data.meetingid,
  145. // uploadUrl: data.uploadUrl,
  146. // AccessToken: data.AccessToken,
  147. // routeinfoid: data.routeinfoid
  148. //}, "*")
  149. }, 5000)
  150. }
  151. window.onmessage = function (event) {
  152. if (event.data == "close") {
  153. $("#wrapper_tabs_menu_li_GXGT").prev("li").addClass("sp-wrapper-tabs-current").show();
  154. $("#wrapper_tabs_box_col_GXGT").prev(".sp-wrapper-tabs-box-col").addClass("sp-wrapper-tabs-box-current").show();
  155. $("#wrapper_tabs_menu_li_GXGT").remove();
  156. $("#wrapper_tabs_box_col_GXGT").remove();
  157. }
  158. }
  159. var app = angular.module('app', []);
  160. app.controller("leftPartCtrl", ["$scope", "$http", "$interval", "$timeout", function ($scope, $http, $interval, $timeout) {
  161. var self = this;
  162. var s4 = new SM4Util();
  163. self.userId = $.cookie("GlWorkPlatform-userid");
  164. self.engName = $.cookie("GlWorkPlatform-username");
  165. self.userName = $.cookie("GlWorkPlatform-chineseName");
  166. self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
  167. self.ctime = $.cookie("CrossPage-ctime");
  168. self.outToken = localStorage.getItem("main-token");
  169. ///增加设备标识
  170. localStorage.setItem("tjJxtGoldenlinkWork-deviceType", "pc");
  171. var postCfg = {
  172. headers: {
  173. 'Content-Type': 'application/json',
  174. 'Authorization': "Bearer " + self.get_AccessToken
  175. }
  176. };
  177. self.set_imgurl = "";
  178. self.get_userInfoJsonStr = {};
  179. self.getReloadUserData = function () {
  180. var postData = {};
  181. //console.log(postData);
  182. //console.log(postData); s4.encryptData_CBC(JSON.stringify(postData))
  183. $http.post(apiurljs.login + "api/User/UserInfo", JSON.stringify(postData), postCfg)
  184. .success(function (obj) {
  185. var res1 = strToJson(s4.decryptData_CBC(obj.data));
  186. localStorage.setItem("GlWorkPlatform-userInfoJsonStr", s4.encryptData_CBC(JSON.stringify(res1.data)));
  187. self.get_userInfoJsonStr = res1.data;
  188. ////加载背景图片*******************************************************************************************
  189. if (apiurljs.login.indexOf("http://139.129.27.3:85") != -1) {
  190. self.set_imgurl = "http://139.129.27.3:8511/web/UploadAttach";
  191. } else {
  192. self.set_imgurl = apiurljs.login.split("glwork")[0] + "glworkweb/UploadAttach";
  193. }
  194. $(".sp-wrapper-tabs .sp-wrapper-tabs-head").css("background-image", "url(" + self.set_imgurl + self.get_userInfoJsonStr.bkimageurl + ")");
  195. self.getData_bkimage();///背景图片
  196. self.getHomePage();
  197. })
  198. .error(function (XMLHttpRequest, textStatus, errorThrown) {
  199. if (textStatus != 200) {
  200. self.loading = false;
  201. }
  202. })
  203. }
  204. self.getReloadUserData();
  205. /////点击桌面设置,打开并跨域发送消息打开设置弹出层--zyg--20230426
  206. self.btnSetDesktop = function () {
  207. var id = 'FZ0';
  208. var setID = "wrapper_tabs_box_col_" + id;
  209. $("#spWrapperTabsPart .sp-wrapper-tabs-box .sp-wrapper-tabs-box-col").removeClass("sp-wrapper-tabs-box-current");
  210. $("#" + setID).addClass("sp-wrapper-tabs-box-current").show();
  211. $timeout(function () {
  212. var ifr = document.getElementById('iframe_wrapper_tabs_box_col_FZ0');
  213. var json = {};
  214. var func = { name: "openLayerSetting", arg: json };//传输name名称以及json串
  215. ifr.contentWindow.postMessage(func, '*');
  216. }, 200);
  217. };
  218. self.imgColActive_code_bkimage = "";
  219. self.bkimageArray = [];
  220. self.bkimageArray_active = {};
  221. self.ifHasDefault_bkimage = 0;
  222. self.getData_bkimage = function () {
  223. var postData = { "userid": self.userId };
  224. //console.log(postData);
  225. //console.log(postData); s4.encryptData_CBC(JSON.stringify(postData))
  226. $http.post(apiurljs.login + "g2work/bkimage/queryDataUserByUserid", JSON.stringify(postData), postCfg)
  227. .success(function (obj) {
  228. //var res = strToJson(s4.decryptData_CBC(obj.data));
  229. var res = obj;
  230. //console.log(JSON.stringify(res));
  231. if (res.success) {
  232. self.bkimageArray = res.data;
  233. angular.forEach(self.bkimageArray, function (item) {
  234. item.URL_set = self.set_imgurl + item.URL;
  235. });
  236. } else {
  237. self.loading = false;
  238. self.bkimageArray = [];
  239. self.bkimageArray_active = {};
  240. }
  241. })
  242. .error(function (XMLHttpRequest, textStatus, errorThrown) {
  243. if (textStatus != 200) {
  244. self.loading = false;
  245. }
  246. })
  247. };
  248. $timeout(function () {
  249. //选择底图
  250. if ($("body").find(".sp-desk-img").length > 0) {
  251. $(".sp-desk-img").each(function () {
  252. $(this).click(function () {
  253. var get_url = $(this).attr('data-url');
  254. var get_code = $(this).attr('data-code');
  255. $(this).addClass("sp-desk-current").siblings().removeClass("sp-desk-current");
  256. $("#wrapper_tabs_box_col_FZ0").find("iframe").contents().find("body").css("background-image", "url(" + get_url + ")")
  257. $("#wrapper_tabs_box_col_FZ0").find("iframe").contents().find("body").css("background-repeat", "no-repeat")
  258. $("#wrapper_tabs_box_col_FZ0").find("iframe").contents().find("body").css("background-size", "cover")
  259. $("#wrapper_tabs_box_col_FZ0").find("iframe").contents().find("body").css("background-position", "0 -30px")
  260. $(".sp-wrapper-tabs .sp-wrapper-tabs-head").css("background-image", "url(" + get_url + ")");
  261. var postData_2 = {
  262. "userid": self.userId,
  263. "code": get_code
  264. };
  265. $http.post(apiurljs.login + "g2work/bkimage/updateDataUserDefault", JSON.stringify(postData_2), postCfg)
  266. .success(function (obj_2) {
  267. //var res = strToJson(s4.decryptData_CBC(obj.data));
  268. var res_2 = obj_2;
  269. //console.log(JSON.stringify(res));
  270. if (res_2.success) {
  271. console.log("背景图片修改成功");
  272. } else {
  273. sp.dialog(res_2.message);
  274. }
  275. })
  276. .error(function (XMLHttpRequest, textStatus, errorThrown) {
  277. if (textStatus != 200) {
  278. self.loading = false;
  279. }
  280. })
  281. });
  282. });
  283. }
  284. }, 1000);
  285. ////加载背景图片*******************************************************************************************
  286. //声明一个左侧的功能列表
  287. self.userFuncList = [];
  288. //首选获取当前用户的个人桌面
  289. self.getHomePage = function () {
  290. self.userFuncList = [];
  291. var postData = {
  292. userid: self.userId
  293. }
  294. $http.post(apiurljs.login + "g2work/desktop/queryDesktopMarkT", { data: s4.encryptData_CBC(JSON.stringify(postData)) }, postCfg)
  295. .success(function (obj) {
  296. var res = strToJson(s4.decryptData_CBC(obj.data));
  297. //console.log(JSON.stringify(res));
  298. var homePageObj = {
  299. CNAME: "工作桌面",
  300. C_H_I_L_D: [],
  301. COPYCHILD: [],
  302. ///FILEN: res.data.tenantcode,
  303. FILEN: self.get_userInfoJsonStr.desktopurl,
  304. FUNCSCOPE: "ADMINISTATOR|ADMIN",
  305. LEAF: 0,
  306. LEVELS: 1,
  307. OPENTYPE: "0",
  308. PARENTID: "0",
  309. PKID: "FZ0",
  310. SORTID: 1,
  311. SRCIMG: "",
  312. SRCIMG32: "",
  313. WINDOWS: "",
  314. IMGBox: "box0",
  315. }
  316. $.cookie("GlWorkPlatform-userTypeEng", res.data.data, { path: '/', expires: 1 });
  317. if (res.data.data == "USER") {
  318. $.cookie("GlWorkPlatform-userType", "普通用户", { path: '/', expires: 1 })
  319. } else if (res.data.data == "SYSADMIN") {
  320. $.cookie("GlWorkPlatform-userType", "系统管理员", { path: '/', expires: 1 })
  321. } else if (res.data.data == "SECADMIN") {
  322. $.cookie("GlWorkPlatform-userType", "安全管理员", { path: '/', expires: 1 })
  323. } else if (res.data.data == "AUDITADMIN") {
  324. $.cookie("GlWorkPlatform-userType", "审计管理员", { path: '/', expires: 1 })
  325. } else if (res.data.data == "ADMIN") {
  326. $.cookie("GlWorkPlatform-userType", "总管理员", { path: '/', expires: 1 })
  327. }
  328. self.userFuncList.push(homePageObj);
  329. //获取用户的功能列表
  330. self.getUserFunc();
  331. ////20230423--zyg-修改,变更成加载图片base64编码,判断是否为base64图片,是直接加载,否设置图片路径;
  332. if (res.data.imgsrc.indexOf("data:image") != -1) {
  333. ///base64图片格式直接加载
  334. $("#spanAdminPhoto").attr("src", res.data.imgsrc);
  335. } else {
  336. ///路径图片,赋值
  337. $("#spanAdminPhoto").attr("src", "AFrontEnd/css/icons/photo/" + res.data.imgsrc);
  338. }
  339. var data = {
  340. tablename: "SYS_CLICKLOG",
  341. data: {
  342. CTIME: self.ctime,
  343. TITLE: "系统登录",
  344. REQUESTURL: window.location.pathname,
  345. REQUESTHEADERURL: window.location.origin,
  346. LOGTYPE: "登录登出",
  347. USERTYPE: $.cookie("GlWorkPlatform-userType"),
  348. ADMIN: $.cookie("GlWorkPlatform-userTypeEng"),
  349. CLIENTIP: sp.myIP(),
  350. PCNAME: sp.detectOS(),
  351. BROWSERNAME: sp.browser(),
  352. RESPONSETIME: sp.getLocalDate1(),
  353. USERID: self.userId,
  354. USERNAME: self.userName
  355. }
  356. }
  357. $http.post(apiurljs.login + "g2app/dataabase/insertFormData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  358. .success(function (res) {
  359. $.cookie("CrossPage-ctime", null, { path: '/', expires: -1 });
  360. })
  361. })
  362. }
  363. self.iframefileurl = "";
  364. //获取用户的功能列表
  365. self.getUserFunc = function () {
  366. $http.post(apiurljs.login + "UserPower/Permissions", { data: s4.encryptData_CBC("") }, postCfg)
  367. .success(function (obj) {
  368. var res = strToJson(s4.decryptData_CBC(obj.data));
  369. res.data.rows.forEach(function (item) {
  370. item.showRightMenu = false;
  371. if (item.C_H_I_L_D.length == 0) {
  372. item.IMGBox = "box0";
  373. } else if (item.C_H_I_L_D.length > 0 && item.C_H_I_L_D.length <= 4) {
  374. item.IMGBox = "box4";
  375. } else if (item.C_H_I_L_D.length > 4) {
  376. item.IMGBox = "box9";
  377. }
  378. let array = angular.copy(item.C_H_I_L_D);
  379. if (array.length >= 12) {
  380. item.COPYCHILD = array.slice(0, 12);
  381. item.hideFunc = true;
  382. item.showFunc = false;
  383. } else {
  384. item.COPYCHILD = array;
  385. item.hideFunc = false;
  386. item.showFunc = false;
  387. }
  388. self.userFuncList.push(item);
  389. })
  390. //console.log(JSON.stringify(self.userFuncList));
  391. //默认打开工作桌面
  392. var title = self.userFuncList[0].CNAME;
  393. var id = self.userFuncList[0].PKID;
  394. var src = self.userFuncList[0].FILEN;
  395. CrossPage = {
  396. cname: "",
  397. ctime: sp.getLocalDate(),
  398. type: 0
  399. }
  400. //self.iframefileurl = self.userFuncList[0].FILEN;
  401. //$("#indexhd_iframe_fileurl").attr("src", self.userFuncList[0].FILEN); ////然后让里面的iframe重新加载点击后的页面
  402. //$(".sp-wrapper-tabs-box-col").show();
  403. sp.addTabNav(id, title, src);
  404. //CrossPage = {
  405. // cname: "",
  406. // ctime: sp.getLocalDate(),
  407. // type: 0
  408. //}
  409. // if (getParameter("openPage") == "") {
  410. // //sp.loadmenufiles();//加载记录菜单文件
  411. // }
  412. // if (getParameter("openPage") != "") {
  413. // self.secondMenu = "全部/";
  414. // self.func.normalList.forEach(function (item) {
  415. // if (item.PKID == getParameter("PKID")) {
  416. // self.CrossPage(item)
  417. // }
  418. // })
  419. // sp.addTabNav(getParameter("PKID"), decodeURI(getParameter("CNAME")), getParameter("openPage"))
  420. // }
  421. })
  422. }
  423. ////点击菜单事件
  424. self.btnNavPage = function (id, title, src) {
  425. //console.log(str);
  426. //self.iframefileurl = str;
  427. ///$("#indexhd_iframe_fileurl").attr("src", str)
  428. if (itemdata.OPENTYPE == "1") {
  429. window.open(itemdata.FILEN);
  430. } else {
  431. sp.addTabNav(itemdata.PKID, itemdata.CNAME, itemdata.FILEN);
  432. }
  433. };
  434. //sp.fitHeight("iframe", $(".sp-wrapper-head").outerHeight() + $(".sp-wrapper-tabs-head").outerHeight()); //设置iframe的高度
  435. //获取上传附件文件格式限制----20230517
  436. uploadformat = [];
  437. function getUploadFormat() {
  438. var data = { tablename: "CODE_UPLOADFORMAT" }
  439. $http.post(apiurljs.login + "g2app/DangAn/queryCodeData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  440. .success(function (obj) {
  441. var res = strToJson(s4.decryptData_CBC(obj.data));
  442. uploadformat = res.data;
  443. })
  444. };
  445. getUploadFormat()
  446. ////头部关键字搜索---20230905
  447. self.headBtnSearchKeyword = "";
  448. self.headSearchResult = [];
  449. self.headSearchResult_view = false;
  450. self.headBtnSearch = function () {
  451. if (sp.isval(self.headBtnSearchKeyword)) {
  452. self.headSearchResult = [];
  453. var data = {
  454. "url": "/basic/api/StatSelect/selectCodeList",
  455. "data": { "keyWord": self.headBtnSearchKeyword }
  456. }
  457. //console.log(JSON.stringify(data));
  458. $http.post(apiurljs.login + "g2app/yizhangtu/selectCodeList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  459. .success(function (obj) {
  460. var res = strToJson(s4.decryptData_CBC(obj.data));
  461. //console.log(JSON.stringify(res.data));
  462. self.headSearchResult = res.data.build;
  463. if (sp.isval(self.headSearchResult)) {
  464. self.headSearchResult_view = true;
  465. } else {
  466. self.headSearchResult_view = false;
  467. }
  468. })
  469. } else {
  470. self.headSearchResult_view = false;
  471. }
  472. };
  473. self.headKeywordPage = function (itemdata) {
  474. var get_token = localStorage.getItem("main-token");
  475. var set_url = apiurljs.onePic + "wholeProcessPage?token=" + get_token + "&name=" + itemdata.name + "&type=" + itemdata.type + "&id=" + itemdata.id + "";
  476. sp.addTabNav(itemdata.id, '一张图', set_url);
  477. self.headSearchResult_view = false;
  478. };
  479. //跨页面记录日志参数
  480. self.CrossPage = function (obj) {
  481. CrossPage = {
  482. cname: obj.CNAME,
  483. ctime: sp.getLocalDate1(),
  484. type: 0
  485. }
  486. }
  487. self.addTabNav = function (PKID, CNAME, FILEN) {
  488. console.log(PKID, CNAME, FILEN)
  489. if (FILEN.indexOf("token=") > -1) {
  490. sp.addTabNav(PKID, CNAME, FILEN.replace("token=", "token=" + self.outToken))
  491. } else {
  492. sp.addTabNav(PKID, CNAME, FILEN)
  493. }
  494. }
  495. }]);
  496. var CrossPage = new Object();