Browse Source

feat: 选段播放逻辑修改

TIANYONG 1 year ago
parent
commit
a9128bf3bb
3 changed files with 6 additions and 5 deletions
  1. 1 1
      src/helpers/formateMusic.ts
  2. 3 2
      src/state.ts
  3. 2 2
      vite.config.ts

+ 1 - 1
src/helpers/formateMusic.ts

@@ -1051,7 +1051,7 @@ export const getNoteByMeasuresSlursStart = (note: any) => {
 			}
 		}
 		if (arr.length) {
-			return arr.find((n: any) => n.i === (note.i - 1))
+			return arr.find((n: any) => n.i === (note.i - 1)) || arr[0]
 		}
 	}
 	return activeNote;

+ 3 - 2
src/state.ts

@@ -638,7 +638,8 @@ export const handleSelection = (item: any) => {
   if (state.section.length !== 2 && item) {
     state.section.push(item);
     if (state.section.length === 2) {
-      state.section = formateSelectMearure(state.section);
+      setSection(state.section[0].MeasureNumberXML,state.section[1].MeasureNumberXML)
+      //state.section = formateSelectMearure(state.section);
       closeToast();
     }
   }
@@ -702,7 +703,7 @@ export const hanldeDirectSelection = (list: any[]) => {
   state.sectionStatus = true;
   setTimeout(() => {
     state.section = formateSelectMearure(list);
-    console.log(333333333,state.section)
+    //console.log(333333333,state.section)
   }, 500);
 };
 let offsetTop = 0;

+ 2 - 2
vite.config.ts

@@ -68,8 +68,8 @@ export default defineConfig({
 				// target: "https://test.lexiaoya.cn",
 				// target: "https://dev.kt.colexiu.com",
 				// target: "https://dev.resource.colexiu.com", // 内容平台开发环境
-				// target: "https://test.resource.colexiu.com",
-				target: "https://test.kt.colexiu.com",
+				target: "https://test.resource.colexiu.com",
+				// target: "https://test.kt.colexiu.com",
 				changeOrigin: true,
 				rewrite: (path) => path.replace(/^\/instrument/, ""),
 			},