Sfoglia il codice sorgente

增加partIndex 字段

黄琪勇 11 mesi fa
parent
commit
da8656ad1a

+ 6 - 3
src/views/creation/index-share.tsx

@@ -96,7 +96,8 @@ export default defineComponent({
       isShow: false,
       height:"initial",
       speedRate:1,
-      musicRenderType:"staff"
+      musicRenderType:"staff",
+      partIndex:0
     })
     const staffDom= ref<HTMLIFrameElement>()
     const {playStaff, pauseStaff, updateProgressStaff} = staffMoveInstance()
@@ -339,6 +340,7 @@ export default defineComponent({
           musicSheetId:encodeURIComponent(state.musicDetail?.musicSheetId),
           speedRate:encodeURIComponent(staffState.speedRate),
           musicRenderType:encodeURIComponent(staffState.musicRenderType),
+          partIndex:encodeURIComponent(staffState.partIndex),
         }
       })
     }
@@ -379,6 +381,7 @@ export default defineComponent({
             const jsonConfig = JSON.parse(res.data.jsonConfig)
             jsonConfig.speedRate && (staffState.speedRate = jsonConfig.speedRate)
             jsonConfig.musicRenderType && (staffState.musicRenderType = jsonConfig.musicRenderType)
+            jsonConfig.partIndex && (staffState.partIndex = jsonConfig.partIndex)
           }catch{
           }
           // 五线谱
@@ -427,8 +430,8 @@ export default defineComponent({
     });
     // 初始化五线谱
     function initStaff(){
-      const src = `${vaildMusicScoreUrl()}/instrument/#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}`;
-      //const src = `https://dev.kt.colexiu.com/instrument/#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}`;
+      const src = `${vaildMusicScoreUrl()}/instrument/#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}&part-index=${staffState.partIndex}`;
+      //const src = `https://dev.kt.colexiu.com/instrument/#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}&part-index=${staffState.partIndex}`;
       staffState.staffSrc = src
       window.addEventListener('message', (event) => {
         const { api, height } = event.data;

+ 6 - 3
src/views/creation/index.tsx

@@ -95,7 +95,8 @@ export default defineComponent({
       isShow: false,
       height:"initial",
       speedRate:1,
-      musicRenderType:"staff"
+      musicRenderType:"staff",
+      partIndex: 0
     })
     const staffDom= ref<HTMLIFrameElement>()
     const {playStaff, pauseStaff, updateProgressStaff} = staffMoveInstance()
@@ -352,13 +353,14 @@ export default defineComponent({
           musicSheetId:encodeURIComponent(state.musicDetail?.musicSheetId),
           speedRate:encodeURIComponent(staffState.speedRate),
           musicRenderType:encodeURIComponent(staffState.musicRenderType),
+          partIndex:encodeURIComponent(staffState.partIndex),
         }
       })
     }
     // 初始化五线谱
     function initStaff(){
-      const src = `${vaildMusicScoreUrl()}/instrument/#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}`;
-      //const src = `https://dev.kt.colexiu.com/instrument/#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}`;
+      const src = `${vaildMusicScoreUrl()}/instrument/#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}&part-index=${staffState.partIndex}`;
+      //const src = `https://dev.kt.colexiu.com/instrument/#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}&part-index=${staffState.partIndex}`;
       staffState.staffSrc = src
       window.addEventListener('message', (event) => {
         const { api, height } = event.data;
@@ -459,6 +461,7 @@ export default defineComponent({
           const jsonConfig = JSON.parse(res.data.jsonConfig)
           jsonConfig.speedRate && (staffState.speedRate = jsonConfig.speedRate)
           jsonConfig.musicRenderType && (staffState.musicRenderType = jsonConfig.musicRenderType)
+          jsonConfig.partIndex && (staffState.partIndex = jsonConfig.partIndex)
         }catch{
         }
         // 五线谱

+ 4 - 3
src/views/creation/playCreation/index.tsx

@@ -43,7 +43,8 @@ export default defineComponent({
       isShow: false,
       height:"initial",
       speedRate:Number(decodeURIComponent(route.query.speedRate as string || "1")),
-      musicRenderType:decodeURIComponent(route.query.musicRenderType as string || "staff")
+      musicRenderType:decodeURIComponent(route.query.musicRenderType as string || "staff"),
+      partIndex:Number(decodeURIComponent(route.query.partIndex as string || "0"))
     })
     const staffDom= ref<HTMLIFrameElement>()
     const {playStaff, pauseStaff, updateProgressStaff} = staffMoveInstance()
@@ -291,8 +292,8 @@ export default defineComponent({
     });
     // 初始化五线谱
     function initStaff(){
-      const src = `${vaildMusicScoreUrl()}/instrument/#/simple-detail?id=${musicSheetId}&musicRenderType=${staffState.musicRenderType}`;
-      //const src = `https://dev.kt.colexiu.com/instrument/#/simple-detail?id=${musicSheetId}&musicRenderType=${staffState.musicRenderType}`;
+      const src = `${vaildMusicScoreUrl()}/instrument/#/simple-detail?id=${musicSheetId}&musicRenderType=${staffState.musicRenderType}&part-index=${staffState.partIndex}`;
+      //const src = `https://dev.kt.colexiu.com/instrument/#/simple-detail?id=${musicSheetId}&musicRenderType=${staffState.musicRenderType}&part-index=${staffState.partIndex}`;
       staffState.staffSrc = src
       window.addEventListener('message', (event) => {
         const { api, height } = event.data;