Commit 79bd2a05 authored by 周成波's avatar 周成波

增加页面配置

parent a86a47c3
...@@ -10,15 +10,20 @@ declare module 'vue' { ...@@ -10,15 +10,20 @@ declare module 'vue' {
ElButton: typeof import('element-plus/es')['ElButton'] ElButton: typeof import('element-plus/es')['ElButton']
ElDialog: typeof import('element-plus/es')['ElDialog'] ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider'] ElDivider: typeof import('element-plus/es')['ElDivider']
ElElFormItem: typeof import('element-plus/es')['ElElFormItem']
ElForm: typeof import('element-plus/es')['ElForm'] ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElImage: typeof import('element-plus/es')['ElImage'] ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput'] ElInput: typeof import('element-plus/es')['ElInput']
ElOption: typeof import('element-plus/es')['ElOption']
ElRadio: typeof import('element-plus/es')['ElRadio'] ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSlider: typeof import('element-plus/es')['ElSlider']
ElTable: typeof import('element-plus/es')['ElTable'] ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElUpload: typeof import('element-plus/es')['ElUpload'] ElUpload: typeof import('element-plus/es')['ElUpload']
ElWatermark: typeof import('element-plus/es')['ElWatermark']
HelloWorld: typeof import('./src/components/HelloWorld.vue')['default'] HelloWorld: typeof import('./src/components/HelloWorld.vue')['default']
IconCommunity: typeof import('./src/components/icons/IconCommunity.vue')['default'] IconCommunity: typeof import('./src/components/icons/IconCommunity.vue')['default']
IconDocumentation: typeof import('./src/components/icons/IconDocumentation.vue')['default'] IconDocumentation: typeof import('./src/components/icons/IconDocumentation.vue')['default']
......
...@@ -31,6 +31,7 @@ const sd_negative_prompt_prefix = default_data.sd_negative_prompt_prefix; ...@@ -31,6 +31,7 @@ const sd_negative_prompt_prefix = default_data.sd_negative_prompt_prefix;
const tyqw = {'api': 'tyqw', 'name':'通义千问线上'}; const tyqw = {'api': 'tyqw', 'name':'通义千问线上'};
const baichuan = {'api': 'langchain', 'name':'baichuan2-7b'}; const baichuan = {'api': 'langchain', 'name':'baichuan2-7b'};
const qwen = {'api': 'langchain', 'name':'Qwen-7B-Chat'}; const qwen = {'api': 'langchain', 'name':'Qwen-7B-Chat'};
const gpt = {'api': 'gpt', 'name':'chatgpt'};
const wenan_llm = qwen.api const wenan_llm = qwen.api
const wenan_llm_name = qwen.name const wenan_llm_name = qwen.name
...@@ -43,6 +44,11 @@ const tuili_llm_name = qwen.name ...@@ -43,6 +44,11 @@ const tuili_llm_name = qwen.name
const fanyi_llm = qwen.api const fanyi_llm = qwen.api
const fanyi_llm_name = qwen.name const fanyi_llm_name = qwen.name
const voice_rate = ref(0)
const voice_volume = ref(0)
const voice = ref("zh-CN-YunjianNeural")
const bgm = ref("解忧曲")
onMounted(() => { onMounted(() => {
// 初始化示例数据 // 初始化示例数据
...@@ -318,10 +324,19 @@ const onGenVideo = () => { ...@@ -318,10 +324,19 @@ const onGenVideo = () => {
img_path: item.local_image_path img_path: item.local_image_path
}; };
}); });
let para_rate = `${voice_rate.value}%`;
let para_volume = `${voice_volume.value}%`;
if(voice_rate.value >= 0){para_rate = `+${para_rate}`}
if(voice_volume.value >= 0){para_volume = `+${para_volume}`}
const video_param = { const video_param = {
task_id: form.task_id, task_id: form.task_id,
if_need_subtitle: form.if_need_subtitle, if_need_subtitle: form.if_need_subtitle,
lang: "zh",
task_info: video_param_detail, task_info: video_param_detail,
rate: para_rate,
volume: para_volume,
voice: voice.value,
bgm: bgm.value,
} }
text2videoService text2videoService
.submitGenVideo(video_param) .submitGenVideo(video_param)
...@@ -533,6 +548,56 @@ const handleExceed: UploadProps['onExceed'] = (files) => { ...@@ -533,6 +548,56 @@ const handleExceed: UploadProps['onExceed'] = (files) => {
</el-table> </el-table>
</el-form-item> </el-form-item>
<!-- 生成视频 --> <!-- 生成视频 -->
<el-form-item label="设置">
<span style="margin: 0 20px">语速:</span>
<el-slider v-model="voice_rate" show-input :min="-50" :max="50" :marks="default_data.marks" style="width: 900px" />
</el-form-item>
<el-form-item>
<span style="margin: 0 20px">音量:</span>
<el-slider v-model="voice_volume" show-input :min="-80" :max="80" :marks="default_data.marks" style="width: 900px" />
</el-form-item>
<el-form-item>
<span style="margin: 20px 20px 0 20px">语音:</span>
<el-select v-model="voice" placeholder="Select" style="width: 400px; margin-top: 20px;">
<el-option
v-for="item in default_data.voices"
:key="item.value"
:label="item.value"
:value="item.value"
>
<span style="float: left">{{ item.value }}</span>
<span
style="
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
"
>{{ item.label }}</span>
</el-option>
</el-select>
<audio :src="'src/assets/edge-tts-voices/' + voice + '.mp3'" controls style="height: 30px; margin: 20px 0 0 10px;"></audio>
</el-form-item>
<el-form-item>
<span style="margin: 0 20px">背景:</span>
<el-select v-model="bgm" placeholder="无" style="width: 400px;">
<el-option
v-for="item in default_data.bgm"
:key="item.value"
:label="item.value"
:value="item.value"
>
<span style="float: left">{{ item.label }}</span>
<span
style="
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
"
>{{ item.value }}</span>
</el-option>
</el-select>
<audio :src="'src/assets/bgm/' + bgm + '.mp3'" controls style="height: 30px; margin-left:10px;"></audio>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onGenVideo">生成视频</el-button> <el-button type="primary" @click="onGenVideo">生成视频</el-button>
</el-form-item> </el-form-item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment