indexdata.js 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. var prjKey = "";
  2. function loadLeftMenu() {
  3. var prjKey = $("[name='prjKey']").val();
  4. var params = {
  5. "prjType" : "2",
  6. "prjKey" : prjKey
  7. };
  8. sendAsyncAjax(params, "toMain.do", "json", loadLeftMenuProcess);
  9. }
  10. function loadLeftMenuProcess(data) {
  11. var html = '';
  12. for (var i = 0; i < data.length; i++) {
  13. html += '<div title="' + data[i].text + '">';
  14. html += '<div style="height: 7px;"></div>';
  15. html += '<ul id="' + data[i].key
  16. + '" class="tree" style="margin-top: 3px;">';
  17. html += '</div> ';
  18. }
  19. if (html != '') {
  20. $("#accordion1").append($(html));
  21. }
  22. loadAccord();
  23. }
  24. function f_tree(treeId) {
  25. var raRegExp = new RegExp(":", "g");
  26. var url = "loadMenu.do?key=" + treeId + "&prjKey=" + prjKey + "&t="
  27. + new Date().getTime();
  28. url = url.replace(raRegExp, "__");
  29. treeId = treeId.replace(raRegExp, "\\:");
  30. $("#" + treeId).ligerTree(
  31. {
  32. url : url,
  33. checkbox : false,
  34. slide : false,
  35. openFolderEven : true,
  36. nodeWidth : 120,
  37. attribute : [ 'nodename', 'url', 'hide', 'target' ],
  38. onSelect : function(node) {
  39. if (node.data == null || !node.data.url)
  40. return;
  41. var tabid = $(node.target).attr("tabid");
  42. if (!tabid) {
  43. tabid = node.data.url;
  44. $(node.target).attr("tabid", tabid);
  45. }
  46. var target = node.data.target;
  47. if (target == '_blank') {
  48. window.open(node.data.url, node.data.text);
  49. } else {
  50. var isSms = node.data.isSms; // sms-chenjb-change
  51. if (isSms == "1") {
  52. f_addTab(tabid, node.data.text,
  53. "SmsAction.do?task=validate_sms&return_tab="
  54. + node.data.url);
  55. } else {
  56. f_addTab(tabid, node.data.text, node.data.url);
  57. }
  58. }
  59. },
  60. onAppend : function(parentNode, newdata) {
  61. if (newdata.length == 1 && newdata[0] == null) {
  62. $("#" + treeId).parent().prev().remove();
  63. $("#" + treeId).parent().remove();
  64. }
  65. },
  66. onSuccess : function(e) {
  67. if (!e[0])
  68. return;
  69. var from = e[0].text;
  70. $(".l-ln").each(function() {
  71. var obj = $(this).parent();
  72. var tree = $(this).parents(".l-tree");
  73. var target = "-" + $(tree).attr("id");
  74. if (from == target) {
  75. $(obj).height($(this).height());
  76. }
  77. });
  78. }
  79. });
  80. }
  81. function toRecList() {
  82. var tabid = "ligerui" + new Date().toDateString();
  83. addTab(tabid, "消息接收列表", "toRecieveMsgList.do?date=" + new Date());
  84. }
  85. function changeDept() {
  86. var cot = $("#followDepts").html();
  87. dialog = $.ligerDialog.open({
  88. title : '在职部门',
  89. content : cot
  90. });
  91. }
  92. function changeFaces() {
  93. var cot = $("#indexfaces").html();
  94. dialog = $.ligerDialog.open({
  95. title : '选择皮肤',
  96. content : cot
  97. });
  98. }
  99. function loadClient() {
  100. var cot = $("#dclient").html();
  101. dialog = $.ligerDialog.open({
  102. title : '下载EU客户端',
  103. content : cot
  104. });
  105. }
  106. function logoutSystem() {
  107. var rs = confirm("是否退出系统");
  108. if (rs == true)
  109. submitTargetAUrl("logout.do", "_top");
  110. if (rs == false)
  111. return false;
  112. }
  113. function hide() {
  114. $("#heard1").hide();
  115. $("body").removeClass("index_body_hidden");
  116. $("#heard").removeClass("heard_hidden");
  117. $("#heard").height("35px");
  118. $("#er_heard").height("35px");
  119. $(".heard1_1_2").html();
  120. layout._onResize();
  121. }
  122. function show() {
  123. $("#heard1").show();
  124. $("body").addClass("index_body_hidden");
  125. $("#heard").addClass("heard_hidden");
  126. $("#heard").height("90px");
  127. $("#er_heard").height("90px");
  128. layout._onResize();
  129. }
  130. function hide2() {
  131. $(".heard1_1_1").hide();
  132. $("#weather_show").hide();
  133. $(".time").hide();
  134. $(".heard1_3").hide();
  135. $("body").removeClass("index_body_hidden");
  136. $("#heard").removeClass("heard_hidden");
  137. $("#heard").height("35px");
  138. $("#er_heard").height("35px");
  139. $(".heard1_1_2").html();
  140. // liger/lib/ligerUI/skins/Aqua/images/index/down.png
  141. $("#hidetop")
  142. .css("background",
  143. "url(liger/lib/ligerUI/skins/Aqua/images/index/down.png) no-repeat center left");
  144. $("#hidetop").hover(function() {
  145. $("#hidetop")
  146. .css("background",
  147. "url(liger/lib/ligerUI/skins/Aqua/images/index/down_hover.png) no-repeat center left");
  148. },function() {
  149. $("#hidetop")
  150. .css("background",
  151. "url(liger/lib/ligerUI/skins/Aqua/images/index/down.png) no-repeat center left");
  152. });
  153. // $("#hidetop").text("显示顶部");
  154. $("#hidetop").attr("title","显示顶部");
  155. document.getElementById('hidetop').onclick = function() {
  156. show2();
  157. };
  158. layout._onResize();
  159. }
  160. function show2() {
  161. $(".heard1_1_1").show();
  162. $("#weather_show").show();
  163. $(".time").show();
  164. $(".heard1_3").show();
  165. $("body").addClass("index_body_hidden");
  166. $("#heard").addClass("heard_hidden");
  167. $("#heard").height("90px");
  168. $("#er_heard").height("90px");
  169. $("#hidetop")
  170. .css("background",
  171. "url(liger/lib/ligerUI/skins/Aqua/images/index/up.png) no-repeat center left");
  172. // $("#hidetop").text("隐藏顶部");
  173. $("#hidetop").attr("title","隐藏顶部");
  174. $("#hidetop").hover(function() {
  175. $("#hidetop")
  176. .css("background",
  177. "url(liger/lib/ligerUI/skins/Aqua/images/index/up_hover.png) no-repeat center left");
  178. },function() {
  179. $("#hidetop")
  180. .css("background",
  181. "url(liger/lib/ligerUI/skins/Aqua/images/index/up.png) no-repeat center left");
  182. });
  183. document.getElementById('hidetop').onclick = function() {
  184. hide2();
  185. };
  186. layout._onResize();
  187. }
  188. function showDutyMsg() {
  189. $.ligerDialog.open({
  190. width : 380,
  191. height : 400,
  192. title : '岗位职责',
  193. url : 'getPositionDes.do'
  194. });
  195. }
  196. function headHide() {
  197. if (navigator.appName == "Microsoft Internet Explorer"
  198. && navigator.appVersion.match(/7./i) == "7.") {
  199. $("#showtop").hide();
  200. $("#hidetop").hide();
  201. } else {
  202. $("#showtop").show();
  203. $("#hidetop").show();
  204. }
  205. }
  206. function loadMenu(e) {
  207. var treeId = $(".tree", $(e).next()).attr("id");
  208. var h = $("li", $(".tree", $(e).next()));
  209. if (h.length != 0)
  210. return;
  211. f_tree(treeId);
  212. manager = $("#" + treeId).ligerGetTreeManager();
  213. if (manager == null)
  214. return;
  215. manager.expandAll();
  216. }
  217. function changeMenu(e, prname) {
  218. $(".l-layout-header-inner").html(prname);
  219. var param = {
  220. 'prjType' : '1',
  221. 'prjKey' : e
  222. };
  223. prjKey = e;
  224. sendAsyncAjax(param, "toMain.do", "html", backCall);
  225. }
  226. function backCall(data) {
  227. $("#accordion1").empty();
  228. $("#accordion1").append(data);
  229. accordion._render();
  230. }
  231. function findTabContent() {
  232. tab = $("#framecenter").ligerGetTabManager();
  233. return tab;
  234. }
  235. function f_heightChanged(options) {
  236. if (tab)
  237. tab.addHeight(options.diff);
  238. if (accordion && options.middleHeight - 24 > 0)
  239. accordion.setHeight(options.middleHeight - 24);
  240. }
  241. function f_addTab(tabid, text, url) {
  242. // 2014-11-14 cxx 点击菜单刷新页面
  243. if (tab.isTabItemExist(tabid)) {
  244. tab.selectTabItem(tabid);
  245. tab.reload(tabid);
  246. } else {
  247. tab.addTabItem({
  248. tabid : tabid,
  249. text : text,
  250. url : url
  251. });
  252. }
  253. }
  254. function f_closeTab(tabid) {
  255. tab.removeTabItem(tabid);
  256. // tab.removeSelectedTabItem();
  257. }
  258. function f_reloadTab(tabid) {
  259. tab.reload(tabid);
  260. }
  261. function f_selectTab(tabid) {
  262. tab.selectTabItem(tabid);
  263. }
  264. function successMsg(msg) {
  265. $.ligerDialog.success(msg);
  266. }
  267. function errorMsg(msg) {
  268. $.ligerDialog.error(msg);
  269. }
  270. function confirmDialog(content, backValidate) {
  271. $.ligerDialog.confirm(content, backValidate);
  272. }
  273. function openDialog(option) {
  274. return $.ligerDialog.open(option);
  275. }
  276. function waitMsg(msg, time) {
  277. $.ligerDialog.waitting(msg);
  278. setTimeout(function() {
  279. $.ligerDialog.closeWaitting();
  280. }, time);
  281. }
  282. function configType() {
  283. $("#client").val("1");
  284. }
  285. function loadConfigType() {
  286. return $("#client").val();
  287. }