var Oe=Object.defineProperty,Be=Object.defineProperties;var Fe=Object.getOwnPropertyDescriptors;var ne=Object.getOwnPropertySymbols;var Pe=Object.prototype.hasOwnProperty,ze=Object.prototype.propertyIsEnumerable;var ae=(y,l,_)=>l in y?Oe(y,l,{enumerable:!0,configurable:!0,writable:!0,value:_}):y[l]=_,E=(y,l)=>{for(var _ in l||(l={}))Pe.call(l,_)&&ae(y,_,l[_]);if(ne)for(var _ of ne(l))ze.call(l,_)&&ae(y,_,l[_]);return y},V=(y,l)=>Be(y,Fe(l));var F=(y,l,_)=>new Promise((A,x)=>{var $=w=>{try{C(_.next(w))}catch(z){x(z)}},P=w=>{try{C(_.throw(w))}catch(z){x(z)}},C=w=>w.done?A(w.value):Promise.resolve(w.value).then($,P);C((_=_.apply(y,l)).next())});import{_ as Re}from"./course-bg2-CxSB1oSX.js";import"./icon19-BYYGCnSf.js";import{b as Ee,r as g,u as Ve,D as He,a as ce,G as Me,J as Ae,X as qe,h as u,i as t,m as f,q as m,Y as re,t as c,v,F as U,k as N,w as ue,e as T,j as I,f as de,g as Ge,$ as Je,d as We,o as r,p as je,s as H,n as M,T as Ke,a6 as Xe,al as Ye,y as Qe,W as Ze,am as et,A as tt}from"./index-CMcNtdVb.js";import{_ as st}from"./no-RFwsBY1n.js";import{L as ot}from"./LabelFilterX-gvmXZW5b.js";import{g as pe}from"./Index-sfpT82lj.js";import"./Tags-DHqdChWG.js";const it={class:"training-course"},lt={class:"training-course-header"},nt={class:"left-carousel"},at={class:"self-content self-content-left"},ct={key:0,class:"title ellipsis-2"},rt={class:"desc-tooltip"},ut={class:"btn"},dt={key:0,class:"overlay-caurse-right"},pt=["src"],vt={class:"right-carousel"},_t={class:"carousel-header"},ht={class:"title"},gt={class:"carousel-indicators"},mt={class:"indicator-dots"},ft=["onClick"],yt={class:"panel-content"},kt=["onClick"],bt={class:"panel-content-item-img"},wt=["src"],Ct={class:"panel-content-item-content"},Tt={class:"panel-content-item-content-title ellipsis-2"},xt={class:"ellipsis-1"},$t={class:"training-course-content"},Dt={class:"training-course-content-left"},St={class:"training-course-content-right"},Lt={class:"flex-row-24"},Ut={class:"filter-condition"},Nt={class:"title"},It={class:"item-list"},Ot=["onClick"];const Bt={class:"filter-content"},Ft={class:"filter-section"},Pt={class:"filter-title"},zt={class:"filter-tags"},Rt=["onClick"],Et={class:"filter-section"},Vt={class:"filter-title"},Ht={class:"filter-tags"},Mt=["onClick"],At={class:"filter-section"},qt={class:"filter-title"},Gt={class:"filter-tags"},Jt=["onClick"],Wt={class:"filter-actions"},jt={key:0,class:"infinite-list-wrapper",style:{overflow:"hidden",height:"calc(100vh - 38px)","overflow-y":"auto","padding-bottom":"0px","box-sizing":"border-box"}},Kt=["infinite-scroll-disabled"],Xt=["onClick"],Yt={class:"main-img"},Qt=["src"],Zt={class:"item-content"},es={class:"item-content-title"},ts={key:0,class:"tag-list-all ellipsis-1"},ss={class:"title ellipsis-1"},os={class:"small-content"},is={class:"item-content-bottom"},ls={class:"item-content-bottom-right"},ns={key:0,class:"loading-state"},as={key:1,class:"no-more"},cs={key:1,class:"no-data"},rs={class:"black-font"},ys={__name:"Index",setup(y){const{t:l}=Ee(),_=Ae(),A=We(),x=g("postScore1"),$=g(""),P=Ge(),C=Ve(),w=g([{label:"recommend",value:"postScore1"},{label:"hot",value:"postScore"},{label:"latest",value:"postTime"}]),{calculateRelativeTime:z}=Ze();He(C.categoryList,()=>{var s;let e=((s=C.categoryList)==null?void 0:s.filter(n=>n.categoryName==="鍩硅璇剧▼AI"))||[];e!=null&&e.length&&($.value=e[0].id)},{deep:!0,immediate:!0});const q=new Map,ve=e=>{const s=Date.now();return(e||[]).filter(n=>{if(n!=null&&n.releaseTime){const a=new Date(n.releaseTime.replace(/-/g,"/")).getTime();if(isNaN(a)||s<a)return!1}if(n!=null&&n.downTime){const a=new Date(n.downTime.replace(/-/g,"/")).getTime();if(isNaN(a)||s>=a)return!1}return!0})},_e=()=>F(null,null,function*(){const e=yield tt();return(e==null?void 0:e.code)===200&&(e!=null&&e.data)?e.data.accessToken:""}),he=(e,s,n=2)=>{const a=`${e}_${s}_${n}`;if(q.has(a))return q.get(a);if(!e)return!0;const o=document.createElement("div");o.style.position="absolute",o.style.visibility="hidden",o.style.zIndex="-1",o.style.top="0",o.style.left="0",o.style.padding="0",o.style.margin="0",o.style.border="none",o.style.width=s+"px",o.style.lineHeight="22px",o.style.fontSize="16px",o.style.fontFamily="inherit",o.style.wordBreak="break-word",o.style.whiteSpace="normal",o.style.wordWrap="break-word",o.style.display="-webkit-box",o.style.webkitBoxOrient="vertical",o.style.webkitLineClamp=n.toString(),o.style.overflow="hidden",o.textContent=e,document.body.appendChild(o);const b=(parseFloat(getComputedStyle(o).lineHeight)||21)*n,d=o.scrollHeight>b;return document.body.removeChild(o),q.set(a,!d),!d},ge=e=>e.descInfo?he(e.descInfo,442,2):!0,me=e=>e?z(e):"",fe=e=>{et(`trainingCourseDetail?id=${e}`)},te=g([]),G=g(!1),D=g({status:"",category:"",sponsor:""}),K={status:[{label:"free",value:"FREE"},{label:"charge",value:"CHARGE"}],category:[{label:"online",value:"ONLINE"},{label:"offline",value:"OFFLINE"}],sponsor:[{label:"official",value:"PUBLIC"},{label:"community",value:"COMMUNITY"}]},X=g(),Y=g(0),J=g(null),ye=e=>{G.value=e},ke=()=>F(null,null,function*(){var s;const e=yield Je({"category-id":$.value,business:"content"});if(e.code===200){const n=((s=e.data)==null?void 0:s.map(a=>V(E({},a),{image:a.pcImg?`${P}/${a.pcImg}`:""})))||[];te.value=ve(n).slice(0,5)}}),be=()=>F(null,null,function*(){var s,n;const e=yield pe({pageNo:1,pageSize:12,postContentType:"course",sortType:"postScore",categorys:[$.value]});if(e.code==="200"){let a=((n=(s=e.data)==null?void 0:s.list)==null?void 0:n.map(o=>V(E({},o),{postPictureUrl:`${P}/${o.postPictureUrl}`})))||[];X.value=we(a,4)}}),we=(e,s)=>{if(!(e!=null&&e.length))return[];const n=[],a=e.splice(0,s*3);for(let o=0;o<a.length;o+=s)n.push({id:o+1,list:a.slice(o,o+s)});return n},se=g(""),k=g({current:1,size:12,total:0,pages:0}),S=g(!1),L=g([]),Q=g([]),Z=ce(()=>k.value.current>=k.value.pages),Ce=ce(()=>S.value||Z.value),Te=e=>{x.value=e,O(!0)},xe=e=>{Q.value=e,O(!0)},O=(e=!1)=>F(null,null,function*(){var s,n,a,o;e&&(k.value.current=1,L.value=[]),S.value=!0;try{const h={pageNo:k.value.current,pageSize:k.value.size,postContentType:"course",sortType:x.value==="postScore1"?"postScore":x.value,categorys:[$.value],topicsCategorys:((n=(s=Q.value)==null?void 0:s.filter(d=>d.tagType===2))==null?void 0:n.map(d=>d.id))||[],productCategorys:((o=(a=Q.value)==null?void 0:a.filter(d=>d.tagType===1))==null?void 0:o.map(d=>d.id))||[]},b=yield pe(h);if(b.code==="200"&&b.data){const{list:d,total:B}=b.data,ee=B&&k.value.size?Math.ceil(B/k.value.size):0;k.value=V(E({},k.value),{total:B,pages:ee});const W=(d||[]).map(R=>V(E({},R),{postPictureUrl:R.postPictureUrl?P+"/"+R.postPictureUrl:""}));k.value.current===1?L.value=W:L.value=[...L.value,...W]}}catch(h){console.error(h),S.value=!1}finally{S.value=!1}}),$e=()=>{D.value={status:"",category:"",sponsor:""},O(!0),G.value=!1},De=()=>{O(!0),G.value=!1},Se=["https://uat.siemens-x.com.cn/x-industrial-ai-web/activityList","https://uat.siemens-x.com.cn/x-industrial-ai-web/marketing","https://uat.siemens-x.com.cn/x-industrial-ai-web/informationCenter","https://uat.siemens-x.com.cn/x-industrial-ai-web/detail","https://uat.siemens-x.com.cn/x-industrial-ai-web/productOrSolution","https://uat.siemens-x.com.cn/x-industrial-ai-web/partners","https://uat.siemens-x.com.cn/x-industrial-ai-web/trainingCourse","https://uat.siemens-x.com.cn/x-industrial-ai-web/trainingCourseDetail","https://ai.siemens-x.com.cn/activityList","https://ai.siemens-x.com.cn/marketing","https://ai.siemens-x.com.cn/informationCenter","https://ai.siemens-x.com.cn/detail","https://ai.siemens-x.com.cn/productOrSolution","https://ai.siemens-x.com.cn/partners","https://ai.siemens-x.com.cn/trainingCourse","https://ai.siemens-x.com.cn/trainingCourseDetail","http://ai.siemens-x.com.cn","https://uat.siemens-x.com.cn/x-industrial-ai-web","http://ai.siemens-x.com.cn/","https://uat.siemens-x.com.cn/x-industrial-ai-web/"],Le=e=>{if(!e)return!0;try{const s=new URL(e);return!Se.some(n=>s.href.includes(n)||s.origin.includes(n))}catch(s){return console.warn("URL瑙f瀽澶辫触锛岄粯璁ら渶瑕佺櫥褰�:",e),!0}},oe=e=>F(null,null,function*(){let s=C.getToken(),n="",a=!1;if(e.linkType==="custom"&&(n=JSON.parse(e.linkDetail).pcUrl,a=Le(n)),!s&&(e.linkType==="product"||e.linkType==="activity"||e.linkType==="shop"||e.linkType==="custom"&&a)){C.loginDialog("2");return}s&&(s=yield _e());const o="https://www.siemens-x.com.cn";let h="";switch(e.linkType){case"product":{h=s?`${o}/offering/${e.linkDetail}?accessToken=${s}`:`${o}/offering/${e.linkDetail}`;break}case"activity":{h=s?`${o}/event-detail?eventId=${e.linkDetail}&accessToken=${s}`:`${o}/event-detail?eventId=${e.linkDetail}`;break}case"shop":{h=s?`${o}/store/shop/${e.linkDetail}?accessToken=${s}`:`${o}/store/shop/${e.linkDetail}`;break}case"custom":{const b=JSON.parse(e.linkDetail).pcUrl;let d=b?new URL(b):"";s&&d&&d.searchParams.set("accessToken",s),h=(d==null?void 0:d.toString())||"";break}case"content":{h=A.resolve({path:"/detail",query:{id:e.linkDetail}}).href;break}default:{h="";break}}h&&window.open(h,"_blank")}),ie=e=>{A.push({path:"/trainingCourseDetail",query:{id:e}})},Ue=e=>{Y.value=e},Ne=e=>{Y.value=e,J.value&&typeof J.value.goToSlide=="function"&&J.value.goToSlide(e)},Ie=()=>{!S.value&&!Z.value&&(k.value.current++,O())};return Me(()=>{se.value=_.query.tagIds||"",O(!0),be(),ke()}),qe(()=>{q.clear()}),(e,s)=>{var le;const n=T("el-tooltip"),a=T("el-button"),o=T("el-popover"),h=T("DisplayTags"),b=T("el-dropdown-item"),d=T("el-dropdown-menu"),B=T("el-dropdown"),ee=T("el-icon"),W=de("infinite-scroll"),R=de("loading");return r(),u("div",it,[t("div",lt,[t("div",nt,[f(re,{items:te.value,"use-background":!1,"show-overlay":!0,"show-indicator-titles":!0,height:"425px","indicator-position":"inside",onItemClick:oe},{default:m(({item:i,index:p})=>[(r(),u("div",{class:"overlay-caurse-content",key:p},[t("div",at,[i.title?(r(),u("div",ct,c(i.title),1)):I("",!0),i.descInfo?(r(),je(n,{key:1,"show-arrow":!1,disabled:ge(i),effect:"customized","popper-class":"tootip-course-desc",placement:"top"},{content:m(()=>[t("div",rt,c(i.descInfo),1)]),default:m(()=>[t("div",{class:"desc ellipsis-2",ref:"descRef"},c(i.descInfo),513)]),_:2},1032,["disabled"])):I("",!0),t("div",ut,[f(a,{type:"primary",size:"large",class:"join-btn",onClick:j=>oe(i)},{default:m(()=>[H(c(i.btnName),1)]),_:2},1032,["onClick"])])]),i.image?(r(),u("div",dt,[t("img",{src:i.image},null,8,pt)])):I("",!0),s[0]||(s[0]=t("div",{class:"bottom-img"},[t("img",{src:Re})],-1))]))]),_:1},8,["items"])]),t("div",vt,[t("div",_t,[t("div",ht,c(v(l)("hotCourseTitle")),1),t("div",gt,[t("div",mt,[(r(!0),u(U,null,N(X.value,(i,p)=>(r(),u("span",{key:p,class:M(["indicator-dot",{active:p===Y.value}]),onClick:j=>Ne(p)},null,10,ft))),128))])])]),f(re,{items:X.value,"use-background":!1,"show-overlay":!1,"show-indicator-titles":!1,height:"326px","indicator-position":"none",autoplay:!0,"autoplay-interval":3e3,ref_key:"rightCarousel",ref:J,onSlideChange:Ue},{default:m(({item:i})=>[t("div",yt,[(r(!0),u(U,null,N(i.list,p=>(r(),u("div",{class:"panel-content-item",key:p,onClick:j=>ie(p.id)},[t("div",bt,[t("img",{src:p.postPictureUrl},null,8,wt)]),t("div",Ct,[t("div",Tt,c(p.title),1),t("div",xt,c(me(p.postTime))+c(p.classHourCount||0)+" "+c(v(l)("section")),1)])],8,kt))),128))])]),_:1},8,["items"])])]),t("div",$t,[t("div",Dt,[f(ot,{categoryId:$.value,default:se.value,onFilterChange:xe,isTitleVisible:!0},null,8,["categoryId","default"])]),t("div",St,[t("div",Lt,[t("div",Ut,[t("div",Nt,c(v(l)("allCourse")),1),t("div",It,[(r(!0),u(U,null,N(w.value,i=>(r(),u("div",{key:i.value,onClick:p=>Te(i.value),class:M({active:i.value===x.value})},c(v(l)(i.label)),11,Ot))),128)),f(o,{placement:"bottom-end",width:210,trigger:"click","popper-class":"filter-popover",visible:G.value,"onUpdate:visible":ye},{reference:m(()=>[I("",!0)]),default:m(()=>[t("div",Bt,[t("div",Ft,[t("div",Pt,c(v(l)("isFree")),1),t("div",zt,[(r(!0),u(U,null,N(K.status,i=>(r(),u("span",{key:i.value,onClick:p=>D.value.status=i.value,class:M(["filter-tag",D.value.status===i.value?"active-item":""])},c(v(l)(i.label)),11,Rt))),128))])]),t("div",Et,[t("div",Vt,c(v(l)("courseForm")),1),t("div",Ht,[(r(!0),u(U,null,N(K.category,i=>(r(),u("span",{key:i.value,onClick:p=>D.value.category=i.value,class:M(["filter-tag",D.value.category===i.value?"active-item":""])},c(v(l)(i.label)),11,Mt))),128))])]),t("div",At,[t("div",qt,c(v(l)("sponsor")),1),t("div",Gt,[(r(!0),u(U,null,N(K.sponsor,i=>(r(),u("span",{key:i.value,onClick:p=>D.value.sponsor=i.value,class:M(["filter-tag",D.value.sponsor===i.value?"active-item":""])},c(v(l)(i.label)),11,Jt))),128))])]),t("div",Wt,[f(a,{size:"small",onClick:$e,text:""},{default:m(()=>[H(c(v(l)("cancel")),1)]),_:1}),f(a,{size:"small",type:"primary",onClick:De},{default:m(()=>[H(c(v(l)("confirm")),1)]),_:1})])])]),_:1},8,["visible"])])]),(le=L.value)!=null&&le.length?(r(),u("div",jt,[ue((r(),u("div",{class:"training-course-content-right-content-list list","infinite-scroll-disabled":Ce.value,"infinite-scroll-distance":"10"},[(r(!0),u(U,null,N(L.value,i=>{var p;return r(),u("div",{class:"training-course-content-right-content-item",onClick:j=>ie(i.id),key:i.id},[t("div",Yt,[t("img",{src:i.postPictureUrl},null,8,Qt)]),t("div",Zt,[t("div",es,[((p=i.topicsList)==null?void 0:p.length)>0?(r(),u("div",ts,[f(h,{class:"ellipsis-1",tagDefaultOptions:i.topicsList,maxVisible:2,svgSize:"12px"},null,8,["tagDefaultOptions"])])):I("",!0),t("div",ss,c(i.title),1),t("div",os,c(i.learnerCount||0)+" "+c(v(l)("alreadyLearned")),1)]),t("div",is,[s[5]||(s[5]=t("div",{class:"item-content-bottom-left"},null,-1)),t("div",ls,[t("div",null,[s[2]||(s[2]=t("img",{src:Ke},null,-1)),H(" "+c(i.likeCount),1)]),t("div",null,[f(B,{trigger:"hover"},{dropdown:m(()=>[f(d,{class:"dropdown-menu"},{default:m(()=>[f(b,{onClick:j=>fe(i.id),class:"dropdown-item"},{default:m(()=>[s[3]||(s[3]=t("img",{src:Ye},null,-1)),H(" "+c(v(l)("share")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),default:m(()=>[s[4]||(s[4]=t("img",{src:Xe},null,-1))]),_:2},1024)])])])])],8,Xt)}),128))],8,Kt)),[[W,Ie]]),S.value?(r(),u("div",ns,[f(ee,{class:"is-loading"},{default:m(()=>[f(v(Qe))]),_:1}),t("span",null,c(v(l)("loading")),1)])):I("",!0),Z.value&&L.value.length>0?(r(),u("p",as,c(v(l)("loadedAllData")),1)):I("",!0)])):ue((r(),u("div",cs,[s[6]||(s[6]=t("img",{src:st},null,-1)),t("div",rs,c(v(l)("noMessage.bigTitleOne")),1),t("div",null,c(v(l)("noMessage.smallTitleOne")),1)])),[[R,S.value]])])])])])}}};export{ys as default};