瀏覽代碼

关键词修改

wolyshaw 2 年之前
父節點
當前提交
61b1940922
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/views/accompaniment/modals/form.vue

+ 3 - 2
src/views/accompaniment/modals/form.vue

@@ -967,9 +967,10 @@ export function getGradualLengthByXml(xml) {
         isLastNoteAndNotClosed = true;
       }
     }
+    const isKeyWork = keys.find(k => k.startsWith(textContent) || textContent?.startsWith(k))
     if (
       ele.type === "metronome" ||
-      (ele.type === "words" && (textContent.startsWith("a tempo") || keys.includes(textContent)) || isLastNoteAndNotClosed)
+      (ele.type === "words" && (textContent.startsWith("a tempo") || isKeyWork) || isLastNoteAndNotClosed)
     ) {
       const indexOf = gradualNotes.findIndex((item) => item.length === 1);
       if (indexOf > -1 && ele.index > gradualNotes[indexOf]?.[0].start) {
@@ -983,7 +984,7 @@ export function getGradualLengthByXml(xml) {
         };
       }
     }
-    if (ele.type === "words" && keys.includes(textContent)) {
+    if (ele.type === "words" && isKeyWork) {
       gradualNotes.push([
         {
           start: ele.index,