Merge remote-tracking branch 'origin/StableVersion' into dev_vite

This commit is contained in:
X1627315083
2025-09-26 21:57:29 +08:00
5 changed files with 110 additions and 34 deletions

View File

@@ -1,5 +1,6 @@
import {Module} from 'vuex'
import {RootState} from '../index'
import { forEach } from 'jszip'
interface DesignDetail{
designDetail:any,
@@ -42,7 +43,6 @@ const DesignDetail : Module<DesignDetail,RootState> = {
state.currentPrintElement = null
},
setDesignDetail(state,data){
console.log(data)
if(data.others.length > 0 && data.others[0].type == "Body"){
state.frontBack.body = data.others[0]
}
@@ -208,7 +208,6 @@ const DesignDetail : Module<DesignDetail,RootState> = {
},
async setPraeview(state,value){//preview
let data = value?.rv || value
console.log(data,'preview')
let currentType = value?.currentType
if(state.designDetail.oldModel?.url)state.frontBack.body.path = state.designDetail.oldModel.url
if(value?.rv?.currentFullBodyView)state.designDetail.currentFullBodyView = value.rv.currentFullBodyView
@@ -220,10 +219,16 @@ const DesignDetail : Module<DesignDetail,RootState> = {
}
let id_:any
if(state.currentDetailType != 'models'){
id_ = state.selectDetail.id || state.selectDetail.newDetail?.sketch?.id
if(data.clothes.length > 2){
//缺少字段临时添加
id_ = item.id || state.selectDetail.newDetail?.sketch?.id
}else{
id_ = state.selectDetail.id || state.selectDetail.newDetail?.sketch?.id
}
}else{
id_ = item.id
}
console.log(id_)
let el:any = document.querySelector('.molepositon .perview_img')
await new Promise((resolve, reject) => {
if(!state.frontBack?.body?.path){
@@ -273,25 +278,27 @@ const DesignDetail : Module<DesignDetail,RootState> = {
resolve('')
};
})
if(state.currentDetailType != 'models'){
state.selectDetail.change = item.change
if(state.selectDetail?.newDetail?.color && currentType != 'color'){
state.selectDetail.color = state.selectDetail?.newDetail?.color
state.selectDetail.newDetail.color = null
let uploadDetail = (detailItem)=>{
detailItem.change = item.change
if(detailItem?.newDetail?.color && currentType != 'color'){
detailItem.color = detailItem?.newDetail?.color
detailItem.newDetail.color = null
}
if(item.partialDesign){
state.selectDetail.partialDesign = item.partialDesign
detailItem.partialDesign = item.partialDesign
}
state.selectDetail.designType = item.designType
state.selectDetail.layersObject = item.layersObject
state.selectDetail.path = item.path
state.selectDetail.minIOPath = item.minIOPath
state.selectDetail.scale = [1,1]
state.selectDetail.offset = [0,0]
state.selectDetail.printObject = item.printObject
state.selectDetail.trims = item.trims
state.selectDetail.type = item.type
state.selectDetail.color = {
detailItem.designType = item.designType
detailItem.layersObject = item.layersObject
detailItem.path = item.path
detailItem.minIOPath = item.minIOPath
detailItem.scale = [1,1]
detailItem.offset = [0,0]
detailItem.printObject = item.printObject
detailItem.trims = item.trims
detailItem.type = item.type
detailItem.maskMinioUrl = item.layersObject?.[0]?.maskMinioUrl
detailItem.maskUrl = item.layersObject?.[0]?.maskUrl
detailItem.color = {
...item.color,
rgba:{
r:item.color?.r,
@@ -300,13 +307,60 @@ const DesignDetail : Module<DesignDetail,RootState> = {
},
gradient:item.gradient,
}
state.selectDetail.undividedLayer = item.undividedLayer
state.selectDetail.undividedLayerWithSinglePrint = item?.undividedLayerWithSinglePrint
if(state.selectDetail.newDetail?.sketch?.id && !state.selectDetail.id){
state.designDetail.clothes.push(state.selectDetail)
detailItem.undividedLayer = item.undividedLayer
detailItem.undividedLayerWithSinglePrint = item?.undividedLayerWithSinglePrint
if(detailItem.newDetail?.sketch?.id && !detailItem.id){
state.designDetail.clothes.push(detailItem)
}
state.selectDetail.id = item.id
if(currentType)if(state.selectDetail.newDetail?.[currentType] && currentType != 'color')delete state.selectDetail.newDetail[currentType]
detailItem.id = item.id
if(currentType)if(detailItem.newDetail?.[currentType] && currentType != 'color')delete detailItem.newDetail[currentType]
}
if(data.clothes.length > 2){
state.designDetail.clothes.forEach((detailItem:any) => {
if(detailItem.id == id_){
uploadDetail(detailItem)
}
});
}else{
uploadDetail(state.selectDetail)
}
if(state.currentDetailType != 'models'){
// state.selectDetail.change = item.change
// if(state.selectDetail?.newDetail?.color && currentType != 'color'){
// state.selectDetail.color = state.selectDetail?.newDetail?.color
// state.selectDetail.newDetail.color = null
// }
// if(item.partialDesign){
// state.selectDetail.partialDesign = item.partialDesign
// }
// state.selectDetail.designType = item.designType
// state.selectDetail.layersObject = item.layersObject
// state.selectDetail.path = item.path
// state.selectDetail.minIOPath = item.minIOPath
// state.selectDetail.scale = [1,1]
// state.selectDetail.offset = [0,0]
// state.selectDetail.printObject = item.printObject
// state.selectDetail.trims = item.trims
// state.selectDetail.type = item.type
// state.selectDetail.maskMinioUrl = item.layersObject?.[0]?.maskMinioUrl
// state.selectDetail.maskUrl = item.layersObject?.[0]?.maskUrl
// state.selectDetail.color = {
// ...item.color,
// rgba:{
// r:item.color?.r,
// g:item.color?.g,
// b:item.color?.b,
// },
// gradient:item.gradient,
// }
// state.selectDetail.undividedLayer = item.undividedLayer
// state.selectDetail.undividedLayerWithSinglePrint = item?.undividedLayerWithSinglePrint
// if(state.selectDetail.newDetail?.sketch?.id && !state.selectDetail.id){
// state.designDetail.clothes.push(state.selectDetail)
// }
// state.selectDetail.id = item.id
// if(currentType)if(state.selectDetail.newDetail?.[currentType] && currentType != 'color')delete state.selectDetail.newDetail[currentType]
}
}
if(value.fun)value.fun()