index.09ddad66.js 5.9 KB

1
  1. import{d as j,P as R,Q as B,S as E,U as i,g as D,W as M,V as N,j as t,F as f,A as m,B as T,f as x,n as $,C as q,y as I}from"./ResizeObserver.es.f28023e0.js";import{L as z}from"./index.79f59946.js";import{D as H,a as U}from"./index.d7f07972.js";import"./index.3b2e70c8.js";import{T as v}from"./index.af901340.js";import{S as V}from"./index.22776016.js";import{g as P}from"./music.480e4a23.js";import{S as W}from"./index.dc99e92f.js";import{C as G}from"./index.bd375ca9.js";import{b as J}from"./bg.650cc876.js";import{T as K}from"./index.787d69a0.js";import"./use-tab-status.653933d8.js";import"./use-id.cc14bbe9.js";import"./index.975e8f79.js";import"./icon-xin2.4ab2a52d.js";import"./index.7a1af785.js";import"./index.9a41251d.js";const O="_sticky_1fbd4_1",Q="_search_1fbd4_42",Y="_albumSearchSection_1fbd4_45",X="_albumSearchTitle_1fbd4_48",Z="_albumSearchResult_1fbd4_62",ee="_albumSearchCell_1fbd4_65",te="_albumLogo_1fbd4_68",ae="_albumContent_1fbd4_75",le="_albumSearchCellActive_1fbd4_90",se="_iconSelect_1fbd4_94",oe="_listContainer_1fbd4_102",re="_line_1fbd4_114",ie="_active_1fbd4_120",ne="_label_1fbd4_123",ue="_alumnList_1fbd4_136",ce="_bgImg_1fbd4_146",de="_tagTabs_1fbd4_154",pe="_fleg_1fbd4_184",me="_iconFree_1fbd4_190",be="_iconFreeDisable_1fbd4_194",fe="_searchResult_1fbd4_200",_e="_searchTitle_1fbd4_206",ge="_radio_1fbd4_212",ve="_resetting_1fbd4_251",he="_confirm_1fbd4_255";var l={sticky:O,search:Q,albumSearchSection:Y,albumSearchTitle:X,albumSearchResult:Z,albumSearchCell:ee,albumLogo:te,albumContent:ae,albumSearchCellActive:le,iconSelect:se,listContainer:oe,line:re,active:ie,label:ne,alumnList:ue,bgImg:ce,tagTabs:de,fleg:pe,iconFree:me,iconFreeDisable:be,searchResult:fe,searchTitle:_e,"radio-group":"_radio-group_1fbd4_212",radio:ge,"organ-radio":"_organ-radio_1fbd4_244",resetting:ve,confirm:he},qe=j({name:"MusicList",props:{teacherId:{type:String||Number,default:""},myself:{type:Boolean,default:!1}},setup({onItemClick:ye},{expose:Se}){localStorage.setItem("behaviorId",P());const _=R(),L=B(),u=_.query.subjectType||"";let d="";u==="SUBJECT"?d="\u58F0\u90E8\u4E91\u7EC3":u==="MUSIC"?d="\u72EC\u594F\u4E91\u7EC3":u==="ENSEMBLE"&&(d="\u5408\u594F\u4E91\u7EC3");const a=E({keyword:_.query.search||"",subjectType:u,page:1,subjectId:null,albumId:_.query.albumId,albumName:"",level:"",type:"",title:d}),o=i(null),c=i(!1),h=i(!1),g=i(!1),r=i({}),y=i();i(),i([]);const S=i(D.platformType==="STUDENT"?"/api-student":"/api-teacher"),w=e=>{a.page=1,a.keyword=e,o.value=null,b()},b=async()=>{var s,p,C;c.value=!0,g.value=!1;const e={...a};try{const n=await I.post(`${S.value}/tenantAlbumMusic/page`,{data:e});if(((p=(s=o.value)==null?void 0:s.rows)==null?void 0:p.length)>0&&n.data.pageNo===1)return;if(o.value){const F=(((C=o.value)==null?void 0:C.rows)||[]).concat(n.data.rows||[]);o.value.rows=F}o.value=o.value||n.data,a.page=n.data.pageNo+1,h.value=n.data.pageNo>=n.data.totalPage}catch{g.value=!0}c.value=!1},k=async()=>{const{data:e}=await I.post(`${S.value}/tenantAlbumMusic/selectCondition`,{data:{subjectType:a.subjectType,tenantAlbumId:a.albumId}});r.value=e||{}},A=M(()=>{const e=r.value;let s=!1;return e.subjects&&e.subjects.length>0&&(s=!0),e.levelList&&e.levelList.length>0&&(s=!0),e.typeList&&e.typeList.length>0&&(s=!0),s});return N(async()=>{c.value=!0,await k(),a.albumId?await b():c.value=!1}),()=>t(f,null,[t("div",{class:l.sticky},[t(K,null,{default:()=>[t(G,{hideHeader:!1,background:"transparent",isFixed:!1,border:!1,title:d,color:"#131415"},null),t(V,{placeholder:"\u8BF7\u8F93\u5165\u66F2\u8C31\u5173\u952E\u8BCD",class:l.search,onSearch:w,type:"tenant",background:"transparent",inputBackground:"transparent"},{left:()=>A.value&&t(H,null,{default:()=>[t(U,{titleClass:a.subjectId||a.type||a.level?l.titleActive:"",title:"\u7B5B\u9009",ref:y},{default:()=>[t("div",{class:l.searchResult,style:{maxHeight:"45vh",overflowY:"auto"}},[r.value.subjects&&r.value.subjects.length>0&&t(f,null,[t("div",{class:l.searchTitle},[m("\u58F0\u90E8")]),t("div",{class:[l["radio-group"],l.radio,l["organ-radio"]]},[r.value.subjects.map(e=>{const s=e.id===a.subjectId;return t(v,{size:"large",plain:s,type:s?"primary":"default",round:!0,onClick:()=>{a.subjectId=e.id}},{default:()=>[e.name]})})])]),r.value.levelList&&r.value.levelList.length>0&&t(f,null,[t("div",{class:l.searchTitle},[m("\u7EA7\u522B")]),t("div",{class:[l["radio-group"],l.radio,l["organ-radio"]]},[r.value.levelList.map(e=>{const s=e.id===a.level;return t(v,{size:"large",plain:s,type:s?"primary":"default",round:!0,onClick:()=>{a.level=e.id}},{default:()=>[e.value]})})])]),r.value.typeList&&r.value.typeList.length>0&&t(f,null,[t("div",{class:l.searchTitle},[m("\u7C7B\u578B")]),t("div",{class:[l["radio-group"],l.radio,l["organ-radio"]]},[r.value.typeList.map(e=>{const s=e.id===a.type;return t(v,{size:"large",plain:s,type:s?"primary":"default",round:!0,onClick:()=>{a.type=e.id}},{default:()=>[e.value]})})])])]),t("div",{class:["btnGroup","btnMore"]},[t(T,{class:l.resetting,type:"primary",plain:!0,round:!0,onClick:()=>{a.subjectId=null,a.level="",a.type=""}},{default:()=>[m("\u91CD \u7F6E")]}),t(T,{class:l.confirm,type:"primary",color:"linear-gradient( 270deg, #FF204B 0%, #FE5B71 100%)",round:!0,block:!0,onClick:()=>{var e;a.page=1,o.value=null,b(),(e=y.value)==null||e.toggle()}},{default:()=>[m("\u786E \u8BA4")]})])]})]})})]}),t("img",{class:l.bgImg,src:J},null)]),t("div",{class:l.alumnList},[t(z,{loading:c.value,finished:h.value,"finished-text":(o.value&&o.value.rows.length,""),onLoad:b,error:g.value,immediateCheck:!1},{default:()=>[o.value&&o.value.rows.length?t(W,{showTitleImg:!0,list:o.value.rows,onDetail:e=>{if(x().isApp){const s=`${location.origin}/tenant/#/music-detail?id=${e.id}&subjectType=${u}&tenantAlbumId=${e.tenantAlbumId}`;$({api:"openWebView",content:{url:s,orientation:1,isHideTitle:!1}})}else L.push({path:"/music-detail",query:{subjectType:u,id:e.id,tenantAlbumId:e.tenantAlbumId}})}},null):!c.value&&t(q,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"CERT",btnStatus:!1},null)]})])])}});export{qe as default};