index.b225e885.js 8.2 KB

1
  1. import{E as Y,G as Z,I as U,d as X,a$ as K,a2 as G,i as t,aS as W,O as _,e as I,s as l,U as u,P as $,Q as ee,S as L,V as ae,b as te,F as z,A as se,N as oe,bg as le,C as ie,aT as O}from"./index.6b776f4b.js";import{S as ne}from"./index.998c3386.js";import{L as re}from"./index.9b1da5d2.js";import"./index.570314c1.js";import{T as ue,a as M}from"./index.21339447.js";import{C as ce}from"./index.1c64afe2.js";import{S as de}from"./select-tag.12a89705.js";import{s as S}from"./index.module.7b815a85.js";import{g as me}from"./music.35746cdc.js";import{S as fe}from"./select-subject.8730d66c.js";import{a as v,S as A}from"./hooks.ad006126.js";import{S as pe}from"./index.7d6320b9.js";import{C as ge}from"./index.33f0ddb9.js";import{b as ve}from"./index.46520b6f.js";import"./use-tab-status.ad41a764.js";import"./use-id.40b6af6b.js";import"./use-refs.a68d4385.js";import"./index.7486196c.js";import"./index.ef17e812.js";import"./index.beb9a25a.js";import"./index.7b4b6592.js";import"./index.bebc33d1.js";import"./index.926ca9c5.js";import"./index.6b2308b1.js";import"./index.c3591af3.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.7cc0b0e7.js";import"./icon-play.bc9e7aab.js";import"./index.f0306d29.js";import"./use-height.c83159bc.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,T=()=>{if(!o.disabled&&!o.loading){const d=c()?o.inactiveValue:o.activeValue;E("update:modelValue",d),E("change",d)}},j=()=>{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:T},[t("div",{class:k("node")},[j()])])}}});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 oa=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:T,myself:j},{expose:d}){const{isLoading:D,state:h}=ve(I(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),R=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,R.value=!1;const e={...n,auditStatus:"PASS",idAndName:n.search,createBy:T};m.value&&(e.chargeType="FREE"),j?e.myself=!0:e.myself=!1;try{const i=await I.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{R.value=!0}w.value=!1},Q=async e=>{try{await I.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 I.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:R.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{oa as default};