Commit 537c76c7 authored by Dazzle Wu's avatar Dazzle Wu

fix: 继续编辑保存草稿失败

parent c1eaae45
......@@ -101,6 +101,7 @@ export interface DraftConfig {
bgmUrl: string | null
materialUrl: string | null
pronunciationLanguage: LangType
pageLayout?: string
memberId?: number
modifiedTime?: string
}
......
......@@ -90,10 +90,40 @@ async function getDraft(id: string) {
async function getTaskConfig(id: string) {
const res = await fetchGetTaskConfig<DraftConfig>(id)
if (res.code === 0) {
digitalCreationStore.updateDigitalCreation({
...res.data,
const draftConfig: DraftConfig = {
id: null,
draftName: '新建數字人視頻' + formatDateTime(new Date()),
})
width: res.data.width || (res.data.pageLayout === ScreenType.LANDSCAPE ? 1280 : 720),
height: res.data.height || (res.data.pageLayout === ScreenType.LANDSCAPE ? 720 : 1280),
w: res.data.w || (res.data.pageLayout === ScreenType.LANDSCAPE ? 607 : 1080),
h: res.data.h || (res.data.pageLayout === ScreenType.LANDSCAPE ? 1080 : 1920),
coverUrl: res.data.coverUrl || digitalCreationStore.coverUrl,
taskType: res.data.taskType || digitalCreationStore.taskType,
inputImageUrl: res.data.inputImageUrl || digitalCreationStore.inputImageUrl,
driveType: res.data.driveType || digitalCreationStore.driveType,
text: res.data.text || digitalCreationStore.text,
person: res.data.person || digitalCreationStore.person,
speed: res.data.speed || digitalCreationStore.speed,
volume: res.data.volume || digitalCreationStore.volume,
pitch: res.data.pitch || digitalCreationStore.pitch,
inputAudioUrl: res.data.inputAudioUrl || digitalCreationStore.inputAudioUrl,
figureId: res.data.figureId || digitalCreationStore.figureId,
cameraId: res.data.cameraId || digitalCreationStore.cameraId,
x: res.data.x || digitalCreationStore.x,
y: res.data.y || digitalCreationStore.y,
subtitlePolicy: res.data.subtitlePolicy || digitalCreationStore.subtitlePolicy,
enabled: res.data.enabled || digitalCreationStore.enabled,
backgroundImageUrl: res.data.backgroundImageUrl || digitalCreationStore.backgroundImageUrl,
autoAnimoji: res.data.autoAnimoji || digitalCreationStore.autoAnimoji,
enablePalindrome: res.data.enablePalindrome || digitalCreationStore.enablePalindrome,
templateId: res.data.templateId || digitalCreationStore.templateId,
title: res.data.title || digitalCreationStore.title,
logoUrl: res.data.logoUrl || digitalCreationStore.logoUrl,
bgmUrl: res.data.bgmUrl || digitalCreationStore.bgmUrl,
materialUrl: res.data.materialUrl || digitalCreationStore.materialUrl,
pronunciationLanguage: res.data.pronunciationLanguage || digitalCreationStore.pronunciationLanguage,
}
digitalCreationStore.updateDigitalCreation(draftConfig)
}
}
</script>
......
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