import{d as I,O as L,P as A,Q as F,S as n,g as B,U as E,j as e,F as v,z as c,B as T,C as j,w as C}from"./index.4f40e5e1.js";import{L as D}from"./index.ec6e6a47.js";import{D as M,a as R}from"./index.f404167d.js";import"./index.c4fa4795.js";import{T as f}from"./index.ff0c0b1f.js";import{S as x}from"./index.9cb1152c.js";import{g as N}from"./music.ef20ecaf.js";import{S as z}from"./index.b0a3835a.js";import{C as U}from"./index.41aa1fc7.js";import{b as P}from"./bg-image.e9966434.js";import{T as $}from"./index.4b5981fc.js";import"./use-tab-status.122f9fa5.js";import"./use-id.d72892eb.js";import"./index.8e0ac410.js";import"./icon-xin2.4ab2a52d.js";import"./index.97fec1a5.js";import"./index.10256463.js";const H="_sticky_2w2qn_1",O="_titleActive_2w2qn_31",V="_listContainer_2w2qn_34",G="_line_2w2qn_46",J="_active_2w2qn_52",K="_label_2w2qn_55",Q="_alumnList_2w2qn_68",Y="_bgImg_2w2qn_75",W="_tagTabs_2w2qn_83",X="_fleg_2w2qn_113",Z="_iconFree_2w2qn_119",ee="_iconFreeDisable_2w2qn_123",te="_searchResult_2w2qn_129",ae="_searchTitle_2w2qn_134",se="_radio_2w2qn_139";var s={sticky:H,titleActive:O,listContainer:V,line:G,active:J,label:K,alumnList:Q,bgImg:Y,tagTabs:W,fleg:X,iconFree:Z,iconFreeDisable:ee,searchResult:te,searchTitle:ae,"radio-group":"_radio-group_2w2qn_139",radio:se,"organ-radio":"_organ-radio_2w2qn_170"},Ce=I({name:"MusicList",props:{teacherId:{type:String||Number,default:""},myself:{type:Boolean,default:!1}},setup({onItemClick:le},{expose:re}){localStorage.setItem("behaviorId",N());const y=L(),q=A(),d=y.query.subjectType||"";let u="";d==="SUBJECT"?u="\u58F0\u90E8\u7EC3\u4E60":d==="MUSIC"?u="\u72EC\u594F\u66F2\u76EE":d==="ENSEMBLE"&&(u="\u5408\u594F\u7EC3\u4E60");const a=F({keyword:y.query.search||"",subjectType:d,page:1,subjectId:null,level:"",type:"",title:u}),l=n(null),p=n(!1),_=n(!1),m=n(!1),o=n({}),h=n(),b=n(B.platformType==="STUDENT"?"/api-student":"/api-teacher"),w=t=>{a.page=1,a.keyword=t,l.value=null,g()},g=async()=>{var r;p.value=!0,m.value=!1;const t={...a};try{const i=await C.post(`${b.value}/tenantAlbumMusic/page`,{data:t});if(l.value){const k=(((r=l.value)==null?void 0:r.rows)||[]).concat(i.data.rows||[]);l.value.rows=k}l.value=l.value||i.data,a.page=i.data.pageNo+1,_.value=i.data.pageNo>=i.data.totalPage}catch{m.value=!0}p.value=!1},S=async()=>{const{data:t}=await C.post(`${b.value}/tenantAlbumMusic/selectCondition`,{data:{subjectType:a.subjectType}});o.value=t||{}};return E(async()=>{p.value=!0,await S(),await g()}),()=>e(v,null,[e("div",{class:s.sticky},[e($,null,{default:()=>[e(U,{background:"transparent",isFixed:!1,border:!1,title:u,color:"#131415"},null),e(x,{onSearch:w,type:"tenant",background:"transparent",inputBackground:"transparent"},{left:()=>e(M,null,{default:()=>[e(R,{titleClass:a.subjectId||a.type||a.level?s.titleActive:"",title:"\u7B5B\u9009",ref:h},{default:()=>[e("div",{class:s.searchResult,style:{maxHeight:"45vh",overflowY:"auto"}},[o.value.subjects&&o.value.subjects.length>0&&e(v,null,[e("div",{class:s.searchTitle},[c("\u58F0\u90E8")]),e("div",{class:[s["radio-group"],s.radio,s["organ-radio"]]},[o.value.subjects.map(t=>{const r=t.id===a.subjectId;return e(f,{size:"large",plain:r,type:r?"primary":"default",round:!0,onClick:()=>{a.subjectId=t.id}},{default:()=>[t.name]})})])]),o.value.levelList&&o.value.levelList.length>0&&e(v,null,[e("div",{class:s.searchTitle},[c("\u7EA7\u522B")]),e("div",{class:[s["radio-group"],s.radio,s["organ-radio"]]},[o.value.levelList.map(t=>{const r=t.id===a.level;return e(f,{size:"large",plain:r,type:r?"primary":"default",round:!0,onClick:()=>{a.level=t.id}},{default:()=>[t.value]})})])]),o.value.typeList&&o.value.typeList.length>0&&e(v,null,[e("div",{class:s.searchTitle},[c("\u7C7B\u578B")]),e("div",{class:[s["radio-group"],s.radio,s["organ-radio"]]},[o.value.typeList.map(t=>{const r=t.id===a.type;return e(f,{size:"large",plain:r,type:r?"primary":"default",round:!0,onClick:()=>{a.type=t.id}},{default:()=>[t.value]})})])])]),e("div",{class:["btnGroup","btnMore"]},[e(T,{type:"primary",plain:!0,round:!0,onClick:()=>{a.subjectId=null,a.level="",a.type=""}},{default:()=>[c("\u91CD \u7F6E")]}),e(T,{type:"primary",round:!0,block:!0,onClick:()=>{var t;w(""),(t=h.value)==null||t.toggle()}},{default:()=>[c("\u786E \u8BA4")]})])]})]})})]}),e("img",{class:s.bgImg,src:P},null)]),e("div",{class:s.alumnList},[e(D,{finished:_.value,"finished-text":(l.value&&l.value.rows.length,""),onLoad:g,error:m.value,immediateCheck:!1},{default:()=>[l.value&&l.value.rows.length?e(z,{showTitleImg:!0,list:l.value.rows,onDetail:t=>{q.push({path:"/music-detail",query:{id:t.id}})}},null):!p.value&&e(j,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)]})])])}});export{Ce as default};
