main_index.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/jquery.js"></script>
  6. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/language/cn.js"></script>
  7. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/main.js"></script>
  8. <script type="text/javascript" src="/nwyj/scripts/jquery/plugins/jquery.extension.util.js"></script>
  9. <link href="/nwyj/scripts/qui/libs/skins/flatBlue/style.css" rel="stylesheet" type="text/css"/>
  10. <link rel="stylesheet" type="text/css" href="/nwyj/css/main_index.css" />
  11. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/table/quiGrid.js" ></script>
  12. <script type="text/javascript" src="/nwyj/scripts/freamwork/com/sinosoft/system/right/userClickNum.js"></script>
  13. <script type="text/javascript" src="/nwyj/scripts/freamwork/com/sinosoft/system/right/main_index_iframe.js"></script>
  14. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/drag/dragSort.js"></script>
  15. <script type="text/javascript">
  16. //配置首页模块函数JSON
  17. /* var idxFunJson = {"getUserData":getUserData,
  18. "getResourceData":getResourceData,
  19. "getdaibanData":getdaibanData,
  20. "getAlertResponseData":getAlertResponseData,
  21. "getUrlData":getUrlData,
  22. "getWorkMenuData":getWorkMenuData,
  23. "loadDuty":loadDuty,
  24. "getGongGaoData":getGongGaoData,
  25. "getStrendIframeData":getStrendIframeData,
  26. "getImportentUserOutageStrend":getImportentUserOutageStrend,
  27. "getLineTripSumStrend":getLineTripSumStrend,
  28. "getNwyjModuleData":getNwyjModuleData}; */
  29. var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  30. var role_id = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
  31. var comp_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  32. var real_name = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  33. var corp_names = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  34. var rolenames = top.com.sinosoft.lz.system.user.LoginInfo.getRolenames();
  35. var logindate = top.com.sinosoft.lz.system.user.LoginInfo.getLogin_date();
  36. var logintime = top.com.sinosoft.lz.system.user.LoginInfo.getLogin_time();
  37. var dept_id = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  38. var deptnames = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
  39. var parent_ids = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
  40. var saphruserid = top.com.sinosoft.lz.system.user.LoginInfo.getSaphruserid();
  41. var user_menu_data = [{
  42. fd_id:"11111",
  43. li_id:"index_left_4",
  44. title:"个人信息",
  45. module_fun:"getUserData",
  46. ul_id:"left_list"
  47. },{
  48. fd_id:"11111",
  49. li_id:"index_left_1",
  50. title:"常用菜单管理",
  51. module_fun:"getWorkMenuData",
  52. ul_id:"left_list"
  53. /* },{
  54. fd_id:"11111",
  55. li_id:"index_left_3",
  56. title:"专业系统集成",
  57. module_fun:"getUrlData",
  58. ul_id:"left_list"
  59. },{
  60. fd_id:"11111",
  61. li_id:"index_right_6",
  62. title:"公告",
  63. module_fun:"getGongGaoData",
  64. ul_id:"right_list" */
  65. },{
  66. fd_id:"11111",
  67. li_id:"index_right_2",
  68. title:"值班信息",
  69. module_fun:"loadDuty",
  70. ul_id:"right_list"
  71. }];
  72. $(function(){
  73. /* 置顶图标固定位置 */
  74. $(top.window).scroll( function() {
  75. var _thisScroll = $(this);
  76. var scroH = _thisScroll.scrollTop();
  77. if(scroH>200){
  78. $(".fixItem").css({"top":scroH+200+"px"});
  79. $("#toTop").show();
  80. }else{
  81. $(".fixItem").css({"top":scroH+200+"px"});
  82. $("#toTop").hide();
  83. }
  84. scroH = null;
  85. _thisScroll = null;
  86. });
  87. /* 置顶图标固定位置 */
  88. //设置初始页面最小高度
  89. var parentHeightidx = window.screen.height;
  90. $(parent.document.body).find("#frmright").css("min-height",parentHeightidx-255);
  91. parentHeightidx = null;
  92. if(comp_id==null||comp_id==""){
  93. top.Dialog.alert("此用户未设置公司,不能访问首页!");
  94. return;
  95. }
  96. //设置高度
  97. resetpageheight();
  98. //initLiCont(user_menu_data,0);
  99. //取用户初始数据
  100. $.ajax({
  101. url : $.pathname() +'/ws/moduleobj/getModuleByUserId/',
  102. type : 'post',
  103. data : {
  104. user_id:user_id
  105. },
  106. dataType : 'json',
  107. async:false,
  108. success : function(data) {
  109. //console.log(data);
  110. if(data.state == "ok"&&data.length == 0){//如果为空,则初始话默认数据
  111. initLiCont(user_menu_data,0);
  112. }else{//加载内容
  113. initLiCont (data.resultData,1);
  114. }
  115. },
  116. error : function(e) {
  117. try{
  118. top.Dialog.alert('访问服务失败!');
  119. }catch(e){
  120. }
  121. }
  122. });
  123. });
  124. /**初始化左右li框架
  125. *idxType 分0、其他
  126. *0、代表用户没有模块数据 其他、代表用户有模块数据
  127. */
  128. function initLiCont (userModuleData,idxType) {
  129. //console.log(userModuleData);
  130. //储存用户模块为空时候初始值信息
  131. var moduleData = "";
  132. for(var i=0;i < userModuleData.length;i++){
  133. var data = userModuleData[i];
  134. var moduleFun = trim(data.module_fun);
  135. var ul_id = trim(data.ul_id);
  136. var li_id = trim(data.li_id);
  137. var li_title = trim(data.title);
  138. var module_url = trim(data.module_url);
  139. var moduleWidth = "";
  140. var moduleHeight = "";
  141. var $cont = $("#"+ul_id).last();
  142. //加载模块初始话数据
  143. moduleData += (li_id+"|"+(i<10?'0'+i:i)+"|0,");
  144. var lihtml = ('<li class="shedu_cont li_cont" id="'+li_id+'" >'
  145. + '<div class="content_title"><span class="title_text">'+li_title+'</span></div>'
  146. + '<div class = "content_btn" style="display: none;" >'
  147. + '<span class="freshing freshimg1" title="刷新" onclick="moduleFresh(\''+li_id+'\',\''+module_url+'\',\''+moduleFun+'\',\''+moduleWidth+'\',\''+moduleHeight+'\');" id="freshing'+li_id+'" ></span>'
  148. + '<span class="closeimg cont_close1 " title="删除" ></span>'
  149. + '</div>'
  150. + '<div class="content_cont" id="cont'+li_id+'" style="min-height:70px">'
  151. + '<div class="idxModule_content"></div>'
  152. + '<div class="idxModule-loading-bg" style="display: block;"></div>'
  153. + '<div class="idxModule-loading-box" style="display: block;"><span>正在加载...</span></div>'
  154. + '</div>'
  155. +'</li>');
  156. $cont.append(lihtml);
  157. var $liList = $cont.find(".li_cont").last();
  158. //储存数据
  159. $liList.data("li_id",li_id);
  160. $liList.data("module_url",module_url);
  161. $liList.data("module_fun",moduleFun);
  162. //加载函数,加载内容
  163. runSelectFun(li_id,module_url,moduleFun,moduleWidth,moduleHeight);
  164. /* var jsFun = idxFunJson[moduleFun];
  165. jsFun(li_id,module_url,moduleWidth,moduleHeight);
  166. jsFun = null; */
  167. liList = null;
  168. $liList = null;
  169. $cont = null;
  170. }
  171. //设置模块标题事件
  172. setTitleFun();
  173. //当新用户没有模块数据时,向服务器写入初始数据
  174. if(idxType==0){
  175. setModuleData(moduleData,0);
  176. moduleData=null;
  177. }
  178. //设置
  179. //$("#left_list").append($('<dt class="clear"></dt>'));
  180. //$("#rigth_list").append($('<dt class="clear"></dt>'));
  181. /*块拖拽 */
  182. $("#right_list ,#left_list").dragSort({
  183. itemSelector: ".li_cont",
  184. dragSelector: ".content_title",
  185. dragBetween: false,
  186. dragEnd: saveOrder,
  187. placeHolderTemplate: "<li class='placeHolder'><div></div></li>"
  188. });
  189. //设置高度
  190. //resetpageheight();
  191. }
  192. /**
  193. * 配置函数
  194. */
  195. function runSelectFun(idx,url,moduleFun,moduleWidth,moduleHeight){
  196. switch (moduleFun) {
  197. case "getUserData": getUserData(idx,url,moduleWidth,moduleHeight); break;
  198. case "getResourceData": getResourceData(idx,url,moduleWidth,moduleHeight); break;
  199. case "getdaibanData": getdaibanData(idx,url,moduleWidth,moduleHeight); break;
  200. case "getAlertResponseData":getAlertResponseData(idx,url,moduleWidth,moduleHeight);break;
  201. case "getUrlData": getUrlData(idx,url,moduleWidth,moduleHeight); break;
  202. case "getWorkMenuData": getWorkMenuData(idx,url,moduleWidth,moduleHeight);break;
  203. case "loadDuty": loadDuty(idx,url,moduleWidth,moduleHeight); break;
  204. case "getGongGaoData": getGongGaoData(idx,url,moduleWidth,moduleHeight); break;
  205. case "getStrendIframeData": getStrendIframeData(idx,url,moduleWidth,moduleHeight); break;
  206. case "getImportentUserOutageStrend":getImportentUserOutageStrend(idx,url,moduleWidth,moduleHeight);break;
  207. case "getLineTripSumStrend":getLineTripSumStrend(idx,url,moduleWidth,moduleHeight); break;
  208. case "getNwyjModuleData": getNwyjModuleData(idx,url,moduleWidth,moduleHeight); break;
  209. case "getGZXTModuleData": getGZXTModuleData(idx,url,moduleWidth,moduleHeight); break;
  210. case "getAccessoryData": getAccessoryData(idx,url,moduleWidth,moduleHeight); break;
  211. }
  212. }
  213. /**
  214. * 模块刷新
  215. */
  216. function moduleFresh(idx,url,moduleFun,moduleWidth,moduleHeight){
  217. if("getdaibanData"!=moduleFun&&"loadDuty"!=moduleFun){
  218. $("#cont"+idx).find(".idxModule_content").last().html("");
  219. }
  220. showLoading(idx);
  221. setTimeout(function(){
  222. if(moduleFun=="getdaibanData"){
  223. getdaibanAjax();
  224. }else if(moduleFun=="loadDuty"){
  225. $(".changeDate").eq(1).click();
  226. }else{
  227. runSelectFun(idx,url,moduleFun,moduleWidth,moduleHeight);
  228. }
  229. },500);
  230. }
  231. /**
  232. * 隐藏加载动画
  233. */
  234. function hideLoading(idx){
  235. $("#cont"+idx).find(".idxModule-loading-box").css("display","none");
  236. $("#cont"+idx).find(".idxModule-loading-bg").css("display","none");
  237. }
  238. /**
  239. * 显示加载动画
  240. */
  241. function showLoading(idx){
  242. $("#cont"+idx).find(".idxModule-loading-box").css("display","block");
  243. $("#cont"+idx).find(".idxModule-loading-bg").css("display","block");
  244. }
  245. /**
  246. * 设置模块标题事件
  247. */
  248. function setTitleFun(){
  249. /*移除按钮的监听方法 */
  250. $(".closeimg").bind("mouseenter",function(){
  251. //console.log("closeimg=============>>>>进");
  252. $(this).removeClass("cont_close1").addClass("cont_close2");
  253. });
  254. $(".closeimg").bind("mouseleave",function(){
  255. //console.log("closeimg=============>>>>出");
  256. $(this).removeClass("cont_close2").addClass("cont_close1");
  257. });
  258. $(".closeimg").bind("click",function(){
  259. var title_li_id = $(this).parent().parent().attr("id");
  260. delectModule(title_li_id);
  261. title_li_id=null;
  262. });
  263. $(".freshing").bind("mouseenter",function(){
  264. //console.log("closeimg=============>>>>进");
  265. $(this).removeClass("freshimg1").addClass("freshimg2");
  266. });
  267. $(".freshing").bind("mouseleave",function(){
  268. //console.log("closeimg=============>>>>出");
  269. $(this).removeClass("freshimg2").addClass("freshimg1");
  270. });
  271. /*模块区域监听方法 */
  272. $(".li_cont").bind("mouseover",function(){
  273. $(this).find(".content_btn").show();
  274. });
  275. $(".li_cont").bind("mouseout",function(){
  276. $(this).find(".content_btn").hide();
  277. });
  278. }
  279. //删除模块数据
  280. function delectModule(li_id){
  281. li_id = trim(li_id);
  282. var $dom = $("#"+li_id);
  283. $.ajax({
  284. url : $.pathname() +'/ws/moduleobj/delectModult/',
  285. type : 'post',
  286. data : {
  287. user_id:user_id,
  288. li_id:li_id
  289. },
  290. dataType : 'text',
  291. async:false,
  292. success : function(data) {
  293. if(data=="error"){
  294. top.Dialog.alert('修改数据失败!');
  295. }else{
  296. $dom.remove();
  297. resetpageheight();
  298. }
  299. $dom = null;
  300. },
  301. error : function(e) {
  302. try{
  303. top.Dialog.alert('访问服务失败!');
  304. }catch(e){
  305. }
  306. $dom = null;
  307. }
  308. });
  309. }
  310. //高度处理
  311. function resetpageheight(){
  312. var leftHeight = $("#left_list").height();
  313. var rightHeight = $("#right_list").height()
  314. var height = leftHeight>rightHeight?leftHeight:rightHeight;
  315. $(window.document.body).height(height);
  316. $(parent.document.body).find("#frmright").css("height",$(window.document.body).height()+30);
  317. leftHeight = null;
  318. rightHeight = null;
  319. height = null;
  320. }
  321. //排序的方法
  322. function saveOrder() {
  323. //var serialStr = "";
  324. var sortData = "";
  325. $(".li_cont").each(function(item, elm) {
  326. //排序li
  327. //serialStr += (item > 0 ? "|" : "") +item/* $(elm).children().html()*/;
  328. //排序module
  329. sortData = trim($(elm).data("li_id"))+"|"+(item<10?'0'+item:item)+"|0,"+sortData;
  330. });
  331. //将排序的数据保存到服务器
  332. //console.log(serialStr);
  333. setModuleData(sortData,2);
  334. //$("input[name=listSortOrder]").val(serialStr);
  335. //serialStr = null;
  336. sortData=null;
  337. };
  338. //创建选择模块弹框
  339. function openDialog(){
  340. var diag = new top.Dialog();
  341. diag.Title = "所有模块";
  342. diag.ShowMaxButton=true;
  343. diag.ShowMinButton=false;
  344. diag.Width= 730;
  345. diag.Height=350;
  346. diag.ButtonAlign="center";
  347. diag.Drag=true;
  348. //点击确定按钮的监听方法
  349. diag.OKEvent = function(){
  350. var inputValue = diag.innerFrame.contentWindow.getDateToParent();
  351. var currentData = inputValue.current;
  352. var beforeData = inputValue.before;
  353. var modulelist = "";
  354. //排序计数
  355. var sort = 0;
  356. //解析需要删除的数据
  357. for(var j=0;j<beforeData.length;j++){
  358. modulelist = beforeData[j]+"|"+(sort<10?'0'+sort:sort)+"|1,"+modulelist;
  359. sort++;
  360. }
  361. //解析需要存入数据
  362. for(var i=0;i<currentData.length;i++){
  363. modulelist = currentData[i]+"|"+(sort<10?'0'+sort:sort)+"|0,"+modulelist;
  364. sort++;
  365. }
  366. //向服务器写入需要改变的数据
  367. setModuleData(modulelist,1);
  368. diag.close();
  369. inputValue = null;
  370. modulelist = null;
  371. sort = null;
  372. };
  373. diag.URL = "/nwyj/page/all_module.jsp";
  374. diag.ShowButtonRow=true;
  375. diag.show();
  376. }
  377. /**
  378. * 修改用户的模块信息
  379. * idxType的值有 0,1,其他,
  380. 0、代表用户没有数据时,初始数据
  381. 1、从左右模块中选择的数据
  382. 其他、排序的数据
  383. */
  384. function setModuleData (modulelist,idxType){
  385. $.ajax({
  386. url : $.pathname() +'/ws/moduleobj/addModuleByUserId/',
  387. type : 'post',
  388. async:false,
  389. data : {
  390. user_id:user_id,
  391. list_data:modulelist
  392. },
  393. dataType : 'text',
  394. success : function(data) {
  395. if(data=="error"){
  396. top.Dialog.alert('修改数据失败!');
  397. }else{
  398. if(idxType==0){//当没有数据时,初始数据
  399. //$.messager.show(0,"您还没有选择任何模块信息,系统已经初始化了一个模块!");
  400. }else if(idxType==1){//从左右模块中选择的数据
  401. window.location.reload();
  402. }else{//排序的数据
  403. resetpageheight();
  404. }
  405. }
  406. },
  407. error : function(e) {
  408. top.Dialog.alert('查询失败!');
  409. }
  410. });
  411. }
  412. function openQuestion(){
  413. var diag = new top.Dialog();
  414. diag.Title = "我的帮助";
  415. /* diag.Width= 730;
  416. diag.Height=390; */
  417. diag.Width = 510;
  418. diag.Height = 390;
  419. diag.Drag=true;
  420. diag.URL = "/nwyj/page/system/questionHuiZong/questionHuiZong_Add.jsp?diag="+diag;
  421. diag.show();
  422. diag.CancelEvent = function(){
  423. diag.close();
  424. diag=null;
  425. };
  426. }
  427. function openMsgBtn(){
  428. //blankopenNext("/nwyj/page/system/message/SendMsg.html");
  429. windowOpenNext("/nwyj/page/system/sms/addMsg.html");
  430. //alert("msg");
  431. /* var diag = new top.Dialog();
  432. diag.Title = "发送消息";
  433. diag.Width= 730;
  434. diag.Height=390;
  435. diag.Drag=true;
  436. diag.URL = "/nwyj/page/system/message/SendMsg.html";
  437. diag.show();
  438. diag.CancelEvent = function(){
  439. diag.close();
  440. diag=null;
  441. }; */
  442. }
  443. //删除左右两端的空格
  444. function trim(str){
  445. if(str!=null){
  446.   return str.replace(/(^\s*)|(\s*$)/g, "");
  447. }
  448. return str;
  449. }
  450. </script>
  451. </head>
  452. <body>
  453. <div class="fixItem" id="idxfixItem">
  454. <div id="toTop" style="display: none;" onclick="script:top.window.scrollTo(0,0);">
  455. <!-- <a href="#indexTop"><img src="/nwyj/images/index/to_top.png" /></a> -->
  456. <a href="javascript:;"><img src="/nwyj/images/index/to_top.png" /></a>
  457. </div>
  458. <div id="" onclick="openDialog();">
  459. <a href="javascript:;"><img src="/nwyj/images/index/add_div.png" /></a>
  460. <span class="floating_left">自定义组件</span>
  461. </div>
  462. <div id="" onclick="openQuestion();">
  463. <a href="javascript:;"><img src="/nwyj/images/index/que_img.png" /></a>
  464. <span class="floating_left">BUG/提问</span>
  465. </div>
  466. <div id="" onclick="openMsgBtn();">
  467. <a href="javascript:;"><img src="/nwyj/images/index/fix_msg.png" /></a>
  468. <span class="floating_left">发送短信</span>
  469. </div>
  470. </div>
  471. <div class="module-content" id="indexTop">
  472. <ul id="left_list" class="ul_cont">
  473. <!-- <li class="shedu_cont li_cont" >
  474. <div class="content_title"><span class="title_text">测试模块</span></div>
  475. <div class="content_btn" style="display: none;" >
  476. <span class="freshing freshimg1" title="刷新" onclick="moduleFresh();" ></span>
  477. <span class="closeimg cont_close1 " title="删除" ></span>
  478. </div>
  479. <div class="content_cont" style="min-height:200px">
  480. <div class="idxModule_content"></div>
  481. <div class="idxModule-loading-bg" style="display: block;"></div>
  482. <div class="idxModule-loading-box" style="display: block;"><span>正在加载...</span></div>
  483. </div>
  484. </li> -->
  485. </ul>
  486. <ul id="right_list" class="ul_cont">
  487. </ul>
  488. <input name="listSortOrder" type="hidden" />
  489. </div>
  490. </body>
  491. </html>