1 |
- import{G as W,I as $,H as K,ac as Z,a1 as G,d as F,V as b,ak as X,ad as Y,X as H,N as Q,bt as ee,ag as te,j as a,aZ as ae,Z as se,an as oe,aX as ne,J as V,U as L,au as le,al as re,bv as ce,af as ie,a7 as ue,aG as de,aT as pe,O as fe,P as B,g as y,Q as me,S as ve,W as be,B as ge,bf as he,C as ye,F as _e,w as A}from"./index.c8a33855.js";import{L as we}from"./index.cf2652a7.js";import{C as Se}from"./index.89b19a2f.js";import{T as Ce}from"./index.d9b7361c.js";import{S as je}from"./index.24110c1a.js";import{g as Te}from"./music.0a7d65d9.js";import{a as x,S as R}from"./hooks.88972ca3.js";import{S as Ie}from"./index.dadd7234.js";import{C as Pe}from"./index.00003e8f.js";import{b as ze}from"./bg-image.e9966434.js";import{T as Ee}from"./index.0cb130e9.js";import{u as ke}from"./use-id.c5c54d4f.js";import"./use-tab-status.9eeb64d0.js";import"./index.5792511e.js";import"./icon-xin.18c43f84.js";import"./index.5da3180f.js";import"./index.a0b72ee6.js";import"./use-height.f274d759.js";import"./index.ed5eea4e.js";const[U,N]=W("dropdown-menu"),Oe={overlay:$,zIndex:K,duration:Z(.2),direction:G("down"),activeColor:String,closeOnClickOutside:$,closeOnClickOverlay:$},q=Symbol(U);var xe=F({name:U,props:Oe,setup(s,{slots:_}){const u=ke(),n=b(),m=b(),C=b(0),{children:d,linkChildren:T}=X(q),E=Y(n),f=H(()=>d.some(e=>e.state.showWrapper)),p=H(()=>{if(f.value&&Q(s.zIndex))return{zIndex:+s.zIndex+1}}),I=()=>{s.closeOnClickOutside&&d.forEach(e=>{e.toggle(!1)})},l=()=>{if(m.value){const e=se(m);s.direction==="down"?C.value=e.bottom:C.value=oe.value-e.top}},g=()=>{f.value&&l()},P=e=>{d.forEach((o,r)=>{r===e?(l(),o.toggle()):o.state.showPopup&&o.toggle(!1,{immediate:!0})})},w=(e,o)=>{const{showPopup:r}=e.state,{disabled:v,titleClass:h}=e;return a("div",{id:`${u}-${o}`,role:"button",tabindex:v?void 0:0,class:[N("item",{disabled:v}),{[ae]:!v}],onClick:()=>{v||P(o)}},[a("span",{class:[N("title",{down:r===(s.direction==="down"),active:r}),h],style:{color:r?s.activeColor:""}},[a("div",{class:"van-ellipsis"},[e.renderTitle()])])])};return T({id:u,props:s,offset:C}),ee(n,I),te("scroll",g,{target:E}),()=>{var e;return a("div",{ref:n,class:N()},[a("div",{ref:m,style:p.value,class:N("bar",{opened:f.value})},[d.map(w)]),(e=_.default)==null?void 0:e.call(_)])}}});const[Re,D]=W("dropdown-item"),Ae={title:String,options:ne(),disabled:Boolean,teleport:[String,Object],lazyRender:$,modelValue:V,titleClass:V};var Ne=F({name:Re,props:Ae,emits:["open","opened","close","closed","change","update:modelValue"],setup(s,{emit:_,slots:u}){const n=L({showPopup:!1,transition:!0,showWrapper:!1}),{parent:m,index:C}=le(q);if(!m){console.error("[Vant] <DropdownItem> must be a child component of <DropdownMenu>.");return}const d=e=>()=>_(e),T=d("open"),E=d("close"),f=d("opened"),p=()=>{n.showWrapper=!1,_("closed")},I=e=>{s.teleport&&e.stopPropagation()},l=(e=!n.showPopup,o={})=>{e!==n.showPopup&&(n.showPopup=e,n.transition=!o.immediate,e&&(n.showWrapper=!0))},g=()=>{if(u.title)return u.title();if(s.title)return s.title;const e=s.options.find(o=>o.value===s.modelValue);return e?e.text:""},P=e=>{const{activeColor:o}=m.props,r=e.value===s.modelValue,v=()=>{n.showPopup=!1,e.value!==s.modelValue&&(_("update:modelValue",e.value),_("change",e.value))},h=()=>{if(r)return a(fe,{class:D("icon"),color:o,name:"success"},null)};return a(Se,{role:"menuitem",key:e.value,icon:e.icon,title:e.text,class:D("option",{active:r}),style:{color:r?o:""},tabindex:r?0:-1,clickable:!0,onClick:v},{value:h})},w=()=>{const{offset:e}=m,{zIndex:o,overlay:r,duration:v,direction:h,closeOnClickOverlay:k}=m.props,j=ie(o);return h==="down"?j.top=`${e.value}px`:j.bottom=`${e.value}px`,ue(a("div",{style:j,class:D([h]),onClick:I},[a(pe,{show:n.showPopup,"onUpdate:show":z=>n.showPopup=z,role:"menu",class:D("content"),overlay:r,position:h==="down"?"top":"bottom",duration:n.transition?v:0,lazyRender:s.lazyRender,overlayStyle:{position:"absolute"},"aria-labelledby":`${m.id}-${C.value}`,closeOnClickOverlay:k,onOpen:T,onClose:E,onOpened:f,onClosed:p},{default:()=>{var z;return[s.options.map(P),(z=u.default)==null?void 0:z.call(u)]}})]),[[de,n.showWrapper]])};return re({state:n,toggle:l,renderTitle:g}),()=>s.teleport?a(ce,{to:s.teleport},{default:()=>[w()]}):w()}});const De=B(Ne),$e=B(xe);const Le="_sticky_pzl6c_1",Fe="_listContainer_pzl6c_28",He="_line_pzl6c_40",Ve="_active_pzl6c_46",Me="_label_pzl6c_49",We="_alumnList_pzl6c_62",Be="_bgImg_pzl6c_68",Ue="_tagTabs_pzl6c_76",qe="_fleg_pzl6c_106",Je="_iconFree_pzl6c_112",Ke="_iconFreeDisable_pzl6c_116",Ze="_searchResult_pzl6c_122",Ge="_searchTitle_pzl6c_127",Xe="_radio_pzl6c_132";var S={sticky:Le,listContainer:Fe,line:He,active:Ve,label:Me,alumnList:We,bgImg:Be,tagTabs:Ue,fleg:qe,iconFree:Je,iconFreeDisable:Ke,searchResult:Ze,searchTitle:Ge,"radio-group":"_radio-group_pzl6c_132",radio:Xe,"organ-radio":"_organ-radio_pzl6c_163"};const M=()=>{};var gt=F({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:s,defauleParams:_,onItemClick:u,teacherId:n,myself:m},{expose:C}){const d=b({id:"",name:""});if(y.platformType==="TEACHER"){const t=y.user.data;d.value={name:t.defaultSubjectName||"\u5168\u90E8\u58F0\u90E8",id:t.defaultSubject||""}}else if(!x(R.SEARCH).id){const c=y.user.data,i=c.subjectId?Number(c.subjectId.split(",")[0]):"",O=c.subjectName?c.subjectName.split(",")[0]:"";i&&x(R.SEARCH,JSON.stringify({id:i,name:O}),"set")}localStorage.setItem("behaviorId",Te());const T=me(),E=ve(),f={};if(y.version&&(f.version=y.version||"",f.platform=y.platformType==="STUDENT"?"ios-student":"ios-teacher"),!s)if(y.platformType==="TEACHER")f.subjectIds=d.value.id;else{const t=x(R.SEARCH);f.subjectIds=t.id}const p=L({search:T.query.search||"",subjectType:T.query.subjectType||"",page:1,...f}),I=b([]),l=b(null),g=b(!1),P=b(!1),w=b(!1),e=b(y.platformType==="STUDENT"?"/api-student":"/api-teacher"),o=t=>{p.page=1,p.search=t,l.value=null,r()},r=async()=>{var c;if(g.value)return;g.value=!0,w.value=!1;const t={...p};try{const i=await A.post(`${e.value}/tenantAlbumMusic/page`,{data:t});if(l.value){const O=(((c=l.value)==null?void 0:c.rows)||[]).concat(i.data.rows||[]);l.value.rows=O}l.value=l.value||i.data,p.page=i.data.pageNo+1,P.value=i.data.pageNo>=i.data.totalPage}catch{w.value=!0}g.value=!1},v=async t=>{try{await A.post("/api-teacher/teacher/defaultSubject",{params:{subjectId:t}})}catch{}},h=t=>{p.page=1,p.subjectIds=t.id,l.value=null,y.platformType==="TEACHER"?(d.value={name:t.name,id:t.id},v(t.id)):(j.id=t.id,j.name=t.name,x(R.SEARCH,JSON.stringify({id:t.id,name:t.name}),"set")),r(),j.show=!1},k=x(R.SEARCH),j=L({show:!1,name:k.id?k.name:"\u5168\u90E8\u58F0\u90E8",id:k.id||""}),z=async()=>{const{data:t}=await A.get(`${e.value}/subject/subjectSelect?type=MUSIC`);if(Array.isArray(t)){const c=[];t.forEach(i=>{i.subjects&&i.subjects.length&&i.subjects.forEach(O=>{c.push(O)})}),I.value=c||[]}},J=async()=>{const{data:t}=await A.post(`${e.value}/tenantAlbumMusic/selectCondition?subjectType=${p.subjectType}`);console.log(t)};return be(async()=>{z(),J()}),C({onSearch:o,onComfirmSubject:h}),()=>a(_e,null,[!s&&a("div",{class:S.sticky},[a(Ee,null,{default:()=>[a(Pe,{background:"transparent",isFixed:!1,border:!1,color:"#131415"},null),a(je,{onSearch:o,type:"tenant",background:"transparent",inputBackground:"transparent"},{left:()=>a($e,null,{default:()=>[a(De,{title:"\u7B5B\u9009"},{default:()=>[a("div",{class:S.searchResult,style:{maxHeight:"45vh",overflowY:"auto"}},[a("div",{class:S.searchTitle},[ge("\u58F0\u90E8")]),a("div",{class:[S["radio-group"],S.radio,S["organ-radio"]]},[I.value.map(t=>{const c=t.id===Number(p.subjectIds||null);return a(Ce,{size:"large",plain:c,type:c?"primary":"default",round:!0,onClick:()=>{console.log(t,"1212")}},{default:()=>[t.name]})})])])]})]})})]}),a("img",{class:S.bgImg,src:ze},null)]),a("div",{class:S.alumnList},[a(we,{loading:g.value,finished:P.value,"finished-text":(l.value&&l.value.rows.length,""),onLoad:r,error:w.value},{default:()=>[l.value&&l.value.rows.length?a(Ie,{showTitleImg:!0,list:l.value.rows,onDetail:t=>{if(u===M){const c=location.origin+location.pathname+"#/music-detail?id="+t.id;he(c,()=>{E.push({path:"/music-detail",query:{id:t.id}})})}else u==null||u(t)}},null):!g.value&&a(ye,{tips:"\u6682\u65E0\u58F0\u90E8\u8BAD\u7EC3",classImgSize:"SMALL",btnStatus:!1},null)]})])])}});export{gt as default};
|