Przeglądaj źródła

Merge branch 'iteraion-20240914-pdf'

lex-xin 9 miesięcy temu
rodzic
commit
b8c91b95cb

+ 18 - 1
public/osmd/index.html

@@ -102,7 +102,24 @@
       }, '*');
     }
 
-    function renderXml(xmlUrl, partIndex) {
+    function renderXml(xmlUrl, partIndex, type) {
+      if(type) {
+        let str = 'staff'
+        if (type === 'first') {
+          str = 'jianpu'
+          window.sett = {
+            keySignature: false,
+          };
+        } else if (type === 'fixed') {
+          str = 'jianpu'
+          window.sett = {
+            keySignature: true,
+          };
+        }
+
+        osmd.EngravingRules.DYMusicScoreType = str
+      }
+      
       osmd
         .load(xmlUrl)
         .then(

+ 2 - 0
src/components/the-sticky/index.tsx

@@ -43,12 +43,14 @@ export default defineComponent({
       sectionStyle: {
         width: '100%',
         height: 'auto',
+        minHeight: 'auto',
         left: '0'
       }
     })
 
     const __initHeight = (height: any) => {
       forms.sectionStyle.height = `${height}px`
+      forms.sectionStyle.minHeight = `${height}px`
       forms.heightV = height
       // 设置名称
       document.documentElement.style.setProperty(props.varName, `${height}px`)

+ 1 - 1
src/tenant/music/music-detail/new-index.tsx

@@ -563,7 +563,7 @@ export default defineComponent({
         const xml = formatXML(parseXmlInfo.parsedXML)
 
         const currentXml = onlyVisible(xml, staffData.partXmlIndex)
-        iframeRef.contentWindow.renderXml(currentXml, 0)
+        iframeRef.contentWindow.renderXml(currentXml, 0, staff.radio)
 
         // iframeRef.contentWindow.renderXml(
         //   staffData.musicXml,

+ 1 - 2
src/views/music/music-detail/index.tsx

@@ -136,7 +136,6 @@ export default defineComponent({
     const onChangeStaff = (type: string) => {
       staff.radio = type
       staff.status = false
-      console.log(type)
       if (type == 'first') {
         loading.value = false
         const tempPdf = musicDetail.value?.firstPdfUrl
@@ -657,7 +656,7 @@ export default defineComponent({
         const xml = formatXML(parseXmlInfo.parsedXML)
 
         const currentXml = onlyVisible(xml, staffData.partXmlIndex)
-        iframeRef.contentWindow.renderXml(currentXml, 0)
+        iframeRef.contentWindow.renderXml(currentXml, 0, staff.radio)
 
         // iframeRef.contentWindow.renderXml(
         //   staffData.musicXml,