|
@@ -109,6 +109,18 @@ export default defineComponent({
|
|
|
const onChangeStaff = (type: string) => {
|
|
|
staff.radio = type
|
|
|
staff.status = false
|
|
|
+
|
|
|
+ if (type == 'first' && firstList.value.length <= 0) {
|
|
|
+ // showImg.value = firstList.value
|
|
|
+ resetRenderPage('first', staffData.musicXml)
|
|
|
+ } else if (type == 'fixed' && fixedList.value.length <= 0) {
|
|
|
+ // showImg.value = fixedList.value
|
|
|
+ resetRenderPage('fixed', staffData.musicXml)
|
|
|
+ } else {
|
|
|
+ if (staffList.value.length <= 0) {
|
|
|
+ resetRenderPage('staff', staffData.musicXml)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
watch(
|
|
|
() => staff.radio,
|
|
@@ -608,8 +620,8 @@ export default defineComponent({
|
|
|
staffData.xmlPartList = partList
|
|
|
}
|
|
|
|
|
|
- // staffData.iframeSrc = `${location.origin}/osmd/index.html`
|
|
|
- staffData.iframeSrc = `${location.origin}${location.pathname}osmd/index.html`
|
|
|
+ staffData.iframeSrc = `${location.origin}/osmd/index.html`
|
|
|
+ // staffData.iframeSrc = `${location.origin}${location.pathname}osmd/index.html`
|
|
|
staffData.musicXml = musicDetail.value?.xmlFileUrl || ''
|
|
|
staffData.partList = musicDetail.value?.background || []
|
|
|
staffData.partList.forEach((part: any) => {
|
|
@@ -650,6 +662,13 @@ export default defineComponent({
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ const resetRenderPage = (type: string, xmlUrl: string) => {
|
|
|
+ const iframeRef: any = document.getElementById('staffIframeRef')
|
|
|
+ if (iframeRef && iframeRef.contentWindow.renderXml) {
|
|
|
+ iframeRef.contentWindow.resetRenderPage(type, xmlUrl)
|
|
|
+ }
|
|
|
+ }
|
|
|
const partColumns = computed(() => {
|
|
|
return staffData.partList.map((item: any, index: number) => {
|
|
|
const instrumentName = getInstrumentName(item.track)
|
|
@@ -842,7 +861,8 @@ export default defineComponent({
|
|
|
: '') +
|
|
|
(staffData.instrumentName ? `(${staffData.instrumentName})` : '')}
|
|
|
</p>
|
|
|
- {musicDetail.value?.musicSheetType === 'CONCERT' ? (
|
|
|
+ {musicDetail.value?.musicSheetType === 'CONCERT' ||
|
|
|
+ showImg.value.length <= 0 ? (
|
|
|
<>
|
|
|
{loading.value && (
|
|
|
<div>
|
|
@@ -955,12 +975,11 @@ export default defineComponent({
|
|
|
onDownloadApp()
|
|
|
return
|
|
|
}
|
|
|
- if(route.query.type ==='search') {
|
|
|
+ if (route.query.type === 'search') {
|
|
|
router.push('train-tool')
|
|
|
} else {
|
|
|
router.back()
|
|
|
}
|
|
|
-
|
|
|
}}
|
|
|
>
|
|
|
开通训练教程
|