var I=Object.defineProperty,N=Object.defineProperties;var P=Object.getOwnPropertyDescriptors;var y=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var x=(o,a,e)=>a in o?I(o,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[a]=e,d=(o,a)=>{for(var e in a||(a={}))q.call(a,e)&&x(o,e,a[e]);if(y)for(var e of y(a))B.call(a,e)&&x(o,e,a[e]);return o},b=(o,a)=>N(o,P(a));import{d as T,_ as V,h as A,V as n,a as l,F as M,w as R,S as O,P as z}from"./vendor.a0144ce9.js";/* empty css               *//* empty css               */import{C as D}from"./index.ccfa57ee.js";import{s as S,C as E,r as K}from"./index.3d95a92c.js";import{I as U}from"./item.e115375c.js";import{S as _}from"./select-tag.a1caf9cf.js";import{s as G}from"./index.module.64874bae.js";import{g as H,m as J}from"./music.21b5a533.js";/* empty css               *//* empty css               *//* empty css               *//* empty css                */import"./index.926ca9c5.js";import"./init-user-icon.d5c3c464.js";import"./favorite.9bdf4305.js";import"./index.28b40a59.js";/* empty css                *//* empty css                */import"./orderStatus.243cb96a.js";import"./index.339fc024.js";const w=()=>{};var ve=T({name:"MusicList",props:{hideSearch:{type:Boolean,default:!1},defauleParams:{type:Object,default:()=>({})},onItemClick:{type:Function,default:w},teacherId:{type:String||Number,default:""}},setup({hideSearch:o,defauleParams:a,onItemClick:e,teacherId:L},{expose:C}){localStorage.setItem("behaviorId",H());const m=V(),p={};S.version&&(p.version=S.version||"",p.platform="ios-student");const r=A(d(d({search:m.query.search||"",musicTagIds:m.query.tagids||"",page:1},p),a)),t=n(null),u=n(!1),g=n(!1),f=n(!1),c=n(!1),h=s=>{r.page=1,r.search=s,t.value=null,v()},v=async()=>{var s;if(!u.value){u.value=!0,f.value=!1;try{const i=await K.post("/api-student/music/sheet/list",{data:b(d({},r),{idAndName:r.search,createBy:L})});if(t.value){let F=(((s=t.value)==null?void 0:s.rows)||[]).concat(i.data.rows||[]);t.value.rows=F}t.value=t.value||i.data,r.page=i.data.pageNo+1,g.value=i.data.pageNo>=i.data.totalPage}catch{f.value=!0}u.value=!1}},j=s=>{const i=Object.values(s).flat().filter(Boolean).join(",");r.musicTagIds=i,r.page=1,t.value=null,v(),c.value=!1};return C({onSearch:h,onComfirm:j}),()=>l(M,null,[l(R,{loading:u.value,finished:g.value,"finished-text":t.value&&t.value.rows.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:v,error:f.value},{default:()=>[!o&&l(O,{class:G.sticky},{default:()=>[l(D,{showAction:!0,onSearch:h,onFilter:()=>c.value=!0,filterDot:!!r.musicTagIds},null)]}),t.value&&t.value.rows.length?t.value.rows.map(s=>l(U,{data:s,onClick:()=>{e===w?J(s):e==null||e(s)}},null)):!u.value&&l(E,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)]}),l(z,{show:c.value,round:!0,closeable:!0,position:"bottom",style:{height:"60%"},teleport:"body","onUpdate:show":s=>c.value=s},{default:()=>[l(_,{onConfirm:j,onCancel:()=>{},defaultValue:m.query.tagids},null)]})])}});export{ve as default};
