detail-01cd0aef-1743496079034.js 14 KB

1
  1. import{C as k}from"./index-4b28fbc5-1743496079034.js";import{d as P,e as v,a5 as x,J as M,q as L,f as a,N as F,g as w,x as b,aL as G,a8 as W,b4 as D,r as A,ai as O,a as U,c as V,ap as $,t as q,v as E,a9 as Y,k as B,ak as z,z as J,aS as Q,b9 as K}from"./index-32ff339b-1743496079034.js";import{u as X}from"./catchData-e5072c59-1743496079034.js";import{a as H}from"./contants-84ba384e-1743496079034.js";import{a as Z,f as ee}from"./index-a6ca04c4-1743496079034.js";import{T as te}from"./index-f30ec7e4-1743496079034.js";import{T as ae}from"./index-f645f05d-1743496079034.js";import{c as ne}from"./api-8ad48a73-1743496079034.js";import{v as se}from"./urlUtils-b5855a3c-1743496079034.js";import{P as ie}from"./index-253b7afc-1743496079034.js";import{N as le}from"./Scrollbar-116ac88a-1743496079034.js";import"./deep-clone-c0d00fc2-1743496079034.js";import"./index-f6cdd761-1743496079034.js";import"./Slider-6d04791b-1743496079034.js";import"./index-c8b1d5a7-1743496079034.js";import"./index-1b97ce1c-1743496079034.js";import"./icon_default-d1bcaf5f-1743496079034.js";import"./useSpeak-f0fad1e8-1743496079034.js";import"./api-a4f14706-1743496079034.js";import"./icon-pan-16e35a82-1743496079034.js";import"./utils-ca810235-1743496079034.js";import"./index-b35a1314-1743496079034.js";import"./ding-8e9054d5-1743496079034.js";import"./searchArray-fcbe278d-1743496079034.js";import"./index-e2ab6121-1743496079034.js";import"./index-7bfe5f9f-1743496079034.js";import"./api-d57212df-1743496079034.js";import"./Cascader-3026ed48-1743496079034.js";import"./index-a098cb7e-1743496079034.js";import"./api-70305ea7-1743496079034.js";import"./api-eb509253-1743496079034.js";import"./teacherIcon-b8e3946d-1743496079034.js";import"./index-c5d2dc80-1743496079034.js";import"./index-5f88418a-1743496079034.js";import"./index-c7c26d59-1743496079034.js";const ce="_xiaokuDetail_bnwy5_1",oe="_detailContainer_bnwy5_20",re="_inputSearch_bnwy5_58",ue="_searchSection_bnwy5_70",me="_searchSectionHide_bnwy5_76",de="_searchGroup_bnwy5_82",pe="_searchGroupOnly_bnwy5_88",he="_hideItem_bnwy5_91",ye="_btnType_bnwy5_97",ge="_moreSearch_bnwy5_139",Se="_activeSearch_bnwy5_161",Ie="_teachingModal_bnwy5_164",fe="_spaceSection_bnwy5_167",_e="_collapseWrap_bnwy5_177",we="_collaoseGroup_bnwy5_183",be="_collaoseBtn_bnwy5_189",ve="_isStart_bnwy5_194",Ne="_isHidden_bnwy5_197",Te="_hideButton_bnwy5_201",Ee="_popSelect_bnwy5_206",Ce="_spaceSection2_bnwy5_216",xe="_textBtn_bnwy5_221",Me="_iconArrow_bnwy5_234",Ae="_textBtnActive_bnwy5_247",Pe="_sectionContainer_bnwy5_255",Oe="_noSearchContainer_bnwy5_262",Be="_wrapList_bnwy5_265",He="_wrapListEmpty_bnwy5_269",Le="_empty_bnwy5_274",Re="_loadingSection_bnwy5_278",je="_loadingSectionEmpty_bnwy5_281",ke="_loadingWrap_bnwy5_290",Fe="_showLoading_bnwy5_296",Ge="_sectionItem_bnwy5_302",We="_img_bnwy5_319",De="_infos_bnwy5_331",Ue="_topName_bnwy5_335",Ve="_types_bnwy5_349",$e="_hot_bnwy5_356",qe="_sing_bnwy5_380",Ye="_song_bnwy5_381",ze="_author_bnwy5_399",n={xiaokuDetail:ce,detailContainer:oe,inputSearch:re,searchSection:ue,searchSectionHide:me,searchGroup:de,searchGroupOnly:pe,hideItem:he,btnType:ye,moreSearch:ge,activeSearch:Se,teachingModal:Ie,spaceSection:fe,collapseWrap:_e,collaoseGroup:we,collaoseBtn:be,isStart:ve,isHidden:Ne,hideButton:Te,popSelect:Ee,spaceSection2:Ce,textBtn:xe,iconArrow:Me,textBtnActive:Ae,sectionContainer:Pe,noSearchContainer:Oe,wrapList:Be,wrapListEmpty:He,empty:Le,loadingSection:Re,loadingSectionEmpty:je,loadingWrap:ke,showLoading:Fe,sectionItem:Ge,img:We,infos:De,topName:Ue,types:Ve,hot:$e,sing:qe,song:Ye,author:ze};function C(u){return typeof u=="function"||Object.prototype.toString.call(u)==="[object Object]"&&!W(u)}const R=P({name:"ChildNodeSearch",props:{activeRow:{type:Object,default:()=>({})},list:{type:Array,default:()=>[]},isHide:{type:Boolean,default:!1}},emits:["selectChildTag"],setup(u,{emit:f}){const{activeRow:h}=D(u),l=A({});return x(()=>u.activeRow,()=>{h.value=u.activeRow,l.value={}}),()=>{var e;return a(O,null,[((e=h.value)==null?void 0:e.id)&&a(O,null,[a(w,{label:h.value.columnName+":",class:u.isHide&&n.hideItem},{default:()=>[a(b,{class:n.spaceSection},{default:()=>{var r;return[(r=h.value)==null?void 0:r.children.map(d=>a("span",{class:[n.textBtn,(h.value.activeIndex||"")==d.id&&n.textBtnActive],onClick:()=>{h.value.activeIndex=d.id;let y,I="";d.children?(y=[{columnName:d.children[0].columnName,name:"全部",id:""},...d.children],I=d.children[0].columnName,l.value={...d,columnName:I,activeIndex:"",children:y}):l.value={},f("selectChildTag",h.value.activeIndex)}},[d.name]))]}})]}),a(R,{isHide:u.isHide,activeRow:l.value,onSelectChildTag:r=>{f("selectChildTag",r||h.value.activeIndex)}},null)])])}}}),Je=P({name:"search-group",props:{type:{type:String,default:""},musicalInstrumentId:{type:String,default:""}},emits:["search","add"],expose:["init"],setup(u,{emit:f}){const h=X(),l=v({musicTagIds:"",audioPlayTypes:"",bookVersionId:null,subjectId:null}),e=v({showMore:!1,tempSubjectId:null}),r=v({audioPlayTypeList:[],selectParents:{},newTags:[],tags:[],tagActiveId:"",tagActive:{},childSelectId:null});x(()=>u.musicalInstrumentId,()=>{u.musicalInstrumentId?c():p()}),x(()=>u.type,()=>{u.musicalInstrumentId||(p(),y())});const d=M(()=>!!u.type),y=()=>{f("search",{...l,subjectId:l.audioPlayTypes!=="SING"?l.subjectId:null,audioPlayTypes:l.audioPlayTypes?l.audioPlayTypes==="PLAY_SING"?["PLAY","SING"]:[l.audioPlayTypes]:[],bookVersionId:r.childSelectId||r.tagActiveId})},I=()=>{e.showMore=!e.showMore},_=s=>{const i={};return s==null||s.forEach(o=>{o.id===l.subjectId&&(i.selected=!0,i.name=o.name)}),i},N=()=>{const s=h.getMusicTagTree;s.forEach(i=>{if(i.children&&i.children.length>0){const o=i.children;o==null||o.forEach(S=>{S.children=null})}}),r.tags=[{columnName:s[0].columnName,name:"全部",id:""},...s],r.tagActiveId=r.tags[0].id},t=s=>{r.tagActiveId=s.id,r.childSelectId=null;let i,o="";s.children?(i=[{columnName:s.children[0].columnName,name:"全部",id:""},...s.children],o=s.children[0].columnName,r.selectParents={...s,columnName:o,activeIndex:"",children:i}):r.selectParents={},y()},p=()=>{var i,o;const s=h.getSubjectInstrumentOnly;if(s.length>0){const S=s[0];S.instruments&&S.instruments.length>1?(e.tempSubjectId=(i=S.instruments[0])==null?void 0:i.value,l.subjectId=(o=S.instruments[0])==null?void 0:o.value):l.subjectId=S.value}},c=()=>{let s=[];h.getSubjectInstrumentOnly.forEach(i=>{u.musicalInstrumentId===i.value?(s=i.instruments||[],l.subjectId=u.musicalInstrumentId,e.tempSubjectId=u.musicalInstrumentId):Array.isArray(i.instruments)&&i.instruments.forEach(o=>{u.musicalInstrumentId===o.value&&(s=i.instruments||[],l.subjectId=u.musicalInstrumentId,e.tempSubjectId=u.musicalInstrumentId)})}),s.length>0&&_(s)},g=async()=>{try{const i=(await Z()).data||[];r.newTags=[{name:"全部",id:""},...i.map(o=>({name:o.name,id:o.id}))]}catch(s){}};return L(async()=>{const s=Object.keys(H).map(i=>({value:i,name:H[i]}));r.audioPlayTypeList=[{name:"全部",value:""},...s],await g(),await h.getMusicTagTreeApi(),N(),await h.getSubjects(),u.musicalInstrumentId?c():p(),y()}),()=>{let s,i,o,S;return a("div",{class:[n.searchGroup,d.value&&n.searchGroupOnly]},[a(F,{labelAlign:"left",labelPlacement:"left"},{default:()=>{var T;return[r.newTags.length>1&&a(w,{label:"标签:",class:d.value&&n.hideItem},{default:()=>[a(b,{class:n.spaceSection},C(s=r.newTags.map(m=>a("span",{class:[n.textBtn,l.musicTagIds===m.id&&n.textBtnActive],onClick:()=>{l.musicTagIds=m.id,y()}},[m.name])))?s:{default:()=>[s]})]}),a("div",{class:!e.showMore&&n.hideItem},[r.tags.length>0&&a(w,{label:((T=r.tags[0])==null?void 0:T.columnName)+":",class:d.value&&n.hideItem},{default:()=>[a(b,{class:n.spaceSection},C(i=r.tags.map(m=>a("span",{class:[n.textBtn,r.tagActiveId===m.id&&n.textBtnActive],onClick:()=>{t(m)}},[m.name])))?i:{default:()=>[i]})]}),a(R,{isHide:d.value,activeRow:r.selectParents,onSelectChildTag:m=>{r.childSelectId=m,y()}},null)]),a(w,{label:"场景:",class:[!e.showMore&&n.hideItem,d.value&&n.hideItem]},{default:()=>[a(b,{class:n.spaceSection},C(o=r.audioPlayTypeList.map(m=>a("span",{class:[n.textBtn,l.audioPlayTypes===m.value&&n.textBtnActive],onClick:()=>{l.audioPlayTypes=m.value,y()}},[m.name])))?o:{default:()=>[o]})]}),(l.audioPlayTypes!=="SING"||d.value)&&a(w,{label:"乐器:",class:!e.showMore&&!d.value&&n.hideItem},{default:()=>[a(b,{class:n.spaceSection},C(S=h.getSubjectInstrumentOnly.map(m=>m.instruments&&m.instruments.length>1?a(G,{options:m.instruments,trigger:"hover",scrollable:!0,value:e.tempSubjectId,"onUpdate:value":[j=>e.tempSubjectId=j,()=>{l.subjectId=e.tempSubjectId,y()}],key:m.value,class:[n.popSelect]},{default:()=>[a("span",{class:[n.textBtn,_(m.instruments).selected&&n.textBtnActive]},[_(m.instruments).name||m.name,a("i",{class:n.iconArrow},null)])]}):a("span",{class:[n.textBtn,l.subjectId===m.value&&n.textBtnActive],onClick:()=>{l.subjectId=m.value,e.tempSubjectId=null,y()}},[m.name])))?S:{default:()=>[S]})]})]}}),!d.value&&a("div",{class:[n.moreSearch,e.showMore?n.activeSearch:""],onClick:I},[e.showMore?"收起":"展开"])])}}}),Pt=P({name:"xiaoku-detail",setup(){const u=U(),f=V(),h=A([{name:"AI学练",path:"/xiaoku-list"},{name:"曲目列表",path:""}]),l=v({page:1,rows:32,status:!0,searchType:""}),e=v({countPage:1,loading:!0,finshed:!1,reshing:!1,tabName:"",list:[],allSearch:{name:"",musicTagIds:"",audioPlayTypes:null,bookVersionId:null,musicalInstrumentId:null,subjectId:null},hotSearch:{name:"",musicalInstrumentId:null},newSearch:{name:"",musicalInstrumentId:null},recommendSearch:{name:"",musicalInstrumentId:null},previewModal:!1,previewParams:{type:"",src:""}}),r=M(()=>e.tabName==="RECOMMEND"?e.recommendSearch.name:e.tabName==="HOT"?e.hotSearch.name:e.tabName==="NEW"?e.newSearch.name:e.allSearch.name),d=M(()=>{let t=e.allSearch.musicalInstrumentId;return e.tabName==="RECOMMEND"?t=e.recommendSearch.musicalInstrumentId:e.tabName==="HOT"?t=e.hotSearch.musicalInstrumentId:e.tabName==="NEW"&&(t=e.newSearch.musicalInstrumentId),t}),y=async t=>{l.page=1,e.reshing=!0,e.finshed=!1,e.list=[];const{subjectId:p,...c}=t;e.tabName==="HOT"?e.hotSearch=Object.assign(e.hotSearch,{musicalInstrumentId:p}):e.tabName=="NEW"?e.newSearch=Object.assign(e.newSearch,{musicalInstrumentId:p}):e.tabName==="RECOMMEND"?e.recommendSearch=Object.assign(e.recommendSearch,{musicalInstrumentId:p}):e.allSearch=Object.assign(e.allSearch,{...c,musicalInstrumentId:p,subjectId:null}),I(),z(()=>{})};A();const I=async()=>{var g,s;l.page==1&&(e.loading=!0);let t={};const{...p}=l;let c={...p,searchType:e.tabName};if(e.tabName==="RECOMMEND")c=Object.assign(c,e.recommendSearch),c.rows=60,c.page=1;else if(e.tabName==="HOT")c=Object.assign(c,e.hotSearch),c.rows=60,c.page=1;else if(e.tabName==="NEW")c=Object.assign(c,e.newSearch),c.rows=60,c.page=1;else{c.name=e.allSearch.name;const{...i}=e.allSearch;c=Object.assign(c,{...i})}try{t=await ne(c)}catch(i){console.log(i)}e.reshing&&(e.list=[],e.reshing=!1),(t==null?void 0:t.code)===200&&Array.isArray((g=t==null?void 0:t.data)==null?void 0:g.rows)?((((s=t==null?void 0:t.data)==null?void 0:s.rows)||[]).forEach(o=>{if(o.audioPlayTypeArray=o.audioPlayTypes?o.audioPlayTypes.split(","):[],o.musicSheetName){const S=new RegExp(c.name,"gi"),T=o.musicSheetName.replace(S,"<span>$&</span>");o.musicNameReg=T}}),e.list=[...e.list,...t.data.rows],e.finshed=l.page>=t.data.pages,e.countPage=t.data.pages):e.finshed=!0,e.loading=!1},_=t=>{const p=t.scoreType==="FIRST"?"firstTone":t.scoreType==="JIAN"?"fixedTone":t.scoreType==="STAVE"?"staff":"firstTone";let c="".concat(se(),"/instrument?v=").concat(+new Date,"&platform=pc&id=").concat(t.id,"&Authorization=").concat(f.getToken,"&musicRenderType=").concat(p,"&showGuide=true"),g="";e.tabName==="RECOMMEND"?g=e.recommendSearch.musicalInstrumentId:e.tabName==="HOT"?g=e.hotSearch.musicalInstrumentId:e.tabName==="NEW"?g=e.newSearch.musicalInstrumentId:g=e.allSearch.musicalInstrumentId,g&&(c+="&instrumentId="+g),window.matchMedia("(display-mode: standalone)").matches?(J.application=window.matchMedia("(display-mode: standalone)").matches,e.previewModal=!0,Q(),e.previewParams={type:"music",src:c}):window.open(c,+new Date+"")},N=t=>{var p;((p=t.data)==null?void 0:p.api)==="back"&&(K(),e.previewModal=!e.previewModal)};return L(async()=>{u.query.type&&(e.tabName=u.query.type),window.addEventListener("message",N)}),$(()=>{window.removeEventListener("message",N)}),()=>a("div",{class:n.xiaokuDetail},[a(k,{list:h.value},null),a("div",{class:n.detailContainer},[a(q,{paneClass:n.paneTitle,justifyContent:"start",paneWrapperClass:n.paneWrapperContainer,value:e.tabName,"onUpdate:value":[t=>e.tabName=t,t=>{l.page=1,e.finshed=!1,e.reshing=!0,e.list=[],d.value&&I()}]},{default:()=>[a(E,{name:"",tab:"全部曲目"},null),a(E,{name:"RECOMMEND",tab:"推荐曲目"},null),a(E,{name:"HOT",tab:"热门曲目"},null),a(E,{name:"NEW",tab:"最新曲目"},null)],suffix:()=>a(te,{placeholder:"请输入曲目名称",round:!0,value:r.value,"onUpdate:value":t=>{e.tabName==="RECOMMEND"?e.recommendSearch.name=t:e.tabName==="HOT"?e.hotSearch.name=t:e.tabName==="NEW"?e.newSearch.name=t:e.allSearch.name=t},class:n.inputSearch,onSearch:t=>{e.tabName==="RECOMMEND"?e.recommendSearch.name=t:e.tabName==="HOT"?e.hotSearch.name=t:e.tabName==="NEW"?e.newSearch.name=t:e.allSearch.name=t,l.page=1,e.finshed=!1,e.list=[],I()}},null)}),a(le,{class:[[n.wrapList,!e.loading&&e.list.length===0&&n.wrapListEmpty]],onScroll:async t=>{var s,i,o;if(e.tabName)return;const p=(s=t.target)==null?void 0:s.clientHeight,c=(i=t.target)==null?void 0:i.scrollTop,g=(o=t.target)==null?void 0:o.scrollHeight;if(p+c+20>=g&&!e.finshed&&!e.loading){if(l.page>=e.countPage)return;l.page=l.page+1,await I()}}},{default:()=>[a(Y,{show:e.loading},{default:()=>[a("div",{class:[n.loadingSection,!e.loading&&e.list.length===0&&n.loadingSectionEmpty]},[a("div",{class:[n.searchSection]},[a(Je,{type:e.tabName,musicalInstrumentId:d.value,onSearch:t=>{y(t)}},null)]),e.list.length>0&&a("div",{class:[n.sectionContainer]},[e.list.map(t=>{var p,c;return a("div",{class:n.sectionItem,onClick:()=>_(t)},[a("div",{class:n.img},[a("img",{referrerpolicy:"no-referrer",src:t.titleImg},null)]),a("div",{class:n.infos},[a("div",{class:n.topName,innerHTML:t.musicNameReg},null),a("div",{class:n.types},[a("div",{class:n.hot},[a("span",null,[ee(t.usedNum)])]),((p=t.audioPlayTypes)==null?void 0:p.includes("SING"))&&a("div",{class:n.sing},[B("演唱")]),((c=t.audioPlayTypes)==null?void 0:c.includes("PLAY"))&&a("div",{class:n.song},[B("演奏")]),a("div",{class:n.author},[t.composer])])])])})]),!e.loading&&e.list.length===0&&a("div",{class:n.empty},[a(ae,null,null)])])]})]})]),a(ie,{show:e.previewModal,"onUpdate:show":t=>e.previewModal=t,type:"music",params:e.previewParams},null)])}});export{Pt as default};