import{d as S,P as v,O as w,Q as E,S as l,U as N,j as a,C as y,F as C,x as b}from"./index.3bfa6a0e.js";import{D as F,a as A}from"./index.60cf2b6f.js";import"./index.79997a38.js";import{L as T}from"./index.0a290e73.js";import{C as R}from"./index.645e7ddc.js";import{T as k}from"./index.52c97b40.js";import{b as M}from"./bg.650cc876.js";import{S as j}from"./index.8a87fb9c.js";import{C as O}from"./index.586937d5.js";import"./use-id.7c44c16f.js";import"./use-tab-status.c0d730a9.js";import"./index.b1671445.js";import"./index.4a8093e5.js";import"./index.983bfd1a.js";const U="_sticky_2r9wh_1",B="_dropdownMenuSub_2r9wh_45",G="_titleActive_2r9wh_74",x="_search_2r9wh_77",H="_bgImg_2r9wh_80",P="_alumnList_2r9wh_88",q="_courseItem_2r9wh_94";var u={sticky:U,dropdownMenuSub:B,titleActive:G,search:x,bgImg:H,alumnList:P,courseItem:q},se=S({name:"lessonCourseware",setup(){const f=v(),m=w(),t=E({keyword:m.query.search||"",albumId:m.query.albumId,subjectList:[],page:1}),o=l(!1),I=l(!1),i=l(!1),c=l(""),d=l([]);let p;(function(e){e.PERCUSSION_SINGLE="\u6253\u51FB\u4E50",e.FLUTE_SINGLE="\u957F\u7B1B",e.SAX_SINGLE="\u8428\u514B\u65AF",e.CLARINET_SINGLE="\u5355\u7C27\u7BA1",e.TRUMPET_SINGLE="\u5C0F\u53F7",e.TROMBONE_SINGLE="\u957F\u53F7",e.HORN_SINGLE="\u5706\u53F7",e.BARITONE_TUBA_SINGLE="\u4E0A\u4F4E\u97F3\u53F7-\u5927\u53F7",e.MUSIC_THEORY="\u4E50\u7406",e.INSTRUMENTAL_ENSEMBLE="\u5408\u594F",e.EUPHONIUM_SINGLE="\u4E0A\u4F4E\u97F3\u53F7",e.TUBA_SINGLE="\u5927\u53F7"})(p||(p={}));const g=async()=>{var e;try{const r=await b.post("/api-student/tenantAlbumMusic/selectCondition",{data:{subjectType:"COURSEWARE",tenantAlbumId:t.albumId}});r.code===200&&(d.value=[{text:"\u5168\u90E8\u6559\u6750",value:""},...(((e=r.data)==null?void 0:e.courseTypeList)||[]).map(s=>({text:p[s],value:s}))])}catch{}};function h(e){t.page=1,t.keyword=e,t.subjectList=[],n()}function _(){t.page=1,t.subjectList=[],n()}const n=async()=>{var e,r;o.value=!0,i.value=!1;try{const s=await b.post("/api-student/tenantAlbumMusic/page",{data:{courseTypeCode:c.value,keyword:t.keyword,albumId:t.albumId,subjectType:"COURSEWARE",page:t.page,rows:20}});if(((e=t.subjectList)==null?void 0:e.length)>0&&s.data.pageNo===1)return;const L=(t.subjectList||[]).concat(((r=s.data)==null?void 0:r.rows)||[]);t.subjectList=L,t.page=s.data.pageNo+1,I.value=s.data.pageNo>=s.data.totalPage}catch{i.value=!0}o.value=!1};return N(async()=>{o.value=!0,await g(),t.albumId?await n():o.value=!1}),()=>a(C,null,[a("div",{class:u.sticky},[a(k,null,{default:()=>[a(R,{hideHeader:!1,background:"transparent",isFixed:!1,border:!1,title:"\u4E91\u6559\u7A0B",color:"#131415"},null),a(j,{class:u.search,onSearch:h,type:"tenant",placeholder:"\u8BF7\u8F93\u5165\u6559\u6750\u5173\u952E\u8BCD",background:"transparent",inputBackground:"transparent"},{left:()=>d.value.length>1&&a(F,{class:u.dropdownMenuSub},{default:()=>[a(A,{titleClass:u.titleActive,modelValue:c.value,"onUpdate:modelValue":e=>c.value=e,options:d.value,onChange:_},{default:()=>[a("div",null,null)]})]})})]}),a("img",{class:u.bgImg,src:M},null)]),a("div",{class:u.alumnList},[a(T,{loading:o.value,finished:I.value,"finished-text":"",onLoad:n,error:i.value,immediateCheck:!1},{default:()=>[t.subjectList.length?a(O,{class:[u.courseItem],list:t.subjectList.map(e=>({name:e.musicSheetName,coverImg:e.titleImg,id:e.id})),onItemClick:e=>{f.push({path:"/courseList",query:{id:e.id,albumId:t.albumId}})}},null):!o.value&&a(y,{tips:"\u6682\u65E0\u6559\u6750",classImgSize:"CERT",btnStatus:!1},null)]})])])}});export{se as default};
