detail-0259a6bd-1731319840132.js 14 KB

1
  1. import{C as k}from"./index-e298ada2-1731319840132.js";import{d as P,e as x,A as C,U as A,q as R,f as t,N as F,g as w,x as y,ay as G,D,aR as W,r as M,F as O,a as U,c as V,T as $,t as q,v as b,E as Y,k as B,S as z,z as J,aD as Q,aW as K}from"./index-6198d9d3-1731319840132.js";import{u as X}from"./catchData-21a2ae20-1731319840132.js";import{a as H}from"./contants-333a16ae-1731319840132.js";import{a as Z,f as ee}from"./index-e5387ddd-1731319840132.js";import{T as te}from"./index-a0e01182-1731319840132.js";import{T as ae}from"./index-eedcb178-1731319840132.js";import{c as se}from"./api-225a1ad7-1731319840132.js";import{v as ne}from"./urlUtils-72ef455d-1731319840132.js";import{P as le}from"./index-14e1a7d9-1731319840132.js";import{N as ie}from"./Scrollbar-924d915b-1731319840132.js";import"./index-114185ea-1731319840132.js";import"./Slider-25b157fd-1731319840132.js";import"./index-4c26192f-1731319840132.js";import"./index-d85dbeb3-1731319840132.js";import"./icon_default-d1bcaf5f-1731319840132.js";import"./useSpeak-f6847790-1731319840132.js";import"./api-70d4d585-1731319840132.js";import"./icon-pan-16e35a82-1731319840132.js";import"./api-5a9c06c7-1731319840132.js";import"./api-437da0ca-1731319840132.js";import"./ding-8e9054d5-1731319840132.js";import"./searchArray-3567ea02-1731319840132.js";import"./index-2b1ee5b2-1731319840132.js";import"./index-d75c8f1f-1731319840132.js";import"./index-b8f8a6a8-1731319840132.js";import"./api-7fc192d9-1731319840132.js";import"./api-e20c9545-1731319840132.js";import"./teacherIcon-b8e3946d-1731319840132.js";import"./index-1c1bf5e5-1731319840132.js";import"./api-de5ca66f-1731319840132.js";import"./Cascader-6acdac20-1731319840132.js";import"./index-7d1e9be5-1731319840132.js";import"./index-07cf98b5-1731319840132.js";const ce="_xiaokuDetail_1wvxm_1",oe="_detailContainer_1wvxm_20",re="_inputSearch_1wvxm_58",me="_searchSection_1wvxm_70",ue="_searchSectionHide_1wvxm_74",de="_searchGroup_1wvxm_80",pe="_searchGroupOnly_1wvxm_86",he="_hideItem_1wvxm_89",ge="_btnType_1wvxm_95",ve="_moreSearch_1wvxm_137",Se="_activeSearch_1wvxm_169",Ie="_teachingModal_1wvxm_172",_e="_spaceSection_1wvxm_175",fe="_collapseWrap_1wvxm_185",we="_collaoseGroup_1wvxm_191",ye="_collaoseBtn_1wvxm_197",xe="_isStart_1wvxm_202",Ne="_isHidden_1wvxm_205",Te="_hideButton_1wvxm_209",be="_popSelect_1wvxm_214",Ee="_spaceSection2_1wvxm_224",Ce="_textBtn_1wvxm_229",Ae="_iconArrow_1wvxm_241",Me="_textBtnActive_1wvxm_250",Pe="_sectionContainer_1wvxm_258",Oe="_noSearchContainer_1wvxm_265",Be="_wrapList_1wvxm_268",He="_wrapListEmpty_1wvxm_272",Re="_empty_1wvxm_277",je="_loadingSection_1wvxm_281",Le="_loadingSectionEmpty_1wvxm_284",ke="_loadingWrap_1wvxm_293",Fe="_showLoading_1wvxm_299",Ge="_sectionItem_1wvxm_305",De="_img_1wvxm_322",We="_infos_1wvxm_334",Ue="_topName_1wvxm_338",Ve="_types_1wvxm_352",$e="_hot_1wvxm_359",qe="_sing_1wvxm_383",Ye="_song_1wvxm_384",ze="_author_1wvxm_402",s={xiaokuDetail:ce,detailContainer:oe,inputSearch:re,searchSection:me,searchSectionHide:ue,searchGroup:de,searchGroupOnly:pe,hideItem:he,btnType:ge,moreSearch:ve,activeSearch:Se,teachingModal:Ie,spaceSection:_e,collapseWrap:fe,collaoseGroup:we,collaoseBtn:ye,isStart:xe,isHidden:Ne,hideButton:Te,popSelect:be,spaceSection2:Ee,textBtn:Ce,iconArrow:Ae,textBtnActive:Me,sectionContainer:Pe,noSearchContainer:Oe,wrapList:Be,wrapListEmpty:He,empty:Re,loadingSection:je,loadingSectionEmpty:Le,loadingWrap:ke,showLoading:Fe,sectionItem:Ge,img:De,infos:We,topName:Ue,types:Ve,hot:$e,sing:qe,song:Ye,author:ze};function E(m){return typeof m=="function"||Object.prototype.toString.call(m)==="[object Object]"&&!D(m)}const j=P({name:"ChildNodeSearch",props:{activeRow:{type:Object,default:()=>({})},list:{type:Array,default:()=>[]},isHide:{type:Boolean,default:!1}},emits:["selectChildTag"],setup(m,{emit:_}){const{activeRow:h}=W(m),i=M({});return C(()=>m.activeRow,()=>{h.value=m.activeRow,i.value={}}),()=>{var e;return t(O,null,[((e=h.value)==null?void 0:e.id)&&t(O,null,[t(w,{label:h.value.columnName+":",class:m.isHide&&s.hideItem},{default:()=>[t(y,{class:s.spaceSection},{default:()=>{var r;return[(r=h.value)==null?void 0:r.children.map(d=>t("span",{class:[s.textBtn,(h.value.activeIndex||"")==d.id&&s.textBtnActive],onClick:()=>{h.value.activeIndex=d.id;let g,I="";d.children?(g=[{columnName:d.children[0].columnName,name:"全部",id:""},...d.children],I=d.children[0].columnName,i.value={...d,columnName:I,activeIndex:"",children:g}):i.value={},_("selectChildTag",h.value.activeIndex)}},[d.name]))]}})]}),t(j,{isHide:m.isHide,activeRow:i.value,onSelectChildTag:r=>{_("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(m,{emit:_}){const h=X(),i=x({musicTagIds:"",audioPlayTypes:"",bookVersionId:null,subjectId:null}),e=x({showMore:!1,tempSubjectId:null}),r=x({audioPlayTypeList:[],selectParents:{},newTags:[],tags:[],tagActiveId:"",tagActive:{},childSelectId:null});C(()=>m.musicalInstrumentId,()=>{m.musicalInstrumentId?c():p()}),C(()=>m.type,()=>{m.musicalInstrumentId||(p(),g())});const d=A(()=>!!m.type),g=()=>{_("search",{...i,subjectId:i.audioPlayTypes!=="SING"?i.subjectId:null,audioPlayTypes:i.audioPlayTypes?i.audioPlayTypes==="PLAY_SING"?["PLAY","SING"]:[i.audioPlayTypes]:[],bookVersionId:r.childSelectId||r.tagActiveId})},I=()=>{e.showMore=!e.showMore},f=n=>{const l={};return n==null||n.forEach(o=>{o.id===i.subjectId&&(l.selected=!0,l.name=o.name)}),l},N=()=>{const n=h.getMusicTagTree;n.forEach(l=>{if(l.children&&l.children.length>0){const o=l.children;o==null||o.forEach(S=>{S.children=null})}}),r.tags=[{columnName:n[0].columnName,name:"全部",id:""},...n],r.tagActiveId=r.tags[0].id},a=n=>{r.tagActiveId=n.id,r.childSelectId=null;let l,o="";n.children?(l=[{columnName:n.children[0].columnName,name:"全部",id:""},...n.children],o=n.children[0].columnName,r.selectParents={...n,columnName:o,activeIndex:"",children:l}):r.selectParents={},g()},p=()=>{var l,o;const n=h.getSubjectInstrumentOnly;if(n.length>0){const S=n[0];S.instruments&&S.instruments.length>1?(e.tempSubjectId=(l=S.instruments[0])==null?void 0:l.value,i.subjectId=(o=S.instruments[0])==null?void 0:o.value):i.subjectId=S.value}},c=()=>{let n=[];h.getSubjectInstrumentOnly.forEach(l=>{m.musicalInstrumentId===l.value?(n=l.instruments||[],i.subjectId=m.musicalInstrumentId,e.tempSubjectId=m.musicalInstrumentId):Array.isArray(l.instruments)&&l.instruments.forEach(o=>{m.musicalInstrumentId===o.value&&(n=l.instruments||[],i.subjectId=m.musicalInstrumentId,e.tempSubjectId=m.musicalInstrumentId)})}),n.length>0&&f(n)},v=async()=>{try{const l=(await Z()).data||[];r.newTags=[{name:"全部",id:""},...l.map(o=>({name:o.name,id:o.id}))]}catch(n){}};return R(async()=>{const n=Object.keys(H).map(l=>({value:l,name:H[l]}));r.audioPlayTypeList=[{name:"全部",value:""},...n],await v(),await h.getMusicTagTreeApi(),N(),await h.getSubjects(),m.musicalInstrumentId?c():p(),g()}),()=>{let n,l,o,S;return t("div",{class:[s.searchGroup,d.value&&s.searchGroupOnly]},[t(F,{labelAlign:"left",labelPlacement:"left"},{default:()=>{var T;return[r.newTags.length>1&&t(w,{label:"标签:",class:d.value&&s.hideItem},{default:()=>[t(y,{class:s.spaceSection},E(n=r.newTags.map(u=>t("span",{class:[s.textBtn,i.musicTagIds===u.id&&s.textBtnActive],onClick:()=>{i.musicTagIds=u.id,g()}},[u.name])))?n:{default:()=>[n]})]}),r.tags.length>0&&t(w,{label:((T=r.tags[0])==null?void 0:T.columnName)+":",class:d.value&&s.hideItem},{default:()=>[t(y,{class:s.spaceSection},E(l=r.tags.map(u=>t("span",{class:[s.textBtn,r.tagActiveId===u.id&&s.textBtnActive],onClick:()=>{a(u)}},[u.name])))?l:{default:()=>[l]})]}),t(j,{isHide:d.value,activeRow:r.selectParents,onSelectChildTag:u=>{r.childSelectId=u,g()}},null),t(w,{label:"场景:",class:[!e.showMore&&s.hideItem,d.value&&s.hideItem]},{default:()=>[t(y,{class:s.spaceSection},E(o=r.audioPlayTypeList.map(u=>t("span",{class:[s.textBtn,i.audioPlayTypes===u.value&&s.textBtnActive],onClick:()=>{i.audioPlayTypes=u.value,g()}},[u.name])))?o:{default:()=>[o]})]}),(i.audioPlayTypes!=="SING"||d.value)&&t(w,{label:"乐器:",class:!e.showMore&&!d.value&&s.hideItem},{default:()=>[t(y,{class:s.spaceSection},E(S=h.getSubjectInstrumentOnly.map(u=>u.instruments&&u.instruments.length>1?t(G,{options:u.instruments,trigger:"hover",scrollable:!0,value:e.tempSubjectId,"onUpdate:value":[L=>e.tempSubjectId=L,()=>{i.subjectId=e.tempSubjectId,g()}],key:u.value,class:[s.popSelect]},{default:()=>[t("span",{class:[s.textBtn,f(u.instruments).selected&&s.textBtnActive]},[f(u.instruments).name||u.name,t("i",{class:s.iconArrow},null)])]}):t("span",{class:[s.textBtn,i.subjectId===u.value&&s.textBtnActive],onClick:()=>{i.subjectId=u.value,e.tempSubjectId=null,g()}},[u.name])))?S:{default:()=>[S]})]})]}}),!d.value&&t("div",{class:[s.moreSearch,e.showMore?s.activeSearch:""],onClick:I},[e.showMore?"收起选项":"展开更多"])])}}}),Mt=P({name:"xiaoku-detail",setup(){const m=U(),_=V(),h=M([{name:"AI学练",path:"/xiaoku-list"},{name:"曲目列表",path:""}]),i=x({page:1,rows:32,status:!0,searchType:""}),e=x({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=A(()=>e.tabName==="RECOMMEND"?e.recommendSearch.name:e.tabName==="HOT"?e.hotSearch.name:e.tabName==="NEW"?e.newSearch.name:e.allSearch.name),d=A(()=>{let a=e.allSearch.musicalInstrumentId;return e.tabName==="RECOMMEND"?a=e.recommendSearch.musicalInstrumentId:e.tabName==="HOT"?a=e.hotSearch.musicalInstrumentId:e.tabName==="NEW"&&(a=e.newSearch.musicalInstrumentId),a}),g=async a=>{i.page=1,e.reshing=!0,e.finshed=!1;const{subjectId:p,...c}=a;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(()=>{})};M();const I=async()=>{var v,n;i.page==1&&(e.loading=!0);let a={};const{...p}=i;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{...l}=e.allSearch;c=Object.assign(c,{...l})}try{a=await se(c)}catch(l){console.log(l)}e.reshing&&(e.list=[],e.reshing=!1),(a==null?void 0:a.code)===200&&Array.isArray((v=a==null?void 0:a.data)==null?void 0:v.rows)?((((n=a==null?void 0:a.data)==null?void 0:n.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,...a.data.rows],e.finshed=i.page>=a.data.pages,e.countPage=a.data.pages):e.finshed=!0,e.loading=!1},f=a=>{const p=a.scoreType==="FIRST"?"firstTone":a.scoreType==="JIAN"?"fixedTone":a.scoreType==="STAVE"?"staff":"firstTone";let c="".concat(ne(),"/instrument?v=").concat(+new Date,"&platform=pc&id=").concat(a.id,"&Authorization=").concat(_.getToken,"&musicRenderType=").concat(p,"&showGuide=true&part-index=0"),v="";e.tabName==="RECOMMEND"?v=e.recommendSearch.musicalInstrumentId:e.tabName==="HOT"?v=e.hotSearch.musicalInstrumentId:e.tabName==="NEW"?v=e.newSearch.musicalInstrumentId:v=e.allSearch.musicalInstrumentId,v&&(c+="&instrumentId="+v),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=a=>{var p;((p=a.data)==null?void 0:p.api)==="back"&&(K(),e.previewModal=!e.previewModal)};return R(async()=>{m.query.type&&(e.tabName=m.query.type),window.addEventListener("message",N)}),$(()=>{window.removeEventListener("message",N)}),()=>t("div",{class:s.xiaokuDetail},[t(k,{list:h.value},null),t("div",{class:s.detailContainer},[t(q,{paneClass:s.paneTitle,justifyContent:"start",paneWrapperClass:s.paneWrapperContainer,value:e.tabName,"onUpdate:value":[a=>e.tabName=a,a=>{i.page=1,e.finshed=!1,e.reshing=!0,e.list=[],d.value&&I()}]},{default:()=>[t(b,{name:"",tab:"全部曲目"},null),t(b,{name:"RECOMMEND",tab:"推荐曲目"},null),t(b,{name:"HOT",tab:"热门曲目"},null),t(b,{name:"NEW",tab:"最新曲目"},null)],suffix:()=>t(te,{placeholder:"请输入曲目名称",round:!0,value:r.value,class:s.inputSearch,onSearch:a=>{e.tabName==="RECOMMEND"?e.recommendSearch.name=a:e.tabName==="HOT"?e.hotSearch.name=a:e.tabName==="NEW"?e.newSearch.name=a:e.allSearch.name=a,i.page=1,e.finshed=!1,e.list=[],I()}},null)}),t(ie,{class:[[s.wrapList,!e.loading&&e.list.length===0&&s.wrapListEmpty]],onScroll:async a=>{var n,l,o;if(e.tabName)return;const p=(n=a.target)==null?void 0:n.clientHeight,c=(l=a.target)==null?void 0:l.scrollTop,v=(o=a.target)==null?void 0:o.scrollHeight;if(p+c+20>=v&&!e.finshed&&!e.loading){if(i.page>=e.countPage)return;i.page=i.page+1,await I()}}},{default:()=>[t(Y,{show:e.loading},{default:()=>[t("div",{class:[s.loadingSection,!e.loading&&e.list.length===0&&s.loadingSectionEmpty]},[t("div",{class:[s.searchSection]},[t(Je,{type:e.tabName,musicalInstrumentId:d.value,onSearch:a=>{g(a)}},null)]),e.list.length>0&&t("div",{class:[s.sectionContainer]},[e.list.map(a=>{var p,c;return t("div",{class:s.sectionItem,onClick:()=>f(a)},[t("div",{class:s.img},[t("img",{referrerpolicy:"no-referrer",src:a.titleImg},null)]),t("div",{class:s.infos},[t("div",{class:s.topName,innerHTML:a.musicNameReg},null),t("div",{class:s.types},[t("div",{class:s.hot},[t("span",null,[ee(a.usedNum)])]),((p=a.audioPlayTypes)==null?void 0:p.includes("SING"))&&t("div",{class:s.sing},[B("演唱")]),((c=a.audioPlayTypes)==null?void 0:c.includes("PLAY"))&&t("div",{class:s.song},[B("演奏")]),t("div",{class:s.author},[a.composer])])])])})]),!e.loading&&e.list.length===0&&t("div",{class:s.empty},[t(ae,null,null)])])]})]})]),t(le,{show:e.previewModal,"onUpdate:show":a=>e.previewModal=a,type:"music",params:e.previewParams},null)])}});export{Mt as default};