filesbox/web/dist/design/designstatic/front/js/mation.js

2 lines
6.4 KiB
JavaScript
Raw Normal View History

2024-07-26 06:10:54 +00:00
var busType=getPar("busType")?decodeURIComponent(getPar("busType")):"";if(!cdnPath)var cdnPath="";var peIde=getPar("typeId")?getPar("typeId"):"",infoValue=getPar("infoValue")?getPar("infoValue"):"1",infoValuePeIde=getPar("typeId")?getPar("typeId"):"",rightFlag=getPar("rightFlag")?getPar("rightFlag"):"",peId,peId2,peId3,peId4,peId5,item,item2,item3,item4,item5;function resetImgSrc(t){var e=t.indexOf("appstatic")>-1?t:t.replace(/([^.]*).([^.]*)$/g,"$1!medium.$2");return e}function coverError(t){var e=event.target;parseInt(e.dataset.errorcount)==0?(e.setAttribute("data-errorcount",1),e.src=t):parseInt(e.dataset.errorcount)==1&&(e.setAttribute("data-errorcount",2),e.src="/static/common/image/information/defult.jpg")}function list(t,e,n){$.ajax({type:"GET",headers:{token:getCookie("token")},url:"/api/disk/getInfoList?projectid=41",contentType:"application/json",dataType:"json",data:{infoTypeID:t||void 0,parentLevel:window.parentLevel||void 0,currentPage:e,pageSize:30,keyword:n},async:!0,success:function(i){for(var s=i.data.list,a="",l=0,o=s.length;l<o;l++){var r=s[l]||{},d=r.infoID,g=r.showTime?getTimeZhCN(r.gmtModified):"",c=r.computerPicPath,I=r.infoType=="1",f=c?JSON.parse(c):[],T=r.fileId,h=r.fileInfo||{},u=r.thumb||"",v=u?[u]:[],y=u,p=r.domain?"//"+r.domain:"",x=r.isUrlInfo?(r.infoUrl||"").indexOf("http")<0?"//"+r.infoUrl:r.infoUrl||"":"",M=x||"/pubinfo/"+d+".shtml",E=s[l].introduce.replace(/<[^>]+>/g,"");if(f.length>1?a+="<li style='height:165px;'>":a+="<li>",a+=' <a href="'+(x?"":p)+M+'" target="_blank">',v.length==1?(a+=" <img src="+(cdnPath+resetImgSrc(y))+' data-errorcount="0" onerror="coverError(&quot'+cdnPath+y+'&quot)" width="156" height="102">',I&&(a+=' <div class="play"></div>'),a+=' <div class="detail" style="left:190px;">'):a+=' <div class="detail" style="left:20px;">',a+=" <h2>",a+=s[l].title.replace(/<script>/gi,stringEncode("<script>")),a+=" </h2>",a+=" <p>"+E+"</p>",v.length>1)for(var D=0,b=v.length;D<b;D++){D==0&&(a+="<div class='moreimgbox'>");var k=r.infoType=="19"||r.infoType=="20"?v[D]:v[D].sourcePath;a+=" <img src="+(cdnPath+resetImgSrc(k))+' data-errorcount="0" onerror="coverError(&quot'+cdnPath+k+'&quot)" width="156" height="102">',D==b-1&&(a+="</div>")}a+=' <div class="viewinfo">',a+=" "+g+"<span></span>",a+=" </div>",a+=" </div>",a+=" </a>",a+="</li>"}$("#pagination2").pagination({currentPage:e,totalPage:Math.ceil(i.data.total/30),isShow:!1,count:30,prevPageText:"<",nextPageText:">",callback:function(L){list(t,L)}}),s.length==0?$(".plate-navcm").html("<div class='nodata'></div>"):$(".plate-navcm").html(a)}})}(function(t,e){var n={init:function(){this.getListHomepageSetting()},getListHomepageSetting:function(){var s=this;t.ajax({type:"GET",url:"/api/disk/getInfoTypeList",contentType:"application/json",dataType:"json",data:{showCount:1},async:!0,success:function(a){window.classifyData=a.data;var l=a.data||[],o=l;parseInt(infoValue)==0&&(o=s.getParentObj(l,peIde,!0)),s.renderNav(o,peIde),s.filterrigEvent(o)}})},renderNav:function(s,a){for(var l=this,o="",r=s,d=s,g=1,c=l.getParentObj(s,a),I=parseInt(g)==1,f=0,T=c.length;f<T;f++){var h=c[f-1]||0,u=c[f];if(r=d,parseInt(g)==0&&c[f]==infoValuePeIde&&(I=!0),r&&I){u?o+='<div class="plate-nav"> <a class="pid" tabs="'+h+'" href="javascript:void(0);">\u5168\u90E8</a>':o+='<div class="plate-nav"> <a class="pid curs" tabs="0" href="javascript:void(0);">\u5168\u90E8</a>';for(var v=0,y=r.length;v<y;v++){var p=r[v];parseInt(u)==parseInt(p.infoTypeID)?(d=p.children,o+='<a class="pid curs" tabs="'+p.infoTypeID+'" parentLevel="'+p.parentLevel+'" href="javascript:void(0);">'+p.typeName+"</a>"):o+='<a class="pid" tabs="'+p.infoTypeID+'" parentLevel="'+p.parentLevel+'" href="javascript:void(0);">'+p.typeName+"</a>"}o+="</div>"}else if(r)for(var v=0,y=r.length;v<y;v++){var p=r[v];parseInt(u)==parseInt(p.infoTypeID)&&(d=p.children)}}t(".filterrig .plate-nav").html(o)},getParentObj:function(s,a,l){var o="",r=s;function d(g,c,I){for(var f=0,T=g.length;f<T;f++){var h=g[f];if(parseInt(h.infoTypeID)==parseInt(c))r=g,o=I+h.infoTypeID+",";else if(h.children){var u=I+h.info