2023-10-31-2-dist
This commit is contained in:
@@ -294,7 +294,7 @@ export default defineComponent({
|
||||
cropper.cropOffsertY = cropper.getImgAxis().y1
|
||||
imgBoxSize.addEventListener('mousemove',this.startMove)
|
||||
this.setImageSize()
|
||||
this.getDefaultPointList(this.imgBox)
|
||||
this.getDefaultPointList(this.imgBox,' ')
|
||||
},300)
|
||||
},
|
||||
realTime(data:any) {
|
||||
@@ -343,7 +343,7 @@ export default defineComponent({
|
||||
|
||||
},
|
||||
//初始化可以使用的点位
|
||||
getDefaultPointList(imgBox:any){
|
||||
getDefaultPointList(imgBox:any,str:any){
|
||||
this.isSubmit = false
|
||||
this.locationList=[]
|
||||
this.pointList = [
|
||||
@@ -360,36 +360,35 @@ export default defineComponent({
|
||||
pointList:[{type:'handLeft',color:'#d88e8e',show:true,field:'hand'},{type:'handRight',color:'#d88e8e',show:true,field:'hand'}]
|
||||
},
|
||||
]
|
||||
if(this.printObject.shoulderLeft?.length >1){//编辑
|
||||
console.log(this.printObject);
|
||||
|
||||
for(let ponit of this.pointList){
|
||||
for(let pointItem of ponit.pointList){
|
||||
if(this.printObject[pointItem.type]?.length){
|
||||
pointItem.show = false
|
||||
let data = {
|
||||
left:this.printObject[pointItem.type][0] * imgBox.width - 12,
|
||||
top:this.printObject[pointItem.type][1] * imgBox.height - 12,
|
||||
color:pointItem.color,
|
||||
type:pointItem.type,
|
||||
field:pointItem.field,
|
||||
}
|
||||
this.locationList.push(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
if(str != 'setPoint'){//编辑
|
||||
this.isSubmit = true
|
||||
// this.option.canScale = false
|
||||
// this.option.canMove = false
|
||||
for(let ponit of this.pointList){
|
||||
for(let pointItem of ponit.pointList){
|
||||
if(this.printObject[pointItem.type]?.length){
|
||||
pointItem.show = false
|
||||
let data = {
|
||||
left:this.printObject[pointItem.type][0] * imgBox.width - 12,
|
||||
top:this.printObject[pointItem.type][1] * imgBox.height - 12,
|
||||
color:pointItem.color,
|
||||
type:pointItem.type,
|
||||
field:pointItem.field,
|
||||
}
|
||||
this.locationList.push(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.oldLocationList = JSON.parse(JSON.stringify(this.locationList))
|
||||
this.oldPointList = JSON.parse(JSON.stringify(this.pointList))
|
||||
}else{
|
||||
this.option.canScale = true
|
||||
// this.option.fixedBox = false
|
||||
this.option.canMove = true
|
||||
// this.option.canMoveBox = true
|
||||
}
|
||||
|
||||
this.oldPointList = JSON.parse(JSON.stringify(this.pointList))
|
||||
|
||||
},
|
||||
setPoint(){
|
||||
console.log();
|
||||
@@ -422,7 +421,7 @@ export default defineComponent({
|
||||
file:printObject.file,
|
||||
url:printObject.url
|
||||
}
|
||||
this.getDefaultPointList(this.imgBox)
|
||||
this.getDefaultPointList(this.imgBox,'setPoint')
|
||||
},
|
||||
AddDian(point:any){
|
||||
if(!point.show){
|
||||
@@ -530,8 +529,8 @@ export default defineComponent({
|
||||
Modal.confirm({
|
||||
title: this.t('ModelPlacement.jsContent1'),
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
okText: 'Ok',
|
||||
cancelText: 'Cancel',
|
||||
okText: 'Yes',
|
||||
cancelText: 'No',
|
||||
mask:false,
|
||||
// centered:true,
|
||||
onOk() {
|
||||
@@ -558,6 +557,9 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
restoreLocationList(){
|
||||
this.locationList = []
|
||||
console.log(this.locationList);
|
||||
|
||||
this.pointList = JSON.parse(JSON.stringify(this.oldPointList))
|
||||
this.locationList = JSON.parse(JSON.stringify(this.oldLocationList))
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user