Prechádzať zdrojové kódy

feat: 解决,系统管理,语音管理,翻页面,回到之前界面数据不刷新

332777428@qq.com 1 mesiac pred
rodič
commit
ab6d565694
1 zmenil súbory, kde vykonal 42 pridanie a 29 odobranie
  1. 42 29
      src/views/system/tts/index.vue

+ 42 - 29
src/views/system/tts/index.vue

@@ -1,3 +1,5 @@
+<!-- 系统管理 语音管理 -->
+
 <template>
   <div class="app-container">
     <el-row :gutter="20">
@@ -11,7 +13,7 @@
               size="mini"
               @click="handleAdd"
               v-hasPermi="['system:tts:add']"
-            >新增
+              >新增
             </el-button>
           </el-col>
         </el-row>
@@ -22,7 +24,11 @@
     <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="文本" prop="text">
-          <el-input v-model="form.text" placeholder="请输入语音文本" maxlength="200"/>
+          <el-input
+            v-model="form.text"
+            placeholder="请输入语音文本"
+            maxlength="200"
+          />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -34,59 +40,66 @@
 </template>
 
 <script>
-
 export default {
+  name:"SystemTTS",
   data() {
     return {
-      title: '转换语音',
+      title: "转换语音",
       // 遮罩层
       loading: true,
       // 是否显示弹出层
       open: false,
       // 表单参数
       form: {
-        text: ''
+        text: "",
       },
       // 表单校验
       rules: {
         text: [
-          { required: true, message: '语音文本不能为空', trigger: 'blur' },
-          { min: 1, max: 200, message: '语音文本长度必须介于 1 和 200 之间', trigger: 'blur' }
-        ]
-      }
-    }
-  },
-  created() {
+          { required: true, message: "语音文本不能为空", trigger: "blur" },
+          {
+            min: 1,
+            max: 200,
+            message: "语音文本长度必须介于 1 和 200 之间",
+            trigger: "blur",
+          },
+        ],
+      },
+    };
   },
+  created() {},
   methods: {
     // 取消按钮
     cancel() {
-      this.open = false
-      this.reset()
+      this.open = false;
+      this.reset();
     },
     // 表单重置
     reset() {
       this.form = {
-        text: ''
-      }
-      this.resetForm('form')
+        text: "",
+      };
+      this.resetForm("form");
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.reset()
-      this.open = true
-      this.title = '转换语音'
+      this.reset();
+      this.open = true;
+      this.title = "转换语音";
     },
     /** 提交按钮 */
-    submitForm: function() {
-      this.$refs['form'].validate(valid => {
+    submitForm: function () {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
-          console.log(this.form)
-          this.open = false
-          this.$download.zip('/system/tts/getAudio?text=' + this.form.text, 'ruoyi')
+          console.log(this.form);
+          this.open = false;
+          this.$download.zip(
+            "/system/tts/getAudio?text=" + this.form.text,
+            "ruoyi"
+          );
         }
-      })
-    }
-  }
-}
+      });
+    },
+  },
+};
 </script>