|
@@ -337,10 +337,10 @@ export default defineComponent({
|
|
|
: location.origin;
|
|
|
// data.iframeSrc = `${origin}/instrument/?id=${details.id}&modelType=practise&modeType=json&Authorization=${token}&isPreView=true&part-index=${data.selectMusicInstrumentIndex}&musicRenderType=${musicRenderType}`;
|
|
|
data.iframeSrc = `${vaildMusicScoreUrl()}/instrument/?id=${
|
|
|
- details.id
|
|
|
+ details?.id
|
|
|
}&modelType=practise&modeType=json&Authorization=${token}&isPreView=true&part-index=${
|
|
|
data.selectMusicInstrumentIndex
|
|
|
- }&musicRenderType=${musicRenderType}`;
|
|
|
+ }&musicRenderType=${musicRenderType}&zoom=0.6`;
|
|
|
|
|
|
console.log('地址', data.iframeSrc);
|
|
|
};
|
|
@@ -426,6 +426,7 @@ export default defineComponent({
|
|
|
// 解析xml,获取分轨信息
|
|
|
const analyzeXml = async () => {
|
|
|
const details = data.musics[data.musicIndex];
|
|
|
+ console.log(details?.musicSheetType, 'details?.musicSheetType')
|
|
|
if (details?.musicSheetType === 'CONCERT') {
|
|
|
if (details.xmlFileUrl) {
|
|
|
const res = await fetch(details.xmlFileUrl).then(response =>
|
|
@@ -482,7 +483,7 @@ export default defineComponent({
|
|
|
if (data.enableFlag) {
|
|
|
const codes = data.code.split(/[,,]/);
|
|
|
codes.forEach((code: string) => {
|
|
|
- let codeTemp = code.replaceAll(' ', '').toLowerCase();
|
|
|
+ let codeTemp = code?.replaceAll(' ', '').toLowerCase();
|
|
|
codeMapKeys.push(codeTemp);
|
|
|
if (codeIdMap.has(codeTemp)) {
|
|
|
codeIdMap.get(codeTemp).push(data.id + '');
|
|
@@ -498,7 +499,7 @@ export default defineComponent({
|
|
|
if (!code) {
|
|
|
return '';
|
|
|
}
|
|
|
- code = code.replaceAll(' ', '').toLowerCase();
|
|
|
+ code = code?.replaceAll(' ', '').toLowerCase();
|
|
|
const tempCode = getInstrumentNameCode(codeMapKeys, code);
|
|
|
if (codeIdMap.has(tempCode)) {
|
|
|
const result = codeIdMap.get(tempCode);
|
|
@@ -520,13 +521,13 @@ export default defineComponent({
|
|
|
// 过滤出能切换的分轨
|
|
|
const filterTracks = (xml: any) => {
|
|
|
const xmlParse = new DOMParser().parseFromString(xml, 'text/xml');
|
|
|
- const partList =
|
|
|
+ const partList: any =
|
|
|
xmlParse
|
|
|
.getElementsByTagName('part-list')?.[0]
|
|
|
?.getElementsByTagName('score-part') || [];
|
|
|
const partListNames = Array.from(partList).map(
|
|
|
- item =>
|
|
|
- item.getElementsByTagName('part-name')?.[0]?.textContent?.trim() || ''
|
|
|
+ (item: any) =>
|
|
|
+ item.getElementsByTagName('part-name')?.[0]?.textContent?.trim() || item.getAttribute('id') || ''
|
|
|
);
|
|
|
const parts: any = xmlParse.getElementsByTagName('part');
|
|
|
|
|
@@ -762,18 +763,14 @@ export default defineComponent({
|
|
|
// onFocus={() => (data.searchNoticeShow = false)}
|
|
|
onBlur={val => {
|
|
|
musicForms.keyword = val?.trim() || '';
|
|
|
- // requestAnimationFrame(() => {
|
|
|
- // requestAnimationFrame(() => {
|
|
|
- // if (musicForms.keyword) {
|
|
|
- // data.searchNoticeShow = true;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // });
|
|
|
}}
|
|
|
- onSearch={val => {
|
|
|
+ onSearch={async val => {
|
|
|
if (!data.loading) {
|
|
|
musicForms.keyword = val;
|
|
|
- handleReset();
|
|
|
+ await handleReset();
|
|
|
+ await analyzeXml();
|
|
|
+
|
|
|
+ musicIframeLoad();
|
|
|
}
|
|
|
}}>
|
|
|
{{
|
|
@@ -1105,7 +1102,8 @@ export default defineComponent({
|
|
|
onClose={() => (data.showChangeVoice = false)}
|
|
|
onConfirm={async (index: number) => {
|
|
|
data.selectMusicInstrumentIndex = index;
|
|
|
- await analyzeXml();
|
|
|
+ console.log(index, 'index-------------------')
|
|
|
+ // await analyzeXml();
|
|
|
// data.iframeSrc = '';
|
|
|
musicIframeLoad();
|
|
|
data.showChangeVoice = false;
|