ui库和web端产品库合并版本(还需修复细节)

This commit is contained in:
2022-11-29 18:27:14 +08:00
parent 5e4bd93238
commit 8bf6c57668
151 changed files with 28267 additions and 49 deletions

View File

@@ -0,0 +1,44 @@
<template>
<el-row type="flex" align="middle">
<el-button type="text" size="small" :loading="loading" icon="iconfont iconClock" title="语音播报"
@click="getSpeechByContent"/>
<ai-audio v-if="speech" :src="speech" skin="flat"/>
</el-row>
</template>
<script>
export default {
name: "AiTransSpeech",
props: {
instance: {type: Function, required: true},
content: String
},
data() {
return {
speech: "",
loading: false
}
},
methods: {
getSpeechByContent() {
this.loading = true
this.instance.post("/app/msc/transToSpeech", null, {
params: {
fileName: "demo",
words: this.content
}
}).then(res => {
this.loading = false
if (res && res.data) {
let url = res.data.join("")
this.speech = url.substring(0, url.indexOf(";"))
}
}).catch(() => this.loading = false)
}
}
}
</script>
<style lang="scss" scoped>
</style>