|
@@ -32,12 +32,34 @@
|
|
|
maxlength="500"
|
|
|
show-count
|
|
|
clearable
|
|
|
- placeholder="基本的 Textarea"
|
|
|
+ placeholder="请输入"
|
|
|
style="flex: 1; min-height: 300px"
|
|
|
/>
|
|
|
</n-flex>
|
|
|
<n-flex style="flex: 1" vertical>
|
|
|
<div>选择人物</div>
|
|
|
+ <n-flex class="card-select" justify="center">
|
|
|
+ <template v-for="(card, index) in cardList" :key="index">
|
|
|
+ <n-card
|
|
|
+ style="flex: 1 1 48%"
|
|
|
+ class="card-item"
|
|
|
+ :class="{ active: activeType(card.type) }"
|
|
|
+ @click="handleCharterSelect(card)"
|
|
|
+ >
|
|
|
+ <n-flex style="flex: 1">
|
|
|
+ <n-avatar
|
|
|
+ round
|
|
|
+ size="small"
|
|
|
+ src="https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg"
|
|
|
+ />
|
|
|
+ <n-flex style="flex: 1" vertical>
|
|
|
+ <span> {{ card.name }}</span>
|
|
|
+ <span> {{ card.desc }}</span>
|
|
|
+ </n-flex>
|
|
|
+ </n-flex>
|
|
|
+ </n-card>
|
|
|
+ </template>
|
|
|
+ </n-flex>
|
|
|
<n-form
|
|
|
ref="formRef"
|
|
|
:model="form"
|
|
@@ -49,14 +71,23 @@
|
|
|
}"
|
|
|
>
|
|
|
<n-form-item label="语速" path="inputValue">
|
|
|
- <n-slider v-model:value="form.speed" :step="1" />
|
|
|
+ <n-slider
|
|
|
+ v-model:value="form.speed"
|
|
|
+ :step="0.1"
|
|
|
+ :min="0"
|
|
|
+ :max="2"
|
|
|
+ />
|
|
|
</n-form-item>
|
|
|
<n-form-item label="音量" path="inputValue">
|
|
|
- <n-slider v-model:value="form.volume" :step="1" />
|
|
|
+ <n-slider
|
|
|
+ v-model:value="form.volume"
|
|
|
+ :step="0.1"
|
|
|
+ :min="0"
|
|
|
+ :max="2"
|
|
|
+ />
|
|
|
</n-form-item>
|
|
|
</n-form>
|
|
|
|
|
|
-
|
|
|
<!-- <n-slider v-model:value="form.speed" :step="1" />-->
|
|
|
<!-- <n-slider v-model:value="form.volume" :step="1" />-->
|
|
|
</n-flex>
|
|
@@ -64,7 +95,7 @@
|
|
|
|
|
|
<template #footer>
|
|
|
<n-flex justify="end">
|
|
|
- <n-button>保存</n-button>
|
|
|
+ <n-button type="primary" @click="handleSave">保存</n-button>
|
|
|
</n-flex>
|
|
|
</template>
|
|
|
</n-card>
|
|
@@ -72,16 +103,19 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, reactive, watchEffect } from 'vue'
|
|
|
-import { NSlider, NForm, NFormItem } from 'naive-ui'
|
|
|
+import { ref, reactive, watchEffect, computed } from 'vue'
|
|
|
+import { NSlider, NForm, NFormItem, NAvatar } from 'naive-ui'
|
|
|
+import { saveTOTTS, SaveTOTTSParams } from '@/api'
|
|
|
+import { useMainStore } from '@/store'
|
|
|
|
|
|
+const main = useMainStore()
|
|
|
const showModal = ref(false)
|
|
|
|
|
|
const form = reactive({
|
|
|
document: '',
|
|
|
voiceType: 0,
|
|
|
- speed: 0,
|
|
|
- volume: 0
|
|
|
+ speed: 0.5,
|
|
|
+ volume: 0.5
|
|
|
})
|
|
|
|
|
|
const emits = defineEmits(['close'])
|
|
@@ -98,6 +132,48 @@ const handleShow = (show: boolean) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const cardList = reactive([
|
|
|
+ {
|
|
|
+ name: '智芳',
|
|
|
+ desc: '自然舒适',
|
|
|
+ type: 0,
|
|
|
+ icon: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '智华',
|
|
|
+ desc: '自然舒适',
|
|
|
+ type: 1,
|
|
|
+ icon: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '智付',
|
|
|
+ desc: '支付播报 特色声音',
|
|
|
+ type: 2,
|
|
|
+ icon: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '智柯',
|
|
|
+ desc: '自然轻快',
|
|
|
+ type: 3,
|
|
|
+ icon: ''
|
|
|
+ }
|
|
|
+])
|
|
|
+const handleCharterSelect = (card) => {
|
|
|
+ console.log('handleCharterSelect', card)
|
|
|
+ form.voiceType = card.type
|
|
|
+}
|
|
|
+
|
|
|
+const handleSave = async () => {
|
|
|
+ const data: SaveTOTTSParams = {
|
|
|
+ ...form,
|
|
|
+ num: main.sceneCode
|
|
|
+ }
|
|
|
+ const res = await saveTOTTS(data)
|
|
|
+ console.log(res)
|
|
|
+}
|
|
|
+
|
|
|
+const activeType = computed(() => (type) => form.voiceType === type)
|
|
|
+
|
|
|
watchEffect(() => {
|
|
|
showModal.value = props.show
|
|
|
})
|
|
@@ -106,4 +182,19 @@ watchEffect(() => {
|
|
|
.close-icon {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
+
|
|
|
+.card-select {
|
|
|
+ min-height: 200px;
|
|
|
+
|
|
|
+ .card-item {
|
|
|
+ &:hover {
|
|
|
+ cursor: pointer;
|
|
|
+ border-color: var(--primary-color);
|
|
|
+ }
|
|
|
+
|
|
|
+ &.active {
|
|
|
+ border-color: var(--primary-color);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|