var O=Object.defineProperty,U=Object.defineProperties;var V=Object.getOwnPropertyDescriptors;var E=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;var P=(i,t,s)=>t in i?O(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s,g=(i,t)=>{for(var s in t||(t={}))z.call(t,s)&&P(i,s,t[s]);if(E)for(var s of E(t))J.call(t,s)&&P(i,s,t[s]);return i},R=(i,t)=>U(i,V(t));import{d as K,u as _,h as F,l as c,a as o,F as $,S as k,K as G,M as Q,P as L}from"./vendor.3506a68e.js";/* empty css               *//* empty css               */import{C as W}from"./index.2d1e9e4b.js";import{s as f,C as X,r as Y}from"./index.9e4b607f.js";import{S as Z}from"./select-tag.7d9fa315.js";import{s as w}from"./index.module.1588db22.js";import{g as ee,m as se}from"./music.a79cce2e.js";import{S as te}from"./select-subject.b88285dd.js";import{u as p,S as j}from"./hooks.6a14d51f.js";import{S as ae}from"./index.187da406.js";/* empty css              *//* empty css               */import"./index.8eb24852.js";/* empty css                *//* empty css                *//* empty css                */import"./index.926ca9c5.js";import"./orderStatus.81f9c36b.js";import"./index.339fc024.js";/* empty css               *//* empty css               */import"./index.be471456.js";/* empty css              */import"./code-down-load.328a30fb.js";import"./logo.bcac726b.js";import"./browser.ebb85846.js";import"./icon_teacher.cb128c00.js";import"./music-icon.c20abf48.js";const q=()=>{};var Be=K({name:"MusicList",props:{hideSearch:{type:Boolean,default:!1},defauleParams:{type:Object,default:()=>({})},onItemClick:{type:Function,default:q},teacherId:{type:String||Number,default:""},myself:{type:Boolean,default:!1}},setup({hideSearch:i,defauleParams:t,onItemClick:s,teacherId:B,myself:H},{expose:M}){if(!p(j.SEARCH).id){const e=f.user.data,n=e.subjectId?Number(e.subjectId.split(",")[0]):"",r=e.subjectName?e.subjectName.split(",")[0]:"";n&&p(j.SEARCH,JSON.stringify({id:n,name:r}),"set")}localStorage.setItem("behaviorId",ee());const h=_(),b={};if(f.version&&(b.version=f.version||"",b.platform=f.platformType==="STUDENT"?"ios-student":"ios-teacher"),!i){const e=p(j.SEARCH);b.subjectIds=e.id}const l=F(g(g({search:h.query.search||"",musicTagIds:h.query.tagids||"",page:1},t),b)),a=c(null),m=c(!1),C=c(!1),y=c(!1),v=c(!1),N=c(!1),D=c(f.platformType==="STUDENT"?"/api-student":"/api-teacher"),I=e=>{l.page=1,l.search=e,a.value=null,S()},S=async()=>{var n;if(m.value)return;m.value=!0,y.value=!1;const e=R(g({},l),{auditStatus:"PASS",idAndName:l.search,createBy:B});N.value&&(e.exquisiteFlag=1),H?e.myself=!0:e.myself=!1;try{const r=await Y.post(`${D.value}/music/sheet/list`,{data:e});if(a.value){const d=(((n=a.value)==null?void 0:n.rows)||[]).concat(r.data.rows||[]);a.value.rows=d}a.value=a.value||r.data,l.page=r.data.pageNo+1,C.value=r.data.pageNo>=r.data.totalPage}catch{y.value=!0}m.value=!1},T=e=>{const n={};for(const d in e)Number(d)===-1?N.value=!!e[d][0]:n[d]=e[d];const r=Object.values(n).flat().filter(Boolean).join(",");l.musicTagIds=r,l.page=1,a.value=null,S(),v.value=!1},A=e=>{l.page=1,l.subjectIds=e.id,u.id=e.id,u.name=e.name,a.value=null,p(j.SEARCH,JSON.stringify({id:e.id,name:e.name}),"set"),S(),u.show=!1},x=p(j.SEARCH),u=F({show:!1,name:x.id?x.name:"\u5168\u90E8\u58F0\u90E8",id:x.id||""});return M({onSearch:I,onComfirm:T,onComfirmSubject:A}),()=>o($,null,[!i&&o(k,{class:w.sticky},{default:()=>[o(W,{showAction:!0,onSearch:I,onFilter:()=>v.value=!0,filterDot:!!l.musicTagIds},{left:()=>o("div",{class:w.label,onClick:()=>u.show=!0},[u.name,o(G,{classPrefix:"iconfont",name:"down",size:12,color:"#333"},null)])})]}),o(Q,{loading:m.value,finished:C.value,"finished-text":a.value&&a.value.rows.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:S,error:y.value},{default:()=>[a.value&&a.value.rows.length?o("div",{class:w.alumnList},[o(ae,{list:a.value.rows,onDetail:e=>{s===q?se(e):s==null||s(e)}},null)]):!m.value&&o(X,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)]}),o(L,{show:v.value,round:!0,closeable:!0,position:"bottom",style:{height:"60%"},teleport:"body","onUpdate:show":e=>v.value=e},{default:()=>[o(Z,{exquisiteFlag:!0,onConfirm:T,onCancel:()=>{},defaultValue:h.query.tagids},null)]}),o(L,{show:u.show,position:"bottom",round:!0,closeable:!0,"safe-area-inset-bottom":!0,onClose:()=>u.show=!1,onClosed:()=>u.show=!1},{default:()=>[o(te,{isReset:!0,type:"MUSIC",searchParams:u,onComfirm:A},null)]})])}});export{Be as default};
