save task origin info for AI generating jobs

This commit is contained in:
RockYang
2024-11-11 17:22:08 +08:00
parent 135755d21d
commit ce8a2d0222
31 changed files with 358 additions and 136 deletions

View File

@@ -38,6 +38,12 @@
</div>
<div class="params">
<div class="item-group">
<el-button class="generate-btn" size="small" @click="generatePrompt" color="#5865f2" :disabled="isGenerating">
<i class="iconfont icon-chuangzuo" style="margin-right: 5px"></i>
<span>生成AI视频提示词</span>
</el-button>
</div>
<div class="item-group">
<span class="label">循环参考图</span>
<el-switch v-model="formData.loop" size="small" style="--el-switch-on-color:#BF78BF;" />
@@ -294,6 +300,20 @@ const create = () => {
})
}
const isGenerating = ref(false)
const generatePrompt = () => {
if (formData.prompt === "") {
return showMessageError("请输入原始提示词")
}
isGenerating.value = true
httpPost("/api/prompt/image", {prompt: formData.prompt}).then(res => {
formData.prompt = res.data
isGenerating.value = false
}).catch(e => {
showMessageError("生成提示词失败:"+e.message)
isGenerating.value = false
})
}
</script>