var M=Object.defineProperty,_=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var d=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var j=(t,i,r)=>i in t?M(t,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[i]=r,m=(t,i)=>{for(var r in i||(i={}))b.call(i,r)&&j(t,r,i[r]);if(d)for(var r of d(i))I.call(i,r)&&j(t,r,i[r]);return t},y=(t,i)=>_(t,q(i));var S=(t,i)=>{var r={};for(var o in t)b.call(t,o)&&i.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&d)for(var o of d(t))i.indexOf(o)<0&&I.call(t,o)&&(r[o]=t[o]);return r};import{a as z}from"./moreArrow.9485fe74.js";import{a as N,s as c}from"./index.3604a4c2.js";import{v as P}from"./index.8040e9d4.js";import{m as T}from"./index.fe62db76.js";import{h as v}from"./scrollbar.min.c94080fe.js";import{b as w,c as U,r as C}from"./index.ff4c28df.js";import{s as x,u as F,S as H}from"./index.c341ce65.js";import{b as L}from"./index.02b05a8f.js";import{P as k}from"./index.54e86490.js";import{d as V,u as W,r as $,o as B,c as a,F as G}from"./vendor.63aa8b19.js";import{C as D}from"./index.ba731085.js";import"./player.8b5ee2bb.js";import"./icon.6e6f91da.js";import"./music.f2b8674a.js";import"./icon_album_active.66672e6b.js";var le=V({name:"musicLibrary",components:{albumItem:N,videoDetailItem:P,musicLIstItem:T,hotSearch:v,silder:w,searchInput:x,pagination:k,ColEmpty:D,banner:L},setup(){var g;const t=W();let i=0;const r=((g=U.user.data)==null?void 0:g.subjectId)||"";r&&(i=Number(r.split(",")[0])),i=F(H.SEARCH).id||i;const e=$({albumList:[],musicList:[],tagTree:[],hideSearch:!0,isshowData:!1,pageInfo:{limit:20,page:1,total:0,page_size:[5,10,20,40,50]},searchs:{musicTagIds:t.query.musicTagIds||"",search:t.query.search||"",subject:i||""}}),p=async()=>{try{const s=e.searchs,{search:n,subject:l}=s,A=S(s,["search","subject"]),f=await C.post("/api-website/open/music/sheet/list",{data:y(m({auditStatus:"PASS"},A),{idAndName:n,subjectIds:l,page:e.pageInfo.page,rows:e.pageInfo.limit,state:1})});e.musicList=f.data.rows.map(u=>(typeof u.paymentType=="string"&&(u.paymentType=u.paymentType.split(",")),u)),e.pageInfo.total=f.data.total,e.pageInfo.total==0?e.isshowData=!0:e.isshowData=!1}catch(n){console.log(n)}},E=async()=>{try{const n=(await C.get("/api-website/open/MusicTag/tree",{params:{type:"MUSIC"}})).data||[];e.tagTree=[{name:"\u5168\u90E8",id:"",isCheck:!0},...n],e.searchs.musicTagIds&&e.tagTree.forEach(l=>{l.isCheck=!1,l.id==e.searchs.musicTagIds&&(l.isCheck=!0)})}catch(s){console.log(s)}},R=s=>{const n=(s||[]).filter(l=>l>0);e.searchs.musicTagIds=n.join(","),h(e.searchs)},h=s=>{e.searchs=m(m({},e.searchs),s),p()};return B(()=>{E(),p()}),()=>a("div",null,[a(L,null,null),a("div",{class:"bg-white"},[a("div",{class:c.w1200},[a("div",{class:c.section,style:"padding-bottom: 0;"},[a("div",{class:c.tagList},[a("div",{class:[c.tagContainer,e.hideSearch&&c.hide]},[e.tagTree.map(s=>a("span",{class:[c.tagItem,s.isCheck&&c.active],onClick:()=>{e.tagTree.forEach(n=>{n.isCheck=!1}),s.isCheck=!0,h({musicTagIds:s.id})}},[s.name]))]),a("div",{class:c.wrapRight,onClick:()=>{e.hideSearch=!e.hideSearch}},[a("span",null,[e.hideSearch?"\u66F4\u591A":"\u6536\u8D77"]),a("img",{class:[c.arrow,!e.hideSearch&&c.active],src:z,alt:""},null)])]),a(x,{isWhile:!1,type:"search",showSearch:!0,placeholder:"\u641C\u7D22\u4F60\u60F3\u7EC3\u4E60\u7684\u4E13\u8F91",searchVal:m({},e.searchs),onStartSearch:s=>{e.pageInfo.page=1,h(s)}},null),a("div",{class:c.hotSearch},[a(v,{onSearchRust:s=>R(s),onHotTag:s=>{e.searchs.search=s,p()},type:"",isChiose:!0},null)]),e.musicList&&e.musicList.length>0&&a(G,null,[a("div",{class:[c.section,c.pb40],style:"padding-top: 0"},[a("div",{class:c.musicList},[e.musicList.map(s=>a(T,{item:s},null))])])]),e.isshowData&&a(D,null,null),a(k,{total:e.pageInfo.total,page:e.pageInfo.page,"onUpdate:page":s=>e.pageInfo.page=s,limit:e.pageInfo.limit,"onUpdate:limit":s=>e.pageInfo.limit=s,pageSizes:e.pageInfo.page_size,pagination:p},null)])])]),a(w,null,null)])}});export{le as default};
