Kaynağa Gözat

增加生成音频限制

秦鹏 3 yıl önce
ebeveyn
işleme
4ef62b4813

+ 5 - 1
src/components/Adult/inputModules/ArticleTemChs/index.vue

@@ -266,6 +266,10 @@ export default {
     // 根据文章生成MP3
     CreadMp3() {
       let _this = this;
+      if (_this.curQue.mp3_list.length > 0) {
+        _this.$message.warning("已有音频,请勿重复生成");
+        return;
+      }
       if (!_this.curQue.article) {
         _this.$message.warning("请先输入内容,在生成音频");
         return;
@@ -276,11 +280,11 @@ export default {
       }).then((res) => {
         res.data.fileInfo.id = res.data.fileInfo.file_id;
         res.data.fileInfo.name = res.data.fileInfo.file_name;
-
         let fileList = [res.data.fileInfo];
         //this.$set(this.curQue, "mp3_file_base64", res.data.fileBase64);
         _this.$set(_this.curQue, "mp3_list", fileList);
         _this.CreadMp3loading = false;
+        _this.$message.success("生成成功");
       });
     },
     // 保存校对

+ 7 - 1
src/components/Adult/inputModules/DialogueArticleChs/index.vue

@@ -230,6 +230,7 @@ import {
   getWordTime,
   compareSenTenceTime,
   getContentFile,
+  textCreadMp3,
 } from "@/api/ajax";
 const Base64 = require("js-base64").Base64;
 import Upload from "../../common/Upload.vue";
@@ -319,6 +320,7 @@ export default {
       compareShow: false,
       compareData: null,
       compareloading: false,
+      CreadMp3loading: false,
     };
   },
   computed: {},
@@ -361,6 +363,10 @@ export default {
     // 根据文章生成MP3
     CreadMp3() {
       let _this = this;
+      if (_this.curQue.mp3_list.length > 0) {
+        _this.$message.warning("已有音频,请勿重复生成");
+        return;
+      }
       if (!_this.curQue.article) {
         _this.$message.warning("请先输入内容,在生成音频");
         return;
@@ -371,11 +377,11 @@ export default {
       }).then((res) => {
         res.data.fileInfo.id = res.data.fileInfo.file_id;
         res.data.fileInfo.name = res.data.fileInfo.file_name;
-
         let fileList = [res.data.fileInfo];
         //this.$set(this.curQue, "mp3_file_base64", res.data.fileBase64);
         _this.$set(_this.curQue, "mp3_list", fileList);
         _this.CreadMp3loading = false;
+        _this.$message.success("生成成功");
       });
     },
     // 保存校对