lex-xin 6 月之前
父節點
當前提交
0707480c6a
共有 2 個文件被更改,包括 25 次插入8 次删除
  1. 21 4
      src/views/cloudPractice/cloudPractice.tsx
  2. 4 4
      src/views/cloudPractice/useData.ts

+ 21 - 4
src/views/cloudPractice/cloudPractice.tsx

@@ -90,6 +90,19 @@ export default defineComponent({
       })
       const partColumns = ref<any>([])
 
+      const musicRenderType = computed(() => {
+         const details = state.details
+         const template: any = {
+            STAVE: "staff",
+            JIAN: "fixedTone",
+            FIRST: "firstTone"
+         }
+         if (details.scoreType) {
+            return template[details.scoreType] || "staff"
+         }
+         return "staff"
+      })
+
       /** 选中的item */
       const activeItem = computed(() => {
          const list = state.list[state.listActive] || {}
@@ -977,7 +990,9 @@ export default defineComponent({
       const resetRender = async () => {
          const iframeRef: any = document.getElementById("staffIframeRef")
          if (userStoreHook.roles === "GYM" || userStoreHook.roles === "KLX") {
-            iframeRef.contentWindow.location.replace(getPreViewCloud(activeItem.value.id, state.partXmlIndex, state.selectedTrack))
+            iframeRef.contentWindow.location.replace(
+               getPreViewCloud(activeItem.value.id, state.partXmlIndex, state.selectedTrack, musicRenderType.value)
+            )
             // state.iframeSrc = getPreViewCloud(activeItem.value.id, state.partXmlIndex)
             return
          }
@@ -1008,9 +1023,11 @@ export default defineComponent({
                   nextTick(() => {
                      const iframeRef: any = document.getElementById("staffIframeRef")
                      if (iframeRef) {
-                        iframeRef.contentWindow.location.replace(getPreViewCloud(activeItem.value.id, state.partXmlIndex, state.selectedTrack))
+                        iframeRef.contentWindow.location.replace(
+                           getPreViewCloud(activeItem.value.id, state.partXmlIndex, state.selectedTrack, musicRenderType.value)
+                        )
                      } else {
-                        state.iframeSrc = getPreViewCloud(activeItem.value.id, state.partXmlIndex, state.selectedTrack)
+                        state.iframeSrc = getPreViewCloud(activeItem.value.id, state.partXmlIndex, state.selectedTrack, musicRenderType.value)
                      }
                   })
                } else {
@@ -1472,7 +1489,7 @@ export default defineComponent({
                      src={btnSubmit as any}
                      onClick={() => {
                         handleChangeAudio("pause")
-                        goToCloud(activeItem.value.id, state.partXmlIndex, state.selectedTrack)
+                        goToCloud(activeItem.value.id, state.partXmlIndex, state.selectedTrack, musicRenderType.value)
                      }}
                   />
 

+ 4 - 4
src/views/cloudPractice/useData.ts

@@ -21,10 +21,10 @@ export const useFunction = () => {
    /** 跳转云教练 */
    const isPracticeShow = ref(false)
    const practiceUrl = ref("")
-   function goToCloud(musicId: string, partIndex = 0, track = "") {
+   function goToCloud(musicId: string, partIndex = 0, track = "", musicRenderType = "") {
       //  GYM,GYT,KLX 区分   云教练
       let gymUrl = `${URL_TEACH_GYM}#/?id=${musicId}&Authorization=${getToken()}&platform=pc&isYjt=1&isHideMusicList=true&systemType=teacher`
-      let klxUrl = `${URL_TEACH_KLX}#/?id=${musicId}&Authorization=${getToken()}&platform=pc&isYjt=1&isHideMusicList=true&systemType=teacher`
+      let klxUrl = `${URL_TEACH_KLX}#/?id=${musicId}&Authorization=${getToken()}&platform=pc&isYjt=1&isHideMusicList=true&systemType=teacher&musicRenderType=${musicRenderType}`
       if (partIndex === 999) {
          gymUrl += `&part-index=${partIndex}`
          klxUrl += `&part-index=${partIndex}`
@@ -46,10 +46,10 @@ export const useFunction = () => {
       practiceUrl.value = ""
    }
 
-   function getPreViewCloud(musicId: string, partIndex = 0, track = "") {
+   function getPreViewCloud(musicId: string, partIndex = 0, track = "", musicRenderType = "") {
       //  GYM,GYT,KLX 区分   云教练
       let gymUrl = `${URL_TEACH_GYM}?t=${Date.now()}#/?id=${musicId}&Authorization=${getToken()}&isPreView=true&zoom=1&downPng=A4&systemType=teacher`
-      let klxUrl = `${URL_TEACH_KLX}?t=${Date.now()}#/?id=${musicId}&Authorization=${getToken()}&isPreView=true&zoom=1&downPng=A4&systemType=teacher`
+      let klxUrl = `${URL_TEACH_KLX}?t=${Date.now()}#/?id=${musicId}&Authorization=${getToken()}&isPreView=true&zoom=1&downPng=A4&systemType=teacher&musicRenderType=${musicRenderType}`
       if (partIndex === 999) {
          gymUrl += `&part-index=${partIndex}`
          klxUrl += `&part-index=${partIndex}`