This commit is contained in:
X1627315083
2024-01-04 09:40:28 +08:00
parent 003d8da364
commit 21c5fad138
10 changed files with 64 additions and 18 deletions

View File

@@ -387,7 +387,10 @@ export default defineComponent({
})
data.designSingleItemDTOList.forEach((item)=>{
let front = arr
let imageCategory1 = arr[1].imageCategory
let imageCategory1
if(arr.length > 1){
imageCategory1 = arr[1].imageCategory
}
arr.forEach((i)=>{
let imageCategory = i.imageCategory.split('_')[0]
if(item.id == i.id){
@@ -402,7 +405,7 @@ export default defineComponent({
// item.offset = [(i?.style?.left.replace(/px/g,'')*ratio).toFixed(0),(i?.style?.top.replace(/px/g,'')*ratio).toFixed(0)]
}
})
if(item.type == this.capitalizeFirstLetter(imageCategory1)){
if(arr.length > 1 && item.type == this.capitalizeFirstLetter(imageCategory1)){
item.scale = front?.imageSize?Number(((front?.style?.width.replace(/px/g,'')*ratio)/front?.imageSize[0]).toFixed(2)):1
}
})