1 |
- import{d as S,P as y,Q as I,U as s,S as A,V as j,bi as C,j as l,be as E,C as N,y as R}from"./ResizeObserver.es.39b48a47.js";import{m as f,s as h}from"./header.08c93344.js";import{g as q}from"./music.0a307f27.js";import{a as L,S as k}from"./hooks.6df65925.js";import{L as V}from"./index.6c529ad4.js";import{S as x}from"./index.62db47bb.js";import"./index.34ac729a.js";import"./index.608320e9.js";import"./index.0e35d2fb.js";import"./index.5d4d28cc.js";import"./use-id.b004ff17.js";import"./use-tab-status.bcc0c503.js";import"./use-refs.07204da6.js";import"./index.720260d3.js";import"./index.db115763.js";import"./index.b6ce06cf.js";import"./index.e10a1ae2.js";import"./index.428ab1a8.js";import"./index.dc19bc54.js";import"./index.926ca9c5.js";import"./select-subject.9a862edf.js";import"./index.e90d2179.js";import"./index.970ad07b.js";import"./icon-xin2.4ab2a52d.js";import"./index.fcbcb027.js";var re=S({name:"MusicSearch",emits:["confirm"],setup(){localStorage.setItem("behaviorId",q());const c=y(),g=I(),o=s(c.query.keyword||""),b=s(),w=L(k.SEARCH);b.value=w.id;const p=a=>{o.value=a,e.value&&(e.value.rows=[]),r.name=a,r.page=1,m()},r=A({name:c.query.search||"",rows:20,page:1}),e=s(null),u=s(!1),d=s(!1),n=s(!1),m=async()=>{var a;if(!u.value){u.value=!0,n.value=!1;try{const t=await R.post("/api-student/music/sheet/searchTenant",{data:r});if(e.value){const i=(((a=e.value)==null?void 0:a.rows)||[]).concat(t.data.music.rows||[]);e.value.rows=i}e.value=e.value||t.data.music;const v=e.value.rows||[];v.forEach(i=>{o.value&&(i.musicSheetName=i.musicSheetName.replace(o.value,`<span style="color: #FE2451">${o.value}</span>`))}),e.value.rows=v,r.page=t.data.music.pageNo+1,d.value=t.data.music.pageNo>=t.data.music.totalPage}catch{n.value=!0}u.value=!1}};return j(()=>{f.on("search",p),m()}),C(()=>{f.off("search",p)}),()=>l("div",{class:[h.search,h.searchAlbum]},[e.value&&e.value.rows.length?l(V,{finished:d.value,"finished-text":(e.value&&e.value.rows.length,""),onLoad:m,error:n.value,immediateCheck:!1},{default:()=>[l(x,{showTitleImg:!0,list:e.value.rows,onDetail:a=>{const t=location.origin+location.pathname+"#/music-detail?id="+a.id+"&tenantAlbumId="+a.tenantAlbumId+"&type=search";E(t,()=>{g.push({path:"/music-detail",query:{id:a.id,tenantAlbumId:a.tenantAlbumId,type:"search"}})})}},null)]}):!u.value&&l(N,{tips:"\u6682\u65E0\u66F2\u76EE",btnStatus:!1},null)])}});export{re as default};
|