调整outfit流程
All checks were successful
git提交控制 AiDA WEB-Node.js main 分支构建部署 / build (20.19.0) (push) Has been skipped

This commit is contained in:
X1627315083
2025-12-31 10:07:08 +08:00
parent e230b4c83f
commit 0ec9e4dc46
2 changed files with 31 additions and 8 deletions

View File

@@ -52,6 +52,12 @@ export const useHGenerateStore = defineStore({
this.customizeInfo.styleUrl = ''
this.customizeInfo.isRegenerated = ''
this.customizeInfo.isFavorite = false
},
/** 上传服装 */
uploadStyle(data: object) {
for (const key in data) {
this.style[key] = data[key]
}
},
uploadCustomizeInfo(data: object) {
for (const key in data) {

View File

@@ -25,7 +25,7 @@ const loadingTitle = computed(()=>{
let str = ''
if(!select.value.status)str = 'Analyzing the Outfit...'
if(select.value.status == 'RUNNING')str = 'Generating Results...'
if(select.value.status == 'PENDING')str = 'Almost there...'
if(select.value.status == 'PENDING' || select.value.status == 'ALMOST_DONE')str = 'Almost there...'
return str
})
@@ -65,11 +65,12 @@ const toProduct = ()=>{
// if(generateStore.style.id){
// generateStore.setIsGenerate(true)
// }
if(!isHistoryFlow.value){
router.push({ path: 'product', query: {...query.value} })
}else{
router.push({ path: 'creation', query: {...query.value, active: FlowType.H_OUTFIT} })
}
router.push({ path: 'product', query: {...query.value} })
// if(!isHistoryFlow.value){
// router.push({ path: 'product', query: {...query.value} })
// }else{
// router.push({ path: 'creation', query: {...query.value, active: FlowType.H_OUTFIT} })
// }
}
const requestOutfit = async ({num})=>{
@@ -103,6 +104,7 @@ const getRequestOutfitList = (generateList)=>{
let value = {requestIDs:generateList.join(',')}
getRequestOutfit(value).then((rv:any)=>{
let selectIndex = rv.findIndex((item)=>item.requestId == data.select.taskId)
console.log(selectIndex)
if(selectIndex != -1){
data.select.id = rv[selectIndex].id
data.select.path = rv[selectIndex].path
@@ -118,9 +120,24 @@ const getRequestOutfitList = (generateList)=>{
}
})
if(['SUCCEEDED'].includes(data.select.status))isLoading.value = false
if(['SUCCEEDED'].includes(data.select.status)){
isLoading.value = false
if(isHistoryFlow.value){
hGenerateStore.uploadStyle({
id: data.select.id,
path: data.select.path,
})
}
}
if(data.styleList.filter((item)=>item?.status == 'FAILED').length > 0){
showToast({
message: 'One of the outfits failed to generate. Please try generating again.',
duration: 2000,
})
isLoading.value = false
}
const taskIdList = data.styleList
.filter(item => item?.taskId && item?.status !== 'SUCCEEDED')
.filter(item => item?.taskId && (item?.status !== 'SUCCEEDED' && item?.status !== 'FAILED'))
.map(item => item.taskId);
if(taskIdList.length > 0){
getGenerateTime = setTimeout(()=>{