瀏覽代碼

fix: 延迟检测资源加载优化后,评测作业流程修改

TIANYONG 1 年之前
父節點
當前提交
6e314225af

+ 1 - 1
osmd-extended

@@ -1 +1 @@
-Subproject commit c93a4a7073b15fdad930909dc2cfd87f0f5eab04
+Subproject commit 6967750d4de04e03f3abb9753b4bca0cbaae83a9

+ 11 - 1
src/page-instrument/custom-plugins/work-index/index.tsx

@@ -1,9 +1,10 @@
-import { defineComponent, onMounted, reactive, ref } from "vue";
+import { defineComponent, onMounted, reactive, ref, watch } from "vue";
 import WorkHome from "../work-home";
 import WorkEaluating from "../work-ealuating";
 import { getQuery } from "/src/utils/queryString";
 import { api_lessonTrainingTrainingStudentDetail } from "../../api";
 import { headTopData } from "../../header-top";
+import { evaluatingData } from "/src/view/evaluating";
 
 const workHomeRef = ref();
 
@@ -37,6 +38,15 @@ export default defineComponent({
 				setModelType();
 			}
 		};
+		// 评测作业监听评测资源加载完成
+		watch(
+			() => evaluatingData.jsonLoadDone,
+			() => {
+				if (data.trainingType === "EVALUATION" && evaluatingData.jsonLoading && evaluatingData.jsonLoadDone) {
+					headTopData.handleChangeModeType('evaluating');
+				}
+			}
+		);
 		onMounted(() => {
 			getWorkDetail();
 		});

+ 1 - 0
src/page-instrument/header-top/index.tsx

@@ -49,6 +49,7 @@ export const headTopData = reactive({
     if (value === "evaluating") {
       // 如果延迟检测资源还在加载中,给出提示
       if (!evaluatingData.jsonLoadDone) {
+        evaluatingData.jsonLoading = true
         showToast('资源加载中,请稍后')
         return
       }

+ 4 - 3
src/page-instrument/view-detail/index.module.less

@@ -11,9 +11,9 @@
 }
 
 .detail {
-    width: 100vw;
+    // width: 100vw;
     height: 100vh;
-    overflow: hidden;
+    // overflow: hidden;
     --header-height: 62px;
     background: var(--container-background);
 
@@ -37,7 +37,8 @@
         border-radius: 10px;
         transition: height .2s;
         transition: padding-bottom .2s;
-        overflow: hidden;
+        // overflow: hidden;
+        overflow-x: scroll;
     }
 }
 

+ 1 - 1
src/page-instrument/view-detail/index.tsx

@@ -53,7 +53,7 @@ const resetFrequency = (list: any[]) => {
   // const instrumentNames = ["ocarina", "pan-flute", "piccolo", "hulusi-flute"];
   const instrumentNames = ["ocarina", "pan-flute", "hulusi-flute"];
   if (!state.fingeringInfo?.name || !instrumentNames.includes(state.fingeringInfo.name)) return list;
-  console.log(state.subjectId, state.fingeringInfo.name, instrumentNames);
+  // console.log(state.subjectId, state.fingeringInfo.name, instrumentNames);
   for (let i = 0; i < list.length; i++) {
     if (list[i].prevFrequency) list[i].prevFrequency = calcCeilFrequency(list[i].prevFrequency);
     if (list[i].frequency) list[i].frequency = calcCeilFrequency(list[i].frequency);

+ 2 - 1
src/view/evaluating/index.tsx

@@ -105,7 +105,8 @@ export const evaluatingData = reactive({
 	/** app播放结束状态,重新评测需要重置为 */
 	isAudioPlayEnd: false,
 	preloadJson: true, // 预加载延迟检测的资源
-	jsonLoadDone: false, // 延迟检测的动画dom加载完成
+	jsonLoading: false, // 延迟检测的资源加载中状态
+	jsonLoadDone: false, // 延迟检测的动画dom加载完成状态
 });
 
 const sendOffsetTime = async (offsetTime: number) => {

+ 3 - 2
src/view/music-score/index.module.less

@@ -1,8 +1,9 @@
 :global {
     #musicAndSelection {
         position: relative;
-        overflow-x: hidden;
+        //overflow-x: hidden;
         overflow-y: auto;
+        overflow-x: scroll;
         height: 100%;
         max-height: 100vh;
         transform: translateY(-5%);
@@ -15,7 +16,7 @@
             transform-origin: left top;
         }
         svg{
-            overflow: visible;
+            // overflow: visible;
         }
         #osmdCanvasPage1{
             position: absolute !important;

+ 2 - 0
src/view/music-score/index.tsx

@@ -102,6 +102,8 @@ export default defineComponent({
 				drawPartNames: props.showPartNames, // 是否渲染声轨名称
 				drawComposer: false, // 渲染作者
 				defaultColorMusic: props.musicColor, // 颜色
+				//renderSingleHorizontalStaffline: true,
+				// pageFormat: 'A4_P',
 				// autoBeam: true,
 				// drawMetronomeMarks: false,
 				// drawLyricist: false,