indexNew1.js 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189
  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"//"http://10.233.22.218/sy/#/sso?token=" + localStorage.getItem("main-token");
  34. $.cookie("GlWorkPlatform-userid", null, {path: '/', expires: -1});
  35. $.cookie("GlWorkPlatform-username", null, {path: '/', expires: -1});
  36. $.cookie("GlWorkPlatform-chineseName", null, {path: '/', expires: -1});
  37. $.cookie("GlWorkPlatform-photo", null, {path: '/', expires: -1});
  38. sessionStorage.removeItem("GlWorkPlatform-LoginFrom");
  39. localStorage.removeItem("GlWorkPlatform-openfileArray"); ////清空保存菜单文件的变量
  40. localStorage.removeItem("GlWorkPlatform-setLeftBarClickID");
  41. localStorage.removeItem("GlWorkPlatform-userInfoJsonStr");
  42. };
  43. //判断是否是第一次进入这个系统,即是否为空库
  44. function checkIsEmptyDatabase() {
  45. $.ajax({
  46. type: "get",
  47. url: apiurljs.login + "connect/isemptydatabase",
  48. //data: { action: "fadetail", userid: userid, routeinfoid: routeinfoid },
  49. dataType: "json",
  50. ContentType: 'application/x-www-form-urlencoded',
  51. success: function (obj) {
  52. var res = strToJson(s4.decryptData_CBC(obj.data));
  53. //console.log(JSON.stringify(res.data));
  54. document.getElementsByTagName("title")[0].innerText = res.data.SYSNAME;
  55. //$(".sp-wrapper-head-title span").html(res.data.SYSNAME);
  56. $.cookie("GlWorkPlatform-SYSNAME", res.data.SECTION, {path: '/', expires: 1});
  57. },
  58. error: function (XMLHttpRequest, textStatus, errorThrown) {
  59. console.log(errorThrown);
  60. }
  61. });
  62. };
  63. //为保证页面显示效果,判断浏览器版本是否过低
  64. function checkIEVersion() {
  65. var getjson = sp.getExplorerInfo();
  66. if (getjson.type == "IE") {
  67. if (getjson.version == "8.0" || getjson.version == "7.0" || getjson.version == "6.0") {
  68. $("#checkIEVersionDiv").text("您当前使用的是" + getjson.type + "浏览器 版本:" + getjson.version + ",版本过低,请更新IE浏览器或使用其他浏览器");
  69. $("#checkIEVersionDiv").show();
  70. //然后跳到需要连接的下载网站
  71. //window.location.href="http://jiaoxueyun.com/download.jsp";
  72. }
  73. }
  74. }
  75. //10分钟不操作退出登录
  76. //$(function () {
  77. // var TimeNum = new Date().getTime();
  78. // //mousedown() 监听鼠标是否使用 keydown() 监听键盘是否可用
  79. // $(document).mousedown(function () {
  80. // TimeNum = new Date().getTime();
  81. // }).keydown(function () {
  82. // TimeNum = new Date().getTime();
  83. // }).mousemove(function () {
  84. // TimeNum = new Date().getTime();
  85. // });
  86. // //setInterval用来判断 当前时间之差
  87. // setInterval(function () {
  88. // //这里判断按键或鼠标 事件是否触发了
  89. // var TimeCount = new Date().getTime();
  90. // var minutes = Math.floor((TimeCount - TimeNum) / (60 * 1000));
  91. // //如果两个时间差大于10分钟
  92. // if (minutes >= 10||$.cookie("GlWorkPlatform-userid")==null||$.cookie("GlWorkPlatform-userid")==undefined) {
  93. // var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span></span>";
  94. // var dialogBody = "<div class=\"sp-dialog-body\">当前会话已超时,请重新登录!</div>";
  95. // var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /></div>";
  96. // $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  97. // sp.openDLTX(".sp-dialog");
  98. // ///取消按钮
  99. // $('.sp-closeDialog').click(function (event) {
  100. // sp.closeCenter(".sp-dialog");
  101. // event.preventDefault();
  102. // event.stopPropagation();
  103. // });
  104. // //post消息的id
  105. // $("#delDataTrue").click(function () {
  106. // window.location.href = 'login.html';
  107. // $.cookie("GlWorkPlatform-userid", null, { path: '/', expires: -1 });
  108. // $.cookie("GlWorkPlatform-username", null, { path: '/', expires: -1 });
  109. // $.cookie("GlWorkPlatform-chineseName", null, { path: '/', expires: -1 });
  110. // $.cookie("GlWorkPlatform-photo", null, { path: '/', expires: -1 });
  111. // sessionStorage.removeItem("GlWorkPlatform-LoginFrom");
  112. // localStorage.removeItem("GlWorkPlatform-openfileArray");
  113. // localStorage.removeItem("GlWorkPlatform-setLeftBarClickID");
  114. // });
  115. // }
  116. // }, 1000);
  117. //})
  118. checkIsEmptyDatabase();
  119. checkIEVersion();
  120. //被邀请加入共享沟通
  121. var userMsg = {userid: get_userid, username: get_chineseName};
  122. if (apiurljs.meetingFlag == true) {
  123. var socket = io.connect(apiurljs.wsio, {path: apiurljs.wspath})
  124. window.socket = socket;
  125. var meetingData = new Object;
  126. socket.emit('userReg', userMsg);
  127. socket.on('error', function (data) {
  128. console.log(JSON.stringify(data) + ' - error');
  129. });
  130. socket.on('disconnect', function (data) {
  131. //失去连接的事件
  132. console.log(JSON.stringify(data) + ' - disconnect');
  133. });
  134. socket.on('reconnect', function (data) {
  135. //重新连接的事件
  136. console.log(JSON.stringify(data) + ' - reconnect');
  137. socket.emit('userReg', userMsg);
  138. });
  139. socket.on('invitemeeting', function (data) {
  140. meetingData = data;
  141. $("#meetingMsg").html("<a title='【" + meetingData.title + "】的沟通会议邀请' onclick='joinMeeting()'>【" + meetingData.title + "】的沟通会议邀请</a>");
  142. $("#meetingMsg").show();
  143. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">系统提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  144. var dialogBody = "<div class=\"sp-dialog-body\">您有一个【" + meetingData.title + "】的沟通会议邀请,确认后跳转到沟通会议室。<br/>如暂时不进入会议室,可以稍后在个人消息列表中选择进入。</div>";
  145. 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>";
  146. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  147. sp.openCenter(".sp-dialog");
  148. $(".closeDialog").click(function (event) {
  149. sp.closeCenter(".sp-dialog");
  150. event.preventDefault();
  151. event.stopPropagation();
  152. });
  153. $("#joinInMeet").click(function () {
  154. sp.dialoghide();
  155. joinMeeting();
  156. });
  157. });
  158. }
  159. function joinMeeting() {
  160. $("#meetingMsg").hide();
  161. var data = meetingData;
  162. var time = new Date().valueOf();
  163. $.cookie("wb_data" + time, JSON.stringify({
  164. meetingid: data.meetingid,
  165. masterid: data.masterid,
  166. mastername: data.mastername,
  167. userid: data.touserid,
  168. username: data.tousername,
  169. title: data.title,
  170. pdf: data.pdf,
  171. wsio: apiurljs.wsio,
  172. wspath: apiurljs.wspath,
  173. uploadUrl: data.uploadUrl,
  174. AccessToken: data.AccessToken,
  175. routeinfoid: data.routeinfoid
  176. }), {path: '/', expires: 1});
  177. window.sp.addTabNav("GXGT", "共享沟通", "meeting/chat.html?wb_ts=" + time);
  178. setTimeout(function () {
  179. $.cookie("wb_data" + time, null, {path: '/', expires: -1});
  180. //document.getElementById('wrapper_tabs_box_col_GXGT').childNodes[0].contentWindow.postMessage({
  181. // masterid: data.masterid,
  182. // touserid: data.touserid,
  183. // tousername: data.tousername,
  184. // title: data.title,
  185. // pdf: data.pdf,
  186. // meetingid: data.meetingid,
  187. // uploadUrl: data.uploadUrl,
  188. // AccessToken: data.AccessToken,
  189. // routeinfoid: data.routeinfoid
  190. //}, "*")
  191. }, 5000)
  192. }
  193. window.onmessage = function (event) {
  194. if (event.data == "close") {
  195. $("#wrapper_tabs_menu_li_GXGT").prev("li").addClass("sp-wrapper-tabs-current").show();
  196. $("#wrapper_tabs_box_col_GXGT").prev(".sp-wrapper-tabs-box-col").addClass("sp-wrapper-tabs-box-current").show();
  197. $("#wrapper_tabs_menu_li_GXGT").remove();
  198. $("#wrapper_tabs_box_col_GXGT").remove();
  199. }
  200. if (typeof (event.data) == "object") {
  201. console.log(event.data);
  202. sp.addTabNav(event.data.id, event.data.title, event.data.src)
  203. }
  204. }
  205. //左侧的动态新动态菜单采用angularJS的方式渲染
  206. var app = angular.module('app', []);
  207. app.controller("leftPartCtrl", ["$scope", "$http", "$interval", "$timeout", function ($scope, $http, $interval, $timeout) {
  208. var self = this;
  209. var s4 = new SM4Util();
  210. self.userId = $.cookie("GlWorkPlatform-userid");
  211. self.engName = $.cookie("GlWorkPlatform-username");
  212. self.userName = $.cookie("GlWorkPlatform-chineseName");
  213. self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
  214. self.ctime = $.cookie("CrossPage-ctime");
  215. self.outToken = localStorage.getItem("main-token");
  216. ///增加设备标识
  217. localStorage.setItem("tjJxtGoldenlinkWork-deviceType", "pc");
  218. //左侧动态赋值高度
  219. var bodyHeight = $(window).height();
  220. $(".sp-menu-list").height(bodyHeight - 115);
  221. ///20230222--修改左侧菜单
  222. self.bindSetMenuSwitch = function () {
  223. if ($(".sp-menu-switch").hasClass("hasClick")) {
  224. $(".sp-menu-switch").removeClass("hasClick");
  225. $(".sp-menu-list").fadeIn(200);
  226. } else {
  227. $(".sp-menu-switch").addClass("hasClick");
  228. $(".sp-menu-list").fadeOut(200);
  229. }
  230. };
  231. /////点击桌面设置,打开并跨域发送消息打开设置弹出层--zyg--20230426
  232. self.btnSetDesktop = function () {
  233. ////sp.addTabNav('FZ0', '工作桌面', 'tpl/_indexgmt/index_2.html');
  234. var id = 'FZ0';
  235. var setID = "wrapper_tabs_box_col_" + id;
  236. $("#spWrapperTabsPart ul li").removeClass("sp-wrapper-tabs-current");
  237. $(".sp-wrapper-tabs-box-current").hide();
  238. $("#spWrapperTabsPart .sp-wrapper-tabs-box .sp-wrapper-tabs-box-col").removeClass("sp-wrapper-tabs-box-current");
  239. $("#wrapper_tabs_menu_li_" + id).addClass("sp-wrapper-tabs-current").show();
  240. $("#" + setID).addClass("sp-wrapper-tabs-box-current").show();
  241. $timeout(function () {
  242. var ifr = document.getElementById('iframe_wrapper_tabs_box_col_FZ0');
  243. var json = {};
  244. var func = { name: "openLayerSetting", arg: json };//传输name名称以及json串
  245. ifr.contentWindow.postMessage(func, '*');
  246. }, 200);
  247. };
  248. var postCfg = {
  249. headers: {
  250. 'Content-Type': 'application/json',
  251. 'Authorization': "Bearer " + self.get_AccessToken
  252. }
  253. };
  254. self.set_imgurl = "";
  255. self.get_userInfoJsonStr = {};
  256. self.getReloadUserData = function () {
  257. var postData = { };
  258. //console.log(postData);
  259. //console.log(postData); s4.encryptData_CBC(JSON.stringify(postData))
  260. $http.post(apiurljs.login + "api/User/UserInfo", JSON.stringify(postData), postCfg)
  261. .success(function (obj) {
  262. var res1 = strToJson(s4.decryptData_CBC(obj.data));
  263. localStorage.setItem("GlWorkPlatform-userInfoJsonStr", s4.encryptData_CBC(JSON.stringify(res1.data)));
  264. self.get_userInfoJsonStr = res1.data;
  265. ////加载背景图片*******************************************************************************************
  266. if (apiurljs.login.indexOf("http://139.129.27.3:85") != -1) {
  267. self.set_imgurl = "http://139.129.27.3:8511/web/UploadAttach";
  268. } else {
  269. self.set_imgurl = apiurljs.login.split("glwork")[0] + "glworkweb/UploadAttach";
  270. }
  271. $(".sp-wrapper-tabs .sp-wrapper-tabs-head").css("background-image", "url(" + self.set_imgurl + self.get_userInfoJsonStr.bkimageurl + ")");
  272. self.getData_bkimage();///背景图片
  273. self.getHomePage();///
  274. self.getUserFavoriteFunc();
  275. self.getUserRecentFunc();
  276. })
  277. .error(function (XMLHttpRequest, textStatus, errorThrown) {
  278. if (textStatus != 200) {
  279. self.loading = false;
  280. }
  281. })
  282. }
  283. self.getReloadUserData();
  284. self.imgColActive_code_bkimage = "";
  285. self.bkimageArray = [];
  286. self.bkimageArray_active = {};
  287. self.ifHasDefault_bkimage = 0;
  288. self.getData_bkimage = function () {
  289. var postData = { "userid": self.userId };
  290. //console.log(postData);
  291. //console.log(postData); s4.encryptData_CBC(JSON.stringify(postData))
  292. $http.post(apiurljs.login + "g2work/bkimage/queryDataUserByUserid", JSON.stringify(postData), postCfg)
  293. .success(function (obj) {
  294. //var res = strToJson(s4.decryptData_CBC(obj.data));
  295. var res = obj;
  296. //console.log(JSON.stringify(res));
  297. if (res.success) {
  298. self.bkimageArray = res.data;
  299. angular.forEach(self.bkimageArray, function (item) {
  300. item.URL_set = self.set_imgurl + item.URL;
  301. });
  302. } else {
  303. self.loading = false;
  304. self.bkimageArray = [];
  305. self.bkimageArray_active = {};
  306. }
  307. })
  308. .error(function (XMLHttpRequest, textStatus, errorThrown) {
  309. if (textStatus != 200) {
  310. self.loading = false;
  311. }
  312. })
  313. };
  314. $timeout(function () {
  315. //选择底图
  316. if ($("body").find(".sp-desk-img").length > 0) {
  317. $(".sp-desk-img").each(function () {
  318. $(this).click(function () {
  319. var get_url = $(this).attr('data-url');
  320. var get_code = $(this).attr('data-code');
  321. $(this).addClass("sp-desk-current").siblings().removeClass("sp-desk-current");
  322. $("#wrapper_tabs_box_col_FZ0").find("iframe").contents().find("body").css("background-image", "url(" + get_url + ")")
  323. $("#wrapper_tabs_box_col_FZ0").find("iframe").contents().find("body").css("background-repeat", "no-repeat")
  324. $("#wrapper_tabs_box_col_FZ0").find("iframe").contents().find("body").css("background-size", "cover")
  325. $("#wrapper_tabs_box_col_FZ0").find("iframe").contents().find("body").css("background-position", "0 -30px")
  326. $(".sp-wrapper-tabs .sp-wrapper-tabs-head").css("background-image", "url(" + get_url + ")");
  327. var postData_2 = {
  328. "userid": self.userId,
  329. "code": get_code
  330. };
  331. $http.post(apiurljs.login + "g2work/bkimage/updateDataUserDefault", JSON.stringify(postData_2), postCfg)
  332. .success(function (obj_2) {
  333. //var res = strToJson(s4.decryptData_CBC(obj.data));
  334. var res_2 = obj_2;
  335. //console.log(JSON.stringify(res));
  336. if (res_2.success) {
  337. console.log("背景图片修改成功");
  338. } else {
  339. sp.dialog(res_2.message);
  340. }
  341. })
  342. .error(function (XMLHttpRequest, textStatus, errorThrown) {
  343. if (textStatus != 200) {
  344. self.loading = false;
  345. }
  346. })
  347. });
  348. });
  349. }
  350. }, 1000);
  351. ////加载背景图片*******************************************************************************************
  352. self.func = {
  353. normalTitle: "全部",
  354. favoriteTitle: "常用功能",
  355. recentTitle: "最近访问",
  356. favoriteList: [],
  357. recentList: [],
  358. keyWord: "",
  359. keyCondition: "",
  360. keyShow: false,
  361. keyPartList: [], //当前模块下所有符合关键字的模块列表
  362. keyPartListCopy: [], //当前模块下前12个符合关键字的模块列表
  363. keyAllList: [], //全局模块下所有符合关键字的模块列表
  364. keyAllListCopy: [], //全局模块下前12个符合关键字的模块列表
  365. keyPartShow: false,
  366. keyPartHide: false,
  367. keyAllShow: false,
  368. keyAllHide: false,
  369. allFuncList: [], //存储最全的功能防止遗漏
  370. nowFuncName: "",
  371. nowFuncCode: ""
  372. }
  373. //声明一个左侧的功能列表
  374. self.userFuncList = [];
  375. //首选获取当前用户的个人桌面
  376. self.getHomePage = function () {
  377. self.userFuncList = [];
  378. var postData = {
  379. userid: self.userId
  380. }
  381. $http.post(apiurljs.login + "g2work/desktop/queryDesktopMarkT", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
  382. .success(function (obj) {
  383. var res = strToJson(s4.decryptData_CBC(obj.data));
  384. //console.log(JSON.stringify(res));
  385. //console.log(get_userInfoJsonStr);
  386. var homePageObj = {
  387. CNAME: "工作桌面",
  388. C_H_I_L_D: [],
  389. COPYCHILD: [],
  390. ///FILEN: res.data.tenantcode,
  391. FILEN: self.get_userInfoJsonStr.desktopurl,
  392. FUNCSCOPE: "ADMINISTATOR|ADMIN",
  393. LEAF: 0,
  394. LEVELS: 1,
  395. OPENTYPE: "0",
  396. PARENTID: "0",
  397. PKID: "FZ0",
  398. SORTID: 1,
  399. SRCIMG: "",
  400. SRCIMG32: "",
  401. WINDOWS: "",
  402. IMGBox: "box0",
  403. }
  404. $.cookie("GlWorkPlatform-userTypeEng", res.data.data, {path: '/', expires: 1});
  405. if (res.data.data == "USER") {
  406. $.cookie("GlWorkPlatform-userType", "普通用户", {path: '/', expires: 1})
  407. } else if (res.data.data == "SYSADMIN") {
  408. $.cookie("GlWorkPlatform-userType", "系统管理员", {path: '/', expires: 1})
  409. } else if (res.data.data == "SECADMIN") {
  410. $.cookie("GlWorkPlatform-userType", "安全管理员", {path: '/', expires: 1})
  411. } else if (res.data.data == "AUDITADMIN") {
  412. $.cookie("GlWorkPlatform-userType", "审计管理员", {path: '/', expires: 1})
  413. } else if (res.data.data == "ADMIN") {
  414. $.cookie("GlWorkPlatform-userType", "总管理员", {path: '/', expires: 1})
  415. }
  416. ////20230423--zyg-修改,变更成加载图片base64编码,判断是否为base64图片,是直接加载,否设置图片路径;
  417. if (res.data.imgsrc.indexOf("data:image") != -1) {
  418. ///base64图片格式直接加载
  419. $("#spanAdminPhoto").attr("src", res.data.imgsrc);
  420. self.usercard.img = res.data.imgsrc;
  421. } else {
  422. ///路径图片,赋值
  423. $("#spanAdminPhoto").attr("src", "AFrontEnd/css/icons/photo/" + res.data.imgsrc);
  424. self.usercard.img = "AFrontEnd/css/icons/photo/" + res.data.imgsrc;
  425. }
  426. self.userFuncList.push(homePageObj);
  427. self.getUserFunc();
  428. var data = {
  429. tablename: "SYS_CLICKLOG",
  430. data: {
  431. CTIME: self.ctime,
  432. TITLE: "系统登录",
  433. REQUESTURL: window.location.pathname,
  434. REQUESTHEADERURL: window.location.origin,
  435. LOGTYPE: "登录登出",
  436. USERTYPE: $.cookie("GlWorkPlatform-userType"),
  437. ADMIN: $.cookie("GlWorkPlatform-userTypeEng"),
  438. CLIENTIP: sp.myIP(),
  439. PCNAME: sp.detectOS(),
  440. BROWSERNAME: sp.browser(),
  441. RESPONSETIME: sp.getLocalDate1(),
  442. USERID: self.userId,
  443. USERNAME: self.userName
  444. }
  445. }
  446. $http.post(apiurljs.login + "g2app/dataabase/insertFormData", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  447. .success(function (res) {
  448. $.cookie("CrossPage-ctime", null, {path: '/', expires: -1});
  449. })
  450. })
  451. }
  452. //获取用户的功能列表
  453. self.getUserFunc = function () {
  454. $http.post(apiurljs.login + "UserPower/Permissions", {data: s4.encryptData_CBC("")}, postCfg)
  455. .success(function (obj) {
  456. var res = strToJson(s4.decryptData_CBC(obj.data));
  457. //console.log(JSON.stringify(res.data));
  458. res.data.rows.forEach(function (item) {
  459. item.showRightMenu = false;
  460. if (item.C_H_I_L_D.length == 0) {
  461. item.IMGBox = "box0";
  462. } else if (item.C_H_I_L_D.length > 0 && item.C_H_I_L_D.length <= 4) {
  463. item.IMGBox = "box4";
  464. } else if (item.C_H_I_L_D.length > 4) {
  465. item.IMGBox = "box9";
  466. }
  467. let array = angular.copy(item.C_H_I_L_D);
  468. if (array.length > 12) {
  469. item.COPYCHILD = array.slice(0, 12);
  470. item.hideFunc = true;
  471. item.showFunc = false;
  472. } else {
  473. item.COPYCHILD = array;
  474. item.hideFunc = false;
  475. item.showFunc = false;
  476. }
  477. self.userFuncList.push(item);
  478. })
  479. //记录全部功能模块列表
  480. res.data.rows.forEach(function (item) {
  481. item.C_H_I_L_D.forEach(function (item2) {
  482. self.func.allFuncList.push(item2);
  483. })
  484. })
  485. //默认打开工作桌面
  486. var title = self.userFuncList[0].CNAME;
  487. var id = self.userFuncList[0].PKID;
  488. var src = self.userFuncList[0].FILEN;
  489. sp.addhometabnav(id, title, src);
  490. CrossPage = {
  491. cname: "",
  492. ctime: sp.getLocalDate(),
  493. type: 0
  494. }
  495. // if (getParameter("openPage") == "") {
  496. // //sp.loadmenufiles();//加载记录菜单文件
  497. // }
  498. // if (getParameter("openPage") != "") {
  499. // self.secondMenu = "全部/";
  500. // self.func.normalList.forEach(function (item) {
  501. // if (item.PKID == getParameter("PKID")) {
  502. // self.CrossPage(item)
  503. // }
  504. // })
  505. // sp.addTabNav(getParameter("PKID"), decodeURI(getParameter("CNAME")), getParameter("openPage"))
  506. // }
  507. })
  508. }
  509. //获取用户常用功能列表
  510. self.getUserFavoriteFunc = function () {
  511. var postData = {
  512. userid: self.userId,
  513. ntops: "4"
  514. }
  515. $http.post(apiurljs.login + "g2work/desktop/queryFavoriteFunc", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
  516. .success(function (obj) {
  517. var res = strToJson(s4.decryptData_CBC(obj.data));
  518. self.func.favoriteList = res.data;
  519. })
  520. }
  521. //获取用户最近访问列表
  522. self.getUserRecentFunc = function () {
  523. var postData = {
  524. userid: self.userId,
  525. ntops: "4"
  526. }
  527. $http.post(apiurljs.login + "g2work/desktop/queryRecentFunc", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
  528. .success(function (obj) {
  529. var res = strToJson(s4.decryptData_CBC(obj.data));
  530. self.func.recentList = res.data;
  531. })
  532. }
  533. //固定二级菜单标志
  534. self.tabFixed = false;
  535. //固定二级菜单函数
  536. self.setTabFixed = function () {
  537. self.tabFixed = true;
  538. }
  539. //取消固定二级菜单函数
  540. self.cancelTabFixed = function () {
  541. self.tabFixed = false;
  542. }
  543. //鼠标放入执行的事件
  544. self.openRightMenu = function (index) {
  545. //self.initSearchFunc();
  546. self.userFuncList.forEach(function (item) {
  547. item.showRightMenu = false;
  548. })
  549. self.func.normalTitle = self.userFuncList[index].CNAME;
  550. self.func.nowFuncCode = self.userFuncList[index].PKID;
  551. self.func.nowFuncName = self.userFuncList[index].CNAME;
  552. self.userFuncList[index].showRightMenu = true;
  553. }
  554. //鼠标移除执行的事件
  555. self.closeRightMenu = function () {
  556. if (self.tabFixed) {
  557. } else {
  558. //self.initSearchFunc();
  559. self.userFuncList.forEach(function (item) {
  560. item.showRightMenu = false;
  561. })
  562. self.func.nowFuncCode = "";
  563. self.func.nowFuncName = "";
  564. }
  565. }
  566. self.openMenuTab = function (code, cname) {
  567. if (code == self.func.nowFuncCode && cname == self.func.nowFuncName) {
  568. return;
  569. //$(".sp-menu-tab").hide();
  570. //self.func.keyWord = "";
  571. //self.func.keyCondition = "";
  572. //self.func.nowFuncCode = "close";
  573. //self.func.nowFuncName = "close";
  574. } else {
  575. //code传空表示查看全部功能
  576. self.func.keyWord = "";
  577. self.func.keyCondition = "";
  578. self.func.nowFuncCode = code;
  579. self.func.nowFuncName = cname;
  580. var array = [];
  581. if (code == "") {
  582. self.func.normalTitle = "全部";
  583. self.func.normalList = [];
  584. self.func.allFuncList.forEach(function (item, index) {
  585. array.push(item);
  586. })
  587. } else {
  588. self.func.normalTitle = cname;
  589. self.func.normalList = [];
  590. self.func.allFuncList.forEach(function (item) {
  591. if (item.PARENTID == code) {
  592. array.push(item);
  593. }
  594. })
  595. }
  596. if (array.length > 12) {
  597. self.func.normalList = array.slice(0, 12);
  598. self.func.hideFunc = true;
  599. self.func.showFunc = false;
  600. } else {
  601. self.func.normalList = array;
  602. self.func.hideFunc = false;
  603. self.func.showFunc = false;
  604. }
  605. self.secondMenu = cname == "" ? "全部/" : cname + "/";
  606. $(".sp-menu-tab").show();
  607. }
  608. }
  609. self.closeMenuTab = function () {
  610. self.func.keyWord = "";
  611. self.func.keyCondition = "";
  612. //self.func.nowFuncCode = "close";
  613. //self.func.nowFuncName = "close";
  614. $(".sp-menu-tab").hide();
  615. }
  616. self.selectMenu = function (item) {
  617. if (item.FILEN != undefined && item.FILEN != '' && item.FILEN != null) {
  618. sp.addTabNav(item.PKID, item.CNAME, item.FILEN);
  619. }
  620. }
  621. //初始化搜索
  622. self.initSearchFunc = function () {
  623. self.func.keyWord = "";
  624. self.func.keyCondition = "";
  625. self.func.keyShow = false;
  626. self.func.keyPartList = []; //当前模块下所有符合关键字的模块列表
  627. self.func.keyPartListCopy = []; //当前模块下前12个符合关键字的模块列表
  628. self.func.keyAllList = []; //全局模块下所有符合关键字的模块列表
  629. self.func.keyAllListCopy = []; //全局模块下前12个符合关键字的模块列表
  630. self.func.keyPartShow = false;
  631. self.func.keyPartHide = false;
  632. self.func.keyAllShow = false;
  633. self.func.keyAllHide = false;
  634. }
  635. self.keyWordFunc = function () {
  636. console.log(self.func.allFuncList);
  637. if (self.func.keyWord == "") {
  638. self.initSearchFunc();
  639. } else {
  640. self.func.keyCondition = " 【关键字: " + self.func.keyWord + " 】";
  641. self.func.keyShow = true;
  642. var resultArray1 = [];
  643. var resultArray2 = [];
  644. self.func.allFuncList.forEach(function (item) {
  645. var index = item.CNAME.indexOf(self.func.keyWord);
  646. if (self.func.nowFuncCode == "") {
  647. } else {
  648. //当前模块下的筛选结果
  649. if (index >=0 && item.PARENTID == self.func.nowFuncCode) {
  650. resultArray1.push(item);
  651. }
  652. //其他模块下的全局筛选结果
  653. if (index >= 0 && item.PARENTID != self.func.nowFuncCode) {
  654. resultArray2.push(item);
  655. }
  656. }
  657. })
  658. self.func.keyPartList=angular.copy(resultArray1);
  659. self.func.keyAllList=angular.copy(resultArray2);
  660. if (resultArray1.length > 12) {
  661. self.func.keyPartListCopy = resultArray1.slice(0, 12);
  662. self.func.keyPartHide = true;
  663. self.func.keyPartShow = false;
  664. } else {
  665. self.func.keyPartListCopy = resultArray1;
  666. self.func.keyPartHide = false;
  667. self.func.keyPartShow = false;
  668. }
  669. if (resultArray2.length > 12) {
  670. self.func.keyAllListCopy = resultArray2.slice(0, 12);
  671. self.func.keyAllHide = true;
  672. self.func.keyAllShow = false;
  673. } else {
  674. self.func.keyAllListCopy = resultArray2;
  675. self.func.keyAllHide = false;
  676. self.func.keyAllShow = false;
  677. }
  678. }
  679. }
  680. self.clearKeyWordFunc = function () {
  681. self.func.keyWord = "";
  682. self.func.keyCondition = "";
  683. var resultArray = [];
  684. self.func.allFuncList.forEach(function (item) {
  685. if (self.func.nowFuncName == "") {
  686. resultArray.push(item);
  687. } else {
  688. if (item.PARENTID == self.func.nowFuncCode) {
  689. resultArray.push(item);
  690. }
  691. }
  692. })
  693. if (resultArray.length > 12) {
  694. self.func.normalList = resultArray.slice(0, 12);
  695. self.func.hideFunc = true;
  696. self.func.showFunc = false;
  697. } else {
  698. self.func.normalList = resultArray;
  699. self.func.hideFunc = false;
  700. self.func.showFunc = false;
  701. }
  702. }
  703. self.selectItemFunc = function (item) {
  704. //console.log(item.CNAME);
  705. //console.log(item.FILEN);
  706. if (item.OPENTYPE == "1") {
  707. window.open(item.FILEN);
  708. } else {
  709. sp.addTabNav(item.PKID, item.CNAME, item.FILEN);
  710. }
  711. self.addRecode(item.CNAME,item.FILEN);
  712. self.CrossPage(item);
  713. self.getUserRecentFunc();
  714. self.getUserFavoriteFunc();
  715. ////关闭左侧菜单
  716. $(".sp-menu-switch").addClass("hasClick");
  717. $(".sp-menu-list").fadeOut(200);
  718. }
  719. self.loadAllKindFunc = function (index) {
  720. //console.log(index);
  721. let array = angular.copy(self.userFuncList[index].C_H_I_L_D);
  722. self.userFuncList[index].COPYCHILD = array;
  723. self.userFuncList[index].hideFunc = false;
  724. self.userFuncList[index].showFunc = true;
  725. }
  726. self.loadPartKindFunc = function (index) {
  727. //console.log(index);
  728. let array = angular.copy(self.userFuncList[index].C_H_I_L_D);
  729. self.userFuncList[index].COPYCHILD = array.slice(0, 12);
  730. self.userFuncList[index].hideFunc = true;
  731. self.userFuncList[index].showFunc = false;
  732. }
  733. self.showKeyPartFunc=function(){
  734. self.func.keyPartListCopy=angular.copy(self.func.keyPartList);
  735. self.func.keyPartHide=false;
  736. self.func.keyPartShow=true;
  737. }
  738. self.hideKeyPartFunc=function(){
  739. self.func.keyPartListCopy=angular.copy(self.func.keyPartList).slice(0, 12);
  740. self.func.keyPartHide=true;
  741. self.func.keyPartShow=false;
  742. }
  743. self.showKeyAllFunc=function(){
  744. self.func.keyAllListCopy=angular.copy(self.func.keyAllList);
  745. self.func.keyAllHide=false;
  746. self.func.keyAllShow=true;
  747. }
  748. self.hideKeyAllFunc=function(){
  749. self.func.keyAllListCopy=angular.copy(self.func.keyAllList).slice(0, 12);
  750. self.func.keyAllHide=true;
  751. self.func.keyAllShow=false;
  752. }
  753. //桌面自定义流程人员初始化
  754. self.InitUser = function () {
  755. var data = {"userid": [], "mark": "1"}
  756. $http.post(apiurljs.login + "g2work/desktop/InitWorkflowCandoCustom", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  757. .success(function (obj) {
  758. var res = strToJson(s4.decryptData_CBC(obj.data));
  759. if (res.success) {
  760. sp.dialog("初始化成功!")
  761. $timeout(function () {
  762. sp.dialoghide()
  763. }, 1000)
  764. }
  765. })
  766. }
  767. self.usercard = {
  768. id: 0,
  769. userid: self.userId,
  770. username: self.userName,
  771. img: "AFrontEnd/css/icons/photo/02.jpg",
  772. DEPNAME: "",
  773. SBTIME: "",
  774. XBTIME: ""
  775. }
  776. self.addRecode=function (name,url) {
  777. var postData = {
  778. tablename: "SYS_LOG",
  779. data: {
  780. LOGTIME: sp.dateFtt("yyyy-MM-dd hh:mm:ss",new Date()),
  781. LOGIP: sp.myIP(),
  782. LOGUSER:self.userName,
  783. LOGFUNC:name,
  784. LOGFUNCURL:url,
  785. LOGAPI:"insertFormData输入参数",
  786. LOGAPIURL:"g2app/dataabase/insertFormData",
  787. LOGAPIPOST:"",
  788. REMARK:""
  789. }
  790. }
  791. var apiData={
  792. data:s4.encryptData_CBC(JSON.stringify(postData))
  793. }
  794. postData.data.LOGAPIPOST=JSON.stringify(apiData);
  795. $http.post(apiurljs.login + "g2app/Data/insertByDataid", { data: s4.encryptData_CBC(JSON.stringify(postData)) }, postCfg)
  796. .success(function (obj) {
  797. })
  798. }
  799. //跨页面记录日志参数
  800. self.CrossPage = function (obj) {
  801. CrossPage = {
  802. cname: obj.CNAME,
  803. ctime: sp.getLocalDate1(),
  804. type: 0
  805. }
  806. }
  807. //获取上传附件文件格式限制----20230517
  808. uploadformat = [];
  809. function getUploadFormat() {
  810. var data = { tablename: "CODE_UPLOADFORMAT" }
  811. $http.post(apiurljs.login + "g2app/DangAn/queryCodeData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  812. .success(function (obj) {
  813. var res = strToJson(s4.decryptData_CBC(obj.data));
  814. uploadformat = res.data;
  815. })
  816. };
  817. getUploadFormat()
  818. ////头部关键字搜索---20230905
  819. self.headBtnSearchKeyword = "";
  820. self.headSearchResult = [];
  821. self.headSearchResult_view = false;
  822. self.headBtnSearch = function () {
  823. if (sp.isval(self.headBtnSearchKeyword)) {
  824. self.headSearchResult = [];
  825. var data = {
  826. "url": "/basic/api/StatSelect/selectCodeList",
  827. "data": { "keyWord": self.headBtnSearchKeyword }
  828. }
  829. //console.log(JSON.stringify(data));
  830. $http.post(apiurljs.login + "g2app/yizhangtu/selectCodeList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  831. .success(function (obj) {
  832. var res = strToJson(s4.decryptData_CBC(obj.data));
  833. //console.log(JSON.stringify(res.data));
  834. self.headSearchResult = res.data.build;
  835. if (sp.isval(self.headSearchResult)) {
  836. self.headSearchResult_view = true;
  837. } else {
  838. self.headSearchResult_view = false;
  839. }
  840. })
  841. } else {
  842. self.headSearchResult_view = false;
  843. }
  844. };
  845. self.headKeywordPage = function (itemdata) {
  846. var get_token = localStorage.getItem("main-token");
  847. var set_url = "http://10.233.22.220/wholeProcessPage?token=" + get_token + "&name=" + itemdata.name + "&type=" + itemdata.type + "&id=" + itemdata.id + "";
  848. sp.addTabNav(itemdata.id, '一张图', set_url);
  849. self.headSearchResult_view = false;
  850. };
  851. //获取上班下班时间规则
  852. // self.queryRules = function () {
  853. // var data = {
  854. // sqlwhere: {}
  855. // }
  856. // $http.post(apiurljs.login + "g2app/Attendance/queryRules", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  857. // .success(function (obj) {
  858. // var res = strToJson(s4.decryptData_CBC(obj.data));
  859. // self.CARDSTART = res.data.STARTTIEM;
  860. // self.CARDEND = res.data.ENDTIME;
  861. // self.getDEPART()
  862. // })
  863. // }
  864. //获得当前人部门
  865. // self.getDEPART = function () {
  866. // var data = {
  867. // userid: self.usercard.userid
  868. // }
  869. // $http.post(apiurljs.login + "g2app/dataabase/queryDpName", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  870. // .success(function (obj) {
  871. // var res = strToJson(s4.decryptData_CBC(obj.data));
  872. // self.usercard.DEPNAME = res.data.length == 0 ? "" : res.data[0].SECTION;
  873. // })
  874. // }
  875. // self.queryRules()
  876. // self.card = function (n) {
  877. // var data = {
  878. // tablename: "ATTENDANCEMAN",
  879. // colums: "*,TO_CHAR(SBTIME,'hh24:mi:ss') as SBTIME1,TO_CHAR(XBTIME,'hh24:mi:ss') as XBTIME1",
  880. // order: "ID",
  881. // sqlwhere: {
  882. // CDATE: sp.format(sp.getLocalDate()),
  883. // CUSERID: self.usercard.userid
  884. // },
  885. // sqlinwhere: "",
  886. // sqllikewhere: ""
  887. // }
  888. // $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
  889. // .success(function (obj) {
  890. // var res = strToJson(s4.decryptData_CBC(obj.data));
  891. // if (res.data.length != 0) {
  892. // self.usercard = {
  893. // id: res.data[0].ID,
  894. // userid: self.usercard.userid,
  895. // username: self.usercard.username,
  896. // DEPNAME: self.usercard.DEPNAME,
  897. // SBTIME: res.data[0].SBTIME ? res.data[0].SBTIME1 : "",
  898. // XBTIME: res.data[0].XBTIME ? res.data[0].XBTIME1 : "",
  899. // DKSTATUS: res.data[0].DKSTATUS.split(",")[0]
  900. // }
  901. // }
  902. // $(".cardtime").html(sp.getLocalDate().slice(11, 19))
  903. // $interval(function () {
  904. // $(".cardtime").html(sp.getLocalDate().slice(11, 19))
  905. // }, 1000)
  906. // if (n == 0) {
  907. // sp.layer("#layer_card")
  908. // }
  909. // })
  910. // }
  911. // self.clickstatus = false;
  912. // self.clickCard = function () {
  913. // if (self.clickstatus == true || (self.usercard.SBTIME != '' && self.usercard.XBTIME != '')) {
  914. // return;
  915. // }
  916. // self.clickstatus = true;
  917. // if (self.usercard.id == 0) {
  918. // var data = {
  919. // tablename: "ATTENDANCEMAN",
  920. // data: {
  921. // CDATE: sp.format(sp.getLocalDate()),
  922. // CNAME: self.usercard.username,
  923. // CUSERID: self.usercard.userid,
  924. // DEPNAME: self.usercard.DEPNAME,
  925. // SBTIME: sp.format(sp.getLocalDate()) + " " + $(".cardtime").html(),
  926. // DKSTATUS: getDKSTATUS($(".cardtime").html(), 1)
  927. // }
  928. // }
  929. // $http.post(apiurljs.login + "g2app/dataabase/insertFormData", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
  930. // .success(function (obj) {
  931. // var res = strToJson(s4.decryptData_CBC(obj.data));
  932. // self.clickstatus = false;
  933. // if (res.success == true) {
  934. // self.card(1)
  935. // } else {
  936. // sp.layerhide()
  937. // sp.dialog(res.message)
  938. // }
  939. // })
  940. // } else {
  941. // var data = {
  942. // id: self.usercard.id,
  943. // tablename: "ATTENDANCEMAN",
  944. // data: {
  945. // CNAME: self.usercard.username,
  946. // CUSERID: self.usercard.userid,
  947. // DEPNAME: self.usercard.DEPNAME,
  948. // XBTIME: sp.format(sp.getLocalDate()) + " " + $(".cardtime").html(),
  949. // DKSTATUS: self.usercard.DKSTATUS + "," + getDKSTATUS($(".cardtime").html(), 2)
  950. // }
  951. // }
  952. // $http.post(apiurljs.login + "g2app/dataabase/upFormData", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
  953. // .success(function (obj) {
  954. // var res = strToJson(s4.decryptData_CBC(obj.data));
  955. // self.clickstatus = false;
  956. // if (res.success == true) {
  957. // self.card(1)
  958. // } else {
  959. // sp.layerhide()
  960. // sp.dialog(res.message)
  961. // }
  962. // })
  963. // }
  964. // }
  965. //获取服务器时间
  966. // self.getServerTime = function () {
  967. // var data = {
  968. // param: "yyyy-MM-dd HH:mm:ss"
  969. // }
  970. // $http.post(apiurljs.login + "g2app/calendar/queryServiceDate", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
  971. // .success(function (obj) {
  972. // var res = strToJson(s4.decryptData_CBC(obj.data));
  973. // self.ServerTime = res.data;
  974. // self.getREMINDTIME()
  975. // })
  976. // }
  977. //获取提醒时间
  978. // self.getREMINDTIME = function () {
  979. // var data = {
  980. // tablename: "CODE_REMINDTIME",
  981. // colums: "*",
  982. // order: "ID",
  983. // sqlwhere: "",
  984. // sqlinwhere: "",
  985. // sqllikewhere: ""
  986. // };
  987. // $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
  988. // .success(function (obj) {
  989. // var res = strToJson(s4.decryptData_CBC(obj.data));
  990. // self.REMINDTIME = res.data;
  991. // self.getFREQUENCY()
  992. // })
  993. // }
  994. //获取提醒频率
  995. // self.getFREQUENCY = function () {
  996. // var data = {
  997. // tablename: "CODE_FREQUENCY",
  998. // colums: "*",
  999. // order: "ID",
  1000. // sqlwhere: "",
  1001. // sqlinwhere: "",
  1002. // sqllikewhere: ""
  1003. // };
  1004. // $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
  1005. // .success(function (obj) {
  1006. // var res = strToJson(s4.decryptData_CBC(obj.data));
  1007. // self.FREQUENCY = res.data;
  1008. // self.getRemindList()
  1009. // })
  1010. // }
  1011. // self.getRemindList = function () {
  1012. // self.remindlist = []
  1013. // var data = {
  1014. // STRATDATE: sp.dateFtt("yyyy-MM-dd", new Date()),
  1015. // USERID: self.engName
  1016. // }
  1017. // $http.post(apiurljs.login + "g2app/calendar/queryDayData", {data: s4.encryptData_CBC(JSON.stringify(postData))}, postCfg)
  1018. // .success(function (obj) {
  1019. // var res = strToJson(s4.decryptData_CBC(obj.data));
  1020. // if (res.data.Items[0].task == null || res.data.Items[0].task == undefined || res.data.Items[0].task == "") {
  1021. // } else {
  1022. // self.remindlist = res.data.Items[0].task;
  1023. //
  1024. // self.remindlist.forEach(function (item) {
  1025. // self.REMINDTIME.forEach(function (item1) {
  1026. // if (item.REMINDTIME == item1.CODE) {
  1027. // item.REMINDTIME = item1.NUM * 3600000
  1028. // }
  1029. // })
  1030. // self.FREQUENCY.forEach(function (item1) {
  1031. // if (item.FREQUENCY == item1.CODE) {
  1032. // item.FREQUENCY = item1.NUM
  1033. // }
  1034. // })
  1035. // })
  1036. //
  1037. // //生成事项提醒循环
  1038. // var remindStart = [];
  1039. // $.each(self.remindlist, function (index, item) {
  1040. // remindStart[index] = $interval(function () {
  1041. // remindGoing(index);
  1042. // }, 1000)
  1043. // })
  1044. // var remindGoing = function (n) {
  1045. // remindWarning(self.remindlist[n], n)
  1046. // //判断循环是否停止
  1047. // if (self.ServerTime >= self.remindlist[n].STARTIME) {
  1048. // $interval.cancel(remindStart[n]);
  1049. // }
  1050. // }
  1051. // //到时提醒
  1052. // var remindWarning = function (obj, n) {
  1053. // var n = obj.FREQUENCY - 1;
  1054. // if (self.ServerTime == TimeToDate(obj.STARTIME, obj.REMINDTIME * n)) {
  1055. // sp.dialog(obj.MEETINGNAME + "第" + (obj.FREQUENCY - n) + "次提醒");
  1056. // $timeout(function () {
  1057. // n--
  1058. // sp.dialoghide()
  1059. // }, 5000)
  1060. // remindStart[obj.id + "times"] = $interval(function () {
  1061. // sp.dialog(obj.MEETINGNAME + "第" + (obj.FREQUENCY - n) + "次提醒");
  1062. // $timeout(function () {
  1063. // n--
  1064. // sp.dialoghide()
  1065. // }, 5000)
  1066. // }, obj.REMINDTIME, n)
  1067. // }
  1068. // }
  1069. // }
  1070. // });
  1071. // }
  1072. //self.getServerTime()
  1073. }])
  1074. var CrossPage = new Object();