feat: 高级工具转产品图 prompt assist弹窗内容修改

This commit is contained in:
zhangyh
2025-11-20 13:39:23 +08:00
parent ae142b8edf
commit f28eaef252
12 changed files with 301 additions and 140 deletions

View File

@@ -320,8 +320,15 @@
}"
:isProductimg="true"
></scaleImage>
<Prompt v-if="productimgMenu.value == 'ToProductImage'" v-model:showModal="showPromptAssist" :promptList="promptTextList" />
<PromptEditProduct v-if="productimgMenu.value == 'Relight'" v-model:showModal="showPromptAssist"></PromptEditProduct>
<Prompt
v-if="productimgMenu.value == 'ToProductImage'"
v-model:showModal="showPromptAssist"
:isDesignPage="isDesignPage"
/>
<PromptEditProduct
v-if="productimgMenu.value == 'Relight'"
v-model:showModal="showPromptAssist"
></PromptEditProduct>
</div>
</template>
@@ -364,7 +371,7 @@ export default defineComponent({
generalMenu,
generalDrag,
Prompt,
PromptEditProduct
PromptEditProduct
},
props: {
setTask: {
@@ -727,8 +734,8 @@ export default defineComponent({
let remPrductimgTime: any = null
let prductimgTime: any = null
let getPrductimg = () => {
// 未输入prompt时不可生成
if (!productImgData.searchName[props.productimgMenu.value]) {
// 非高级工具 未输入prompt时不可生成
if (!productImgData.searchName[props.productimgMenu.value] && !props.isDesignPage) {
message.info(t('ProductImg.noPrompt'))
return
}
@@ -784,22 +791,6 @@ export default defineComponent({
}
productImgData.isProductimg = true
// 设置默认prompt
if (!productImgData.searchName[props.productimgMenu.value]) {
const isFromDesignPage = props.source == 'design' || props.isDesignPage
const { ageGroup, httpType } = store.state.Workspace.probjects
const isSingleDesign = httpType === 'SINGLE_DESIGN'
if (!isFromDesignPage) {
data.prompt = t('poseTransfer.UploadWithModel')
} else if (ageGroup === 'Adult') {
data.prompt = isSingleDesign
? t('poseTransfer.SingleAdultTryOn')
: t('poseTransfer.SeriesAdultTryOn')
} else if (isSingleDesign) {
data.prompt = t('poseTransfer.SingleGarment')
}
}
let url = Https.httpUrls.toProduct
if (props.productimgMenu.value == 'Relight') {
url = Https.httpUrls.relight
@@ -1107,36 +1098,16 @@ export default defineComponent({
})
// 计算属性:根据条件生成提示词列表
const promptTextList = computed(() => {
const isFromDesignPage = props.source === 'design' || props.isDesignPage
const { ageGroup, httpType } = store.state.Workspace.probjects
const isSingleDesign = httpType === 'SINGLE_DESIGN'
const isAdult = ageGroup === 'Adult'
if (!isFromDesignPage) {
// 如果不是从design来的返回两个提示词
return [t('poseTransfer.UploadWithoutModel'), t('poseTransfer.UploadWithModel')]
} else {
// 如果是从design来的
if (isSingleDesign) {
// SINGLE_DESIGN: 两个提示词
const secondPrompt = isAdult
? t('poseTransfer.SingleAdultTryOn')
: t('poseTransfer.SingleChildTryOn')
return [t('poseTransfer.SingleGarment'), secondPrompt]
} else {
// SERIES_DESIGN: 一个提示词
return [
isAdult
? t('poseTransfer.SeriesAdultTryOn')
: t('poseTransfer.SeriesChildTryOn')
]
}
}
})
const showPromptAssist = ref(false)
const handleClickAssistBtn = () => {
const { httpType } = store.state.Workspace.probjects
const isSingleDesign = httpType === 'SINGLE_DESIGN'
if (props.isDesignPage && !isSingleDesign) {
const promptText = t('ProductImg.Series')
productImgData.searchName[props.productimgMenu.value] = promptText
return
}
showPromptAssist.value = true
}
@@ -1150,7 +1121,6 @@ export default defineComponent({
productimgMenuList,
RelightDirectionList,
RelightDirection,
promptTextList,
showPromptAssist,
setproduct,