|
@@ -5,7 +5,9 @@
|
|
<div class="bottomList">
|
|
<div class="bottomList">
|
|
<n-space>
|
|
<n-space>
|
|
<n-button type="primary" @click="handleAddTTS"> 音转文</n-button>
|
|
<n-button type="primary" @click="handleAddTTS"> 音转文</n-button>
|
|
- <n-button type="primary"> 文转音</n-button>
|
|
|
|
|
|
+ <n-button type="primary" @click="showSTTModel.show = true">
|
|
|
|
+ 文转音
|
|
|
|
+ </n-button>
|
|
</n-space>
|
|
</n-space>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -21,19 +23,26 @@
|
|
:show="showTTSModel.show"
|
|
:show="showTTSModel.show"
|
|
@close="showTTSModel.show = false"
|
|
@close="showTTSModel.show = false"
|
|
></TtsModel>
|
|
></TtsModel>
|
|
|
|
+
|
|
|
|
+ <SttModel
|
|
|
|
+ :show="showSTTModel.show"
|
|
|
|
+ @close="showSTTModel.show = false"
|
|
|
|
+ ></SttModel>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import { h, reactive, onMounted, watchEffect, ref } from 'vue'
|
|
import { h, reactive, onMounted, watchEffect, ref } from 'vue'
|
|
-import { NButton, NTooltip } from 'naive-ui'
|
|
|
|
-import { fetchTtsList } from '@/api'
|
|
|
|
|
|
+import { NButton, NTooltip, useDialog } from 'naive-ui'
|
|
|
|
+import { fetchTtsList, deleteTTS } from '@/api'
|
|
import { useMainStore } from '@/store'
|
|
import { useMainStore } from '@/store'
|
|
import type { TTSItem } from './type'
|
|
import type { TTSItem } from './type'
|
|
import TtsModel from './ttsModel.vue'
|
|
import TtsModel from './ttsModel.vue'
|
|
|
|
+import SttModel from './sttModel.vue'
|
|
|
|
|
|
defineProps<{ msg: string }>()
|
|
defineProps<{ msg: string }>()
|
|
|
|
|
|
|
|
+const dialog = useDialog()
|
|
const main = useMainStore()
|
|
const main = useMainStore()
|
|
|
|
|
|
const data = ref<TTSItem[]>([])
|
|
const data = ref<TTSItem[]>([])
|
|
@@ -43,7 +52,11 @@ const showTTSModel = ref({
|
|
isEditing: false,
|
|
isEditing: false,
|
|
data: {}
|
|
data: {}
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+const showSTTModel = ref({
|
|
|
|
+ show: false,
|
|
|
|
+ isEditing: false,
|
|
|
|
+ data: {}
|
|
|
|
+})
|
|
const paginationReactive = reactive({
|
|
const paginationReactive = reactive({
|
|
page: 1,
|
|
page: 1,
|
|
pageSize: 5,
|
|
pageSize: 5,
|
|
@@ -151,6 +164,7 @@ const columns = [
|
|
style: { marginLeft: '2px' },
|
|
style: { marginLeft: '2px' },
|
|
onClick: () => {
|
|
onClick: () => {
|
|
// _doDelete(row.id)
|
|
// _doDelete(row.id)
|
|
|
|
+ handleDelTTS(row.id)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -165,6 +179,21 @@ const columns = [
|
|
const handleAddTTS = () => {
|
|
const handleAddTTS = () => {
|
|
showTTSModel.value.show = true
|
|
showTTSModel.value.show = true
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+const handleDelTTS = (id: number) => {
|
|
|
|
+ console.log('handleDelTTS', id)
|
|
|
|
+
|
|
|
|
+ dialog.warning({
|
|
|
|
+ title: '删除',
|
|
|
|
+ content: '是否确定删除?',
|
|
|
|
+ negativeText: '取消',
|
|
|
|
+ positiveText: '确认',
|
|
|
|
+ onPositiveClick: async () => {
|
|
|
|
+ // await deleteTTS()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
const openEdit = () => {}
|
|
const openEdit = () => {}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
@@ -184,5 +213,5 @@ code
|
|
|
|
|
|
.textToaudio
|
|
.textToaudio
|
|
min-height: 100%
|
|
min-height: 100%
|
|
- border-left: 1px solid
|
|
|
|
|
|
+ //border-left: 1px solid
|
|
</style>
|
|
</style>
|