Browse Source

Merge branch 'feature-tianyong-newVersion' into ktyq-online-new

TIANYONG 6 months ago
parent
commit
26fd368fa3
3 changed files with 6 additions and 6 deletions
  1. 2 2
      src/helpers/calcSpeed.ts
  2. 3 3
      src/helpers/formateMusic.ts
  3. 1 1
      vite.config.ts

+ 2 - 2
src/helpers/calcSpeed.ts

@@ -160,13 +160,13 @@ export const getGradualLengthByXml = (xml: string) => {
 	// 结尾处手动插入一个音符节点
 	eles.push({
 		ele: notes[notes.length - 1],
-		index: notes.length-1,
+		index: notes.length,
 		noteInMeasureIndex: 0,
 		textContent: "",
 		type: "metronome",
 		allDuration: 1,
 		leftDuration: 0,
-		measureIndex: measures.length-1,
+		measureIndex: measures.length,
 	});
 
 	const gradualNotes: GradualNote[] = [];

+ 3 - 3
src/helpers/formateMusic.ts

@@ -1121,8 +1121,8 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 					// 范围内小节
 					const inFiestOrLastMeasure = first.closedMeasureIndex !== measureListIndex && last.closedMeasureIndex !== measureListIndex;
 					if (inTheFirstMeasure || inTheLastMeasure || inFiestOrLastMeasure) {
-						const startTime = state.gradualTimes[first.measureIndex+1];
-						const endTime = state.gradualTimes[last.measureIndex+1];
+						const startTime = state.gradualTimes[first.measureIndex];
+						const endTime = state.gradualTimes[last.measureIndex];
 						if (startTime && endTime) {
 							const times = continuous - first.leftDuration / first.allDuration + last.leftDuration / last.allDuration;
 							const diff = dayjs(tranTime(endTime)).diff(dayjs(tranTime(startTime)), "millisecond");
@@ -1260,7 +1260,7 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 			 */
 			if (state.isEvxml && note.isRestFlag && note?.noteTimeInfo?.length === 0 && state.xmlHasTimes ) {
 				const idx = _notes.findIndex(item=>item.note === note);
-				const allowRange = Math.abs(_notes[idx+1]?.note?.noteTimeInfo?.[0]?.begin - _notes[idx-1]?.note?.noteTimeInfo?.[0]?.end) < 10;
+				const allowRange = Math.abs(_notes[idx+1]?.note?.noteTimeInfo?.[0]?.begin*1000 - _notes[idx-1]?.note?.noteTimeInfo?.[0]?.end*1000) < 10;
 				if (allowRange) {
 					note.maxNoteNum = note.maxNoteNum - 1;
 					// 唱名时间补齐,当删除这个音符的时候,上个音符的持续时间要加上这个音符的时间

+ 1 - 1
vite.config.ts

@@ -76,7 +76,7 @@ export default defineConfig({
         // target: "https://kt.colexiu.com",
         // target: "https://test.lexiaoya.cn",
         // target: "https://kt.colexiu.com",
-        target: "https://test.resource.colexiu.com", // 内容平台开发环境,内容平台开发,需在url链接上加上isCbs=true
+        target: "https://dev.resource.colexiu.com", // 内容平台开发环境,内容平台开发,需在url链接上加上isCbs=true
         // target: "https://test.kt.colexiu.com",
         // target: "https://mec.colexiu.com",
         changeOrigin: true,