indexNew2.js 50 KB

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