刘洋 6 сар өмнө
parent
commit
5ffaa94810

+ 8 - 3
src/components/vEditor/components/TtsDialog.vue

@@ -72,12 +72,17 @@ export default {
       this.status = obj.status;
       this.statusStr = obj.statusStr;
     },
-    initData() {},
+    initData() {
+      this.text = ``;
+      this.status = "UNDEFINED";
+      this.statusStr = "立即合成";
+      this.blob = null;
+    },
     closed() {
-      this.ttsVoice.ttsWS?.close();
+      this.ttsVoice?.reset();
     },
     cancel() {
-      this.ttsVoice.ttsWS?.close();
+      this.ttsVoice?.reset();
       this.modalIsShow = false;
     },
     open() {

+ 6 - 0
src/plugins/tts/index.js

@@ -202,4 +202,10 @@ export default class TtsVoice {
     node.click();
     node.remove();
   }
+  reset() {
+    this.ttsWS?.close();
+    this.text = "";
+    this.blob = "";
+    this.changeBtnStatus("UNDEFINED");
+  }
 }