main_index_iframe1.html 15 KB

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