8f94372198d75f89c72938aa5e281d084884e9f3.svn-base 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. var conditionJson;
  2. var param={};
  3. var $dom=null;
  4. /**
  5. * 页面加载完成后执行
  6. */
  7. $(function() {
  8. init();
  9. });
  10. $(function(){
  11. $(".cs_win_item").on("click",function(){
  12. if($(this).hasClass("cs_win_item_active")){
  13. $(this).removeClass("cs_win_item_active");
  14. }else{
  15. $(".cs_win_item_active").removeClass("cs_win_item_active");
  16. $(this).addClass("cs_win_item_active");
  17. };
  18. });
  19. });
  20. /**
  21. * 初始化方法
  22. */
  23. function init(){
  24. conditionJson = resolveUrl();
  25. initLatout();
  26. loadMaticList();
  27. bindEventOnOkayAndCancle();
  28. };
  29. function initLatout(){
  30. $("#i_headtext").html(conditionJson.subject);
  31. };
  32. function getSubjectDate(data){
  33. var temData=data.rows.sort(function(item1,item2){
  34. if(parseInt(item1.rows[0]["SORT1"])>parseInt(item2.rows[0]["SORT1"])){
  35. return 1;
  36. }else if(parseInt(item1.rows[0]["SORT1"])<parseInt(item2.rows[0]["SORT1"])){
  37. return -1;
  38. }else{
  39. return 0;
  40. };
  41. });
  42. data.rows=temData;
  43. var synt = [];
  44. for(var index=0,len=data.rows.length;index<len;index++){
  45. param[data.rows[index].name]=data.rows[index].rows;
  46. synt = synt.concat(data.rows[index].rows);
  47. };
  48. param["组合展示"] = synt;
  49. initSubjectWinShow();
  50. getSubjectWinItem(param[conditionJson.subject]);
  51. };
  52. /* 初始化左侧窗口 */
  53. function initSubjectWinShow(){
  54. $("#das_bor"+conditionJson.wnum).removeClass("co_win_border").addClass("ct_win_border");
  55. if(conditionJson.subjectSubName1=="undefined" || conditionJson.subjectSubName1=="null" || conditionJson.subjectSubName1==undefined || conditionJson.subjectSubName1==null || conditionJson.subjectSubName1==""){
  56. getEmptyWinDom("subjectSubName1");
  57. };
  58. if(conditionJson.subjectSubName2=="undefined" || conditionJson.subjectSubName2=="null" || conditionJson.subjectSubName2==undefined || conditionJson.subjectSubName2==null || conditionJson.subjectSubName2==""){
  59. getEmptyWinDom("subjectSubName2");
  60. };
  61. if(conditionJson.subjectSubName3=="undefined" || conditionJson.subjectSubName3=="null" || conditionJson.subjectSubName3==undefined || conditionJson.subjectSubName3==null || conditionJson.subjectSubName3==""){
  62. getEmptyWinDom("subjectSubName3");
  63. };
  64. if(conditionJson.subjectSubName4=="undefined" || conditionJson.subjectSubName4=="null" || conditionJson.subjectSubName4==undefined || conditionJson.subjectSubName4==null || conditionJson.subjectSubName4==""){
  65. getEmptyWinDom("subjectSubName4");
  66. };
  67. for(var key in param[conditionJson.subject]){
  68. if(conditionJson.subjectSubName1==param[conditionJson.subject][key]["TM_NAME"]){
  69. getSubjectWinDom("subjectSubName1",param[conditionJson.subject][key]);
  70. }else if(conditionJson.subjectSubName2==param[conditionJson.subject][key]["TM_NAME"]){
  71. getSubjectWinDom("subjectSubName2",param[conditionJson.subject][key]);
  72. }else if(conditionJson.subjectSubName3==param[conditionJson.subject][key]["TM_NAME"]){
  73. getSubjectWinDom("subjectSubName3",param[conditionJson.subject][key]);
  74. }else if(conditionJson.subjectSubName4==param[conditionJson.subject][key]["TM_NAME"]){
  75. getSubjectWinDom("subjectSubName4",param[conditionJson.subject][key]);
  76. };
  77. };
  78. };
  79. function getEmptyWinDom(win_count_id){
  80. $("#"+win_count_id).empty();
  81. var $empty_win_div = document.createElement("div");
  82. $($empty_win_div).addClass("empty_win");
  83. $("#"+win_count_id).append($empty_win_div);
  84. };
  85. function getSubjectWinDom(win_count_id, win_param){
  86. var $details_win_div = document.createElement("div");
  87. var $subject_btn_span = document.createElement("span");
  88. $($subject_btn_span).addClass("subject_btn_span").attr("title",win_param.TM_NAME).html(win_param.TM_NAME);
  89. var $scdm_a = document.createElement("a");
  90. $($scdm_a).attr("title","从该窗口移出此图表").addClass("subject_char_details_more").attr("charurl",win_param.TM_URL).attr("charname",win_param.TM_NAME).html("-");
  91. $($scdm_a).on("click",function(){
  92. getEmptyWinDom($(this).parent().parent().attr("id"));
  93. });
  94. $($details_win_div).addClass("details_win").append($subject_btn_span).append($scdm_a);
  95. var $c_scdm_a = document.createElement("a");
  96. var $c_scdm_sub_img = document.createElement("img");
  97. $($c_scdm_sub_img).addClass("scdm_img subject_bg_img "+win_param.TM_IMGURL);
  98. $($c_scdm_a).addClass("subject_char_details_more").append($c_scdm_sub_img);
  99. $("#"+win_count_id).append($details_win_div).append($c_scdm_a).data("data",win_param);
  100. };
  101. /* 得到右侧专题选择列表 */
  102. function getSubjectWinItem(data){
  103. $("#i_right").empty();
  104. var $subject_list_char_ul = document.createElement("ul");
  105. $($subject_list_char_ul).attr("id","subject_char").addClass("subject_char group");
  106. for(var index = 0; index < data.length; index++){
  107. var last_area_name = "";
  108. var flag = false;
  109. if(index!=0){
  110. last_area_name = data[index-1].AREA_NAME;
  111. };
  112. if($("#i_headtext").html()=="组合展示"){
  113. flag = true;
  114. };
  115. if(flag && data[index].AREA_NAME=="组合展示"){break;};
  116. /*if(flag && last_area_name!=data[index].AREA_NAME){
  117. var $subject_group_title_left_box_div = document.createElement("div");
  118. $($subject_group_title_left_box_div).addClass("subject_left_group").html(data[index].AREA_NAME);
  119. $($subject_list_char_ul).append($subject_group_title_left_box_div);
  120. };*/
  121. var $subject_char_li = document.createElement("li");
  122. var $subject_char_details_div = document.createElement("div");
  123. $($subject_char_details_div).addClass("details");
  124. var $subject_char_details_span = document.createElement("span");
  125. $($subject_char_details_span).html(data[index].TM_NAME).addClass("subject_btn_span").attr("title",data[index].TM_NAME);
  126. /* var $subject_char_details_a = document.createElement("a");
  127. $($subject_char_details_a).html("+").attr("title","添加到快速查看").addClass("subject_char_details_more")
  128. .attr("charUrl",data[index].TM_URL).attr("charName",data[index].TM_NAME);
  129. $($subject_char_details_a).click(function(){
  130. //alert("添加到快速查看")
  131. var flg = true;
  132. var aid = null;
  133. var tid = null;
  134. $(".cbcc_btn").each(function(){
  135. if(flg){
  136. if($(this).attr("addBtn")=="1"){
  137. aid = $(this).attr("id");
  138. flg = false;
  139. };
  140. };
  141. if(!($(this).attr("thisAdd") == undefined)){
  142. tid = $(this).attr("id");
  143. $("#"+tid).removeAttr("thisAdd");
  144. };
  145. });
  146. if(tid!=null){ aid = tid; };
  147. if(aid==null){
  148. alert("快速添加按钮只能设置5个,如果想添加请移除快速按钮来替换!")
  149. }else{
  150. .attr("charUrl",data[index].TM_URL).attr("charName",data[index].TM_NAME);
  151. $("#"+aid).attr("addBtn","0").removeAttr("title").find("span").html($(this).attr("charName"))
  152. .attr("title",$(this).attr("charName"));
  153. $("#"+aid).find("a").attr("addBtn","0").attr("title","移除快速查看").html("-");
  154. };
  155. });
  156. $($subject_char_details_div).append($subject_char_details_span).append($subject_char_details_a);*/
  157. $($subject_char_details_div).append($subject_char_details_span);
  158. var $subject_char_show_a = document.createElement("a");
  159. $($subject_char_show_a).addClass("subject_char_details_more");
  160. var $subject_char_show_img = document.createElement("img");
  161. $($subject_char_show_img).addClass(data[index].TM_IMGURL+" subject_bg_img");
  162. $($subject_char_show_a).append($subject_char_show_img);
  163. if($("#i_headtext").html()=="组合展示"){
  164. if(data[index].IS_SYNTHESIZE!=0){
  165. $($subject_char_li).addClass("subject_acitve_left");
  166. };
  167. }else{
  168. if(data[index].TM_BEX!=0){
  169. $($subject_char_li).addClass("subject_acitve_left");
  170. };
  171. };
  172. $($subject_char_li).append($subject_char_details_div).append($subject_char_show_a)
  173. .attr("subject",data[index].TM_NAME).data("data",data[index]).addClass("subject_char_each");
  174. $($subject_char_li).click(function(e){
  175. var $dom=$(this);
  176. var dom_data = $dom.data("data");
  177. $(this).addClass("subject_acitve_left");
  178. var $fly_subject_item_div = document.createElement("div");
  179. $($fly_subject_item_div).addClass("fly_subject_item");
  180. var $fly_si_title_div = document.createElement("div");
  181. $($fly_si_title_div).addClass("fly_details");
  182. var $fly_sit_span = document.createElement("span");
  183. $($fly_sit_span).html(dom_data.TM_NAME).addClass("fly_subject_btn_span");
  184. $($fly_si_title_div).append($fly_sit_span);
  185. var $fly_si_img_a = document.createElement("a");
  186. $($fly_si_img_a).addClass("fly_subject_char_details_more");
  187. var $fly_si_img = document.createElement("img");
  188. $($fly_si_img).addClass(dom_data.TM_IMGURL+" subject_bg_img");
  189. $($fly_si_img_a).append($fly_si_img);
  190. $($fly_subject_item_div).append($fly_si_title_div).append($fly_si_img_a);
  191. $("#i_matic_content").append($fly_subject_item_div);
  192. var starOffset = $($dom).offset();
  193. var endOffset = $(".cs_win_item_active").offset();
  194. var fly_id ;
  195. if(endOffset==null || endOffset==undefined){
  196. fly_id = conditionJson.wnum;
  197. endOffset = $("#das_bor"+fly_id).offset();
  198. }else{
  199. fly_id = $(".cs_win_item_active").attr("winnum");
  200. };
  201. $($fly_subject_item_div).css({top:starOffset.top, left:starOffset.left});
  202. $($fly_subject_item_div).animate({top:endOffset.top, left:endOffset.left},300).fadeOut(300);
  203. setTimeout(function(){
  204. $($fly_subject_item_div).remove();
  205. $(".cs_win_item").each(function(){
  206. var thisOffset = $(this).offset();
  207. if(((endOffset.top+1)==thisOffset.top && (endOffset.left+1)==thisOffset.left)||
  208. (endOffset.top==thisOffset.top && endOffset.left==thisOffset.left)){
  209. if($(this).children(".empty_win").prop("outerHTML")==undefined){
  210. /*$(this).find(".details_win").eq(0).find(".subject_btn_span").eq(0)
  211. .attr("title",dom_data.TM_NAME).html(dom_data.TM_NAME).next()
  212. .attr("charurl",dom_data.TM_URL).attr("charname",dom_data.TM_NAME);
  213. var $new_img = document.createElement("img");
  214. $($new_img).addClass("scdm_img subject_bg_img "+dom_data.TM_IMGURL);
  215. $(this).find("a").eq(1).find("img").eq(0).remove();
  216. $(this).find("a").eq(1).append($new_img);*/
  217. var fd_id = $(this).data("data").FD_OBJECTID;
  218. var fd_id_old = dom_data.FD_OBJECTID;
  219. if(fd_id!=fd_id_old){
  220. $(".subject_char_each").each(function(){
  221. if(fd_id==$(this).data("data").FD_OBJECTID){
  222. $(this).removeClass("subject_acitve_left");
  223. };
  224. });
  225. $(this).empty();
  226. getSubjectWinDom($(this).attr("id"),dom_data);
  227. }
  228. }else{
  229. $(this).children(".empty_win").remove();
  230. getSubjectWinDom($(this).attr("id"),dom_data);
  231. };
  232. };
  233. });
  234. },300);
  235. //alert(JSON.stringify($dom.data("data")))
  236. });
  237. $($subject_list_char_ul).append($subject_char_li);
  238. };
  239. $("#i_right").append($subject_list_char_ul);
  240. };
  241. function flySubjectShowBox($fly_dom,starOffset,endOffset){
  242. $($fly_dom).css({top:starOffset.top, left:starOffset.left});
  243. $($fly_dom).animate({top:endOffset.top, left:endOffset.left},300).fadeOut(300);
  244. };
  245. /**
  246. *
  247. */
  248. function bindEventOnOkayAndCancle(){
  249. /**
  250. * 确定事件
  251. */
  252. $("#i_submit").on("click",function(){
  253. $(".cs_win_item").each(function(){
  254. var thisOffset = $(this).offset();
  255. if(thisOffset.top < 65 && thisOffset.left < 20){
  256. top.changeSite("i_index_content1",$(this).data("data"));
  257. }else if(thisOffset.top < 65 && thisOffset.left > 120){
  258. top.changeSite("i_index_content4",$(this).data("data"));
  259. }else if(thisOffset.top > 170 && thisOffset.left < 20){
  260. top.changeSite("i_index_content2",$(this).data("data"));
  261. }else if(thisOffset.top > 170 && thisOffset.left > 120){
  262. top.changeSite("i_index_content5",$(this).data("data"));
  263. };
  264. });
  265. top.destoryIframeContent("i_index_maticlist");
  266. });
  267. /**
  268. * 销毁本页面
  269. */
  270. $("#i_cancle").on("click",function(){
  271. top.destoryIframeContent("i_index_maticlist");
  272. });
  273. /**
  274. * 筛选功能的text获取焦点事件
  275. */
  276. $("#i_searchtext").on("focus",function(){
  277. $(this).attr("value","").css({color:"#000000",border:"none"});
  278. });
  279. $("#i_searchtext").on("keyup",function(e){
  280. if(e.keyCode==13){
  281. search();
  282. }
  283. });
  284. /**
  285. * 筛选功能绑定点击事件
  286. */
  287. $("#i_search_b").on("click",search);
  288. $(".c_ul_li_topdiv_p").each(function(){
  289. $(this).on("mouseenter",function(){
  290. $(this).css({color:"red","background-color": "yellow"});
  291. }).on("mouseleave",function(){
  292. $(this).css({color:"#000000","background-color": "#e5e5e7"});
  293. });
  294. });
  295. }
  296. /**
  297. * 筛选功能查询方法
  298. */
  299. function search(){
  300. if($("#i_searchtext").val()=="" || $("#i_searchtext").val()==null){
  301. function fn1(){
  302. alt.destory();
  303. return;
  304. }
  305. function fn2(){
  306. alt.destory();
  307. top.destoryMenu();
  308. }
  309. if($dom==null){
  310. var alt=new Alert({ok:fn1,cancle:fn2},
  311. {text:"请您输入查询条件!"});
  312. //创建节点
  313. alt.create("");
  314. }
  315. }else{
  316. postSearch({comId:conditionJson["dept_id"],name:$("#i_searchtext").val().trim()},createInfo);
  317. }
  318. }
  319. /**
  320. * 发送post请求,请求查询筛选的数据
  321. * @param param
  322. * @param callFunction
  323. */
  324. function postSearch(param,callFunction){
  325. $.post(path + "ws/MaticService/MaticService/getMaticMapInfoThroughLikeInfo",{like:param.name,comId:param.comId},function(result){
  326. callFunction(result.rows);
  327. bindEventOnMaticView();
  328. },"json");
  329. }
  330. /**
  331. * 加载页面数据
  332. */
  333. function loadMaticList() {
  334. var _this=arguments.callee;
  335. $.post(path + "ws/MaticService/MaticService/getMaticMapInfo", {comId:conditionJson["dept_id"]}, function(
  336. result) {
  337. $div = $("<div></div>");
  338. if (result.state == "SUCCESS") {
  339. //loadListItem(result);
  340. getSubjectDate(result);
  341. //accordionMenu($("#i_matic_content"), result.rows);
  342. } else {
  343. function fn1(){
  344. _this();
  345. return;
  346. }
  347. function fn2(){
  348. alt.destory();
  349. }
  350. if($dom==null){
  351. var alt=new Alert({ok:fn1,cancle:fn2},
  352. {text:"加载失败!是否需要继续加载?"});
  353. //创建节点
  354. alt.create("");
  355. }
  356. }
  357. }, "json");
  358. };
  359. /**
  360. * 加载左侧列表
  361. * @param data 后台查询的数据
  362. */
  363. function loadListItem(data){
  364. createList(data);
  365. for(var item in param){
  366. createInfo(param[item]);
  367. break;
  368. }
  369. /*createInfo(param[0]);*/
  370. bindEventOnMaticView();
  371. }
  372. /**
  373. * 加载左侧列表
  374. * @param data
  375. */
  376. function createList(data){
  377. var htmlStr="<ul class='c_item_list_ul'>";
  378. htmlStr+="<h2>全部<span class='c_amout'>("+data.total+")</span></h2>";
  379. var temData=data.rows.sort(function(item1,item2){
  380. if(parseInt(item1.rows[0]["SORT1"])>parseInt(item2.rows[0]["SORT1"])){
  381. return 1;
  382. }else if(parseInt(item1.rows[0]["SORT1"])<parseInt(item2.rows[0]["SORT1"])){
  383. return -1;
  384. }else{
  385. return 0;
  386. };
  387. });
  388. data.rows=temData;
  389. for(var index=0,len=data.rows.length;index<len;index++){
  390. param[data.rows[index].name]=data.rows[index].rows;
  391. if(data.rows[index].rows[0]["FD_OBJECTID"]!=0){
  392. htmlStr+="<li class='c_item_list_li' data="+data.rows[index].name+"><div>"+data.rows[index].name+"<span class='c_amout'>("+data.rows[index].rows.length+")</span></div></li>";
  393. }else{
  394. htmlStr+="<li class='c_item_list_li' data="+data.rows[index].name+"><div>"+data.rows[index].name+"<span class='c_amout'>(0)</span></div></li>";
  395. }
  396. }
  397. htmlStr+="</ul>";
  398. $("#i_left").append(htmlStr);
  399. htmlStr=null;
  400. bindItemEvent();
  401. }
  402. /**
  403. * 左侧列表绑定点击事件
  404. * 绑定列表事件
  405. */
  406. function bindItemEvent(){
  407. $("#i_left").find("ul").find("li").each(function(i,item){
  408. $(this).on("click",function(){
  409. createInfo(param[$(this).attr("data")]);
  410. bindEventOnMaticView();
  411. if($(this).siblings(".c_item_list_li_click").size()>0){
  412. $(this).siblings(".c_item_list_li_click").removeClass("c_item_list_li_click");
  413. }
  414. $(this).addClass("c_item_list_li_click");
  415. }).on("mouseenter",function(){
  416. /*var $dom=$(this).find("div");
  417. $dom.animate({"margin-top":"-30px"},200,"",function(){
  418. $dom.css({"margin-top":"-30px"}).animate({"margin-top":"0px"},200,"",function(){
  419. $dom.animate({"font-size":"20px"},200,"",function(){
  420. $dom.animate({"font-size":"12px"},200);
  421. $dom=null;
  422. });
  423. });
  424. });*/
  425. //_this=null;
  426. });
  427. });
  428. /* $("#i_left").find("ul").on("click","li",function(){
  429. alert("===");
  430. alert(JSON.stringify(param[$(this).attr("data")]));
  431. createInfo(param[$(this).attr("data")]);
  432. bindEventOnMaticView();
  433. }).on("mouseenter","li",function(){
  434. var $dom=$(this).find("div");
  435. $dom.animate({"margin-top":"-30px"},200,"",function(){
  436. $dom.css({"margin-top":"-30px"}).animate({"margin-top":"0px"},200,"",function(){
  437. $dom.animate({"font-size":"20px"},200,"",function(){
  438. $dom.animate({"font-size":"12px"},200);
  439. $dom=null;
  440. });
  441. });
  442. });
  443. //_this=null;
  444. });*/
  445. }
  446. /**
  447. * 创建视图详情
  448. * @param param
  449. * @returns {Boolean}
  450. */
  451. function createInfo(param){
  452. $("#i_content_info").empty();
  453. if(param[0]["FD_OBJECTID"]==0){
  454. $("#i_content_info").append("<div style='margin-top: 40px;text-align: center;color: #141414;'>暂未配置外部系统!</div>");
  455. return false;
  456. }
  457. $("#i_content_info").append("<ul class='c_ul'></ul>");
  458. for(var index=0,len=param.length;index<len;index++){
  459. $("#i_content_info").find("ul").append(
  460. "<li class='c_ul_li'><div class='c_ul_li_topdiv'><p class='c_ul_li_topdiv_p'>"
  461. + param[index]["TM_NAME"]
  462. + "</p></div><div class='"+param[index]["TM_IMGURL"]+" c_ul_li_bottomdiv _background_position' title='"
  463. + param[index]["TM_NAME"] + "'></div></li>");
  464. $("#i_content_info").find("ul").find("li").last().data("data", param[index]);
  465. }
  466. return false;
  467. }
  468. /**
  469. * 给单个选项绑定点击事件
  470. */
  471. function bindEventOnMaticView(){
  472. $("#i_content_info").find("ul").on("click","li",function(){
  473. $dom=$(this);
  474. }).on("mouseenter","li",function(){
  475. /* console.log("====");*/
  476. var $dom=$(this).on("click",function(){
  477. $(this).siblings(".c_has_click").removeClass("c_has_click");
  478. $(this).addClass("c_has_click");
  479. }).find(".c_ul_li_bottomdiv");
  480. $dom.animate({"background-size":"103px"},200,"",function(){
  481. $dom.animate({"background-size":"50px"},200,"",function(){
  482. $dom.animate({"background-size":"75px"},200);
  483. $dom=null;
  484. });
  485. });
  486. });
  487. }
  488. /******************************************无用代码************************************************************/
  489. /**
  490. *
  491. * @param $dom
  492. * @param data
  493. */
  494. function accordionMenu($dom, data) {
  495. var $divCon = $("<div class='_ul_count_content'></div>");
  496. if (data.length == 0)
  497. throw Error("accordionMenu($dom,data)中data的长度为0或者空");
  498. if ($dom == null || $dom == undefined)
  499. throw new Error("accordionMenu($dom,data)中容器节点不能为空");
  500. for ( var item in data) {
  501. if (data[item].rows.length == 0)
  502. continue;
  503. $div = $("<div class='_ul_content'></div>");
  504. menuItem($div, data[item]);
  505. $divCon.append($div);
  506. }
  507. ;
  508. $dom.append($divCon);
  509. $dom.append("<div class='_jsc_close'></div>");
  510. $dom.find("._jsc_close").on("click", function() {
  511. top.destoryMenu();
  512. }).on("mouseenter", function() {
  513. $(this).addClass("_jsc_close_changeImg");
  514. }).on("mouseleave", function() {
  515. $(this).removeClass("_jsc_close_changeImg");
  516. });
  517. }
  518. // 创建单个选择list
  519. function menuItem($dom, data) {
  520. $ul = $("<ul></ul>");
  521. $h2 = $("<div class='_ul_head'><div class='_view_list_line'></div><div class='_view_list'><h2>"
  522. + data.name + "</h2></div></div>");
  523. // 点击隐藏选择项
  524. $ul.append($h2);
  525. $dom.append($ul);
  526. for ( var item1 in data.rows) {
  527. $dom.find("ul").last().append(
  528. "<li class='_ul_li'><div class='_matic_title'><p >"
  529. + data.rows[item1]["TM_NAME"]
  530. + "</p></div><div class='_matic_img' title='"
  531. + data.rows[item1]["TM_NAME"] + "'><img src='"
  532. + (path + data.rows[item1]["TM_IMGURL"])
  533. + "'/></div></li>");
  534. $dom.find("ul").last().find("li").last().data("data", data.rows[item1]);
  535. inAndLeaveAndClick($dom.find("ul").last().find("li").last(), function(
  536. $dom) {
  537. top.changeSite(conditionJson["iframeId"], $dom.data("data"));
  538. top.destoryMenu();
  539. }, moveIn, moveOut);
  540. }
  541. $dom.find("._view_list").click(function() {
  542. $(this).parents("._ul_content").toggleClass("_ul_content_hide");
  543. });
  544. }