index.bafc2921.js 8.1 KB

1
  1. import{d as Y,y as S,g as l,U as i,P as Z,Q as K,S as D,V as W,f as $,j as a,F as U,A as ee,N as L,be as ae,C as te,aS as H}from"./ResizeObserver.es.282029b9.js";import{S as se}from"./index.cb2a4c7d.js";import{L as le}from"./index.55b2f838.js";import{S as oe}from"./index.04bc8b12.js";import"./index.503676c2.js";import{T as re,a as x}from"./index.55872952.js";import{S as P}from"./index.5af8dde5.js";import{S as ne}from"./select-tag.5ff80e70.js";import{g as ie}from"./music.7a68a019.js";import{S as ue}from"./select-subject.76c761b0.js";import{a as f,S as m}from"./hooks.4363bfd9.js";import{S as ce}from"./index.7e21419f.js";import{C as pe}from"./index.eb139bb9.js";import{c as fe}from"./index.9b4a8510.js";import{T as me}from"./index.13e5fb89.js";import"./use-tab-status.9bf787ad.js";import"./use-id.19b4fa35.js";import"./use-refs.3580c3ef.js";import"./index.aa695a1a.js";import"./index.bb35c1e6.js";import"./index.1abe2299.js";import"./index.599cf58a.js";import"./index.24beea84.js";import"./index.926ca9c5.js";import"./index.2779c5d6.js";import"./icon_uploader.93248775.js";import"./icon-xin.a59bfaf1.js";import"./icon_album.9592f49b.js";import"./icon_album_active.25be6148.js";import"./icon_exquisite.858d352b.js";import"./icon_music_active.a468d335.js";import"./index.c5bd2feb.js";import"./icon-play.bc9e7aab.js";const de="_sticky_lhjbw_1",ge="_listContainer_lhjbw_5",be="_line_lhjbw_17",he="_active_lhjbw_23",Ae="_searchGroup_lhjbw_26",ve="_label_lhjbw_33",Se="_searchs_lhjbw_38",ye="_alumnList_lhjbw_49",we="_alumnListOnly_lhjbw_55",je="_bgImg_lhjbw_58",Ce="_tagTabs_lhjbw_66",Te="_fleg_lhjbw_100";var u={sticky:de,listContainer:ge,line:be,active:he,searchGroup:Ae,label:ve,searchs:Se,alumnList:ye,alumnListOnly:we,bgImg:je,tagTabs:Ce,fleg:Te},Ee="./assets/bgImg.2964f21d.png",Be="data:image/png;base64,iVBORw0KGgoAAAANSUhEUg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Rx40i+atFzm23fR9wU4kRj5Y5kj5qYnZ7mBwB3AAsBk7qAhJNJprOeklRvCH14mFT95NfgYskhbruOHYjxi+quX6a/QbEXRJPs62SInhnBdq3xyOlGo7tmStpy4grMIqlb51iezlwV/WH40RdMSYAZTtuBEKQ5pwbxwygQFwX/QSIR0wopfljClAgFgDnAwsl7f0PfUtCHGOyShkAAAAASUVORK5CYII=";const O=()=>{};var ia=Y({name:"MusicList",props:{hideSearch:{type:Boolean,default:!1},onlySearch:{type:Boolean,default:!1},height:{type:Number,default:0},defauleParams:{type:Object,default:()=>({})},onItemClick:{type:Function,default:O},teacherId:{type:String||Number,default:""},myself:{type:Boolean,default:!1}},setup({hideSearch:E,onlySearch:B,height:F,defauleParams:V,onItemClick:A,teacherId:z,myself:M},{expose:J}){const{isLoading:Ie,state:I}=fe(S(l.platformApi+"/MusicTag/tree",{params:{type:"MUSIC"}}),null),R=i(F||0),X=e=>{R.value=e},d=i({id:"",name:""});if(l.platformType==="TEACHER"){const e=l.user.data;d.value={name:e.defaultSubjectName||"\u5168\u90E8\u58F0\u90E8",id:e.defaultSubject||""}}else if(!f(m.SEARCH).id){const t=l.user.data,o=t.subjectId?Number(t.subjectId.split(",")[0]):"",p=t.subjectName?t.subjectName.split(",")[0]:"";o&&f(m.SEARCH,JSON.stringify({id:o,name:p}),"set")}localStorage.setItem("behaviorId",ie());const y=Z(),q=K(),b={};l.version&&(b.version=l.version||"",b.platform=l.platformType==="STUDENT"?"ios-student":"ios-teacher");const c=i(!1);if(!E){if(l.platformType==="TEACHER")b.subjectIds=d.value.id;else{const t=f(m.SEARCH);b.subjectIds=t.id}const e=f(m.MUSIC_FREE);c.value=e.chargeType}const r=D({search:y.query.search||"",musicTagIds:y.query.tagids||"",page:1,...V,...b}),s=i(null),h=i(!1),N=i(!1),w=i(!1),j=i(!1),v=i(!0),G=i(l.platformType==="STUDENT"?"/api-student":"/api-teacher"),C=e=>{r.page=1,r.search=e,s.value=null,g()},g=async()=>{var t;if(h.value)return;h.value=!0,w.value=!1;const e={...r,auditStatus:"PASS",idAndName:r.search,createBy:z};c.value&&(e.chargeType="FREE"),M?e.myself=!0:e.myself=!1;try{const o=await S.post(`${G.value}/music/sheet/list`,{data:e});if(s.value){const p=(((t=s.value)==null?void 0:t.rows)||[]).concat(o.data.rows||[]);s.value.rows=p}s.value=s.value||o.data,r.page=o.data.pageNo+1,N.value=o.data.pageNo>=o.data.totalPage}catch{w.value=!0}h.value=!1},Q=async e=>{try{await S.post("/api-teacher/teacher/defaultSubject",{params:{subjectId:e}})}catch{}},_=e=>{const t={};for(const p in e)Number(p)===-1?c.value=!!e[p][0]:t[p]=e[p];const o=Object.values(t).flat().filter(Boolean).join(",");r.musicTagIds=o,r.page=1,s.value=null,g(),j.value=!1},k=e=>{r.page=1,r.subjectIds=e.id,s.value=null,l.platformType==="TEACHER"?(d.value={name:e.name,id:e.id},Q(e.id)):(n.id=e.id,n.name=e.name,f(m.SEARCH,JSON.stringify({id:e.id,name:e.name}),"set")),g(),n.show=!1},T=f(m.SEARCH),n=D({show:!1,name:T.id?T.name:"\u5168\u90E8\u58F0\u90E8",id:T.id||""});return W(async()=>{try{if(!$().iPhone){v.value=!1;return}const{data:e}=await S.get("/api-admin/appVersionInfo/queryByPlatform",{params:{platform:l.platformType==="TEACHER"?"ios-teacher":"ios-student"}});l.version>e.version?v.value=!0:v.value=!1}catch{}}),J({onSearch:C,onComfirm:_,updateStickyHeight:X,onComfirmSubject:k}),()=>{const e=I.value&&I.value.data||[];return a(U,null,[!E&&a(U,null,[a(me,{class:u.sticky},{default:()=>[a(pe,{background:"transparent",isFixed:!1,border:!1,backIconColor:"white",color:"#fff"},{right:()=>!v.value&&a("span",{class:u.fleg,onClick:()=>{c.value!=c.value,f(m.MUSIC_FREE,JSON.stringify({chargeType:c.value}),"set"),s.value=null,r.page=1,g()}},[a(oe,{modelValue:c.value,"onUpdate:modelValue":t=>c.value=t,size:"20px"},null),a("span",null,[ee("\u514D\u8D39")])])}),a(P,{onSearch:C,background:"transparent",inputBackground:"transparent",leftIcon:Be},{left:()=>a("div",{class:u.label,onClick:()=>n.show=!0},[l.platformType==="TEACHER"?d.value.name:n.name,a(L,{classPrefix:"iconfont",name:"down",size:12,color:"#fff"},null)])}),a(re,{shrink:!0,class:u.tagTabs,lineHeight:0,"onClick-tab":t=>{r.musicTagIds=t.name,s.value=null,r.page=1,g()}},{default:()=>[a(x,{title:"\u5168\u90E8",name:""},null),e.map(t=>a(x,{title:t.name,name:t.id},null))]})]}),a("img",{class:u.bgImg,src:Ee},null)]),B?a(se,{position:"top",offsetTop:R.value},{default:()=>[a(P,{onSearch:C,background:"transparent",inputBackground:"white",class:u.searchGroup},{left:()=>a("div",{class:[u.label,u.searchs],onClick:()=>n.show=!0},[l.platformType==="TEACHER"?d.value.name:n.name,a(L,{classPrefix:"iconfont",name:"down",size:12,color:"#949597"},null)])})]}):"",a("div",{class:[u.alumnList,B&&u.alumnListOnly]},[a(le,{loading:h.value,finished:N.value,"finished-text":(s.value&&s.value.rows.length,""),onLoad:g,error:w.value},{default:()=>[s.value&&s.value.rows.length?a(ce,{list:s.value.rows,onDetail:t=>{if(A===O){const o=location.origin+location.pathname+"#/music-detail?id="+t.id;ae(o,()=>{q.push({path:"/music-detail",query:{id:t.id}})})}else A==null||A(t)}},null):!h.value&&a(te,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)]})]),a(H,{show:j.value,round:!0,closeable:!0,position:"bottom",style:{height:"60%"},teleport:"body","onUpdate:show":t=>j.value=t},{default:()=>[a(ne,{exquisiteFlag:!0,onConfirm:_,onCancel:()=>{},defaultValue:y.query.tagids},null)]}),a(H,{show:n.show,position:"bottom",round:!0,closeable:!0,"safe-area-inset-bottom":!0,onClose:()=>n.show=!1,onClosed:()=>n.show=!1},{default:()=>[a(ue,{type:"MUSIC",searchParams:l.platformType==="TEACHER"?d.value:n,onComfirm:k},null)]})])}}});export{ia as default};