TIANYONG 11 месяцев назад
Родитель
Сommit
20e0afb6a0

+ 3 - 1
src/page-instrument/evaluat-model/evaluat-result/index.tsx

@@ -48,6 +48,8 @@ export default defineComponent({
       console.log("结束", evaluatingData.resultData);
       /** 生成评测记录的时候,记录当前评测的谱面类型,用于评测报告默认展示的谱面类型 */
       evaluatingData.resultData.scoreData.musicType = state.musicRenderType;
+      // 评测的速度,如果是选段,则选选段开头小节的速度
+      const evaluatSpeed = state.sectionStatus && state.section.length === 2 && state.section[0].measureSpeed ? state.section[0].measureSpeed * state.basePlayRate : state.speed;      
       const body = {
         deviceType: browser().android ? "ANDROID" : "IOS", // 设备类型
         intonation: evaluatingData.resultData.intonation, // 音准
@@ -57,7 +59,7 @@ export default defineComponent({
         behaviorId: getBehaviorId(), // 行为id
         sourceTime: getAudioDuration(), // 音频时长
         partIndex: state.partIndex, // 音轨
-        speed: state.speed, // 速度
+        speed: evaluatSpeed, // 速度
         practiceSource: query.workRecord ? "LESSON_TRAINING" : "EVALUATION", // 练习来源
         score: evaluatingData.resultData.score, // 分数
         clientType: storeData.user.clientType, // 客户端类型

+ 13 - 3
src/page-instrument/evaluat-model/index.tsx

@@ -266,6 +266,8 @@ export default defineComponent({
       // rate = parseFloat(rate.toFixed(2));
       console.log("速度比例", rate, "速度", state.speed);
       calculateInfo = formatTimes();
+      // 评测的速度,如果是选段,则选选段开头小节的速度
+      const evaluatSpeed = state.sectionStatus && state.section.length === 2 && state.section[0].measureSpeed ? state.section[0].measureSpeed * state.basePlayRate : state.speed;
       const content = {
         musicXmlInfos: calculateInfo.datas,
         subjectId: state.musicalCode,
@@ -278,7 +280,7 @@ export default defineComponent({
         clientId: storeData.platformType === "STUDENT" ? "student" : storeData.platformType === "TEACHER" ? "teacher" : "education",
         hertz: state.setting.frequency,
         reactionTimeMs: state.setting.reactionTimeMs ? Number(state.setting.reactionTimeMs) : 0,
-        speed: state.speed,
+        speed: evaluatSpeed,
         heardLevel: state.setting.evaluationDifficulty,
         // beatLength: Math.round((state.fixtime * 1000) / rate),
         beatLength: actualBeatLength,
@@ -482,12 +484,20 @@ export default defineComponent({
             <>
               <img class={styles.iconBtn} src={headImg("icon_reset.png")} onClick={() => {
                 // 校验评测最小间隔时间
-                checkMinInterval()
+                const currentTime = +new Date();
+                // 开始评测和结束评测的间隔时间小于800毫秒,则不处理
+                if (currentTime - evaluatingData.recordingTime < 800) {
+                  return;
+                }
                 handleEvaluatResult("selfCancel")
               }} />
               <img class={styles.iconBtn} src={headImg("submit.png")} onClick={() => {
                 // 校验评测最小间隔时间
-                checkMinInterval()
+                const currentTime = +new Date();
+                // 开始评测和结束评测的间隔时间小于800毫秒,则不处理
+                if (currentTime - evaluatingData.recordingTime < 800) {
+                  return;
+                }
                 handleEndBegin()
               }} />
             </>

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

@@ -163,6 +163,7 @@ export default defineComponent({
     };
 
     onMounted(async () => {
+      state.isEvaluatReport = true;
       const res = await api_musicPracticeRecordDetail(query.id);
       state.partIndex = Number(res?.data?.partIndex);
       let resultData = {} as any;
@@ -184,7 +185,6 @@ export default defineComponent({
       scoreData.intonation = res.data?.intonation;
       scoreData.score = res.data?.score;
       scoreData.videoFilePath = res.data?.videoFilePath || res.data?.recordFilePath;
-      state.isEvaluatReport = true;
       await getMusicDetail(resultData.musicalNotesPlayStats?.examSongId);
       // 从练习记录进入评测报告,默认显示五线谱
       // if (!query.musicRenderType) {
@@ -193,6 +193,8 @@ export default defineComponent({
       // 评测报告展示什么类型的谱面
       state.isSingleLine = false;
       scoreData.musicType = query.musicRenderType ? query.musicRenderType : resultData.musicType ? resultData.musicType : state.musicRenderType;
+      // @ts-ignore
+      state.musicRenderType = scoreData.musicType;
       detailData.isLoading = false;
       // Promise.all([
       // 	getMusicSheetDetail(resultData.musicalNotesPlayStats?.examSongId),

+ 4 - 0
src/state.ts

@@ -1545,6 +1545,9 @@ const setState = (data: any, index: number) => {
    * STAVE("五线谱"),JIAN("固定调"),FIRST("首调"),
    */
   musicalRenderType = data.scoreType === 'STAVE' ? 'staff' : data.scoreType === 'JIAN' ? 'fixedTone' : data.scoreType === 'FIRST' ? '' : 'firstTone';
+  if (!state.isEvaluatReport) {
+    state.musicRenderType = query.musicRenderType || musicalRenderType || EnumMusicRenderType.firstTone;  
+  }
   state.musicRenderType = query.musicRenderType || musicalRenderType || EnumMusicRenderType.firstTone;  
   /**
    * TODO:摇篮曲特殊处理
@@ -1858,6 +1861,7 @@ watch(
 
 /** 刷新谱面 */
 export const refreshMusicSvg = () => {
+  clearSelection();
   resetBaseRate();
   state.activeMeasureIndex = -1;
   // 销毁旋律线

+ 1 - 1
src/view/follow-practice/index.tsx

@@ -145,7 +145,7 @@ const clearRightNoteColor = () => {
 	const leftVal = document.getElementById(`vf-${noteId}`)?.getBoundingClientRect()?.left || 0;
 	state.times.forEach((item: any) => {
 		const note: HTMLElement = document.getElementById(`vf-${item.id}`)!;
-		if (note?.getBoundingClientRect()?.left > leftVal) {
+		if (note?.getBoundingClientRect()?.left >= leftVal) {
 			note.classList.remove("follow-up", "follow-down", "follow-error", "follow-success");
 		}
 	});