|
@@ -116,31 +116,12 @@ export default defineComponent({
|
|
const renderStaff = async () => {
|
|
const renderStaff = async () => {
|
|
try {
|
|
try {
|
|
if (staffData.musicPdfUrl) {
|
|
if (staffData.musicPdfUrl) {
|
|
- // staffData.iframeSrc =
|
|
|
|
- // "/pdf/web/viewer.html?file=" +
|
|
|
|
- // encodeURIComponent(staffData.musicPdfUrl) + "&t=" + Date.now();
|
|
|
|
- // https://cdn.oss.dayaedu.com/daya202409/UOFW4q5.pdf
|
|
|
|
- // https://cdn.oss.dayaedu.com/daya202409/UOFVK2A.pdf
|
|
|
|
- // https://cdn.oss.dayaedu.com/daya202409/UODQffO.pdf
|
|
|
|
-
|
|
|
|
- // staffData.iframeSrc = `${location.origin}${
|
|
|
|
- // location.pathname
|
|
|
|
- // }pdf/web/viewer.html?file=${encodeURIComponent(staffData.musicPdfUrl)}&t=${Date.now()}`
|
|
|
|
-
|
|
|
|
- // const iframeRef = document.querySelector("#staffIframeRef") as any
|
|
|
|
- // iframeRef.contentWindow.location.replace("/pdf/web/viewer.html?file=" +
|
|
|
|
- // encodeURIComponent(staffData.musicPdfUrl) + "&t=" + Date.now());
|
|
|
|
|
|
|
|
const iframeRef = document.querySelector("#staffIframeRef") as any
|
|
const iframeRef = document.querySelector("#staffIframeRef") as any
|
|
iframeRef.contentWindow.location.replace( `${location.origin}${
|
|
iframeRef.contentWindow.location.replace( `${location.origin}${
|
|
location.pathname
|
|
location.pathname
|
|
}pdf/web/viewer.html?file=${encodeURIComponent(staffData.musicPdfUrl)}&t=${Date.now()}`);
|
|
}pdf/web/viewer.html?file=${encodeURIComponent(staffData.musicPdfUrl)}&t=${Date.now()}`);
|
|
} else {
|
|
} else {
|
|
- // staffData.iframeSrc = `/osmd/index.html`;
|
|
|
|
- // staffData.iframeSrc = `${location.origin}${location.pathname}osmd/index.html`
|
|
|
|
- // const iframeRef = document.querySelector("#staffIframeRef") as any
|
|
|
|
- // iframeRef.contentWindow.location.replace(`/osmd/index.html`);
|
|
|
|
-
|
|
|
|
const iframeRef = document.querySelector("#staffIframeRef") as any
|
|
const iframeRef = document.querySelector("#staffIframeRef") as any
|
|
iframeRef.contentWindow.location.replace(`${location.origin}${location.pathname}osmd/index.html`);
|
|
iframeRef.contentWindow.location.replace(`${location.origin}${location.pathname}osmd/index.html`);
|
|
|
|
|
|
@@ -177,12 +158,6 @@ export default defineComponent({
|
|
return item
|
|
return item
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // for (let key of instruments) {
|
|
|
|
- // const _key = key.toLocaleLowerCase().replace(/ /g, '')
|
|
|
|
- // if (name.includes(_key)) {
|
|
|
|
- // return key
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
return ''
|
|
return ''
|
|
}
|
|
}
|
|
|
|
|
|
@@ -192,6 +167,8 @@ export default defineComponent({
|
|
staffData.musicPdfUrl = row.musicPdfUrl
|
|
staffData.musicPdfUrl = row.musicPdfUrl
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
staffData.partNames = await getPartNames(row.xmlFileUrl)
|
|
staffData.partNames = await getPartNames(row.xmlFileUrl)
|
|
let partList = row.background || []
|
|
let partList = row.background || []
|
|
partList = partList.filter(
|
|
partList = partList.filter(
|
|
@@ -213,22 +190,19 @@ export default defineComponent({
|
|
staffData.selectedPartName = defaultShowStaff.instrumentName
|
|
staffData.selectedPartName = defaultShowStaff.instrumentName
|
|
staffData.partXmlIndex = defaultShowStaff.xmlIndex
|
|
staffData.partXmlIndex = defaultShowStaff.xmlIndex
|
|
|
|
|
|
- if (row.musicSheetType === 'SINGLE') {
|
|
|
|
|
|
+ // 是否为并
|
|
|
|
+ if(staffData.isComberRender) {
|
|
staffData.musicPdfUrl = row.musicPdfUrl
|
|
staffData.musicPdfUrl = row.musicPdfUrl
|
|
} else {
|
|
} else {
|
|
- // 是否为并
|
|
|
|
- if(staffData.isComberRender) {
|
|
|
|
- staffData.musicPdfUrl = row.musicPdfUrl
|
|
|
|
|
|
+ const item = getInstrumentItem(
|
|
|
|
+ staffData.details?.background || [],
|
|
|
|
+ partColumns.value[staffData.selectedPartIndex]?.track
|
|
|
|
+ )
|
|
|
|
+ console.log(item, 'item', staffData.details?.background, partColumns.value[staffData.selectedPartIndex]?.track)
|
|
|
|
+ if (item) {
|
|
|
|
+ staffData.musicPdfUrl = item.musicPdfUrl
|
|
} else {
|
|
} else {
|
|
- const item = getInstrumentItem(
|
|
|
|
- staffData.details?.background || [],
|
|
|
|
- partColumns.value[staffData.selectedPartIndex]?.track
|
|
|
|
- )
|
|
|
|
- if (item) {
|
|
|
|
- staffData.musicPdfUrl = item.musicPdfUrl
|
|
|
|
- } else {
|
|
|
|
- staffData.musicPdfUrl = ''
|
|
|
|
- }
|
|
|
|
|
|
+ staffData.musicPdfUrl = ''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -356,7 +330,7 @@ export default defineComponent({
|
|
<div class={styles.musicImg}>
|
|
<div class={styles.musicImg}>
|
|
<Image src={iconBg} />
|
|
<Image src={iconBg} />
|
|
</div>
|
|
</div>
|
|
- <div class={styles.info}>
|
|
|
|
|
|
+ {staffData.details.id && !staffData.musicPdfUrl && <div class={styles.info}>
|
|
<p class={styles.names}>
|
|
<p class={styles.names}>
|
|
{staffData.details.musicSheetName}
|
|
{staffData.details.musicSheetName}
|
|
{staffData.details.musicSheetType === 'CONCERT' && staffData.selectedPartName
|
|
{staffData.details.musicSheetType === 'CONCERT' && staffData.selectedPartName
|
|
@@ -364,10 +338,11 @@ export default defineComponent({
|
|
: ''}
|
|
: ''}
|
|
</p>
|
|
</p>
|
|
<p class={styles.author}>{staffData.details.composer}</p>
|
|
<p class={styles.author}>{staffData.details.composer}</p>
|
|
- </div>
|
|
|
|
|
|
+ </div>}
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div class={styles.showImgContainer}>
|
|
|
|
|
|
+ <div class={[styles.showImgContainer, staffData.musicPdfUrl && styles.pdfContainer]}>
|
|
{/* {staffData.details?.musicSheetType === 'CONCERT' ? (
|
|
{/* {staffData.details?.musicSheetType === 'CONCERT' ? (
|
|
<> */}
|
|
<> */}
|
|
{loading.value && (
|
|
{loading.value && (
|