index.e635e8b5.js 8.1 KB

1
  1. import{A as F,G as O,E as W,aa as H,$ as U,d as A,S as m,ai as K,ab as G,V as R,L as X,bs as Y,ae as Z,j as a,aX as J,X as Q,al as ee,aV as te,H as D,Q as B,as as ae,aj as oe,bu as le,ad as se,a5 as ne,aE as re,aR as ie,M as ce,N as M,O as ue,P as de,g as pe,U as ve,F as T,z as S,B as $,C as me,Z as fe,w as L}from"./index.cf487d9e.js";import{L as ge}from"./index.f45751d0.js";import{C as ye}from"./index.e3693273.js";import{T as E}from"./index.f3f705ee.js";import{S as be}from"./index.d4b11cb0.js";import{g as he}from"./music.070d0add.js";import{S as _e}from"./index.a638295f.js";import{C as we}from"./index.36fcf68d.js";import{b as Ce}from"./bg-image.e9966434.js";import{T as ke}from"./index.0656d807.js";import{u as Se}from"./use-id.f045e77e.js";import"./use-tab-status.56c677c5.js";import"./index.1c8c6ce9.js";import"./icon-xin2.4ab2a52d.js";import"./index.bc1a15dc.js";import"./index.b915e986.js";import"./use-height.6b216291.js";import"./index.dffaafe3.js";const[N,P]=F("dropdown-menu"),Ie={overlay:O,zIndex:W,duration:H(.2),direction:U("down"),activeColor:String,closeOnClickOutside:O,closeOnClickOverlay:O},V=Symbol(N);var Te=A({name:N,props:Ie,setup(l,{slots:g}){const v=Se(),n=m(),u=m(),p=m(0),{children:o,linkChildren:c}=K(V),y=G(n),b=R(()=>o.some(t=>t.state.showWrapper)),_=R(()=>{if(b.value&&X(l.zIndex))return{zIndex:+l.zIndex+1}}),d=()=>{l.closeOnClickOutside&&o.forEach(t=>{t.toggle(!1)})},w=()=>{if(u.value){const t=Q(u);l.direction==="down"?p.value=t.bottom:p.value=ee.value-t.top}},C=()=>{b.value&&w()},k=t=>{o.forEach((e,s)=>{s===t?(w(),e.toggle()):e.state.showPopup&&e.toggle(!1,{immediate:!0})})},h=(t,e)=>{const{showPopup:s}=t.state,{disabled:r,titleClass:f}=t;return a("div",{id:`${v}-${e}`,role:"button",tabindex:r?void 0:0,class:[P("item",{disabled:r}),{[J]:!r}],onClick:()=>{r||k(e)}},[a("span",{class:[P("title",{down:s===(l.direction==="down"),active:s}),f],style:{color:s?l.activeColor:""}},[a("div",{class:"van-ellipsis"},[t.renderTitle()])])])};return c({id:v,props:l,offset:p}),Y(n,d),Z("scroll",C,{target:y}),()=>{var t;return a("div",{ref:n,class:P()},[a("div",{ref:u,style:_.value,class:P("bar",{opened:b.value})},[o.map(h)]),(t=g.default)==null?void 0:t.call(g)])}}});const[Pe,x]=F("dropdown-item"),xe={title:String,options:te(),disabled:Boolean,teleport:[String,Object],lazyRender:O,modelValue:D,titleClass:D};var Oe=A({name:Pe,props:xe,emits:["open","opened","close","closed","change","update:modelValue"],setup(l,{emit:g,slots:v}){const n=B({showPopup:!1,transition:!0,showWrapper:!1}),{parent:u,index:p}=ae(V);if(!u){console.error("[Vant] <DropdownItem> must be a child component of <DropdownMenu>.");return}const o=t=>()=>g(t),c=o("open"),y=o("close"),b=o("opened"),_=()=>{n.showWrapper=!1,g("closed")},d=t=>{l.teleport&&t.stopPropagation()},w=(t=!n.showPopup,e={})=>{t!==n.showPopup&&(n.showPopup=t,n.transition=!e.immediate,t&&(n.showWrapper=!0))},C=()=>{if(v.title)return v.title();if(l.title)return l.title;const t=l.options.find(e=>e.value===l.modelValue);return t?t.text:""},k=t=>{const{activeColor:e}=u.props,s=t.value===l.modelValue,r=()=>{n.showPopup=!1,t.value!==l.modelValue&&(g("update:modelValue",t.value),g("change",t.value))},f=()=>{if(s)return a(ce,{class:x("icon"),color:e,name:"success"},null)};return a(ye,{role:"menuitem",key:t.value,icon:t.icon,title:t.text,class:x("option",{active:s}),style:{color:s?e:""},tabindex:s?0:-1,clickable:!0,onClick:r},{value:f})},h=()=>{const{offset:t}=u,{zIndex:e,overlay:s,duration:r,direction:f,closeOnClickOverlay:j}=u.props,q=se(e);return f==="down"?q.top=`${t.value}px`:q.bottom=`${t.value}px`,ne(a("div",{style:q,class:x([f]),onClick:d},[a(ie,{show:n.showPopup,"onUpdate:show":I=>n.showPopup=I,role:"menu",class:x("content"),overlay:s,position:f==="down"?"top":"bottom",duration:n.transition?r:0,lazyRender:l.lazyRender,overlayStyle:{position:"absolute"},"aria-labelledby":`${u.id}-${p.value}`,closeOnClickOverlay:j,onOpen:c,onClose:y,onOpened:b,onClosed:_},{default:()=>{var I;return[l.options.map(k),(I=v.default)==null?void 0:I.call(v)]}})]),[[re,n.showWrapper]])};return oe({state:n,toggle:w,renderTitle:C}),()=>l.teleport?a(le,{to:l.teleport},{default:()=>[h()]}):h()}});const qe=M(Oe),Ee=M(Te);const Ae="_sticky_1albq_1",Re="_titleActive_1albq_31",De="_listContainer_1albq_34",$e="_line_1albq_46",Le="_active_1albq_52",ze="_label_1albq_55",Fe="_alumnList_1albq_68",Be="_bgImg_1albq_75",Me="_tagTabs_1albq_83",Ne="_fleg_1albq_113",Ve="_iconFree_1albq_119",je="_iconFreeDisable_1albq_123",We="_searchResult_1albq_129",He="_searchTitle_1albq_134",Ue="_radio_1albq_139";var i={sticky:Ae,titleActive:Re,listContainer:De,line:$e,active:Le,label:ze,alumnList:Fe,bgImg:Be,tagTabs:Me,fleg:Ne,iconFree:Ve,iconFreeDisable:je,searchResult:We,searchTitle:He,"radio-group":"_radio-group_1albq_139",radio:Ue,"organ-radio":"_organ-radio_1albq_170"};function z(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!fe(l)}var dt=A({name:"MusicList",props:{teacherId:{type:String||Number,default:""},myself:{type:Boolean,default:!1}},setup({onItemClick:l},{expose:g}){localStorage.setItem("behaviorId",he());const v=ue(),n=de(),u=v.query.subjectType||"";let p="";u==="SUBJECT"?p="\u58F0\u90E8\u7EC3\u4E60":u==="MUSIC"?p="\u72EC\u594F\u66F2\u76EE":u==="ENSEMBLE"&&(p="\u5408\u594F\u7EC3\u4E60");const o=B({keyword:v.query.search||"",subjectType:u,page:1,subjectId:null,level:"",type:"",title:p}),c=m(null),y=m(!1),b=m(!1),_=m(!1),d=m({}),w=m(),C=m(pe.platformType==="STUDENT"?"/api-student":"/api-teacher"),k=e=>{o.page=1,o.keyword=e,c.value=null,h()},h=async()=>{var s;y.value=!0,_.value=!1;const e={...o};try{const r=await L.post(`${C.value}/tenantAlbumMusic/page`,{data:e});if(c.value){const f=(((s=c.value)==null?void 0:s.rows)||[]).concat(r.data.rows||[]);c.value.rows=f}c.value=c.value||r.data,o.page=r.data.pageNo+1,b.value=r.data.pageNo>=r.data.totalPage}catch{_.value=!0}y.value=!1},t=async()=>{const{data:e}=await L.post(`${C.value}/tenantAlbumMusic/selectCondition`,{data:{subjectType:o.subjectType}});d.value=e||{}};return ve(async()=>{y.value=!0,await t(),await h()}),()=>a(T,null,[a("div",{class:i.sticky},[a(ke,null,{default:()=>[a(we,{background:"transparent",isFixed:!1,border:!1,title:p,color:"#131415"},null),a(be,{onSearch:k,type:"tenant",background:"transparent",inputBackground:"transparent"},{left:()=>a(Ee,null,{default:()=>[a(qe,{titleClass:o.subjectId||o.type||o.level?i.titleActive:"",title:"\u7B5B\u9009",ref:w},{default:()=>[a("div",{class:i.searchResult,style:{maxHeight:"45vh",overflowY:"auto"}},[d.value.subjects&&d.value.subjects.length>0&&a(T,null,[a("div",{class:i.searchTitle},[S("\u58F0\u90E8")]),a("div",{class:[i["radio-group"],i.radio,i["organ-radio"]]},[d.value.subjects.map(e=>{const s=e.id===o.subjectId;return a(E,{size:"large",plain:s,type:s?"primary":"default",round:!0,onClick:()=>{o.subjectId=e.id}},{default:()=>[e.name]})})])]),d.value.levels&&d.value.levels.length>0&&a(T,null,[a("div",{class:i.searchTitle},[S("\u7EA7\u522B")]),a("div",{class:[i["radio-group"],i.radio,i["organ-radio"]]},[d.value.levels.map(e=>{const s=e===o.level;return a(E,{size:"large",plain:s,type:s?"primary":"default",round:!0,onClick:()=>{o.level=e}},z(e)?e:{default:()=>[e]})})])]),d.value.types&&d.value.types.length>0&&a(T,null,[a("div",{class:i.searchTitle},[S("\u7C7B\u578B")]),a("div",{class:[i["radio-group"],i.radio,i["organ-radio"]]},[d.value.types.map(e=>{const s=e===o.type;return a(E,{size:"large",plain:s,type:s?"primary":"default",round:!0,onClick:()=>{o.type=e}},z(e)?e:{default:()=>[e]})})])])]),a("div",{class:["btnGroup","btnMore"]},[a($,{type:"primary",plain:!0,round:!0,onClick:()=>{o.subjectId=null,o.level="",o.type=""}},{default:()=>[S("\u91CD \u7F6E")]}),a($,{type:"primary",round:!0,block:!0,onClick:()=>{var e;k(""),(e=w.value)==null||e.toggle()}},{default:()=>[S("\u786E \u8BA4")]})])]})]})})]}),a("img",{class:i.bgImg,src:Ce},null)]),a("div",{class:i.alumnList},[a(ge,{finished:b.value,"finished-text":(c.value&&c.value.rows.length,""),onLoad:h,error:_.value,immediateCheck:!1},{default:()=>[c.value&&c.value.rows.length?a(_e,{showTitleImg:!0,list:c.value.rows,onDetail:e=>{n.push({path:"/music-detail",query:{id:e.id}})}},null):!y.value&&a(me,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)]})])])}});export{dt as default};