更新开发环境API服务地址,将主服务和新功能服务的IP地址从内网地址改为公网地址116.204.74.41,在音频资产管理中新增文本转语音功能按钮和对话框组件,在知识库文件管理中将文件名改为可点击链接支持跳转到文档详情页面
This commit is contained in:
@@ -32,6 +32,10 @@
|
||||
<el-icon><ele-Plus /></el-icon>
|
||||
上传音频
|
||||
</el-button>
|
||||
<el-button type="warning" @click="handleTts">
|
||||
<el-icon><ele-Microphone /></el-icon>
|
||||
文本转语音
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -114,12 +118,16 @@
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 文本转语音弹窗 -->
|
||||
<TtsDialog ref="ttsDialogRef" @success="handleTtsSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, onUnmounted } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import TtsDialog from './component/ttsDialog.vue';
|
||||
|
||||
interface AudioItem {
|
||||
id: number;
|
||||
@@ -305,10 +313,35 @@ const handleReset = () => {
|
||||
getList();
|
||||
};
|
||||
|
||||
const ttsDialogRef = ref<InstanceType<typeof TtsDialog>>();
|
||||
|
||||
const handleAdd = () => {
|
||||
ElMessage.info('上传音频功能开发中...');
|
||||
};
|
||||
|
||||
// 打开文本转语音弹窗
|
||||
const handleTts = () => {
|
||||
ttsDialogRef.value?.openDialog();
|
||||
};
|
||||
|
||||
// 文本转语音成功回调
|
||||
const handleTtsSuccess = (data: any) => {
|
||||
// 添加到列表
|
||||
const newItem: AudioItem = {
|
||||
id: Date.now(),
|
||||
name: data.name,
|
||||
voiceType: data.voiceType,
|
||||
duration: data.duration,
|
||||
fileSize: data.fileSize,
|
||||
sampleRate: data.sampleRate,
|
||||
audioUrl: '',
|
||||
status: 1,
|
||||
createdAt: new Date().toLocaleString('zh-CN', { hour12: false }).replace(/\//g, '-'),
|
||||
};
|
||||
mockData.unshift(newItem);
|
||||
getList();
|
||||
};
|
||||
|
||||
const handleEdit = (row: AudioItem) => {
|
||||
ElMessage.info(`编辑音频: ${row.name}`);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user