index.e6eb325f.js 12 KB

1
  1. import{d as _,j as a,A as D,g as o,y as Q,U as u,a3 as ae,a8 as te,T as se,B as L,P as oe,Q as le,S as O,V as ne,f as ie,be as ue,C as re,aS as ce,F as fe}from"./ResizeObserver.es.39b48a47.js";import{L as ve}from"./index.6c529ad4.js";import"./index.608320e9.js";import"./index.0e35d2fb.js";import{T as pe,a as J}from"./index.5d4d28cc.js";import{D as de,a as me}from"./index.720260d3.js";import"./index.db115763.js";import{S as Ae}from"./index.e10a1ae2.js";import{c as Z}from"./index.dc19bc54.js";import{T as X}from"./index.34ac729a.js";import{C as Y}from"./index.0a093430.js";import"./index.3c44a6d7.js";import{c as V}from"./index.926ca9c5.js";import{C as ge}from"./index.a256e876.js";import{g as Se}from"./music.0a307f27.js";import{S as be}from"./select-subject.9a862edf.js";import{a as h,S as C}from"./hooks.6df65925.js";import{S as he}from"./index.62db47bb.js";import{C as Ce}from"./index.970ad07b.js";import{b as Pe}from"./bg-image.e9966434.js";import{T as ye}from"./index.e90d2179.js";import"./use-tab-status.bcc0c503.js";import"./use-id.b004ff17.js";import"./use-refs.07204da6.js";import"./index.428ab1a8.js";import"./icon-xin2.4ab2a52d.js";import"./index.fcbcb027.js";const Te="_select_ku3kj_1",Ee="_title_ku3kj_17",we="_tit_ku3kj_17",ke="_childContent_ku3kj_31",Be="_item_ku3kj_36",je="_radio_ku3kj_46",Fe="_btn_ku3kj_73";var r={select:Te,title:Ee,tit:we,childContent:ke,item:Be,"radio-group":"_radio-group_ku3kj_46",radio:je,btn:Fe},Qe=_({name:"SelectTagChild",props:{child:{type:Array,default:()=>[]},onSelect:{type:Function,default:()=>{}},rowSingle:{type:Boolean,default:!1},needAllButton:{type:Boolean,default:!0}},setup({child:y,onSelect:g,needAllButton:p,rowSingle:T},{attrs:w}){return()=>{const d=w.selected;return a(ge,{class:V(r.childContent,r["radio-group"]),modelValue:d,"onUpdate:modelValue":f=>{g(f)}},{default:()=>[p&&a(Y,{name:0,class:r.radio,onClick:()=>g([])},{default:()=>[a(X,{class:V(r.item,"van-ellipsis"),type:"primary",plain:d.length!==0,round:!0,size:"large"},{default:()=>[D("\u5168\u90E8")]})]}),y.map(f=>a(Y,{key:f.id,name:f.id,class:r.radio,onClick:()=>{T&&g([f.id])}},{default:()=>[a(X,{class:V(r.item,"van-ellipsis"),plain:!d.includes(f.id),type:"primary",round:!0,size:"large"},{default:()=>[f.name]})]}))]})}}}),Me=_({name:"SelectTag",props:{defaultValue:{type:String,default:""},rowSingle:{type:Boolean,default:!1},exquisiteFlag:{type:Boolean,default:!1},needAllButton:{type:Boolean,default:!0}},emits:["cancel","confirm"],setup({exquisiteFlag:y,defaultValue:g,...p},{emit:T,expose:w}){const d=o.platformType==="STUDENT"?"/api-student":"/api-teacher",{isLoading:f,state:m}=Z(Q(d+"/MusicTag/tree"),null),v=()=>{S.value=[],T("cancel")};(g||"").split(",").map(c=>Number(c));const S=u([]),k={};return ae(m,()=>{if(m.value){const c=m.value&&m.value.data||[];for(const A of c)k[A.id]=A.name}}),w({resetTags:v}),()=>{const c=m.value&&m.value.data||[];return a("div",{class:r.select},[a("h4",{class:r.title},[D("\u5168\u90E8\u6807\u7B7E")]),a("div",{class:r.content},[c.length>0&&a("div",{class:r.list},[a(Qe,te({selected:S.value||[],child:c||[],onSelect:A=>{if(S.value.length>=3){se("\u6700\u591A\u53EA\u80FD\u90093\u4E2A\u6807\u7B7E");return}setTimeout(()=>{A.forEach(M=>{S.value.includes(M)||S.value.push(M)})},100)}},p),null)])]),a("footer",{class:"van-safe-area-bottom van-hairline--top"},[a(L,{class:r.btn,round:!0,onClick:v},{default:()=>[D("\u91CD\u7F6E")]}),a(L,{class:r.btn,type:"primary",round:!0,onClick:()=>T("confirm",S.value,k)},{default:()=>[D("\u786E\u8BA4")]})])])}}});const Re="_sticky_3vo7v_1",De="_titleActive_3vo7v_37",Ie="_listContainer_3vo7v_40",xe="_line_3vo7v_52",Ne="_active_3vo7v_58",Ve="_label_3vo7v_61",_e="_alumnList_3vo7v_74",qe="_bgImg_3vo7v_80",ze="_tagTabs_3vo7v_87",Ue="_fleg_3vo7v_117",Ke="_iconFree_3vo7v_123",He="_iconFreeDisable_3vo7v_127";var P={sticky:Re,titleActive:De,listContainer:Ie,line:xe,active:Ne,label:Ve,alumnList:_e,bgImg:qe,tagTabs:ze,fleg:Ue,iconFree:Ke,iconFreeDisable:He},Ge="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA0CAMAAABCWc3rAAAC8VBMVEUAAADooPPpofPlpPXoo/XcqPbqpfjpofPqovToofPiovLpo/TppfTppfTonvPGtv/LsPq5uv/pofS5uv/qovTItf3Atv3novP/tv/btv/opPTTrfnonfPSrfnonfHUrPi4u//FtP3dp/a7vP/hpfXHtfy4u//Hsfu3tfrAtPy3uP+4vP/15fT////9+v325/X68/r68fn+/f736vb79fv57/n89/zopPPonfL+/P726fa3uv/47vj47Pe4vP/37Pf8+P22uP9kd+1iee/OrvnSrPhuZ+zDtPyiQ/efRPZdfvFwYu1rbetsauzKsfrMr/rhp/VzWe1mduxqcOu4t//UqfeaRfXkpvS+uf26QPzGsvvgovS+tf2+P/zQrfnb1vbeqPbmn/NagPNgfPBpc+u7tv6xQfrYqvfX0/WYRPXFwfOQRfNxXe1ndOu7u/7Isfu1QfusQvnYqPemQ/fcqfacRPaMRvOJR/KFR/FodezBt/3CP/3Fs/zOdPzJfvvv5/nm2vipQvjKt/a3vfW+n/VXg/X04fTw0vR0Vu768f357v3Bs/324PzVnPvapvaruPXcpfWVRfS7uvOCSPB1U+53T+7z6/nUz/jWq/js4/ftuvXepPXst/S/r/TjofR/SPCHkO/EQf307vv00vnfzPnl3vjf0/fOvPXz2/TvxvSYovKImfJhgvJyg+6Ggu726PzZpPvRkfrVrPnSwvjaqfesYfacZvOSovKHXfBpfe96Se98bu7u2Pze3PnatvnmzfjkwPjJkvjwvvfJpfe2ffbQxvTrrPS3tvOoq/KQffDOV/7KQP7o5v3Lyv3mt/nRt/m6bPnLwf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RpaGvAC089AJxk1ujO4sVLbGzGPS0Co8v9UYsex/dwPPRSlbpF01PM5FfToUAbQM/Yo2QZ7CW9ydgiBD00YCACIYGcEgFSVK46/jszAMi/OMyGM1aQF02GmNjglwgQzCpSCFre8NhCUqgUMFII+37xkUDZq6bJF9YhZaeQ41Dt8CWxOjpJY0wq/vFmQwpzZRhcAqtVT9XoKGQVCRB8g5gpUVSxEWfejrrKmiXL0PKmXtZaC7nHGUSPGJxpGMTceuhpFQNK0XqoTanUviUvQVQrgW9lUBFKJZKYeZ06UGo1aMoicAH88zb/1lNqBUt6t3aMFaor9kHwHykY8RLQ9z9CDw1dWGugDiZU0t1KADxLCf9eBVLWKOgCegbo0oazxkKVUBKK2nyue3+OzcYPDc3p76d9AKeR4sJEdReJf38WB2XDWwkQOjWjeNS+tZBoWNy+sFALESOFOvZn8yh5ivScE3mN6denA8WvhvWUCJkMRm7YS9Dy5o42XBf8DLBoEf1Swn4qod9KerSl/i4dJUKWkIAAhAAATHCiCSDucw8QZswYAO7WqkbaWpop+DlKMMHHxRoT6Ph8hBat4OvrVjt9PV2tpq7cIrEIGoj+3VsMbNWXz9o/9F/8d2wBs7IAAAAASUVORK5CYII=";const W=()=>{};var ba=_({name:"MusicList",props:{hideSearch:{type:Boolean,default:!1},defauleParams:{type:Object,default:()=>({})},onItemClick:{type:Function,default:W},teacherId:{type:String||Number,default:""},myself:{type:Boolean,default:!1},showLight:{type:Boolean,default:!1},lightText:{type:String,default:""}},setup({hideSearch:y,defauleParams:g,onItemClick:p,teacherId:T,myself:w,showLight:d,lightText:f},{expose:m}){const v=u(f),{isLoading:S,state:k}=Z(Q(o.platformApi+"/MusicTag/tree",{params:{type:"MUSIC"}}),null),c=u({id:"",name:""});if(o.platformType==="TEACHER"){const e=o.user.data;c.value={name:e.defaultSubjectName||"\u5168\u90E8\u58F0\u90E8",id:e.defaultSubject||""}}else if(!h(C.SEARCH).id){const t=o.user.data,l=t.subjectId?Number(t.subjectId.split(",")[0]):"",i=t.subjectName?t.subjectName.split(",")[0]:"";l&&h(C.SEARCH,JSON.stringify({id:l,name:i}),"set")}localStorage.setItem("behaviorId",Se());const A=oe(),M=le(),B={};o.version&&(B.version=o.version||"",B.platform=o.platformType==="STUDENT"?"ios-student":"ios-teacher");const b=u(!1);if(!y){if(o.platformType==="TEACHER")B.subjectIds=c.value.id;else{const t=h(C.SEARCH);B.subjectIds=t.id}const e=h(C.MUSIC_FREE);b.value=e.chargeType}const n=O({search:A.query.search||"",musicTagIds:A.query.tagids||"",page:1,...g,...B}),s=u(null),j=u(!1),q=u(!1),I=u(!1),x=u(!1),R=u(!0),$=u(o.platformType==="STUDENT"?"/api-student":"/api-teacher"),z=e=>{n.page=1,n.search=e,v.value=e,s.value=null,E()},E=async()=>{var t;if(j.value)return;j.value=!0,I.value=!1;const e={...n,auditStatus:"PASS",idAndName:n.search,createBy:T};y&&(e.idAndName=v.value,e.search=null),b.value&&(e.chargeType="FREE"),w?e.myself=!0:e.myself=!1;try{const l=await Q.post(`${$.value}/music/sheet/list`,{data:e});if(s.value){const i=(((t=s.value)==null?void 0:t.rows)||[]).concat(l.data.rows||[]);s.value.rows=i}if(s.value=s.value||l.data,console.log(d,"showLight",v.value),d){const i=s.value.rows||[];i.forEach(G=>{v.value&&(G.musicSheetName=G.musicSheetName.replace(v.value,`<span style="color: #FE2451">${v.value}</span>`))}),s.value.rows=i,console.log(i,"temp")}n.page=l.data.pageNo+1,q.value=l.data.pageNo>=l.data.totalPage}catch{I.value=!0}j.value=!1},ee=async e=>{try{await Q.post("/api-teacher/teacher/defaultSubject",{params:{subjectId:e}})}catch{}},U=e=>{const t={};for(const i in e)Number(i)===-1?b.value=!!e[i][0]:t[i]=e[i];const l=Object.values(t).flat().filter(Boolean).join(",");n.musicTagIds=l,n.page=1,s.value=null,E(),x.value=!1},K=u(),H=e=>{n.page=1,n.subjectIds=e.id,s.value=null,K.value.toggle(),o.platformType==="TEACHER"?(c.value={name:e.name,id:e.id},ee(e.id)):(F.id=e.id,F.name=e.name,h(C.SEARCH,JSON.stringify({id:e.id,name:e.name}),"set")),E(),F.show=!1},N=h(C.SEARCH),F=O({show:!1,name:N.id?N.name:"\u5168\u90E8\u58F0\u90E8",id:N.id||""});return ne(async()=>{try{if(!ie().iPhone){R.value=!1;return}const{data:e}=await Q.get("/api-admin/appVersionInfo/queryByPlatform",{params:{platform:o.platformType==="TEACHER"?"ios-teacher":"ios-student"}});o.version>e.version?R.value=!0:R.value=!1}catch{}}),m({onSearch:z,onComfirm:U,onComfirmSubject:H}),()=>{const e=k.value&&k.value.data||[];return a(fe,null,[!y&&a("div",{class:P.sticky},[a(ye,null,{default:()=>[a(Ce,{background:"transparent",isFixed:!1,border:!1,color:"#131415"},{right:()=>!R.value&&a("span",{class:P.fleg,onClick:()=>{b.value=!b.value,h(C.MUSIC_FREE,JSON.stringify({chargeType:b.value}),"set"),s.value=null,n.page=1,E()}},[a("img",{src:Ge,class:[P.iconFree,!b.value&&P.iconFreeDisable]},null)])}),a(Ae,{onSearch:z,type:"tenant",background:"transparent",inputBackground:"transparent"},{left:()=>a(de,null,{default:()=>[a(me,{title:F.name,ref:K},{default:()=>[a(be,{type:"MUSIC",isReset:!0,searchParams:o.platformType==="TEACHER"?c.value:F,onComfirm:H},null)]})]})}),a(pe,{shrink:!0,class:P.tagTabs,lineHeight:0,"onClick-tab":t=>{n.musicTagIds=t.name,s.value=null,n.page=1,E()}},{default:()=>[a(J,{title:"\u5168\u90E8",name:""},null),e.map(t=>a(J,{title:t.name,name:t.id},null))]})]}),a("img",{class:P.bgImg,src:Pe},null)]),a("div",{class:[P.alumnList,"searchClass"]},[a(ve,{loading:j.value,finished:q.value,"finished-text":(s.value&&s.value.rows.length,""),onLoad:E,error:I.value},{default:()=>[s.value&&s.value.rows.length?a(he,{showTitleImg:!0,list:s.value.rows,onDetail:t=>{if(p===W){const l=location.origin+location.pathname+"#/music-detail?id="+t.id;ue(l,()=>{M.push({path:"/music-detail",query:{id:t.id}})})}else p==null||p(t)}},null):!j.value&&a(re,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)]})]),a(ce,{show:x.value,round:!0,closeable:!0,position:"bottom",style:{height:"60%"},teleport:"body","onUpdate:show":t=>x.value=t},{default:()=>[a(Me,{exquisiteFlag:!0,onConfirm:U,onCancel:()=>{},defaultValue:A.query.tagids},null)]})])}}});export{ba as default};