f14176b9ee63d0993ada14a0cf8347920f224796.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. <%@page language="java" pageEncoding="UTF-8"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <title></title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/jquery.js"></script>
  8. <link href="/nwyj/scripts/qui/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
  9. <link href="/nwyj/scripts/qui/system/layout_flat/skin/style.css" rel="stylesheet" type="text/css" id="skin" skinPath="/nwyj/scripts/qui/" scrollerY="false" scrollerX="false"/>
  10. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/language/cn.js"></script>
  11. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/framework.js"></script>
  12. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/main.js"></script>
  13. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/popup/drag.js"></script>
  14. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/popup/messager.js"></script>
  15. <script type="text/javascript" src="/nwyj/scripts/jquery/plugins/jquery.extension.util.js"></script>
  16. <script type="text/javascript" src="/nwyj/scripts/freamwork/com/sinosoft/common/utils/Request.js"></script>
  17. <script type="text/javascript" src="/nwyj/scripts/freamwork/com/sinosoft/system/loading/loading.js"></script>
  18. <link href="/nwyj/scripts/freamwork/com/sinosoft/system/loading/loading.css" rel="stylesheet" type="text/css"/>
  19. <style>
  20. html, body{
  21. width:100%;
  22. height: 100%;
  23. }
  24. body{ position: relative;}
  25. .contonter{
  26. width: 100%;
  27. height: 100%;
  28. }
  29. .tab_cont{
  30. padding-top:10px;
  31. float:left;
  32. border-right:1px solid #b1b0b0;
  33. height:100%;
  34. width:23.8%;
  35. }
  36. .tab_numb{
  37. color: #0255c7;
  38. font-size: 14px;
  39. font-family: "微软雅黑";
  40. font-weight:lighter;
  41. }
  42. .tab_list{
  43. font-weight:bold;
  44. color: #313030;
  45. font-size: 14px;
  46. font-family: "微软雅黑";
  47. padding: 5px 0 5px 10px;
  48. }
  49. .tab_list:hover{
  50. cursor: pointer;
  51. background-color: #e8edf4;
  52. }
  53. .tab_list_after{
  54. background-color: #e8edf4;
  55. }
  56. .mod_cont{
  57. float:left;
  58. margin:5px;
  59. width: 74.5%;
  60. height: 100%;
  61. }
  62. .mod_cont ul{
  63. list-style-type: none;
  64. margin: 0px;
  65. padding:0px;
  66. }
  67. .mod_cont li{
  68. width:118px;
  69. height:118px;
  70. margin:10px 5px;
  71. text-align:center;
  72. display:inline-block;
  73. border: 1px solid #b1b0b0;
  74. }
  75. .text_img {
  76. margin-top:15px;
  77. height: 60px;
  78. width: 60px;
  79. }
  80. .text_div{
  81. white-space: nowrap;
  82. width: 118px;
  83. overflow: hidden;
  84. text-overflow: ellipsis;
  85. height:30px;
  86. line-height:30px;
  87. border-bottom:1px solid #b1b0b0;
  88. font-size: 14px;
  89. }
  90. .mod_list{
  91. position: relative;
  92. }
  93. .module_list_cursor{
  94. cursor:pointer;
  95. }
  96. .selet_menu{
  97. border-color: red !important;
  98. }
  99. .check_select2 {
  100. border: 0px none;
  101. background-image: url("/nwyj/images/index/module_img/sel_img_2.png");
  102. background-repeat: no-repeat;
  103. background-position: 95% 95%;
  104. padding: 0px 0px 0px 0px;
  105. display: inline-block;
  106. white-space: nowrap;
  107. word-break: keep-all;
  108. word-wrap: normal;
  109. background-size: 18px 14px;
  110. }
  111. .check_select1 {
  112. border: 0px none;
  113. background-image: url("/nwyj/images/index/module_img/sel_img_1.png");
  114. background-repeat: no-repeat;
  115. background-position: 95% 95%;
  116. padding: 0px 0px 0px 0px;
  117. display: inline-block;
  118. white-space: nowrap;
  119. word-break: keep-all;
  120. word-wrap: normal;
  121. background-size: 18px 14px;
  122. }
  123. .search_mod{
  124. position: relative;
  125. margin:5px 5px 5px 15px;
  126. height: 8%;
  127. }
  128. .search_img{
  129. position: absolute;
  130. top: 4px;
  131. left: 8px;
  132. }
  133. .search_input{
  134. width:200px;
  135. padding-left:30px;
  136. }
  137. .mod_cont_ul{
  138. height: 87%;
  139. overflow: auto;
  140. width: 100%;
  141. }
  142. </style>
  143. <script type="text/javascript">
  144. var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  145. var roleids = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
  146. var corp_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  147. //保存当前选中的模块
  148. var moduleDataList = [];
  149. //var moduleNew = [];
  150. //储存原有模块
  151. var moduleDataBefore = [];
  152. /*
  153. var allModule = [{
  154. ul_id:"left_list",
  155. li_id:"index_left_1",
  156. img_url:"/nwyj/images/index/module_img/index_left_1.png",
  157. title_name:"常用菜单管理",
  158. module_fun:"getWorkMenuData"
  159. },{
  160. ul_id:"right_list",
  161. li_id:"index_right_1",
  162. img_url:"/nwyj/images/index/module_img/index_right_1.png",
  163. title_name:"资源分布图",
  164. module_fun:"getResourceData"
  165. },{
  166. ul_id:"left_list",
  167. li_id:"index_left_2",
  168. img_url:"/nwyj/images/index/module_img/index_left_2.png",
  169. title_name:"预警与响应",
  170. module_fun:"getAlertResponseData"
  171. },{
  172. ul_id:"right_list",
  173. li_id:"index_right_2",
  174. img_url:"/nwyj/images/index/module_img/index_right_2.png",
  175. title_name:"值班信息",
  176. module_fun:"loadDuty"
  177. },{
  178. ul_id:"left_list",
  179. li_id:"index_left_3",
  180. img_url:"/nwyj/images/index/module_img/index_left_3.png",
  181. title_name:"集成URL",
  182. module_fun:"getUrlData"
  183. },{
  184. ul_id:"right_list",
  185. li_id:"index_right_4",
  186. img_url:"/nwyj/images/index/module_img/index_right_4.png",
  187. title_name:"待办",
  188. module_fun:"getdaibanData"
  189. }];
  190. */
  191. $(function(){
  192. $("body").indexLoading().show();
  193. //设置中间竖线高度
  194. var contenterHight = $(parent.document.body).height();
  195. $(".tab_cont").height(contenterHight);
  196. //初始化模块
  197. //setTimeout(function(){
  198. getAllModuleData("",0);
  199. //},1000);
  200. /* 初始话窗口 */
  201. //initModuleCont(allModule);
  202. /* 创建工作台中的菜单 */
  203. //getWorkMenuData();
  204. /* 创建所有的菜单列表 */
  205. //getAllMenuData();
  206. ///监听左边选项tab的点击事件
  207. $(".tab_list").bind("click",function(){
  208. $("body").indexLoading().show();
  209. var $self = $(this);
  210. $self.addClass("tab_list_after").siblings().removeClass("tab_list_after");
  211. var value = $self.attr("value");
  212. getAllModuleData(value,1);
  213. $self = null;
  214. value=null;
  215. });
  216. $("#search_module_btn").bind("click",searchModule);
  217. $("#search_module_input").keydown(function(event){
  218. if(event.which == "13")
  219. $("#search_module_btn").click();
  220. });
  221. });
  222. //
  223. function searchModule(){
  224. $("body").indexLoading().show();
  225. $(".tab_list").eq(0).addClass("tab_list_after").siblings().removeClass("tab_list_after");
  226. var searchCond = $("#search_module_input").val();
  227. if(searchCond==""){
  228. getAllModuleData("",0);
  229. }else{
  230. //debugger;
  231. $.ajax({
  232. url : '/nwyj/ws/moduleobj/getSearchModule/',
  233. type : 'post',
  234. data : {
  235. user_id:user_id,
  236. corp_id:corp_id,
  237. moduleName:searchCond
  238. },
  239. dataType : 'json',
  240. //async:false,
  241. success : function(data) {
  242. //console.log(data);
  243. data = data.resultData;
  244. initModuleCont(data,0);
  245. },
  246. error : function(e) {
  247. top.Dialog.alert("访问服务失败!");
  248. }
  249. });
  250. }
  251. }
  252. //获取所有模块的信息
  253. function getAllModuleData(parent_menu,modType){
  254. $.ajax({
  255. url : '/nwyj/ws/moduleobj/getAllModule/',
  256. type : 'post',
  257. data : {
  258. user_id:user_id,
  259. corp_id:corp_id,
  260. parent_menu:parent_menu
  261. },
  262. dataType : 'json',
  263. //async:false,
  264. success : function(data) {
  265. //alert("--->jinru");
  266. data = data.resultData;
  267. initModuleCont(data,modType);
  268. },
  269. error : function(e) {
  270. try{
  271. top.Dialog.alert("访问服务失败!");
  272. }catch(e){
  273. }
  274. }
  275. });
  276. }
  277. //获得当前用户已经拥有的模块信息
  278. function getDataBefore(){
  279. $.ajax({
  280. url : '/nwyj/ws/moduleobj/getModuleByUserId/',
  281. type : 'post',
  282. data : {
  283. user_id:user_id
  284. },
  285. dataType : 'json',
  286. //async:false,
  287. success : function(data) {
  288. data = data.resultData;
  289. for(var i=0;i<data.length;i++){
  290. $("#"+data[i].li_id).removeClass("check_select2").addClass("check_select1");
  291. var module = trim(data[i].li_id);
  292. moduleDataList.push(module);
  293. moduleDataBefore.push(module);
  294. module=null;
  295. }
  296. },
  297. error : function(e) {
  298. try{
  299. top.Dialog.alert("访问服务失败!");
  300. }catch(e){
  301. }
  302. }
  303. });
  304. }
  305. //初始化右边模块内容,并处理其他操作(分初次、以后)
  306. var isFrist = true;
  307. function initModuleCont(moduleData,modType){
  308. var tabNum = 0;
  309. var tabNum0 = 0;
  310. var tabNum1 = 0;
  311. var tabNum2 = 0;
  312. var tabNum3 = 0;
  313. var tabNum4 = 0;
  314. var tabNum5 = 0;
  315. //console.log(moduleData);
  316. var $dom = $("#mod_cont").find("ul");
  317. $dom.empty();
  318. for(var i=0;i<moduleData.length;i++){
  319. var data = moduleData[i];
  320. tabNum++;
  321. if((data.parent_menu).indexOf("0")>-1){
  322. tabNum0++;
  323. }
  324. if((data.parent_menu).indexOf("1")>-1){
  325. tabNum1++;
  326. }
  327. if((data.parent_menu).indexOf("2")>-1){
  328. tabNum2++;
  329. }
  330. if((data.parent_menu).indexOf("3")>-1){
  331. tabNum3++;
  332. }
  333. if((data.parent_menu).indexOf("4")>-1){
  334. tabNum4++;
  335. }
  336. if((data.parent_menu).indexOf("5")>-1){
  337. tabNum5++;
  338. }
  339. var datalitle = trim(data.title);
  340. if("index_left_7"==data.li_id){
  341. datalitle = "公告(左)";
  342. }
  343. var $list = $('<li class="mod_list module_list_cursor check_select2" id="'+trim(data.li_id)+'" title="'+trim(data.title)+'"></li>');
  344. var $text = $('<div class="text_div" >'+datalitle+'</div>');
  345. var $img = $('<img class="text_img " src="'+trim(data.img_url)+'"/>');
  346. $dom.append($list);
  347. $list.append($text).append($img);
  348. $list.data("li_id",trim(data.li_id));
  349. $list.bind("mouseenter",moveInModule);
  350. $list.bind("mouseleave",moveOutMoule);
  351. $list.bind("click",goModuleAdd);
  352. $list = null;
  353. $text = null;
  354. $img = null;
  355. data = null;
  356. }
  357. /*
  358. if(modType==0){
  359. }*/
  360. if(isFrist){
  361. $("#tabNum").html("("+tabNum+")");
  362. $("#tabNum0").html("("+tabNum0+")");
  363. //$("#tabNum1").html("("+tabNum1+")");
  364. $("#tabNum2").html("("+tabNum2+")");
  365. //$("#tabNum3").html("("+tabNum3+")");
  366. $("#tabNum4").html("("+tabNum4+")");
  367. //$("#tabNum5").html("("+tabNum5+")");
  368. getDataBefore();
  369. isFrist = false;
  370. }else{
  371. getFlagToData(moduleDataList);
  372. }
  373. tabNum = null;
  374. tabNum0 = null;
  375. tabNum1 = null;
  376. tabNum2 = null;
  377. tabNum3 = null;
  378. tabNum4 = null;
  379. tabNum5 = null;
  380. $dom = null;
  381. //隐藏加载图标
  382. $("body").indexLoading().hide();
  383. }
  384. //当点击左边选项tab时,根据现在选中的模块数据,初始标记
  385. function getFlagToData (data){
  386. for(var i=0;i<data.length;i++){
  387. var dataMod = data[i];
  388. $("#"+dataMod).removeClass("check_select2").addClass("check_select1");
  389. dataMod = null;
  390. }
  391. }
  392. //鼠标移除模块的监听方法
  393. function moveOutMoule(){
  394. var $self = $(this);
  395. if($self.hasClass("module_list_cursor")){
  396. $self.removeClass("module_list_cursor");
  397. }
  398. $self = null;
  399. }
  400. //鼠标进入模块的监听方法
  401. function moveInModule(){
  402. var $self = $(this);
  403. $self.addClass("module_list_cursor");
  404. $self = null;
  405. }
  406. //储存需要删除的模块
  407. var delectModules = [];
  408. //点击每个模块的事件(删除、添加)
  409. function goModuleAdd(){
  410. var $self = $(this);
  411. var module_fun = $self.data("module_fun");
  412. var li_id = $self.data("li_id");
  413. var module = trim(li_id);
  414. if($self.hasClass("check_select1")){//删除
  415. var list = [];
  416. $self.removeClass("check_select1").addClass("check_select2");
  417. for(var i=0;i<moduleDataList.length;i++){
  418. if(module!=moduleDataList[i]){
  419. list.push(moduleDataList[i]);
  420. }
  421. }
  422. for(var j=0;j<moduleDataBefore.length;j++){
  423. if(module==moduleDataBefore[j]){
  424. delectModules.push(moduleDataBefore[j]);
  425. }
  426. }
  427. moduleDataList=list;
  428. list=null;
  429. }else{//添加
  430. $self.removeClass("check_select2").addClass("check_select1");
  431. moduleDataList.push(module);
  432. var list1 = [];
  433. for(var k=0;k<delectModules.length;k++){
  434. if(module!=delectModules[k]){
  435. list1.push(delectModules[k]);
  436. }
  437. }
  438. delectModules=list1
  439. list1=null;
  440. }
  441. module =null;
  442. li_id=null;
  443. $self = null;
  444. title = null;
  445. }
  446. //父窗口调用,并取数据的方法
  447. function getDateToParent(){
  448. var data = {
  449. current:moduleDataList,
  450. before:delectModules
  451. };
  452. return data;
  453. data=null;
  454. }
  455. //删除左右两端的空格
  456. function trim(str){
  457. if(str!=null){
  458.   return str.replace(/(^\s*)|(\s*$)/g, "");
  459. }
  460. return str;
  461. }
  462. </script>
  463. </head>
  464. <body>
  465. <div class="contonter" >
  466. <div class="tab_cont">
  467. <div class="tab_list tab_list_after" value="">全部<span class="tab_numb" id="tabNum">--</span></div>
  468. <div class="tab_list " value="0">系统管理<span class="tab_numb" id="tabNum0">--</span></div>
  469. <!-- <div class="tab_list " value="1">日常管理<span class="tab_numb" id="tabNum1">--</span></div> -->
  470. <div class="tab_list " value="2">应急处置<span class="tab_numb" id="tabNum2">--</span></div>
  471. <!-- <div class="tab_list " value="3">保供电<span class="tab_numb" id="tabNum3">--</span></div> -->
  472. <div class="tab_list " value="4">驾驶舱<span class="tab_numb" id="tabNum4">--</span></div>
  473. <!-- <div class="tab_list " value="5">待办<span class="tab_numb" id="tabNum5">--</span></div> -->
  474. </div>
  475. <div class="mod_cont" id="mod_cont">
  476. <div class="search_mod" id="searchinput" >
  477. <a href="javascript:;" class="search_img" id="search_module_btn"><img src="/nwyj/images/index/search_img.png"/></a>
  478. <input watermark="应用模块" type="text" class="search_input" id="search_module_input">
  479. </div>
  480. <ul class="mod_cont_ul" >
  481. </ul>
  482. </div>
  483. </div>
  484. </body>
  485. </html>