Przeglądaj źródła

Merge branch 'iteration-20231220'

lex 1 rok temu
rodzic
commit
3cacb7d975

+ 17 - 15
src/pc/component/upload-to-resources/index.tsx

@@ -208,26 +208,28 @@ export default defineComponent({
           handleClose();
           return;
         }
-        // 判断是否有wav文件,如果没有则生成保存
-        if (!props.item.filePath) {
-          const url = await productWav(false);
-          props.item.filePath = url;
-        }
-        if (!props.item.filePath) {
-          message.error("没有生成wav文件");
-          handleClose();
-          return;
-        }
+
+        // if (!props.item.filePath) {
+        //   message.error("没有生成wav文件");
+        //   handleClose();
+        //   return;
+        // }
         model.saveLoading = true;
         handleAutoProduct();
       });
     };
     const handleSubmit = async () => {
-      await api_musicSheetCreationUpdate({
-        id: props.item.id,
-        subjectId: froms.subjectId,
-        filePath: props.item.filePath,
-      });
+      // 判断是否有wav文件,如果没有则生成保存
+      if (!props.item.filePath) {
+        const url = await productWav(false);
+        props.item.filePath = url;
+        await api_musicSheetCreationUpdate({
+          id: props.item.id,
+          subjectId: froms.subjectId,
+          filePath: props.item.filePath,
+        });
+      }
+
       await wav2mp3();
       model.saveProgress = 70;
       if (!props.show) return;

+ 2 - 2
src/pc/home/index.tsx

@@ -109,7 +109,7 @@ export default defineComponent({
       drawCount: 0,
       isSave: true,
       musicId: Date.now().toString(),
-      musicName: "", // 曲谱名称
+      musicName: "" as any, // 曲谱名称
       creator: "", // 创建者
       subjectId: "", // 声部
       speed: "",
@@ -1504,7 +1504,7 @@ export default defineComponent({
           console.log("🚀 ~ parseData:", parseData);
           abcData.abc = formateAbc(parseData[0], { subjectCode: abcData.abc.subjectCode });
           console.log(abcData.abc, "12");
-          data.musicName = abcData.abc.title || data.musicName;
+          data.musicName = data.musicName || abcData.abc.title;
           data.creator = abcData.abc.creator || data.creator;
           await handleResetRender();
         }