index.7d22abf0.js 8.1 KB

1
  1. import{A as Y,E as Z,H as U,d as X,a_ as K,a1 as G,j as t,aS as W,N as _,w as j,g as l,S as u,O as $,P as ee,Q as L,U as ae,f as te,F as z,z as se,M as oe,be as le,C as ie,aR as O}from"./index.e6d6174e.js";import{S as ne}from"./index.9093bc60.js";import{L as re}from"./index.f904775d.js";import"./index.b4a53c6a.js";import{T as ue,a as M}from"./index.54627972.js";import{S as ce}from"./index.c42f80e3.js";import{S as de}from"./select-tag.3f6ab952.js";import{s as S}from"./index.module.7b815a85.js";import{g as me}from"./music.ce788382.js";import{S as fe}from"./select-subject.5521b320.js";import{a as v,S as A}from"./hooks.00b5b341.js";import{S as pe}from"./index.311acfa6.js";import{C as ge}from"./index.045f03fd.js";import{b as ve}from"./index.684ca989.js";import"./use-tab-status.e9ba8498.js";import"./use-id.f239f36f.js";import"./use-refs.eb803454.js";import"./index.af99cf22.js";import"./index.17d70acf.js";import"./index.05f2b7dd.js";import"./index.3d7e5752.js";import"./index.d92a5aca.js";import"./index.926ca9c5.js";import"./index.c67b3500.js";import"./icon_uploader.9f387137.js";import"./icon-xin.df8ab2d7.js";import"./icon_album.fa329df6.js";import"./icon_album_active.ce98b2a8.js";import"./icon_exquisite.69e33c80.js";import"./icon_music_active.3b316ab8.js";import"./index.67c54471.js";import"./icon-play.bc9e7aab.js";import"./index.d8c651bf.js";import"./use-height.8140ea04.js";const[Ae,k]=Y("switch"),be={size:Z,loading:Boolean,disabled:Boolean,modelValue:U,activeColor:String,inactiveColor:String,activeValue:{type:U,default:!0},inactiveValue:{type:U,default:!1}};var Se=X({name:Ae,props:be,emits:["change","update:modelValue"],setup(o,{emit:E}){const c=()=>o.modelValue===o.activeValue,I=()=>{if(!o.disabled&&!o.loading){const d=c()?o.inactiveValue:o.activeValue;E("update:modelValue",d),E("change",d)}},R=()=>{if(o.loading){const d=c()?o.activeColor:o.inactiveColor;return t(W,{class:k("loading"),color:d},null)}};return K(()=>o.modelValue),()=>{const{size:d,loading:D,disabled:h,activeColor:p,inactiveColor:y}=o,C=c(),g={fontSize:G(d),backgroundColor:C?p:y};return t("div",{role:"switch",class:k({on:C,loading:D,disabled:h}),style:g,tabindex:h?void 0:0,"aria-checked":C,onClick:I},[t("div",{class:k("node")},[R()])])}}});const he=_(Se);var ye="./assets/bgImg.2964f21d.png",Ce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA6BJREFUWEe9l2molVUUhp+32YKoSBNEKAoriawfShRhpIRNVkg/kiCHhCAzikiEjEQztJnyRzRB9SOwbBCKirLBkgoawYIoUAJDi2ikAXljxf4u62y/e8/xnsNd/87+1l7rOXuvvfa7RQ9mezpwCXA2MAU4FjgE+B3YAXwBbAFelPRzDyGHXDSSs+1LgdXAtB6D/g08BtwpaVcvc1oBbB8PPAOc00uQFp8/gVWS1nebvw+A7VnAs2WZh5tv4N+yDSPleB5YICm2qtU6AGzPBl4BDq68I1kE2wy8D+yS9I/to4ETgTnAVcDUlizvAbPDv41gCMD2qcAHwFGVYyS+VdJ3XerlgAJxDzCx8n1K0jXDAtiOf/wJcFpy2gvcIumBbvuYv9ueBLwAxMnJtljSE3Ws/1fA9jLgwepjJL93f5I3vmVrtgEnp/k/AifU9SDbB5azHOSNbZI0bzTJE0Rs6edVPd0s6f4cNwAuLIXXjEexTJX0bT8AZWUfBq5Pcb6UdHoN8BCwNA2+JOnyfpMXgFOAr6pYkyV934zFCnwIzEhOiyQ9OQiAAvF1VQvzJG3KAHuqpjND0scDBHgOyPUUR/ruDBB7nhtPxxL1C2K73uI1klZmgOjb41KiKZK+6TdxOg2PAtemeHdIWpUBdgKTk8N5kt4ZIEC09jhpjS2VtCEDvAZckBxWSlozCADbBwG7gbgzGpsl6a0McFu585uxzySdOSCA+GPxBxuLejtG0h8ZIDrW9irhZZJe7hfC9tZKU2yWNDfHbe6Ct4GZ6UMU4XRJv4wWwvZCoL58LpYUNTFkDUAkD02X9cHroQMlhRbYL7N9LvAGcGiauE1SaMoOy3rgcWBR9T2W8EpJP/RKYPtq4BHg8DTnL+AsSXE5DQtwGPBmUb7Z6SdgHbBBUvSMVrN9RinmUM/ZQr7NlxQybx+rJdl44F0gLpHaonIDMFRTKN74PaFIsjjnbXIskq+QtM72BElxJNtXoBm1fSTwNNBRrb1uQfILIRoX20bba4El0W8kfZpjDSfLYzzu8egRx40i+atFzm23fR9wU4kRj5Y5kj5qYnZ7mBwB3AAsBk7qAhJNJprOeklRvCH14mFT95NfgYskhbruOHYjxi+quX6a/QbEXRJPs62SInhnBdq3xyOlGo7tmStpy4grMIqlb51iezlwV/WH40RdMSYAZTtuBEKQ5pwbxwygQFwX/QSIR0wopfljClAgFgDnAwsl7f0PfUtCHGOyShkAAAAASUVORK5CYII=";const J=()=>{};var sa=X({name:"MusicList",props:{hideSearch:{type:Boolean,default:!1},defauleParams:{type:Object,default:()=>({})},onItemClick:{type:Function,default:J},teacherId:{type:String||Number,default:""},myself:{type:Boolean,default:!1}},setup({hideSearch:o,defauleParams:E,onItemClick:c,teacherId:I,myself:R},{expose:d}){const{isLoading:D,state:h}=ve(j(l.platformApi+"/MusicTag/tree",{params:{type:"MUSIC"}}),null),p=u({id:"",name:""});if(l.platformType==="TEACHER"){const e=l.user.data;p.value={name:e.defaultSubjectName||"\u5168\u90E8\u58F0\u90E8",id:e.defaultSubject||""}}else if(!v(A.SEARCH).id){const a=l.user.data,i=a.subjectId?Number(a.subjectId.split(",")[0]):"",f=a.subjectName?a.subjectName.split(",")[0]:"";i&&v(A.SEARCH,JSON.stringify({id:i,name:f}),"set")}localStorage.setItem("behaviorId",me());const y=$(),C=ee(),g={};l.version&&(g.version=l.version||"",g.platform=l.platformType==="STUDENT"?"ios-student":"ios-teacher");const m=u(!1);if(!o){if(l.platformType==="TEACHER")g.subjectIds=p.value.id;else{const a=v(A.SEARCH);g.subjectIds=a.id}const e=v(A.MUSIC_FREE);m.value=e.chargeType}const n=L({search:y.query.search||"",musicTagIds:y.query.tagids||"",page:1,...E,...g}),s=u(null),w=u(!1),P=u(!1),T=u(!1),N=u(!1),B=u(!0),q=u(l.platformType==="STUDENT"?"/api-student":"/api-teacher"),x=e=>{n.page=1,n.search=e,s.value=null,b()},b=async()=>{var a;if(w.value)return;w.value=!0,T.value=!1;const e={...n,auditStatus:"PASS",idAndName:n.search,createBy:I};m.value&&(e.chargeType="FREE"),R?e.myself=!0:e.myself=!1;try{const i=await j.post(`${q.value}/music/sheet/list`,{data:e});if(s.value){const f=(((a=s.value)==null?void 0:a.rows)||[]).concat(i.data.rows||[]);s.value.rows=f}s.value=s.value||i.data,n.page=i.data.pageNo+1,P.value=i.data.pageNo>=i.data.totalPage}catch{T.value=!0}w.value=!1},Q=async e=>{try{await j.post("/api-teacher/teacher/defaultSubject",{params:{subjectId:e}})}catch{}},H=e=>{const a={};for(const f in e)Number(f)===-1?m.value=!!e[f][0]:a[f]=e[f];const i=Object.values(a).flat().filter(Boolean).join(",");n.musicTagIds=i,n.page=1,s.value=null,b(),N.value=!1},F=e=>{n.page=1,n.subjectIds=e.id,s.value=null,l.platformType==="TEACHER"?(p.value={name:e.name,id:e.id},Q(e.id)):(r.id=e.id,r.name=e.name,v(A.SEARCH,JSON.stringify({id:e.id,name:e.name}),"set")),b(),r.show=!1},V=v(A.SEARCH),r=L({show:!1,name:V.id?V.name:"\u5168\u90E8\u58F0\u90E8",id:V.id||""});return ae(async()=>{try{if(!te().iPhone){B.value=!1;return}const{data:e}=await j.get("/api-admin/appVersionInfo/queryByPlatform",{params:{platform:l.platformType==="TEACHER"?"ios-teacher":"ios-student"}});l.version>e.version?B.value=!0:B.value=!1}catch{}}),d({onSearch:x,onComfirm:H,onComfirmSubject:F}),()=>{const e=h.value&&h.value.data||[];return t(z,null,[!o&&t(z,null,[" ",t(ne,{class:S.sticky},{default:()=>[t(ge,{background:"transparent",isFixed:!1,border:!1,backIconColor:"white",color:"#fff"},{right:()=>!B.value&&t("span",{class:S.fleg,onClick:()=>{m.value!=m.value,v(A.MUSIC_FREE,JSON.stringify({chargeType:m.value}),"set"),s.value=null,n.page=1,b()}},[t(he,{modelValue:m.value,"onUpdate:modelValue":a=>m.value=a,size:"20px"},null),t("span",null,[se("\u514D\u8D39")])])}),t(ce,{onSearch:x,background:"transparent",inputBackground:"transparent",leftIcon:Ce},{left:()=>t("div",{class:S.label,onClick:()=>r.show=!0},[l.platformType==="TEACHER"?p.value.name:r.name,t(oe,{classPrefix:"iconfont",name:"down",size:12,color:"#fff"},null)])}),t(ue,{shrink:!0,class:S.tagTabs,lineHeight:0,"onClick-tab":a=>{n.musicTagIds=a.name,s.value=null,n.page=1,b()}},{default:()=>[t(M,{title:"\u5168\u90E8",name:""},null),e.map(a=>t(M,{title:a.name,name:a.id},null))]})]}),t("img",{class:S.bgImg,src:ye},null)]),t("div",{class:S.alumnList},[t(re,{loading:w.value,finished:P.value,"finished-text":(s.value&&s.value.rows.length,""),onLoad:b,error:T.value},{default:()=>[s.value&&s.value.rows.length?t(pe,{list:s.value.rows,onDetail:a=>{if(c===J){const i=location.origin+location.pathname+"#/music-detail?id="+a.id;le(i,()=>{C.push({path:"/music-detail",query:{id:a.id}})})}else c==null||c(a)}},null):!w.value&&t(ie,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)]})]),t(O,{show:N.value,round:!0,closeable:!0,position:"bottom",style:{height:"60%"},teleport:"body","onUpdate:show":a=>N.value=a},{default:()=>[t(de,{exquisiteFlag:!0,onConfirm:H,onCancel:()=>{},defaultValue:y.query.tagids},null)]}),t(O,{show:r.show,position:"bottom",round:!0,closeable:!0,"safe-area-inset-bottom":!0,onClose:()=>r.show=!1,onClosed:()=>r.show=!1},{default:()=>[t(fe,{type:"MUSIC",searchParams:l.platformType==="TEACHER"?p.value:r,onComfirm:F},null)]})])}}});export{sa as default};