index.e6da4a2d.js 3.6 KB

1
  1. import{d as S,P as v,O as w,Q as E,S as r,U as N,j as a,f as y,n as C,C as F,F as A,x as b}from"./index.40f4b64d.js";import{D as T,a as R}from"./index.46a29dbc.js";import"./index.7d1a23c4.js";import{L as M}from"./index.5e0f25ab.js";import{C as k}from"./index.c44a09c1.js";import{T as j}from"./index.c51e1e5e.js";import{b as O}from"./bg.650cc876.js";import{S as U}from"./index.f15d9073.js";import{C as B}from"./index.fe2e7281.js";import"./use-id.d148d155.js";import"./use-tab-status.7423f29c.js";import"./index.489876c1.js";import"./index.1014dabb.js";const G="_sticky_2r9wh_1",x="_dropdownMenuSub_2r9wh_45",H="_titleActive_2r9wh_74",P="_search_2r9wh_77",V="_bgImg_2r9wh_80",q="_alumnList_2r9wh_88",$="_courseItem_2r9wh_94";var o={sticky:G,dropdownMenuSub:x,titleActive:H,search:P,bgImg:V,alumnList:q,courseItem:$},ue=S({name:"lessonCourseware",setup(){const f=v(),m=w(),t=E({keyword:m.query.search||"",albumId:m.query.albumId,subjectList:[],page:1}),l=r(!1),I=r(!1),i=r(!1),c=r(""),d=r([]);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 u=await b.post("/api-student/tenantAlbumMusic/selectCondition",{data:{subjectType:"COURSEWARE",tenantAlbumId:t.albumId}});u.code===200&&(d.value=[{text:"\u5168\u90E8\u6559\u6750",value:""},...(((e=u.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,u;l.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(((u=s.data)==null?void 0:u.rows)||[]);t.subjectList=L,t.page=s.data.pageNo+1,I.value=s.data.pageNo>=s.data.totalPage}catch{i.value=!0}l.value=!1};return N(async()=>{l.value=!0,await g(),t.albumId?await n():l.value=!1}),()=>a(A,null,[a("div",{class:o.sticky},[a(j,null,{default:()=>[a(k,{hideHeader:!1,background:"transparent",isFixed:!1,border:!1,title:"\u4E91\u8BFE\u5802",color:"#131415"},null),a(U,{class:o.search,onSearch:h,type:"tenant",placeholder:"\u8BF7\u8F93\u5165\u6559\u6750\u5173\u952E\u8BCD",background:"transparent",inputBackground:"transparent"},{left:()=>d.value.length>1&&a(T,{class:o.dropdownMenuSub},{default:()=>[a(R,{titleClass:o.titleActive,modelValue:c.value,"onUpdate:modelValue":e=>c.value=e,options:d.value,onChange:_},{default:()=>[a("div",null,null)]})]})})]}),a("img",{class:o.bgImg,src:O},null)]),a("div",{class:o.alumnList},[a(M,{loading:l.value,finished:I.value,"finished-text":"",onLoad:n,error:i.value,immediateCheck:!1},{default:()=>[t.subjectList.length?a(B,{class:[o.courseItem],list:t.subjectList.map(e=>({name:e.musicSheetName,coverImg:e.titleImg,id:e.id})),onItemClick:e=>{if(y().isApp){const u=`${location.origin}/tenant/#/courseList?id=${e.id}&albumId=${t.albumId}`;C({api:"openWebView",content:{url:u,orientation:1,isHideTitle:!1}})}else f.push({path:"/courseList",query:{id:e.id,albumId:t.albumId}})}},null):!l.value&&a(F,{tips:"\u6682\u65E0\u6559\u6750",classImgSize:"CERT",btnStatus:!1},null)]})])])}});export{ue as default};