12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- function tabPosition(tabjson,menuId,imgclass){
- var __top = $(top.document.body);
- var positionText = __top.find("#positionTitle1").text();
- imgclass = imgclass==""?__top.find("#positionTitle1").attr("class"):imgclass;
- __top.find("#positionMsg").html("");
-
- //添加菜单和图标
- __top.find("#positionMsg").append("<div id='positionTitle1' data-menuid='"+menuId+"' data-imgclass='"+imgclass+"' class='positiontitab "+imgclass+"'>"+positionText+"</div>");
-
- //添加页签
- __top.find("#positionMsg").append("<div class=' positiontitab positionTab positionTabCurrent' id='"+tabjson[0].YQ_ID+"' data-tabId='"+tabjson[0].FD_OBJECTID+"' data-index='"+0+"' data-src='"+tabjson[0].YQ_SRC+"'>"+tabjson[0].YQ_NAME+"</div>");
- for(var i=1;i<tabjson.length;i++){
- __top.find("#positionMsg").append("<div class=' positiontitab positionTab' data-tabId='"+tabjson[i].FD_OBJECTID+"' data-index='"+i+"' id='"+tabjson[i].YQ_ID+"' data-src='"+tabjson[i].YQ_SRC+"'>"+tabjson[i].YQ_NAME+"</div>");
- }
- __top.find("#positionMsg").append("<div class='clear'></div>");
-
- //添加左移右移图标
- __top.find("#currPosition .changeYQ").remove();
- __top.find("#currPosition").append(
- "<div class='changeYQ' id='changeYQ'>" +
- "<div class='toleft nomove'>" +
- "<a href='javascript:;'>" +
- "<img src='/nwyj/scripts/qui/libs/icons/icons_position/toleft1.png'/>" +
- "</a>" +
- "</div>" +
- "<div class='toright canmove'>" +
- "<a href='javascript:;'>" +
- "<img src='/nwyj/scripts/qui/libs/icons/icons_position/toright.png'/>" +
- "</a>" +
- "</div>" +
- "</div>");
- __top.find("#positionMsg .positionTabCurrent").click();
- };
-
- $(function(){
- var $tab = $(top.document.body).find("#positionMsg .positionTab");
- if($tab.length == 0){
- var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var menuId = $(top.document.body).find("#positionTitle1").attr("data-menuid");
- $.ajax({
- type: "POST",
- url: "/nwyj/ws/tabyq/PositionTabService/getTabById",
- //async: false,
- data: {
- menuId:menuId,
- userId:user_id
- },
- success: function(data){
- if(data.length>0){
- tabPosition(data,menuId,"");
- }
-
- }
- });
- }
- });
|