1 |
- import{d as z,j as a,z as q,g as o,w as Q,S as c,a2 as ae,a7 as te,T as se,B as G,O as oe,P as le,Q as L,U as ue,f as ne,M as ie,be as re,C as ce,aR as O,F as fe}from"./index.cf487d9e.js";import{L as pe}from"./index.f45751d0.js";import"./index.801123b8.js";import"./index.c6b3d658.js";import{T as ve,a as J}from"./index.e0acffb1.js";import{S as de}from"./index.d4b11cb0.js";import{b as Z}from"./index.dffaafe3.js";import{T as X}from"./index.f3f705ee.js";import{C as Y}from"./index.92528e2b.js";import"./index.3a938adc.js";import{c as N}from"./index.926ca9c5.js";import{C as me}from"./index.aab412e1.js";import{g as Ae}from"./music.070d0add.js";import{S as ge}from"./select-subject.38c2fc8b.js";import{a as P,S as y}from"./hooks.d9eb54a1.js";import{S as be}from"./index.a638295f.js";import{C as Se}from"./index.36fcf68d.js";import{b as he}from"./bg-image.e9966434.js";import{T as Ce}from"./index.0656d807.js";import"./use-tab-status.56c677c5.js";import"./use-id.f045e77e.js";import"./use-refs.48cf5796.js";import"./index.e3693273.js";import"./index.1c8c6ce9.js";import"./icon-xin2.4ab2a52d.js";import"./index.bc1a15dc.js";import"./index.b915e986.js";import"./use-height.6b216291.js";const Pe="_select_ku3kj_1",ye="_title_ku3kj_17",Te="_tit_ku3kj_17",we="_childContent_ku3kj_31",Ee="_item_ku3kj_36",ke="_radio_ku3kj_46",Be="_btn_ku3kj_73";var r={select:Pe,title:ye,tit:Te,childContent:we,item:Ee,"radio-group":"_radio-group_ku3kj_46",radio:ke,btn:Be},je=z({name:"SelectTagChild",props:{child:{type:Array,default:()=>[]},onSelect:{type:Function,default:()=>{}},rowSingle:{type:Boolean,default:!1},needAllButton:{type:Boolean,default:!0}},setup({child:T,onSelect:S,needAllButton:d,rowSingle:w},{attrs:k}){return()=>{const m=k.selected;return a(me,{class:N(r.childContent,r["radio-group"]),modelValue:m,"onUpdate:modelValue":f=>{S(f)}},{default:()=>[d&&a(Y,{name:0,class:r.radio,onClick:()=>S([])},{default:()=>[a(X,{class:N(r.item,"van-ellipsis"),type:"primary",plain:m.length!==0,round:!0,size:"large"},{default:()=>[q("\u5168\u90E8")]})]}),T.map(f=>a(Y,{key:f.id,name:f.id,class:r.radio,onClick:()=>{w&&S([f.id])}},{default:()=>[a(X,{class:N(r.item,"van-ellipsis"),plain:!m.includes(f.id),type:"primary",round:!0,size:"large"},{default:()=>[f.name]})]}))]})}}}),Fe=z({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:T,defaultValue:S,...d},{emit:w,expose:k}){const m=o.platformType==="STUDENT"?"/api-student":"/api-teacher",{isLoading:f,state:A}=Z(Q(m+"/MusicTag/tree"),null),p=()=>{h.value=[],w("cancel")};(S||"").split(",").map(u=>Number(u));const h=c([]),B={};return ae(A,()=>{if(A.value){const u=A.value&&A.value.data||[];for(const g of u)B[g.id]=g.name}}),k({resetTags:p}),()=>{const u=A.value&&A.value.data||[];return a("div",{class:r.select},[a("h4",{class:r.title},[q("\u5168\u90E8\u6807\u7B7E")]),a("div",{class:r.content},[u.length>0&&a("div",{class:r.list},[a(je,te({selected:h.value||[],child:u||[],onSelect:g=>{if(h.value.length>=3){se("\u6700\u591A\u53EA\u80FD\u90093\u4E2A\u6807\u7B7E");return}setTimeout(()=>{g.forEach(M=>{h.value.includes(M)||h.value.push(M)})},100)}},d),null)])]),a("footer",{class:"van-safe-area-bottom van-hairline--top"},[a(G,{class:r.btn,round:!0,onClick:p},{default:()=>[q("\u91CD\u7F6E")]}),a(G,{class:r.btn,type:"primary",round:!0,onClick:()=>w("confirm",h.value,B)},{default:()=>[q("\u786E\u8BA4")]})])])}}});const Qe="_sticky_quuc1_1",Me="_listContainer_quuc1_17",Re="_line_quuc1_29",qe="_active_quuc1_35",Ie="_label_quuc1_38",xe="_alumnList_quuc1_51",De="_bgImg_quuc1_57",Ne="_tagTabs_quuc1_65",ze="_fleg_quuc1_95",Ve="_iconFree_quuc1_101",Ue="_iconFreeDisable_quuc1_105";var b={sticky:Qe,listContainer:Me,line:Re,active:qe,label:Ie,alumnList:xe,bgImg:De,tagTabs:Ne,fleg:ze,iconFree:Ve,iconFreeDisable:Ue},_e="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/m6bPnLwfe6jfenRffBx/a/vvSyqfKhi/FxifGZm/B7Ve7syv3quf3di/3SZv3hr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5FfToUAbQM/Yo2QZ7CW9ydgiBD00YCACIYGcEgFSVK46/jszAMi/OMyGM1aQF02GmNjglwgQzCpSCFre8NhCUqgUMFII+37xkUDZq6bJF9YhZaeQ41Dt8CWxOjpJY0wq/vFmQwpzZRhcAqtVT9XoKGQVCRB8g5gpUVSxEWfejrrKmiXL0PKmXtZaC7nHGUSPGJxpGMTceuhpFQNK0XqoTanUviUvQVQrgW9lUBFKJZKYeZ06UGo1aMoicAH88zb/1lNqBUt6t3aMFaor9kHwHykY8RLQ9z9CDw1dWGugDiZU0t1KADxLCf9eBVLWKOgCegbo0oazxkKVUBKK2nyue3+OzcYPDc3p76d9AKeR4sJEdReJf38WB2XDWwkQOjWjeNS+tZBoWNy+sFALESOFOvZn8yh5ivScE3mN6denA8WvhvWUCJkMRm7YS9Dy5o42XBf8DLBoEf1Swn4qod9KerSl/i4dJUKWkIAAhAAATHCiCSDucw8QZswYAO7WqkbaWpop+DlKMMHHxRoT6Ph8hBat4OvrVjt9PV2tpq7cIrEIGoj+3VsMbNWXz9o/9F/8d2wBs7IAAAAASUVORK5CYII=";const W=()=>{};var ga=z({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:T,defauleParams:S,onItemClick:d,teacherId:w,myself:k,showLight:m,lightText:f},{expose:A}){const p=c(f),{isLoading:h,state:B}=Z(Q(o.platformApi+"/MusicTag/tree",{params:{type:"MUSIC"}}),null),u=c({id:"",name:""});if(o.platformType==="TEACHER"){const e=o.user.data;u.value={name:e.defaultSubjectName||"\u5168\u90E8\u58F0\u90E8",id:e.defaultSubject||""}}else if(!P(y.SEARCH).id){const t=o.user.data,l=t.subjectId?Number(t.subjectId.split(",")[0]):"",i=t.subjectName?t.subjectName.split(",")[0]:"";l&&P(y.SEARCH,JSON.stringify({id:l,name:i}),"set")}localStorage.setItem("behaviorId",Ae());const g=oe(),M=le(),j={};o.version&&(j.version=o.version||"",j.platform=o.platformType==="STUDENT"?"ios-student":"ios-teacher");const C=c(!1);if(!T){if(o.platformType==="TEACHER")j.subjectIds=u.value.id;else{const t=P(y.SEARCH);j.subjectIds=t.id}const e=P(y.MUSIC_FREE);C.value=e.chargeType}const n=L({search:g.query.search||"",musicTagIds:g.query.tagids||"",page:1,...S,...j}),s=c(null),F=c(!1),V=c(!1),I=c(!1),x=c(!1),R=c(!0),$=c(o.platformType==="STUDENT"?"/api-student":"/api-teacher"),U=e=>{n.page=1,n.search=e,p.value=e,s.value=null,E()},E=async()=>{var t;if(F.value)return;F.value=!0,I.value=!1;const e={...n,auditStatus:"PASS",idAndName:n.search,createBy:w};T&&(e.idAndName=p.value,e.search=null),C.value&&(e.chargeType="FREE"),k?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(m,"showLight",p.value),m){const i=s.value.rows||[];i.forEach(H=>{p.value&&(H.musicSheetName=H.musicSheetName.replace(p.value,`<span style="color: #FE2451">${p.value}</span>`))}),s.value.rows=i,console.log(i,"temp")}n.page=l.data.pageNo+1,V.value=l.data.pageNo>=l.data.totalPage}catch{I.value=!0}F.value=!1},ee=async e=>{try{await Q.post("/api-teacher/teacher/defaultSubject",{params:{subjectId:e}})}catch{}},_=e=>{const t={};for(const i in e)Number(i)===-1?C.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=e=>{n.page=1,n.subjectIds=e.id,s.value=null,o.platformType==="TEACHER"?(u.value={name:e.name,id:e.id},ee(e.id)):(v.id=e.id,v.name=e.name,P(y.SEARCH,JSON.stringify({id:e.id,name:e.name}),"set")),E(),v.show=!1},D=P(y.SEARCH),v=L({show:!1,name:D.id?D.name:"\u5168\u90E8\u58F0\u90E8",id:D.id||""});return ue(async()=>{try{if(!ne().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{}}),A({onSearch:U,onComfirm:_,onComfirmSubject:K}),()=>{const e=B.value&&B.value.data||[];return a(fe,null,[!T&&a("div",{class:b.sticky},[a(Ce,null,{default:()=>[a(Se,{background:"transparent",isFixed:!1,border:!1,color:"#131415"},{right:()=>!R.value&&a("span",{class:b.fleg,onClick:()=>{C.value=!C.value,P(y.MUSIC_FREE,JSON.stringify({chargeType:C.value}),"set"),s.value=null,n.page=1,E()}},[a("img",{src:_e,class:[b.iconFree,C.value&&b.iconFreeDisable]},null)])}),a(de,{onSearch:U,type:"tenant",background:"transparent",inputBackground:"transparent"},{left:()=>a("div",{class:b.label,onClick:()=>v.show=!0},[o.platformType==="TEACHER"?u.value.name:v.name,a(ie,{classPrefix:"iconfont",name:"down",size:12,color:"#131415"},null)])}),a(ve,{shrink:!0,class:b.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:b.bgImg,src:he},null)]),a("div",{class:[b.alumnList,"searchClass"]},[a(pe,{loading:F.value,finished:V.value,"finished-text":(s.value&&s.value.rows.length,""),onLoad:E,error:I.value},{default:()=>[s.value&&s.value.rows.length?a(be,{showTitleImg:!0,list:s.value.rows,onDetail:t=>{if(d===W){const l=location.origin+location.pathname+"#/music-detail?id="+t.id;re(l,()=>{M.push({path:"/music-detail",query:{id:t.id}})})}else d==null||d(t)}},null):!F.value&&a(ce,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)]})]),a(O,{show:x.value,round:!0,closeable:!0,position:"bottom",style:{height:"60%"},teleport:"body","onUpdate:show":t=>x.value=t},{default:()=>[a(Fe,{exquisiteFlag:!0,onConfirm:_,onCancel:()=>{},defaultValue:g.query.tagids},null)]}),a(O,{show:v.show,position:"bottom",round:!0,closeable:!0,"safe-area-inset-bottom":!0,onClose:()=>v.show=!1,onClosed:()=>v.show=!1},{default:()=>[a(ge,{type:"MUSIC",searchParams:o.platformType==="TEACHER"?u.value:v,onComfirm:K},null)]})])}}});export{ga as default};
|