1 |
- 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 c in t)b.call(t,c)&&i.indexOf(c)<0&&(r[c]=t[c]);if(t!=null&&d)for(var c of d(t))i.indexOf(c)<0&&I.call(t,c)&&(r[c]=t[c]);return r};import{a as z}from"./moreArrow.9485fe74.js";import{a as N,s as o}from"./index.3604a4c2.js";import{v as P}from"./index.8040e9d4.js";import{m as T}from"./index.6af6c3f0.js";import{h as v}from"./scrollbar.min.588a5f49.js";import{b as w,c as U,r as C}from"./index.e37e9468.js";import{s as x,u as F,S as H}from"./index.6981d36d.js";import{b as L}from"./index.8a8b0581.js";import{P as k}from"./index.de4a2c10.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:o.w1200},[a("div",{class:o.section,style:"padding-bottom: 0;"},[a("div",{class:o.tagList},[a("div",{class:[o.tagContainer,e.hideSearch&&o.hide]},[e.tagTree.map(s=>a("span",{class:[o.tagItem,s.isCheck&&o.active],onClick:()=>{e.tagTree.forEach(n=>{n.isCheck=!1}),s.isCheck=!0,h({musicTagIds:s.id})}},[s.name]))]),a("div",{class:o.wrapRight,onClick:()=>{e.hideSearch=!e.hideSearch}},[a("span",null,[e.hideSearch?"\u66F4\u591A":"\u6536\u8D77"]),a("img",{class:[o.arrow,!e.hideSearch&&o.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:o.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:[o.section,o.pb40],style:"padding-top: 0"},[a("div",{class:o.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};
|