|
@@ -277,6 +277,7 @@ export default defineComponent({
|
|
getMusicList();
|
|
getMusicList();
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ // const staffIframeRef = ref();
|
|
const musicIframeLoad = () => {
|
|
const musicIframeLoad = () => {
|
|
const token = storage.get(ACCESS_TOKEN);
|
|
const token = storage.get(ACCESS_TOKEN);
|
|
const details = data.musics[data.musicIndex];
|
|
const details = data.musics[data.musicIndex];
|
|
@@ -288,14 +289,14 @@ export default defineComponent({
|
|
: data.showMusicImg === 'staff'
|
|
: data.showMusicImg === 'staff'
|
|
? 'staff'
|
|
? 'staff'
|
|
: 'firstTone';
|
|
: 'firstTone';
|
|
- const origin = /(localhost|192)/.test(location.host)
|
|
|
|
- ? 'https://test.lexiaoya.cn'
|
|
|
|
- : location.origin;
|
|
|
|
data.iframeSrc = `${vaildMusicScoreUrl()}/instrument/?id=${
|
|
data.iframeSrc = `${vaildMusicScoreUrl()}/instrument/?id=${
|
|
details.id
|
|
details.id
|
|
}&modelType=practise&modeType=json&Authorization=${token}&isPreView=true&part-index=${
|
|
}&modelType=practise&modeType=json&Authorization=${token}&isPreView=true&part-index=${
|
|
data.selectMusicInstrumentIndex
|
|
data.selectMusicInstrumentIndex
|
|
}&musicRenderType=${musicRenderType}`;
|
|
}&musicRenderType=${musicRenderType}`;
|
|
|
|
+
|
|
|
|
+ const staffIframeRef: any = document.querySelector('#staffIframeRef');
|
|
|
|
+ staffIframeRef.contentWindow?.location?.replace(data.iframeSrc);
|
|
};
|
|
};
|
|
|
|
|
|
const setSearchBox = () => {
|
|
const setSearchBox = () => {
|
|
@@ -506,6 +507,8 @@ export default defineComponent({
|
|
handleReset();
|
|
handleReset();
|
|
});
|
|
});
|
|
setSearchBox();
|
|
setSearchBox();
|
|
|
|
+
|
|
|
|
+ musicIframeLoad();
|
|
});
|
|
});
|
|
|
|
|
|
return () => (
|
|
return () => (
|
|
@@ -694,12 +697,14 @@ export default defineComponent({
|
|
)} */}
|
|
)} */}
|
|
<iframe
|
|
<iframe
|
|
id="staffIframeRef"
|
|
id="staffIframeRef"
|
|
|
|
+ // ref={staffIframeRef}
|
|
style={{
|
|
style={{
|
|
width: '100%'
|
|
width: '100%'
|
|
// opacity: loading.value ? 0 : 1
|
|
// opacity: loading.value ? 0 : 1
|
|
}}
|
|
}}
|
|
- src={data.iframeSrc}
|
|
|
|
- onLoad={musicIframeLoad}></iframe>
|
|
|
|
|
|
+ // src={data.iframeSrc}
|
|
|
|
+ // onLoad={musicIframeLoad}
|
|
|
|
+ ></iframe>
|
|
{/* <OsmdPreview ref={osmdPreviewRef} /> */}
|
|
{/* <OsmdPreview ref={osmdPreviewRef} /> */}
|
|
</>
|
|
</>
|
|
</div>
|
|
</div>
|