Explorar el Código

fix: 打击乐的评测报告显示内容错误修复

TIANYONG hace 2 semanas
padre
commit
9a03138c44
Se han modificado 1 ficheros con 3 adiciones y 63 borrados
  1. 3 63
      src/page-instrument/view-evaluat-report/index.tsx

+ 3 - 63
src/page-instrument/view-evaluat-report/index.tsx

@@ -101,69 +101,7 @@ export default defineComponent({
       api_setStatusBarVisibility();
     });
     // console.log(route.params, query)
-    /** 获取曲谱数据 */
-    const getMusicInfo = (res: any) => {
-      const index = state.partIndex;
-      const musicInfo = {
-        ...res.data,
-        ...res.data.background[index],
-      };
-      // console.log("🚀 ~ musicInfo:", musicInfo);
-      setState(musicInfo, index);
-      setCustom();
-      detailData.isLoading = false;
-    };
-
-    const setState = (data: any, index: number) => {
-      // console.log("🚀 ~ data:", data)
-      state.scrollContainer = "scrollContainer";
-      state.detailId = data.id;
-      state.xmlUrl = data.xmlFileUrl;
-      state.partIndex = index;
-      state.subjectId = data.musicSubject;
-      state.categoriesId = data.categoriesId;
-      state.categoriesName = data.musicTagNames;
-      state.enableEvaluation = data.canEvaluate ? true : false;
-      state.examSongId = data.id + "";
-      state.examSongName = data.musicSheetName;
-      // 解析扩展字段
-      if (data.extConfigJson) {
-        try {
-          state.extConfigJson = JSON.parse(data.extConfigJson as string);
-        } catch (error) {
-          console.error("解析扩展字段错误:", error);
-        }
-      }
-      state.isOpenMetronome = data.mp3Type === "MP3_METRONOME" ? true : false;
-      state.needTick = data.isOpenMetronome;
-      state.isShowFingering = data.showFingering ? true : false;
-      state.music = data.audioFileUrl;
-      state.accompany = data.metronomeUrl || data.metronomeUrl;
-      state.midiUrl = data.midiUrl;
-      state.parentCategoriesId = data.musicTag;
-      state.playMode = data.audioType === "MP3" ? "MP3" : "MIDI";
-      state.originSpeed = state.speed = data.speed;
-      // console.log('速度',10,state.speed)
-      state.track = data.track;
-      state.enableNotation = data.notation ? true : false;
 
-      // 映射声部ID
-      state.subjectId = mappingVoicePart(state.subjectId as any, "ORCHESTRA");
-      // console.log("🚀 ~ state.subjectId:", state.subjectId);
-      // 是否打击乐
-      state.isPercussion = state.subjectId == 23 || state.subjectId == 113 || state.subjectId == 121 || isRhythmicExercises();
-
-      // 设置指法
-      state.fingeringInfo = subjectFingering(state.subjectId);
-      // console.log("🚀 ~ state.fingeringInfo:", state.fingeringInfo, state.subjectId, state.track)
-      // state.isOpenPrepare = true
-    };
-
-    const setCustom = () => {
-      if (state.extConfigJson.multitrack) {
-        setGlobalData("multitrack", state.extConfigJson.multitrack);
-      }
-    };
 
     onMounted(async () => {
       state.isEvaluatReport = true;
@@ -197,6 +135,8 @@ export default defineComponent({
       // 评测报告展示什么类型的谱面
       state.isSingleLine = false;
       scoreData.musicType = query.musicRenderType ? query.musicRenderType : resultData.musicType ? resultData.musicType : state.musicRenderType;
+      // 如果是打击乐,只显示节奏一栏,itemType需要修改为'cadence'
+      scoreData.itemType = state.isPercussion ? 'cadence' : 'intonation';
       // @ts-ignore
       state.musicRenderType = scoreData.musicType;
       detailData.isLoading = false;
@@ -276,7 +216,7 @@ export default defineComponent({
           active = allNote.value.find((item: any) => item.i === idx)
         }        
         setTimeout(() => {
-          if (useedid.value.includes(active.id)) {
+          if ( !active || useedid.value.includes(active.id) ) {
             return;
           }
           useedid.value.push(active.id);