1 |
- import{d as V,x as y,g as l,S as n,O as J,P as X,Q as D,U as q,f as Q,j as t,F as U,z as Y,M as Z,bf as K,C as G,aR as k}from"./index.40f4b64d.js";import{L as W}from"./index.5e0f25ab.js";import{S as $}from"./index.d5da1d8a.js";import"./index.56cebac4.js";import"./index.df9064eb.js";import{T as ee,a as x}from"./index.54e6d83c.js";import{S as ae}from"./index.f15d9073.js";import{S as te}from"./select-tag.be44cf57.js";import{g as se}from"./music.5471694f.js";import{S as le}from"./select-subject.4a4e01a1.js";import{a as p,S as f}from"./hooks.2e42c921.js";import{S as oe}from"./index.84929eb7.js";import{C as re}from"./index.c44a09c1.js";import{c as ie}from"./index.489876c1.js";import{T as ne}from"./index.c51e1e5e.js";import"./use-tab-status.7423f29c.js";import"./use-id.d148d155.js";import"./use-refs.fee9cfed.js";import"./index.7d1a23c4.js";import"./index.1014dabb.js";import"./index.fc52eb63.js";import"./index.0e3dd7fb.js";import"./index.04092a81.js";import"./index.926ca9c5.js";import"./index.a822915c.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.21ebe2ef.js";import"./icon-play.bc9e7aab.js";const ue="_sticky_wg0y2_1",ce="_listContainer_wg0y2_5",pe="_line_wg0y2_17",fe="_active_wg0y2_23",me="_label_wg0y2_26",de="_alumnList_wg0y2_39",ge="_bgImg_wg0y2_45",be="_tagTabs_wg0y2_53",Ae="_fleg_wg0y2_87";var d={sticky:ue,listContainer:ce,line:pe,active:fe,label:me,alumnList:de,bgImg:ge,tagTabs:be,fleg:Ae},ve="./assets/bgImg.2964f21d.png",Se="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA6BJREFUWEe9l2molVUUhp+32YKoSBNEKAoriawfShRhpIRNVkg/kiCHhCAzikiEjEQztJnyRzRB9SOw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py4grMIqlb51iezlwV/WH40RdMSYAZTtuBEKQ5pwbxwygQFwX/QSIR0wopfljClAgFgDnAwsl7f0PfUtCHGOyShkAAAAASUVORK5CYII=";const H=()=>{};var ea=V({name:"MusicList",props:{hideSearch:{type:Boolean,default:!1},defauleParams:{type:Object,default:()=>({})},onItemClick:{type:Function,default:H},teacherId:{type:String||Number,default:""},myself:{type:Boolean,default:!1}},setup({hideSearch:E,defauleParams:L,onItemClick:v,teacherId:P,myself:_},{expose:F}){const{isLoading:ye,state:I}=ie(y(l.platformApi+"/MusicTag/tree",{params:{type:"MUSIC"}}),null),g=n({id:"",name:""});if(l.platformType==="TEACHER"){const e=l.user.data;g.value={name:e.defaultSubjectName||"\u5168\u90E8\u58F0\u90E8",id:e.defaultSubject||""}}else if(!p(f.SEARCH).id){const a=l.user.data,o=a.subjectId?Number(a.subjectId.split(",")[0]):"",c=a.subjectName?a.subjectName.split(",")[0]:"";o&&p(f.SEARCH,JSON.stringify({id:o,name:c}),"set")}localStorage.setItem("behaviorId",se());const h=J(),O=X(),b={};l.version&&(b.version=l.version||"",b.platform=l.platformType==="STUDENT"?"ios-student":"ios-teacher");const u=n(!1);if(!E){if(l.platformType==="TEACHER")b.subjectIds=g.value.id;else{const a=p(f.SEARCH);b.subjectIds=a.id}const e=p(f.MUSIC_FREE);u.value=e.chargeType}const r=D({search:h.query.search||"",musicTagIds:h.query.tagids||"",page:1,...L,...b}),s=n(null),A=n(!1),j=n(!1),w=n(!1),C=n(!1),S=n(!0),z=n(l.platformType==="STUDENT"?"/api-student":"/api-teacher"),B=e=>{r.page=1,r.search=e,s.value=null,m()},m=async()=>{var a;if(A.value)return;A.value=!0,w.value=!1;const e={...r,auditStatus:"PASS",idAndName:r.search,createBy:P};u.value&&(e.chargeType="FREE"),_?e.myself=!0:e.myself=!1;try{const o=await y.post(`${z.value}/music/sheet/list`,{data:e});if(s.value){const c=(((a=s.value)==null?void 0:a.rows)||[]).concat(o.data.rows||[]);s.value.rows=c}s.value=s.value||o.data,r.page=o.data.pageNo+1,j.value=o.data.pageNo>=o.data.totalPage}catch{w.value=!0}A.value=!1},M=async e=>{try{await y.post("/api-teacher/teacher/defaultSubject",{params:{subjectId:e}})}catch{}},R=e=>{const a={};for(const c in e)Number(c)===-1?u.value=!!e[c][0]:a[c]=e[c];const o=Object.values(a).flat().filter(Boolean).join(",");r.musicTagIds=o,r.page=1,s.value=null,m(),C.value=!1},N=e=>{r.page=1,r.subjectIds=e.id,s.value=null,l.platformType==="TEACHER"?(g.value={name:e.name,id:e.id},M(e.id)):(i.id=e.id,i.name=e.name,p(f.SEARCH,JSON.stringify({id:e.id,name:e.name}),"set")),m(),i.show=!1},T=p(f.SEARCH),i=D({show:!1,name:T.id?T.name:"\u5168\u90E8\u58F0\u90E8",id:T.id||""});return q(async()=>{try{if(!Q().iPhone){S.value=!1;return}const{data:e}=await y.get("/api-admin/appVersionInfo/queryByPlatform",{params:{platform:l.platformType==="TEACHER"?"ios-teacher":"ios-student"}});l.version>e.version?S.value=!0:S.value=!1}catch{}}),F({onSearch:B,onComfirm:R,onComfirmSubject:N}),()=>{const e=I.value&&I.value.data||[];return t(U,null,[!E&&t(U,null,[t(ne,{class:d.sticky},{default:()=>[t(re,{background:"transparent",isFixed:!1,border:!1,backIconColor:"white",color:"#fff"},{right:()=>!S.value&&t("span",{class:d.fleg,onClick:()=>{u.value!=u.value,p(f.MUSIC_FREE,JSON.stringify({chargeType:u.value}),"set"),s.value=null,r.page=1,m()}},[t($,{modelValue:u.value,"onUpdate:modelValue":a=>u.value=a,size:"20px"},null),t("span",null,[Y("\u514D\u8D39")])])}),t(ae,{onSearch:B,background:"transparent",inputBackground:"transparent",leftIcon:Se},{left:()=>t("div",{class:d.label,onClick:()=>i.show=!0},[l.platformType==="TEACHER"?g.value.name:i.name,t(Z,{classPrefix:"iconfont",name:"down",size:12,color:"#fff"},null)])}),t(ee,{shrink:!0,class:d.tagTabs,lineHeight:0,"onClick-tab":a=>{r.musicTagIds=a.name,s.value=null,r.page=1,m()}},{default:()=>[t(x,{title:"\u5168\u90E8",name:""},null),e.map(a=>t(x,{title:a.name,name:a.id},null))]})]}),t("img",{class:d.bgImg,src:ve},null)]),t("div",{class:d.alumnList},[t(W,{loading:A.value,finished:j.value,"finished-text":(s.value&&s.value.rows.length,""),onLoad:m,error:w.value},{default:()=>[s.value&&s.value.rows.length?t(oe,{list:s.value.rows,onDetail:a=>{if(v===H){const o=location.origin+location.pathname+"#/music-detail?id="+a.id;K(o,()=>{O.push({path:"/music-detail",query:{id:a.id}})})}else v==null||v(a)}},null):!A.value&&t(G,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)]})]),t(k,{show:C.value,round:!0,closeable:!0,position:"bottom",style:{height:"60%"},teleport:"body","onUpdate:show":a=>C.value=a},{default:()=>[t(te,{exquisiteFlag:!0,onConfirm:R,onCancel:()=>{},defaultValue:h.query.tagids},null)]}),t(k,{show:i.show,position:"bottom",round:!0,closeable:!0,"safe-area-inset-bottom":!0,onClose:()=>i.show=!1,onClosed:()=>i.show=!1},{default:()=>[t(le,{type:"MUSIC",searchParams:l.platformType==="TEACHER"?g.value:i,onComfirm:N},null)]})])}}});export{ea as default};
|