Преглед на файлове

Merge branch 'iteration-temp-http' into staging

lex-xin преди 1 месец
родител
ревизия
c7a1db308f
променени са 1 файла, в които са добавени 27 реда и са изтрити 7 реда
  1. 27 7
      src/views/cloudPractice/cloudPractice.tsx

+ 27 - 7
src/views/cloudPractice/cloudPractice.tsx

@@ -36,7 +36,7 @@ import userStore from "@/store/modules/user"
 import PlayLoading from "./component/play-loading"
 import PracticeForm from "@/businessComponents/practiceForm"
 import { saveAs } from "file-saver"
-import JSZip, { file } from "jszip"
+import JSZip from "jszip"
 import { svgtopng } from "./formatSvgToImg"
 
 export default defineComponent({
@@ -715,7 +715,7 @@ export default defineComponent({
          state.selectedPartName = ""
          state.selectedTrack = ""
          state.selectedPartIndex = 0
-         state.musicPdfUrl = ""
+         // state.musicPdfUrl = ""
          state.partXmlIndex = 0
          document.querySelector(".musicList-container")?.scroll(0, 0)
          state.page = 1
@@ -1303,20 +1303,40 @@ export default defineComponent({
                               state.selectedTrack = item.track
                               state.partXmlIndex = item.xmlIndex
                               nextTick(() => {
-                                 if (item && item.musicPdfUrl) {
+                                 // if (item && item.musicPdfUrl) {
+                                 //    staffLoading.value = true
+                                 //    state.musicPdfUrl = item.musicPdfUrl
+                                 //    renderStaff()
+                                 // } else {
+                                 //    loading.value = true
+                                 //    if (state.musicPdfUrl) {
+                                 //       state.musicPdfUrl = ""
+                                 //       renderStaff()
+                                 //    } else {
+                                 //       resetRender()
+                                 //    }
+                                 // }
+                                 let tempPdf = ""
+                                 if (activeItem.value?.isComberRender) {
+                                    if (activeItem.value?.musicPdfUrl) {
+                                       tempPdf = activeItem.value?.musicPdfUrl
+                                    }
+                                 } else {
+                                    tempPdf = item.musicPdfUrl
+                                 }
+                                 if (tempPdf) {
+                                    state.musicPdfUrl = tempPdf
                                     staffLoading.value = true
-                                    state.musicPdfUrl = item.musicPdfUrl
                                     renderStaff()
                                  } else {
                                     loading.value = true
-                                    if (state.musicPdfUrl) {
-                                       state.musicPdfUrl = ""
+                                    // 为了处理,之前是使用pdf渲染,现在又用osmd,iframe没有重新加载
+                                    if (state.iframeSrc.indexOf("pdf/web") !== -1) {
                                        renderStaff()
                                     } else {
                                        resetRender()
                                     }
                                  }
-                                 console.log(value, "value", item)
                               })
                            }}
                            class={["PopSelect", "PopSelectPart"]}