|
@@ -1,6 +1,7 @@
|
|
<script setup>
|
|
<script setup>
|
|
import { ElMessage } from 'element-plus'
|
|
import { ElMessage } from 'element-plus'
|
|
import { workbenchApi } from '@/api/voice/workbench';
|
|
import { workbenchApi } from '@/api/voice/workbench';
|
|
|
|
+import { watchEffect } from 'vue';
|
|
|
|
|
|
const emit = defineEmits(['onParsed']);
|
|
const emit = defineEmits(['onParsed']);
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
@@ -20,8 +21,15 @@ const isExpandStatus = ref({});
|
|
|
|
|
|
const loading = computed(() => loadingStatus.value['loading' + props.id]);
|
|
const loading = computed(() => loadingStatus.value['loading' + props.id]);
|
|
|
|
|
|
-watch(() => props.id, () => {
|
|
|
|
- parsedVoiceList.value = props.content? JSON.parse(props.content) : [];
|
|
|
|
|
|
+// watch(() => props.id, () => {
|
|
|
|
+// parsedVoiceList.value = props.content ? JSON.parse(props.content) : [];
|
|
|
|
+// Object.keys(isExpandStatus.value).forEach(key => {
|
|
|
|
+// isExpandStatus.value[key] = false;
|
|
|
|
+// })
|
|
|
|
+// })
|
|
|
|
+
|
|
|
|
+watchEffect(() => {
|
|
|
|
+ parsedVoiceList.value = props.content ? JSON.parse(props.content) : [];
|
|
Object.keys(isExpandStatus.value).forEach(key => {
|
|
Object.keys(isExpandStatus.value).forEach(key => {
|
|
isExpandStatus.value[key] = false;
|
|
isExpandStatus.value[key] = false;
|
|
})
|
|
})
|
|
@@ -62,13 +70,16 @@ const handleTransformVoiceToText = async () => {
|
|
<slot></slot>
|
|
<slot></slot>
|
|
<span
|
|
<span
|
|
class="text-[#165DFF] text-[12px] cursor-pointer"
|
|
class="text-[#165DFF] text-[12px] cursor-pointer"
|
|
- @click="handleTransformVoiceToText">{{ isExpandStatus['id' + id] ? '收起文字' : '转文字'}}
|
|
|
|
|
|
+ @click="handleTransformVoiceToText"
|
|
|
|
+ v-if="!content"
|
|
|
|
+ >{{ isExpandStatus['id' + id] ? '收起文字' : '转文字'}}
|
|
</span>
|
|
</span>
|
|
<el-icon class="is-loading" v-show="loading">
|
|
<el-icon class="is-loading" v-show="loading">
|
|
<Loading />
|
|
<Loading />
|
|
</el-icon>
|
|
</el-icon>
|
|
</div>
|
|
</div>
|
|
- <ul class="record-play-content" v-show="isExpandStatus['id' + id]">
|
|
|
|
|
|
+ <!-- v-show="isExpandStatus['id' + id]" -->
|
|
|
|
+ <ul class="record-play-content" >
|
|
<li v-for="item, index in parsedVoiceList" :key="index">
|
|
<li v-for="item, index in parsedVoiceList" :key="index">
|
|
<span>
|
|
<span>
|
|
{{ item.Text }}
|
|
{{ item.Text }}
|