music-list.379bac27.js 14 KB

1
  1. import{d as G,ah as I,R as U,g as n,r as x,y as H,$ as W,c as a,aj as _,F as X,a5 as q,ak as $,P as z,al as K,m as B,_ as Q,e as J,bq as Y,bf as Z}from"./index.332c7f08.js";import{O as uu}from"./index.626c48f9.js";import{g as eu,s as g}from"./index.module.d12e02f5.js";import{O as tu}from"./index.d7c1b6ac.js";import{O as au}from"./index.d2064f3d.js";import{D as O,a as h}from"./index.6fe63dc5.js";import{L as ou}from"./index.b186dfda.js";import{C as su}from"./index.324108a5.js";import{C as ru}from"./index.91135ff9.js";import{P as iu}from"./index.656e257f.js";import"./index.1ed6273e.js";import"./use-tab-status.9d769af8.js";import"./Picker.e56f94bd.js";import"./index.7c580591.js";import"./index.1e2dfe6e.js";import"./index.4aa8e076.js";const D={"Acoustic Grand Piano":"\u5927\u94A2\u7434","Bright Acoustic Piano":"\u660E\u4EAE\u7684\u94A2\u7434","Electric Grand Piano":"\u7535\u94A2\u7434","Rhodes Piano":"\u67D4\u548C\u7684\u7535\u94A2\u7434","Chorused Piano":"\u52A0\u5408\u5531\u6548\u679C\u7684\u7535\u94A2\u7434",Harpsichord:"\u7FBD\u7BA1\u952E\u7434",Clavichord:"\u79D1\u62C9\u7EF4\u79D1\u7279\u7434",Celesta:"\u94A2\u7247\u7434",Glockenspiel:"\u94A2\u7247\u7434","Music box":"\u516B\u97F3\u76D2",Vibraphone:"\u98A4\u97F3\u7434",Marimba:"\u9A6C\u6797\u5DF4",Xylophone:"\u6728\u7434","Tubular Bells":"\u7BA1\u949F",Dulcimer:"\u5927\u626C\u7434","Hammond Organ":"\u51FB\u6746\u98CE\u7434","Percussive Organ":"\u6253\u51FB\u5F0F\u98CE\u7434","Rock Organ":"\u6447\u6EDA\u98CE\u7434","Church Organ":"\u6559\u5802\u98CE\u7434","Reed Organ":"\u7C27\u7BA1\u98CE\u7434",Accordian:"\u624B\u98CE\u7434",Harmonica:"\u53E3\u7434","Tango Accordian":"\u63A2\u6208\u624B\u98CE\u7434","Acoustic Guitar":"\u94A2\u5F26\u5409\u4ED6","Electric Guitar":"\u95F7\u97F3\u7535\u5409\u4ED6","Overdriven Guitar":"\u52A0\u9A71\u52A8\u6548\u679C\u7684\u7535\u5409\u4ED6","Distortion Guitar":"\u52A0\u5931\u771F\u6548\u679C\u7684\u7535\u5409\u4ED6","Guitar Harmonics":"\u5409\u4ED6\u548C\u97F3","Acoustic Bass":"\u5927\u8D1D\u53F8","Electric Bass":"\u7535\u8D1D\u53F8","Fretless Bass":"\u65E0\u54C1\u8D1D\u53F8","Slap Bass":"\u638C\u51FB","Synth Bass":"\u7535\u5B50\u5408\u6210",Violin:"\u5C0F\u63D0\u7434",Viola:"\u4E2D\u63D0\u7434",Cello:"\u5927\u63D0\u7434",Contrabass:"\u4F4E\u97F3\u5927\u63D0\u7434","Tremolo Strings":"\u5F26\u4E50\u7FA4\u98A4\u97F3\u97F3\u8272","Pizzicato Strings":"\u5F26\u4E50\u7FA4\u62E8\u5F26\u97F3\u8272","Orchestral Harp":"\u7AD6\u7434",Timpani:"\u5B9A\u97F3\u9F13","String Ensemble":"\u5F26\u4E50\u5408\u594F\u97F3\u8272","Synth Strings":"\u5408\u6210\u5F26\u4E50\u5408\u594F\u97F3\u8272","Choir Aahs":"\u4EBA\u58F0\u5408\u5531","Voice Oohs":"\u4EBA\u58F0","Synth Voice":"\u5408\u6210\u4EBA\u58F0","Orchestra Hit":"\u7BA1\u5F26\u4E50\u6572\u51FB\u9F50\u594F",Trumpet:"\u5C0F\u53F7",Trombone:"\u957F\u53F7",Tuba:"\u5927\u53F7","Muted Trumpet":"\u52A0\u5F31\u97F3\u5668\u5C0F\u53F7","French Horn":"\u6CD5\u56FD\u53F7","Brass Section":"\u94DC\u7BA1\u7EC4","Synth Brass":"\u5408\u6210\u94DC\u7BA1\u97F3\u8272","Soprano Sax":"\u9AD8\u97F3\u8428\u514B\u65AF\u7BA1","Alto Sax":"\u4E2D\u97F3\u8428\u514B\u65AF\u7BA1","Tenor Sax":"\u6B21\u4E2D\u97F3\u8428\u514B\u65AF\u7BA1","Baritone Sax":"\u4F4E\u97F3\u8428\u514B\u65AF\u7BA1",Oboe:"\u53CC\u7C27\u7BA1","English Horn":"\u82F1\u56FD\u7BA1",Bassoon:"\u5DF4\u677E",Clarinet:"\u5355\u7C27\u7BA1","Soprano Saxophone":"\u9AD8\u97F3\u8428\u514B\u65AF\u7BA1","Alto Saxophone":"\u4E2D\u97F3\u8428\u514B\u65AF\u7BA1","Tenor Saxophone":"\u6B21\u4E2D\u97F3\u8428\u514B\u65AF\u7BA1","Baritone Saxophone":"\u4F4E\u97F3\u8428\u514B\u65AF\u7BA1",Piccolo:"\u77ED\u7B1B",Flute:"\u957F\u7B1B",Recorder:"\u7AD6\u7B1B","Soprano Recorder":"\u9AD8\u97F3\u7AD6\u7B1B","Pan Flute":"\u6392\u7BAB","Bottle Blow":"\u74F6\u6728\u7BA1",Whistle:"\u53E3\u54E8\u58F0",Ocarina:"\u9676\u7B1B",Lead:"\u5408\u6210\u4E3B\u97F3","Lead lead":"\u5408\u6210\u4E3B\u97F3","Pad age":"\u5408\u6210\u97F3\u8272",Pad:"\u5408\u6210\u97F3\u8272",FX:"\u5408\u6210\u6548\u679C \u79D1\u5E7B",Sitar:"\u897F\u5854\u5C14",Banjo:"\u73ED\u5353\u7434",Shamisen:"\u4E09\u6627\u7EBF",Koto:"\u5341\u4E09\u5F26\u7B5D",Kalimba:"\u5361\u6797\u5DF4",Bagpipe:"\u98CE\u7B1B",Fiddle:"\u6C11\u65CF\u63D0\u7434",Shanai:"\u5C71\u5948","Tinkle Bell":"\u53EE\u5F53\u94C3",Agogos:"\u963F\u6208\u6208\u94C3","Steel Drums":"\u94A2\u9F13","Taiko Drum":"\u592A\u9F13","Melodic Toms":"\u55F5\u55F5\u9F13","Synth Drums":"\u5408\u6210\u9F13","Reverse Cymbals":"\u53CD\u5411\u9572","Agogo Bells":"\u963F\u6208\u6208\u94C3","Taiko Drums":"\u592A\u9F13",Bongos:"\u90A6\u6208\u9F13","Bongo Bell":"\u90A6\u6208\u94C3",Congas:"\u5EB7\u52A0\u9F13",Guiro:"\u522E\u58F6","Guitar Fret Noise":"\u5409\u4ED6\u6362\u628A\u6742\u97F3","Breath Noise":"\u547C\u5438\u58F0",Seashore:"\u6D77\u6D6A\u58F0","Bird Tweet":"\u9E1F\u9E23","Telephone Ring":"\u7535\u8BDD\u94C3",Helicopter:"\u76F4\u5347\u673A",Applause:"\u9F13\u638C\u58F0",Gunshot:"\u67AA\u58F0","Acoustic Bass Drum":"\u5927\u9F13","Bass Drum":"\u5927\u9F13","Side Drum":"\u5C0F\u9F13\u9F13\u8FB9","Acoustic Snare":"\u5C0F\u9F13","Hand Claps":"\u62CD\u624B","Electric Snare":"\u5C0F\u9F13","Low Floor Tom":"\u4F4E\u97F3\u55F5\u9F13","Closed Hi-Hat":"\u95ED\u5408\u8E29\u9572","High Floor Tom":"\u9AD8\u97F3\u843D\u5730\u55F5\u9F13","Pedal Hi-Hat":"\u811A\u8E0F\u8E29\u9572","Low Tom":"\u4F4E\u97F3\u55F5\u9F13","Open Hi-Hat":"\u5F00\u97F3\u8E29\u9572","Low-Mid Tom":"\u4E2D\u4F4E\u97F3\u55F5\u9F13","Hi Mid Tom":"\u9AD8\u97F3\u9F13","Crash Cymbals":"\u5BF9\u9572","High Tom":"\u9AD8\u97F3\u55F5\u9F13","Ride Cymbals":"\u53EE\u53EE\u9572","Chinese Cymbals":"\u4E2D\u56FD\u9572","Ride Bell":"\u5706\u94C3",Tambourine:"\u94C3\u9F13","Splash Cymbal":"\u6E85\u97F3\u9572",Cowbell:"\u725B\u94C3","Crash Cymbal":"\u5F3A\u97F3\u94B9","Vibra-Slap":"\u98A4\u97F3\u5668","Ride Cymbal":"\u6253\u70B9\u94B9","Hi Bongo":"\u9AD8\u97F3\u90A6\u6208\u9F13","Low Bongo":"\u4F4E\u97F3\u90A6\u6208\u9F13","Mute Hi Conga":"\u5F31\u97F3\u9AD8\u97F3\u5EB7\u52A0\u9F13","Open Hi Conga":"\u5F3A\u97F3\u9AD8\u97F3\u5EB7\u52A0\u9F13","Low Conga":"\u4F4E\u97F3\u5EB7\u52A0\u9F13","High Timbale":"\u9AD8\u97F3\u5929\u5DF4\u9F13","Low Timbale":"\u4F4E\u97F3\u5929\u5DF4\u9F13","High Agogo":"\u9AD8\u97F3\u963F\u6208\u6208\u94C3","Low Agogo":"\u4F4E\u97F3\u963F\u6208\u6208\u94C3",Cabasa:"\u5361\u5DF4\u8428",Maracas:"\u6C99\u9524","Short Whistle":"\u77ED\u53E3\u54E8","Long Whistle":"\u957F\u53E3\u54E8","Short Guiro":"\u77ED\u522E\u58F6","Long Guiro":"\u957F\u522E\u58F6",Claves:"\u54CD\u68D2","Hi Wood Block":"\u9AD8\u97F3\u6728\u9C7C","Low Wood Block":"\u4F4E\u97F3\u6728\u9C7C","Mute Triangle":"\u5F31\u97F3\u4E09\u89D2\u94C1","Open Triangle":"\u5F3A\u97F3\u4E09\u89D2\u94C1","Drum Set":"\u67B6\u5B50\u9F13","Hulusi flute":"\u846B\u82A6\u4E1D",Melodica:"\u53E3\u98CE\u7434","Snare Drum":"\u5C0F\u519B\u9F13",Cymbal:"\u9572",Cymbals:"\u9572","Horn in F":"\u5706\u53F7",Triangle:"\u4E09\u89D2\u94C1",Vibrato:"\u98A4\u97F3\u7434","Suspend Cymbals":"\u540A\u9572","Suspended Cymbals":"\u540A\u9572","Tom-Toms":"\u55F5\u55F5\u9F13",Bell:"\u94C3\u94DB",Bells:"\u94C3\u94DB","Alto Clarinet":"\u4E2D\u97F3\u5355\u7C27\u7BA1","Bass Clarinet":"\u4F4E\u97F3\u5355\u7C27\u7BA1",Cornet:"\u77ED\u53F7",Euphonium:"\u4E0A\u4F4E\u97F3\u53F7","crash cymbals":"\u5BF9\u9572",Castanets:"\u54CD\u677F",Shaker:"\u6C99\u9524","Mark tree":"\u97F3\u6811",Chimes:"\u7BA1\u949F","Mark Tree":"\u97F3\u6811","Tom-toms":"\u55F5\u55F5\u9F13","Hi-Hat":"\u8E29\u9572","Sleigh Bells":"\u96EA\u6A47\u94C3",Flexatone:"\u5F39\u97F3\u5668","Brake drum":"\u95F8\u9F13",Gong:"\u9523","concert tom":"\u97F3\u4E50\u4F1A\u55F5\u55F5\u9F13","brake drum":"\u8F66\u8F6E\u9F13","finger cymbal":"\u6307\u94B9","ride cymbal":"\u53EE\u53EE\u9572","Concert Toms":"\u97F3\u4E50\u4F1A\u55F5\u55F5\u9F13",Vibraslap:"\u5F39\u97F3\u5668","Wood Blocks":"\u6728\u9C7C","Temple Blocks":"\u6728\u9C7C","Wood Block":"\u6728\u9C7C","Field Drum":"\u519B\u9F13","Quad-Toms":"\u7B52\u9F13",Quads:"\u7B52\u9F13","Drums set":"\u67B6\u5B50\u9F13","High Bongo":"\u90A6\u6208",Timbales:"\u5929\u5DF4\u9F13","rain stick":"\u96E8\u68D2","String Bass":"\u5F26\u4E50\u4F4E\u97F3","Floor Tom":"\u4FA7\u55F5\u9F13","Brake Drum":"\u95F8\u9F13","Tam-tam":"\u5927\u9523"},nu=l=>{const p=l.replace(/ /g," ").toLocaleLowerCase(),F=Object.keys(D);for(let r=0;r<F.length;r++)if(F[r].replace(/ /g," ").toLocaleLowerCase()===p)return D[F[r]]||"";for(let r=0;r<F.length;r++){const C=F[r].replace(/ /g," ").toLocaleLowerCase();if(p.includes(C))return D[F[r]]||""}return""};function lu(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!K(l)}var Tu=G({name:"accompany-music-list",props:{musicTree:{type:Array,default:()=>[]}},setup(){var y,S,b,T,v,w;const l=I(),p=eu("icon-music.svg"),F=U({}),r=((S=(y=n.user)==null?void 0:y.data)==null?void 0:S.phone)||"accompany-music-list-subject",C=localStorage.getItem(r)||((w=(v=(T=(b=n.user)==null?void 0:b.data)==null?void 0:T.subjectId)==null?void 0:v.split(","))==null?void 0:w[0])||"",u=x({loading:!1,firstRender:!1,finished:!1,refreshing:!1,musicTree:[],pagenation:{page:1,rows:20},value1:null,value2:null,PopoverOpen:!1,list:[],keyword:"",musicSubject:C,subjectList:[]}),k=async()=>{try{const t=await B.get(n.platformApi+"/musicSheetCategories/queryTree?enable=true");Array.isArray(t==null?void 0:t.data)&&(u.musicTree=t.data),Q(()=>{E()})}catch(t){console.log(t)}},j=async()=>{try{((await B.post(n.platformApi+"/open/subjectBasicConfig/page",{data:{enableFlag:!0,page:1,rows:100}})).data.rows||[]).forEach(o=>{u.subjectList.push({text:o.subjectName,value:o.subjectId+""})})}catch{}},P=async()=>{try{const t=await B.get("/api-student/student/member");F.value=t.data||{}}catch(t){console.log(t)}},R=H(()=>{const t=u.musicTree.find(e=>e.id==l.query.categorieid);return Array.isArray(t==null?void 0:t.musicSheetCategoriesList)?t.musicSheetCategoriesList.map(o=>(u.value1||(u.value1=o.id,u.value2=null),{text:o.name,value:o.id})):[]}),V=H(()=>{const t=u.musicTree.find(e=>e.id==l.query.categorieid);if(Array.isArray(t==null?void 0:t.musicSheetCategoriesList)){const e=t.musicSheetCategoriesList.find(o=>o.id==u.value1);if(Array.isArray(e==null?void 0:e.musicSheetCategoriesList))return[{text:"\u5168\u90E8",value:null}].concat(e.musicSheetCategoriesList.map(A=>({text:A.name,value:A.id})))}return[{text:"\u5168\u90E8",value:null}]}),E=async()=>{var e;if(u.loading)return;u.loading=!0;const t={...u.pagenation,keyword:u.keyword,musicSheetCategoriesId:u.value2||u.value1,status:1};n.platformType=="TEACHER"&&(t.musicSubject=u.musicSubject);try{const o=await B.post(n.platformApi+"/musicSheet/page",{data:t,hideLoading:!0});Array.isArray((e=o==null?void 0:o.data)==null?void 0:e.rows)?(u.list=[].concat(u.list,o.data.rows),u.pagenation.page+=1,u.finished=o.data.rows.length<u.pagenation.rows):u.finished=!0}catch{u.finished=!0}u.loading=!1,u.refreshing=!1,u.firstRender=!0},c=()=>{u.pagenation.page=1,u.list=[],u.finished=!1,u.list=[],E()},f=async t=>{const e=`${location.origin}/orchestra-music-score/?id=${t.id}&part-index=${s.partIndex}`;console.log("\u{1F680} ~ src:",e),J({api:"openAccompanyWebView",content:{url:e,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})};W(()=>{n.platformType=="STUDENT"&&P(),n.platformType=="TEACHER"&&j(),k()});const s=x({open:!1,musicXml:{},instrumentName:"",partIndex:0,partList:[]}),N=async t=>{const e=[];Y("\u52A0\u8F7D\u4E2D...");try{const o=await fetch(t).then(i=>i.text()),A=new DOMParser().parseFromString(o,"text/xml");let m=Array.from(A.getElementsByTagName("part-name"));m=m.filter(i=>{var d,L;return!((L=(d=i.textContent)==null?void 0:d.toLocaleUpperCase())!=null&&L.includes("COMMON"))});for(let i=0;i<m.length;i++){const d=nu(m[i].textContent||"");e.push({text:d?m[i].textContent+`(${d})`:"",value:i})}Z()}catch(o){console.log(o)}return console.log("\u{1F680} ~ partNames:",e),e},M=async t=>{if(s.musicXml[t.id])return s.instrumentName=t.id,s.open=!0,Promise.resolve();s.musicXml[t.id]=await N(t.xmlFileUrl),s.instrumentName=t.id,s.open=!0};return()=>{let t;return a("div",{class:g["accompany-music-list"]},[a(tu,{mode:"sticky",class:g.heade,onGetHeight:e=>{document.documentElement.style.setProperty("--header-height",e+"px")}},{default:()=>[a(_,{border:!1},null),a("div",null,[a(O,{activeColor:"var(--van-primary)"},{default:()=>[a(h,{modelValue:u.value1,"onUpdate:modelValue":e=>u.value1=e,options:R.value,onChange:()=>{u.value2=null,c()}},null),a(h,{modelValue:u.value2,"onUpdate:modelValue":e=>u.value2=e,options:V.value,onChange:()=>c()},null)]}),a("div",{class:g.filter},[a(au,{class:g.filterBox,onSearch:e=>{u.keyword=e,c()}},{left:()=>a(X,null,[n.platformType=="TEACHER"?a(O,{activeColor:"var(--van-primary)"},{default:()=>[a(h,{modelValue:u.musicSubject,"onUpdate:modelValue":e=>u.musicSubject=e,options:u.subjectList,onChange:()=>{localStorage.setItem(r,u.musicSubject),c()}},null)]}):null])})])])]}),a(uu,{modelValue:u.refreshing,"onUpdate:modelValue":e=>u.refreshing=e,onRefresh:c,style:"min-height: calc(100vh - var(--header-height))"},{default:()=>[a(ou,{"loading-text":" ",immediateCheck:!1,loading:u.loading,finished:u.finished,"onUpdate:finished":e=>u.finished=e,finishedText:" ",onLoad:()=>{E()}},{default:()=>[a(su,{inset:!0},lu(t=u.list.map(e=>a(ru,{size:"large",center:!0,title:e.musicSheetName,isLink:!0,onClick:()=>{if(e.musicSheetType=="CONCERT"){M(e);return}f(e)}},{icon:()=>a(q,{style:{marginRight:"12px"},size:40,name:p},null)})))?t:{default:()=>[t]}),a("div",{style:{height:"40px"}},null)]}),u.firstRender&&!u.loading&&!u.list.length&&a($,{tips:"\u6682\u65E0\u66F2\u8C31"},null)]}),a(z,{teleport:"body",position:"bottom",round:!0,show:s.open,"onUpdate:show":e=>s.open=e},{default:()=>[a(iu,{columns:s.musicXml[s.instrumentName],onConfirm:e=>{s.open=!1,s.partIndex=e.selectedValues[0],f({id:s.instrumentName})},onCancel:()=>s.open=!1},null)]})])}}});export{Tu as default};