main_index_test.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  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_now.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 "getAccessoryData": getAccessoryData(idx,url,moduleWidth,moduleHeight); break;
  210. }
  211. }
  212. /**
  213. * 模块刷新
  214. */
  215. function moduleFresh(idx,url,moduleFun,moduleWidth,moduleHeight){
  216. if("getdaibanData"!=moduleFun&&"loadDuty"!=moduleFun){
  217. $("#cont"+idx).find(".idxModule_content").last().html("");
  218. }
  219. showLoading(idx);
  220. setTimeout(function(){
  221. if(moduleFun=="getdaibanData"){
  222. getdaibanAjax();
  223. }else if(moduleFun=="loadDuty"){
  224. $(".changeDate").eq(1).click();
  225. }else{
  226. runSelectFun(idx,url,moduleFun,moduleWidth,moduleHeight);
  227. }
  228. },500);
  229. }
  230. /**
  231. * 隐藏加载动画
  232. */
  233. function hideLoading(idx){
  234. $("#cont"+idx).find(".idxModule-loading-box").css("display","none");
  235. $("#cont"+idx).find(".idxModule-loading-bg").css("display","none");
  236. }
  237. /**
  238. * 显示加载动画
  239. */
  240. function showLoading(idx){
  241. $("#cont"+idx).find(".idxModule-loading-box").css("display","block");
  242. $("#cont"+idx).find(".idxModule-loading-bg").css("display","block");
  243. }
  244. /**
  245. * 设置模块标题事件
  246. */
  247. function setTitleFun(){
  248. /*移除按钮的监听方法 */
  249. $(".closeimg").bind("mouseenter",function(){
  250. //console.log("closeimg=============>>>>进");
  251. $(this).removeClass("cont_close1").addClass("cont_close2");
  252. });
  253. $(".closeimg").bind("mouseleave",function(){
  254. //console.log("closeimg=============>>>>出");
  255. $(this).removeClass("cont_close2").addClass("cont_close1");
  256. });
  257. $(".closeimg").bind("click",function(){
  258. var title_li_id = $(this).parent().parent().attr("id");
  259. delectModule(title_li_id);
  260. title_li_id=null;
  261. });
  262. $(".freshing").bind("mouseenter",function(){
  263. //console.log("closeimg=============>>>>进");
  264. $(this).removeClass("freshimg1").addClass("freshimg2");
  265. });
  266. $(".freshing").bind("mouseleave",function(){
  267. //console.log("closeimg=============>>>>出");
  268. $(this).removeClass("freshimg2").addClass("freshimg1");
  269. });
  270. /*模块区域监听方法 */
  271. $(".li_cont").bind("mouseover",function(){
  272. $(this).find(".content_btn").show();
  273. });
  274. $(".li_cont").bind("mouseout",function(){
  275. $(this).find(".content_btn").hide();
  276. });
  277. }
  278. //删除模块数据
  279. function delectModule(li_id){
  280. li_id = trim(li_id);
  281. var $dom = $("#"+li_id);
  282. $.ajax({
  283. url : $.pathname() +'/ws/moduleobj/delectModult/',
  284. type : 'post',
  285. data : {
  286. user_id:user_id,
  287. li_id:li_id
  288. },
  289. dataType : 'text',
  290. async:false,
  291. success : function(data) {
  292. if(data=="error"){
  293. top.Dialog.alert('修改数据失败!');
  294. }else{
  295. $dom.remove();
  296. resetpageheight();
  297. }
  298. $dom = null;
  299. },
  300. error : function(e) {
  301. try{
  302. top.Dialog.alert('访问服务失败!');
  303. }catch(e){
  304. }
  305. $dom = null;
  306. }
  307. });
  308. }
  309. //高度处理
  310. function resetpageheight(){
  311. var leftHeight = $("#left_list").height();
  312. var rightHeight = $("#right_list").height()
  313. var height = leftHeight>rightHeight?leftHeight:rightHeight;
  314. $(window.document.body).height(height);
  315. $(parent.document.body).find("#frmright").css("height",$(window.document.body).height()+30);
  316. leftHeight = null;
  317. rightHeight = null;
  318. height = null;
  319. }
  320. //排序的方法
  321. function saveOrder() {
  322. //var serialStr = "";
  323. var sortData = "";
  324. $(".li_cont").each(function(item, elm) {
  325. //排序li
  326. //serialStr += (item > 0 ? "|" : "") +item/* $(elm).children().html()*/;
  327. //排序module
  328. sortData = trim($(elm).data("li_id"))+"|"+(item<10?'0'+item:item)+"|0,"+sortData;
  329. });
  330. //将排序的数据保存到服务器
  331. //console.log(serialStr);
  332. setModuleData(sortData,2);
  333. //$("input[name=listSortOrder]").val(serialStr);
  334. //serialStr = null;
  335. sortData=null;
  336. };
  337. //创建选择模块弹框
  338. function openDialog(){
  339. var diag = new top.Dialog();
  340. diag.Title = "所有模块";
  341. diag.ShowMaxButton=true;
  342. diag.ShowMinButton=false;
  343. diag.Width= 730;
  344. diag.Height=350;
  345. diag.ButtonAlign="center";
  346. diag.Drag=true;
  347. //点击确定按钮的监听方法
  348. diag.OKEvent = function(){
  349. var inputValue = diag.innerFrame.contentWindow.getDateToParent();
  350. var currentData = inputValue.current;
  351. var beforeData = inputValue.before;
  352. var modulelist = "";
  353. //排序计数
  354. var sort = 0;
  355. //解析需要删除的数据
  356. for(var j=0;j<beforeData.length;j++){
  357. modulelist = beforeData[j]+"|"+(sort<10?'0'+sort:sort)+"|1,"+modulelist;
  358. sort++;
  359. }
  360. //解析需要存入数据
  361. for(var i=0;i<currentData.length;i++){
  362. modulelist = currentData[i]+"|"+(sort<10?'0'+sort:sort)+"|0,"+modulelist;
  363. sort++;
  364. }
  365. //向服务器写入需要改变的数据
  366. setModuleData(modulelist,1);
  367. diag.close();
  368. inputValue = null;
  369. modulelist = null;
  370. sort = null;
  371. };
  372. diag.URL = "/nwyj/page/all_module.jsp";
  373. diag.ShowButtonRow=true;
  374. diag.show();
  375. }
  376. /**
  377. * 修改用户的模块信息
  378. * idxType的值有 0,1,其他,
  379. 0、代表用户没有数据时,初始数据
  380. 1、从左右模块中选择的数据
  381. 其他、排序的数据
  382. */
  383. function setModuleData (modulelist,idxType){
  384. $.ajax({
  385. url : $.pathname() +'/ws/moduleobj/addModuleByUserId/',
  386. type : 'post',
  387. async:false,
  388. data : {
  389. user_id:user_id,
  390. list_data:modulelist
  391. },
  392. dataType : 'text',
  393. success : function(data) {
  394. if(data=="error"){
  395. top.Dialog.alert('修改数据失败!');
  396. }else{
  397. if(idxType==0){//当没有数据时,初始数据
  398. //$.messager.show(0,"您还没有选择任何模块信息,系统已经初始化了一个模块!");
  399. }else if(idxType==1){//从左右模块中选择的数据
  400. window.location.reload();
  401. }else{//排序的数据
  402. resetpageheight();
  403. }
  404. }
  405. },
  406. error : function(e) {
  407. top.Dialog.alert('查询失败!');
  408. }
  409. });
  410. }
  411. function openQuestion(){
  412. var diag = new top.Dialog();
  413. diag.Title = "我的帮助";
  414. /* diag.Width= 730;
  415. diag.Height=390; */
  416. diag.Width = 510;
  417. diag.Height = 390;
  418. diag.Drag=true;
  419. diag.URL = "/nwyj/page/system/questionHuiZong/questionHuiZong_Add.jsp?diag="+diag;
  420. diag.show();
  421. diag.CancelEvent = function(){
  422. diag.close();
  423. diag=null;
  424. };
  425. }
  426. function openMsgBtn(){
  427. //blankopenNext("/nwyj/page/system/message/SendMsg.html");
  428. windowOpenNext("/nwyj/page/system/sms/addMsg.html");
  429. //alert("msg");
  430. /* var diag = new top.Dialog();
  431. diag.Title = "发送消息";
  432. diag.Width= 730;
  433. diag.Height=390;
  434. diag.Drag=true;
  435. diag.URL = "/nwyj/page/system/message/SendMsg.html";
  436. diag.show();
  437. diag.CancelEvent = function(){
  438. diag.close();
  439. diag=null;
  440. }; */
  441. }
  442. //删除左右两端的空格
  443. function trim(str){
  444. if(str!=null){
  445.   return str.replace(/(^\s*)|(\s*$)/g, "");
  446. }
  447. return str;
  448. }
  449. </script>
  450. </head>
  451. <body>
  452. <div class="fixItem" id="idxfixItem">
  453. <div id="toTop" style="display: none;" onclick="script:top.window.scrollTo(0,0);">
  454. <!-- <a href="#indexTop"><img src="/nwyj/images/index/to_top.png" /></a> -->
  455. <a href="javascript:;"><img src="/nwyj/images/index/to_top.png" /></a>
  456. </div>
  457. <div id="" onclick="openDialog();">
  458. <a href="javascript:;"><img src="/nwyj/images/index/add_div.png" /></a>
  459. <span class="floating_left">自定义组件</span>
  460. </div>
  461. <div id="" onclick="openQuestion();">
  462. <a href="javascript:;"><img src="/nwyj/images/index/que_img.png" /></a>
  463. <span class="floating_left">BUG/提问</span>
  464. </div>
  465. <div id="" onclick="openMsgBtn();">
  466. <a href="javascript:;"><img src="/nwyj/images/index/fix_msg.png" /></a>
  467. <span class="floating_left">发送短信</span>
  468. </div>
  469. </div>
  470. <div class="module-content" id="indexTop">
  471. <ul id="left_list" class="ul_cont">
  472. <!-- <li class="shedu_cont li_cont" >
  473. <div class="content_title"><span class="title_text">测试模块</span></div>
  474. <div class="content_btn" style="display: none;" >
  475. <span class="freshing freshimg1" title="刷新" onclick="moduleFresh();" ></span>
  476. <span class="closeimg cont_close1 " title="删除" ></span>
  477. </div>
  478. <div class="content_cont" style="min-height:200px">
  479. <div class="idxModule_content"></div>
  480. <div class="idxModule-loading-bg" style="display: block;"></div>
  481. <div class="idxModule-loading-box" style="display: block;"><span>正在加载...</span></div>
  482. </div>
  483. </li> -->
  484. </ul>
  485. <ul id="right_list" class="ul_cont">
  486. </ul>
  487. <input name="listSortOrder" type="hidden" />
  488. </div>
  489. </body>
  490. </html>