修复印花界面,切换线稿图印花储存有问题
This commit is contained in:
@@ -125,28 +125,32 @@ const DesignDetail : Module<DesignDetail,RootState> = {
|
||||
// if(item.id == state.selectDetail.id){
|
||||
// }
|
||||
// });
|
||||
let select = state.selectDetail
|
||||
if(value.id){
|
||||
select = state.designDetail.clothes.find((item:any) => item.id == value.id)
|
||||
}
|
||||
let {data} = value
|
||||
let str = value.str || state.currentDetailType
|
||||
if(!state.selectDetail)return
|
||||
if(!state.selectDetail.newDetail){
|
||||
state.selectDetail.newDetail = {}
|
||||
if(!select)return
|
||||
if(!select.newDetail){
|
||||
select.newDetail = {}
|
||||
}
|
||||
if(str == 'sketch'){
|
||||
state.selectDetail.newDetail[str] = data
|
||||
select.newDetail[str] = data
|
||||
}else if(str == 'color'){
|
||||
state.selectDetail.newDetail[str] = data
|
||||
select.newDetail[str] = data
|
||||
}else if(str == 'print'){
|
||||
state.selectDetail.newDetail[str] = data
|
||||
select.newDetail[str] = data
|
||||
}else if(str == 'element'){
|
||||
state.selectDetail.newDetail[str] = data
|
||||
select.newDetail[str] = data
|
||||
}else if(str == 'models'){
|
||||
// if(!state.designDetail.newModel)state.designDetail.newModel={}
|
||||
state.designDetail.newModel = JSON.parse(JSON.stringify(data))
|
||||
}else{
|
||||
if(!state.selectDetail.newDetail[str])state.selectDetail.newDetail[str] = []
|
||||
const foundObjects = state.selectDetail.newDetail[str].filter((item:any) => item.id === data.id);
|
||||
if(!select.newDetail[str])select.newDetail[str] = []
|
||||
const foundObjects = select.newDetail[str].filter((item:any) => item.id === data.id);
|
||||
if(foundObjects.length == 0){
|
||||
state.selectDetail.newDetail[str].push(data)
|
||||
select.newDetail[str].push(data)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user