1 |
- import{i as w}from"./icon_back-c5ec0a72-1709546248219.js";import{d as p,e as d,p as y,f as e,w as m,j as u,k as h,u as _,B as f,v as k,ac as I,ad as T,q as b,t as S,A as L,O as W}from"./index-272deb89-1709546248219.js";import{T as B}from"./index-2b3c05f3-1709546248219.js";import{T as C}from"./index-6c16f4bf-1709546248219.js";import{P as v}from"./index-f2685a19-1709546248219.js";import{a as N,b as E}from"./api-8cd468f0-1709546248219.js";const x="_container_19grw_1",G="_iconBack_19grw_1",V="_separator_19grw_63",U="_wrap_19grw_68",j="_listWrap_19grw_73",z="_listWrapEmpty_19grw_79",n={container:x,iconBack:G,separator:V,wrap:U,listWrap:j,listWrapEmpty:z},F="_searchGroup_p9yh1_1",A="_btnType_p9yh1_5",M="_inputSearch_p9yh1_18",O="_searchCatatory_p9yh1_39",P="_addTrain_p9yh1_44",R="_list_p9yh1_56",q="_itemWrap_p9yh1_66",D="_itemWrapBox_p9yh1_71",$="_itemCard_p9yh1_79",H="_itemImgSection_p9yh1_88",J="_itemTag_p9yh1_95",K="_img_p9yh1_120",Q="_itemTitle_p9yh1_130",o={searchGroup:F,btnType:A,inputSearch:M,searchCatatory:O,addTrain:P,list:R,itemWrap:q,itemWrapBox:D,itemCard:$,itemImgSection:H,itemTag:J,img:K,itemTitle:Q},X=p({name:"search-group",props:{categoryChildList:{type:Array,default:()=>[]},wikiCategoryId:{type:String,default:""}},emits:["search","add"],expose:["init"],setup(i,{emit:c}){const a=d({keyword:"",wikiCategoryId:i.wikiCategoryId||""}),r=()=>{c("search",a)};return y(async()=>{}),()=>e("div",{class:o.searchGroup},[e("div",{class:[o.searchCatatory]},[e(m,{size:"small",class:o.btnType},{default:()=>[i.categoryChildList.length>0?e(u,{type:a.wikiCategoryId===i.wikiCategoryId?"primary":"default",secondary:a.wikiCategoryId!==i.wikiCategoryId,round:!0,size:"small",focusable:!1,onClick:()=>{a.wikiCategoryId=i.wikiCategoryId,r()}},{default:()=>[h("全部")]}):e("span",null,null),i.categoryChildList.map(s=>e(u,{type:a.wikiCategoryId===s.id?"primary":"default",secondary:a.wikiCategoryId!==s.id,round:!0,size:"small",focusable:!1,onClick:()=>{a.wikiCategoryId=s.id,r()}},{default:()=>[s.name]}))]}),e(B,{class:o.inputSearch,placeholder:"请输入音乐家关键词",round:!0,onSearch:s=>{a.keyword=s,r()}},null)])])}}),Y=p({name:"musician-list",props:{categoryId:{type:String,default:""},categoryChildList:{type:Array,default:()=>[]}},setup(i){const c=_(),a=d({searchWord:"",loading:!1,pageTotal:0,pagination:{page:1,rows:18},searchGroup:{type:"MUSICIAN",keyword:"",wikiCategoryId:i.categoryId},tableList:[],teachingStatus:!1,show:!1,item:{}}),r=async()=>{a.loading=!0;try{const{data:t}=await N({...a.pagination,...a.searchGroup}),g=t.rows||[];g.forEach(l=>{l.knowledgeWikiCategories&&l.knowledgeWikiCategories.length&&(l.categories=l.knowledgeWikiCategories[0].knowledgeWikiCategoryTypeName)}),a.tableList=g||[],a.pageTotal=Number(t.total)}catch(t){}a.loading=!1},s=async t=>{a.pagination.page=1,a.searchGroup=Object.assign(a.searchGroup,t),r()};return y(()=>{r()}),()=>e("div",{class:o.instrumentList},[e(X,{categoryChildList:i.categoryChildList||[],wikiCategoryId:i.categoryId,onSearch:t=>s(t)},null),e(f,{show:a.loading,"onUpdate:show":t=>a.loading=t,style:{"min-height":"50vh"}},{default:()=>[e("div",{class:o.list},[a.tableList.map(t=>e("div",{class:o.itemWrap,onClick:()=>{c.push({path:"/content-instruments-detail",query:{type:"MUSICIAN",id:t.id,name:t.name}})}},[e("div",{class:o.itemWrapBox},[e("div",{class:o.itemCard},[t.categories?e("span",{class:o.itemTag},[t.categories]):"",e("div",{class:o.itemImgSection},[e(k,{src:t.avatar,class:o.img,objectFit:"cover",previewDisabled:!0},null)]),e("div",{class:o.itemTitle},[t.name])])])])),!a.loading&&a.tableList.length<=0&&e(C,{style:{minHeight:"50vh"},description:"暂无音乐家"},null)])]}),e(v,{page:a.pagination.page,"onUpdate:page":t=>a.pagination.page=t,pageSize:a.pagination.rows,"onUpdate:pageSize":t=>a.pagination.rows=t,pageTotal:a.pageTotal,"onUpdate:pageTotal":t=>a.pageTotal=t,pageSizes:[18,24,30,36],onList:r},null)])}});function Z(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!L(i)}const ra=p({name:"content-musician",setup(){const i=sessionStorage.getItem("content-musician-tab"),c=_(),a=d({tabValue:"",categoryList:[],loading:!1});return(async()=>{a.loading=!0;try{const{data:s}=await E({type:"MUSICIAN",page:1,rows:99});a.categoryList=s.rows||[],a.categoryList.length&&W(()=>{a.tabValue=i||"name-"+a.categoryList[0].id})}catch(s){}a.loading=!1})(),()=>{let s;return e("div",{class:n.container},[e(m,{align:"center",wrapItem:!1,size:16},{default:()=>[e("img",{style:{cursor:"pointer"},src:w,class:n.iconBack,onClick:()=>c.push({path:"/"})},null),e(I,{separator:""},{default:()=>[e(T,null,{default:()=>[h("音乐家")]})]})]}),e("div",{class:n.wrap},[e("div",{class:[n.listWrap,!a.loading&&a.categoryList.length<=0&&n.listWrapEmpty]},[!a.loading&&a.categoryList.length<=0&&e(C,{description:"暂无音乐家"},null),e(b,{defaultValue:"myResources",paneClass:n.paneTitle,justifyContent:"center",paneWrapperClass:n.paneWrapperContainer,"onUpdate:value":[t=>{sessionStorage.setItem("content-musician-tab",t)},t=>a.tabValue=t],value:a.tabValue},Z(s=a.categoryList.map(t=>e(S,{name:"name-".concat(t.id),tab:t.name},{default:()=>[e(Y,{categoryId:t.id,categoryChildList:t.childrenList},null)]})))?s:{default:()=>[s]})])])])}}});export{ra as default};
|