index-542e009a-1737412120514.js 5.9 KB

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