修复印花线稿合成图显示异常

This commit is contained in:
X1627315083
2026-01-16 13:39:00 +08:00
parent 2b7db933d9
commit a720fba84e
5 changed files with 106 additions and 52 deletions

View File

@@ -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],