import{i as I}from"./icon_back-c5ec0a72-1734950731618.js";import{d,e as p,q as h,f as a,x as _,j as y,k as f,u as C,E as S,w as T,aS as b,aT as W,t as L,v,D as B,S as N}from"./index-efb66432-1734950731618.js";import{T as G}from"./index-80ba3b64-1734950731618.js";import{T as w}from"./index-043f1db0-1734950731618.js";import{P as E}from"./index-4013b1bc-1734950731618.js";import{a as V,b as x}from"./api-9f0dec79-1734950731618.js";const F="_container_19grw_1",U="_iconBack_19grw_1",j="_separator_19grw_63",z="_wrap_19grw_68",A="_listWrap_19grw_73",O="_listWrapEmpty_19grw_79",l={container:F,iconBack:U,separator:j,wrap:z,listWrap:A,listWrapEmpty:O},D="_searchGroup_1291e_1",M="_btnType_1291e_5",P="_inputSearch_1291e_18",R="_searchCatatory_1291e_39",q="_addTrain_1291e_44",J="_list_1291e_56",$="_itemWrap_1291e_66",H="_itemWrapBox_1291e_71",K="_itemCard_1291e_79",Q="_itemImgSection_1291e_88",X="_itemTag_1291e_95",Y="_img_1291e_120",Z="_itemTitle_1291e_130",o={searchGroup:D,btnType:M,inputSearch:P,searchCatatory:R,addTrain:q,list:J,itemWrap:$,itemWrapBox:H,itemCard:K,itemImgSection:Q,itemTag:X,img:Y,itemTitle:Z},ee=d({name:"search-group",props:{categoryChildList:{type:Array,default:()=>[]},defaultWikiCategoryId:{type:String,default:""},wikiCategoryId:{type:String,default:""},searchValue:{type:String,default:""}},emits:["search","add"],expose:["init"],setup(s,{emit:u}){const t=p({keyword:s.searchValue||"",wikiCategoryId:s.wikiCategoryId||s.defaultWikiCategoryId||""}),n=()=>{u("search",t)};return h(async()=>{console.log(t,"formsformsformsforms")}),()=>a("div",{class:o.searchGroup},[a("div",{class:[o.searchCatatory]},[a(_,{size:"small",class:o.btnType},{default:()=>[s.categoryChildList.length>0?a(y,{type:t.wikiCategoryId===s.defaultWikiCategoryId?"primary":"default",secondary:t.wikiCategoryId!==s.defaultWikiCategoryId,round:!0,size:"small",focusable:!1,onClick:()=>{t.wikiCategoryId=s.defaultWikiCategoryId,n()}},{default:()=>[f("全部")]}):a("span",null,null),s.categoryChildList.map(e=>a(y,{type:t.wikiCategoryId===e.id?"primary":"default",secondary:t.wikiCategoryId!==e.id,round:!0,size:"small",focusable:!1,onClick:()=>{t.wikiCategoryId=e.id,n()}},{default:()=>[e.name]}))]}),a(G,{class:o.inputSearch,value:s.searchValue,placeholder:"请输入音乐家名称",round:!0,onSearch:e=>{t.keyword=e,n()}},null)])])}}),ae=d({name:"musician-list",props:{categoryId:{type:String,default:""},categoryChildList:{type:Array,default:()=>[]}},setup(s){const u=(i="get",g="")=>{const c="content-musician-catch";if(i==="get"){const m=sessionStorage.getItem(c);return m?JSON.parse(m):null}else i==="set"&&sessionStorage.setItem(c,g)},t=C(),n=u("get"),e=p({searchWord:"",loading:!1,pageTotal:0,pagination:n&&n.pagination?n.pagination:{page:1,rows:18},searchGroup:n&&n.searchGroup?n.searchGroup:{type:"MUSICIAN",keyword:"",wikiCategoryId:s.categoryId},tableList:[],teachingStatus:!1,show:!1,item:{}}),r=async()=>{e.loading=!0,u("set",JSON.stringify({pagination:e.pagination,searchGroup:e.searchGroup}));try{const{data:i}=await V({...e.pagination,...e.searchGroup}),g=i.rows||[];g.forEach(c=>{c.knowledgeWikiCategories&&c.knowledgeWikiCategories.length&&(c.categories=c.knowledgeWikiCategories[0].knowledgeWikiCategoryTypeName)}),e.tableList=g||[],e.pageTotal=Number(i.total)}catch(i){}e.loading=!1},k=async i=>{e.pagination.page=1,e.searchGroup=Object.assign(e.searchGroup,i),r()};return h(()=>{r()}),()=>a("div",{class:o.instrumentList},[a(ee,{categoryChildList:s.categoryChildList||[],wikiCategoryId:e.searchGroup.wikiCategoryId,defaultWikiCategoryId:s.categoryId,searchValue:e.searchGroup.keyword,onSearch:i=>k(i)},null),a(S,{show:e.loading,"onUpdate:show":i=>e.loading=i,style:{"min-height":"50vh"}},{default:()=>[a("div",{class:o.list},[e.tableList.map(i=>a("div",{class:o.itemWrap,onClick:()=>{t.push({path:"/content-instruments-detail",query:{type:"MUSICIAN",id:i.id,name:i.name}})}},[a("div",{class:o.itemWrapBox},[a("div",{class:o.itemCard},[i.categories?a("span",{class:o.itemTag},[i.categories]):"",a("div",{class:o.itemImgSection},[a(T,{src:i.avatar,class:o.img,objectFit:"cover",previewDisabled:!0},null)]),a("div",{class:o.itemTitle},[i.name])])])])),!e.loading&&e.tableList.length<=0&&a(w,{style:{minHeight:"50vh"},description:"暂无音乐家"},null)])]}),a(E,{page:e.pagination.page,"onUpdate:page":i=>e.pagination.page=i,pageSize:e.pagination.rows,"onUpdate:pageSize":i=>e.pagination.rows=i,pageTotal:e.pageTotal,"onUpdate:pageTotal":i=>e.pageTotal=i,pageSizes:[18,24,30,36],onList:r},null)])}});function te(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!B(s)}const le=d({name:"content-musician",setup(){const s=sessionStorage.getItem("content-musician-tab"),u=C(),t=p({tabValue:"",categoryList:[],loading:!1});return(async()=>{t.loading=!0;try{const{data:e}=await x({type:"MUSICIAN",page:1,rows:99});t.categoryList=e.rows||[],t.categoryList.length&&N(()=>{t.tabValue=s||"name-"+t.categoryList[0].id})}catch(e){}t.loading=!1})(),()=>{let e;return a("div",{class:l.container},[a(_,{align:"center",wrapItem:!1,size:16},{default:()=>[a("img",{style:{cursor:"pointer"},src:I,class:l.iconBack,onClick:()=>u.push({path:"/"})},null),a(b,{separator:""},{default:()=>[a(W,null,{default:()=>[f("音乐家")]})]})]}),a("div",{class:l.wrap},[a("div",{class:[l.listWrap,!t.loading&&t.categoryList.length<=0&&l.listWrapEmpty]},[!t.loading&&t.categoryList.length<=0&&a(w,{description:"暂无音乐家"},null),a(L,{defaultValue:"myResources",paneClass:l.paneTitle,justifyContent:"center",paneWrapperClass:l.paneWrapperContainer,"onUpdate:value":[r=>{sessionStorage.setItem("content-musician-tab",r),sessionStorage.removeItem("content-musician-catch")},r=>t.tabValue=r],value:t.tabValue},te(e=t.categoryList.map(r=>a(v,{name:"name-".concat(r.id),tab:r.name},{default:()=>[a(ae,{categoryId:r.id,categoryChildList:r.childrenList},null)]})))?e:{default:()=>[e]})])])])}}});export{le as default};