|
@@ -1,3 +1,5 @@
|
|
|
|
+<!-- 系统管理 语音管理 -->
|
|
|
|
+
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
@@ -11,7 +13,7 @@
|
|
size="mini"
|
|
size="mini"
|
|
@click="handleAdd"
|
|
@click="handleAdd"
|
|
v-hasPermi="['system:tts:add']"
|
|
v-hasPermi="['system:tts:add']"
|
|
- >新增
|
|
|
|
|
|
+ >新增
|
|
</el-button>
|
|
</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -22,7 +24,11 @@
|
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
|
<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 ref="form" :model="form" :rules="rules" label-width="80px">
|
|
<el-form-item label="文本" prop="text">
|
|
<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-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -34,59 +40,66 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-
|
|
|
|
export default {
|
|
export default {
|
|
|
|
+ name:"SystemTTS",
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- title: '转换语音',
|
|
|
|
|
|
+ title: "转换语音",
|
|
// 遮罩层
|
|
// 遮罩层
|
|
loading: true,
|
|
loading: true,
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
open: false,
|
|
open: false,
|
|
// 表单参数
|
|
// 表单参数
|
|
form: {
|
|
form: {
|
|
- text: ''
|
|
|
|
|
|
+ text: "",
|
|
},
|
|
},
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {
|
|
rules: {
|
|
text: [
|
|
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: {
|
|
methods: {
|
|
// 取消按钮
|
|
// 取消按钮
|
|
cancel() {
|
|
cancel() {
|
|
- this.open = false
|
|
|
|
- this.reset()
|
|
|
|
|
|
+ this.open = false;
|
|
|
|
+ this.reset();
|
|
},
|
|
},
|
|
// 表单重置
|
|
// 表单重置
|
|
reset() {
|
|
reset() {
|
|
this.form = {
|
|
this.form = {
|
|
- text: ''
|
|
|
|
- }
|
|
|
|
- this.resetForm('form')
|
|
|
|
|
|
+ text: "",
|
|
|
|
+ };
|
|
|
|
+ this.resetForm("form");
|
|
},
|
|
},
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
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) {
|
|
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>
|
|
</script>
|