1 |
- import{A as Q,E as Y,H as V,d as J,a_ as Z,a1 as K,j as t,aS as G,N as W,w as I,g as o,S as u,O as $,P as ee,Q as _,U as ae,f as te,F,z as se,M as le,be as oe,C as ie,aR as z}from"./index.394decd7.js";import{L as ne}from"./index.dc786267.js";import"./index.3bbf4ddb.js";import"./index.f1b52763.js";import{T as re,a as O}from"./index.ae00317c.js";import{S as ue}from"./index.ada5e712.js";import{S as ce}from"./select-tag.9412794d.js";import{g as de}from"./music.8e2b5f5b.js";import{S as me}from"./select-subject.2c6b1606.js";import{a as v,S as b}from"./hooks.9e5ee122.js";import{S as fe}from"./index.3dfdbf1b.js";import{C as pe}from"./index.e6e212d8.js";import{c as ge}from"./index.75a0444f.js";import{T as ve}from"./index.88270f6d.js";import"./use-tab-status.723110ee.js";import"./use-id.e2f22365.js";import"./use-refs.09b2d19c.js";import"./index.9e0d46e4.js";import"./index.224299a1.js";import"./index.dab716ce.js";import"./index.24fb4ee4.js";import"./index.b91a923c.js";import"./index.926ca9c5.js";import"./index.e164926c.js";import"./icon_uploader.ff962490.js";import"./icon-xin.62588855.js";import"./icon_album.ed729d4a.js";import"./icon_album_active.469423f9.js";import"./icon_exquisite.4b18ad76.js";import"./icon_music_active.1e7b47ef.js";import"./index.ae2dd816.js";import"./icon-play.bc9e7aab.js";import"./index.b9aedd1d.js";const[be,U]=Q("switch"),Ae={size:Y,loading:Boolean,disabled:Boolean,modelValue:V,activeColor:String,inactiveColor:String,activeValue:{type:V,default:!0},inactiveValue:{type:V,default:!1}};var Se=J({name:be,props:Ae,emits:["change","update:modelValue"],setup(l,{emit:E}){const c=()=>l.modelValue===l.activeValue,B=()=>{if(!l.disabled&&!l.loading){const d=c()?l.inactiveValue:l.activeValue;E("update:modelValue",d),E("change",d)}},j=()=>{if(l.loading){const d=c()?l.activeColor:l.inactiveColor;return t(G,{class:U("loading"),color:d},null)}};return Z(()=>l.modelValue),()=>{const{size:d,loading:D,disabled:y,activeColor:p,inactiveColor:h}=l,w=c(),g={fontSize:K(d),backgroundColor:w?p:h};return t("div",{role:"switch",class:U({on:w,loading:D,disabled:y}),style:g,tabindex:y?void 0:0,"aria-checked":w,onClick:B},[t("div",{class:U("node")},[j()])])}}});const ye=W(Se);const he="_sticky_wg0y2_1",we="_listContainer_wg0y2_5",Ce="_line_wg0y2_17",Ee="_active_wg0y2_23",Te="_label_wg0y2_26",Ie="_alumnList_wg0y2_39",Be="_bgImg_wg0y2_45",je="_tagTabs_wg0y2_53",Re="_fleg_wg0y2_87";var S={sticky:he,listContainer:we,line:Ce,active:Ee,label:Te,alumnList:Ie,bgImg:Be,tagTabs:je,fleg:Re},Ne="./assets/bgImg.2964f21d.png",ke="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 M=()=>{};var da=J({name:"MusicList",props:{hideSearch:{type:Boolean,default:!1},defauleParams:{type:Object,default:()=>({})},onItemClick:{type:Function,default:M},teacherId:{type:String||Number,default:""},myself:{type:Boolean,default:!1}},setup({hideSearch:l,defauleParams:E,onItemClick:c,teacherId:B,myself:j},{expose:d}){const{isLoading:D,state:y}=ge(I(o.platformApi+"/MusicTag/tree",{params:{type:"MUSIC"}}),null),p=u({id:"",name:""});if(o.platformType==="TEACHER"){const e=o.user.data;p.value={name:e.defaultSubjectName||"\u5168\u90E8\u58F0\u90E8",id:e.defaultSubject||""}}else if(!v(b.SEARCH).id){const a=o.user.data,i=a.subjectId?Number(a.subjectId.split(",")[0]):"",f=a.subjectName?a.subjectName.split(",")[0]:"";i&&v(b.SEARCH,JSON.stringify({id:i,name:f}),"set")}localStorage.setItem("behaviorId",de());const h=$(),w=ee(),g={};o.version&&(g.version=o.version||"",g.platform=o.platformType==="STUDENT"?"ios-student":"ios-teacher");const m=u(!1);if(!l){if(o.platformType==="TEACHER")g.subjectIds=p.value.id;else{const a=v(b.SEARCH);g.subjectIds=a.id}const e=v(b.MUSIC_FREE);m.value=e.chargeType}const n=_({search:h.query.search||"",musicTagIds:h.query.tagids||"",page:1,...E,...g}),s=u(null),C=u(!1),L=u(!1),R=u(!1),N=u(!1),T=u(!0),X=u(o.platformType==="STUDENT"?"/api-student":"/api-teacher"),P=e=>{n.page=1,n.search=e,s.value=null,A()},A=async()=>{var a;if(C.value)return;C.value=!0,R.value=!1;const e={...n,auditStatus:"PASS",idAndName:n.search,createBy:B};m.value&&(e.chargeType="FREE"),j?e.myself=!0:e.myself=!1;try{const i=await I.post(`${X.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,L.value=i.data.pageNo>=i.data.totalPage}catch{R.value=!0}C.value=!1},q=async e=>{try{await I.post("/api-teacher/teacher/defaultSubject",{params:{subjectId:e}})}catch{}},x=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,A(),N.value=!1},H=e=>{n.page=1,n.subjectIds=e.id,s.value=null,o.platformType==="TEACHER"?(p.value={name:e.name,id:e.id},q(e.id)):(r.id=e.id,r.name=e.name,v(b.SEARCH,JSON.stringify({id:e.id,name:e.name}),"set")),A(),r.show=!1},k=v(b.SEARCH),r=_({show:!1,name:k.id?k.name:"\u5168\u90E8\u58F0\u90E8",id:k.id||""});return ae(async()=>{try{if(!te().iPhone){T.value=!1;return}const{data:e}=await I.get("/api-admin/appVersionInfo/queryByPlatform",{params:{platform:o.platformType==="TEACHER"?"ios-teacher":"ios-student"}});o.version>e.version?T.value=!0:T.value=!1}catch{}}),d({onSearch:P,onComfirm:x,onComfirmSubject:H}),()=>{const e=y.value&&y.value.data||[];return t(F,null,[!l&&t(F,null,[t(ve,{class:S.sticky},{default:()=>[t(pe,{background:"transparent",isFixed:!1,border:!1,backIconColor:"white",color:"#fff"},{right:()=>!T.value&&t("span",{class:S.fleg,onClick:()=>{m.value!=m.value,v(b.MUSIC_FREE,JSON.stringify({chargeType:m.value}),"set"),s.value=null,n.page=1,A()}},[t(ye,{modelValue:m.value,"onUpdate:modelValue":a=>m.value=a,size:"20px"},null),t("span",null,[se("\u514D\u8D39")])])}),t(ue,{onSearch:P,background:"transparent",inputBackground:"transparent",leftIcon:ke},{left:()=>t("div",{class:S.label,onClick:()=>r.show=!0},[o.platformType==="TEACHER"?p.value.name:r.name,t(le,{classPrefix:"iconfont",name:"down",size:12,color:"#fff"},null)])}),t(re,{shrink:!0,class:S.tagTabs,lineHeight:0,"onClick-tab":a=>{n.musicTagIds=a.name,s.value=null,n.page=1,A()}},{default:()=>[t(O,{title:"\u5168\u90E8",name:""},null),e.map(a=>t(O,{title:a.name,name:a.id},null))]})]}),t("img",{class:S.bgImg,src:Ne},null)]),t("div",{class:S.alumnList},[t(ne,{loading:C.value,finished:L.value,"finished-text":(s.value&&s.value.rows.length,""),onLoad:A,error:R.value},{default:()=>[s.value&&s.value.rows.length?t(fe,{list:s.value.rows,onDetail:a=>{if(c===M){const i=location.origin+location.pathname+"#/music-detail?id="+a.id;oe(i,()=>{w.push({path:"/music-detail",query:{id:a.id}})})}else c==null||c(a)}},null):!C.value&&t(ie,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)]})]),t(z,{show:N.value,round:!0,closeable:!0,position:"bottom",style:{height:"60%"},teleport:"body","onUpdate:show":a=>N.value=a},{default:()=>[t(ce,{exquisiteFlag:!0,onConfirm:x,onCancel:()=>{},defaultValue:h.query.tagids},null)]}),t(z,{show:r.show,position:"bottom",round:!0,closeable:!0,"safe-area-inset-bottom":!0,onClose:()=>r.show=!1,onClosed:()=>r.show=!1},{default:()=>[t(me,{type:"MUSIC",searchParams:o.platformType==="TEACHER"?p.value:r,onComfirm:H},null)]})])}}});export{da as default};
|