fix
This commit is contained in:
@@ -237,7 +237,26 @@ export default defineComponent({
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
hasDuplicateId(arr) {
|
||||
const set = new Set();
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
const id = arr[i].id;
|
||||
if (set.has(id)) {
|
||||
return true;
|
||||
}
|
||||
set.add(id);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
soleId(arr,index){
|
||||
let randomNum = Math.floor(100 + Math.random() * 900);
|
||||
arr[index].id = this.sketchImg.id_? Number(this.sketchImg.id_+(randomNum+"")):this.current.id_
|
||||
if(this.hasDuplicateId(arr)){
|
||||
this.soleId(arr,index)
|
||||
}else{
|
||||
return arr
|
||||
}
|
||||
},
|
||||
//提交
|
||||
setPreview(){
|
||||
let designItemDetail = JSON.parse(JSON.stringify(this.store.state.DesignDetailModule.designItemDetail))
|
||||
@@ -265,7 +284,8 @@ export default defineComponent({
|
||||
data.designSingleItemDTOList[index].offset = [0,0]
|
||||
data.designSingleItemDTOList[index].scale = 1
|
||||
}
|
||||
data.designSingleItemDTOList[index].id = this.sketchImg.id_? this.sketchImg.id_:this.current.id_
|
||||
data.designSingleItemDTOList = this.soleId(data.designSingleItemDTOList,index)
|
||||
this.sketchImg.id_ = data.designSingleItemDTOList[index].id
|
||||
data.designSingleItemDTOList[index].path =this.sketchImg.minIOPath? this.sketchImg.minIOPath: this.current.minIOPath
|
||||
data.designSingleItemDTOList[index].type =this.sketchImg.type? this.sketchImg.type: this.current.type
|
||||
}else if(this.type_ == 2){
|
||||
|
||||
Reference in New Issue
Block a user