修复印花线稿合成图显示异常
This commit is contained in:
@@ -54,6 +54,25 @@ const DesignDetail : Module<DesignDetail,RootState> = {
|
||||
data.clothes.forEach((v:any,index:any)=>{
|
||||
// if(!v?.partialDesignDTO){
|
||||
// }
|
||||
function isJSONString(str) {
|
||||
try {
|
||||
JSON.parse(str);
|
||||
return true; // 解析成功,是有效的JSON字符串
|
||||
} catch (e) {
|
||||
return false; // 解析失败,不是有效的JSON字符串
|
||||
}
|
||||
}
|
||||
v?.printObject?.prints?.forEach((item:any) => {
|
||||
console.log(item.object)
|
||||
if(isJSONString(item.object)){
|
||||
item.object = JSON.parse(item.object)
|
||||
}
|
||||
});
|
||||
v?.trims?.prints?.forEach((item:any) => {
|
||||
if(isJSONString(item.object)){
|
||||
item.object = JSON.parse(item.object)
|
||||
}
|
||||
});
|
||||
for (let i = v.layersObject.length-1; i >= 0; i--) {
|
||||
v.layersObject[i].style = {
|
||||
top:v.layersObject[i].position?.[0],
|
||||
|
||||
Reference in New Issue
Block a user