fix
This commit is contained in:
@@ -220,7 +220,9 @@ export default defineComponent({
|
||||
maxImgSize:'2000', //限制图片最大宽度和高度
|
||||
enlarge: 7, //图片根据截图框输出比例倍数
|
||||
mode: 'auto 90%', //图片默认渲染方式
|
||||
limitMinSize:'100%'
|
||||
limitMinSize:'100%',
|
||||
imgLoad:()=>{
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -229,22 +231,6 @@ export default defineComponent({
|
||||
this.userInfo = JSON.parse(userInfo);
|
||||
this.getSex()
|
||||
},
|
||||
watch: {
|
||||
sex:{
|
||||
handler(newVal:any,oldVal:any){
|
||||
// let imgbox:any = this.$refs.imgbox
|
||||
// let imgBoxSizeBG = imgbox?.getElementsByClassName('cropper-view-box-BG')?.[0]
|
||||
// if(imgBoxSizeBG){
|
||||
// if(newVal == 'Male'){
|
||||
// imgBoxSizeBG.style.background = `url(./image/maleBG.png) no-repeat 0 0 / 100% 100%`
|
||||
// }else{
|
||||
// imgBoxSizeBG.style.background = `url(./image/femaleBG.png) no-repeat 0 0 / 100% 100%`
|
||||
// }
|
||||
// }
|
||||
|
||||
},
|
||||
},
|
||||
},
|
||||
methods:{
|
||||
formatter(value:number){
|
||||
return `${value}%`;
|
||||
@@ -284,28 +270,31 @@ export default defineComponent({
|
||||
|
||||
}
|
||||
// imgBoxSize.style.backgroundImage = 'url('+require('@assets/images/library/lemaleBG.png')')'
|
||||
|
||||
let cropper:any = this.$refs.cropper
|
||||
cropper.cropH = cropper.scale*cropper.trueHeight
|
||||
cropper.cropW = cropper.cropH/2.125
|
||||
cropper.cropOffsertX = cropper.getImgAxis().x1+(cropper.scale*cropper.trueWidth/2-cropper.cropW/2)
|
||||
cropper.cropOffsertY = cropper.getImgAxis().y1
|
||||
imgBoxSize.addEventListener('mousemove',this.startMove)
|
||||
this.setImageSize()
|
||||
this.getDefaultPointList(this.imgBox,' ')
|
||||
|
||||
})
|
||||
|
||||
},800)
|
||||
},
|
||||
setCropperWH(){
|
||||
let cropper:any = this.$refs.cropper
|
||||
if(cropper.h != cropper.cropH){
|
||||
this.getDefaultPointList(this.imgBox,' ')
|
||||
return
|
||||
}
|
||||
cropper.cropH = cropper.scale*cropper.trueHeight
|
||||
cropper.cropW = cropper.cropH/2.125
|
||||
cropper.cropOffsertX = cropper.getImgAxis().x1+(cropper.scale*cropper.trueWidth/2-cropper.cropW/2)
|
||||
cropper.cropOffsertY = cropper.getImgAxis().y1
|
||||
},
|
||||
realTime(data:any) {
|
||||
clearTimeout(this.cropperTime)
|
||||
this.cropperTime = setTimeout(()=>{
|
||||
this.setImageSize()
|
||||
},1000)
|
||||
},100)
|
||||
|
||||
},
|
||||
setImageSize(){
|
||||
this.setCropperWH()
|
||||
let imgbox:any = this.$refs.imgbox
|
||||
let imgBoxSize = imgbox.getElementsByClassName('cropper-crop-box')[0]
|
||||
let position = imgBoxSize.getBoundingClientRect()
|
||||
@@ -716,7 +705,7 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
|
||||
printPreview(){
|
||||
async printPreview(){
|
||||
let file = this.printObject.templateId ? null :this.printObject.file,
|
||||
models = {
|
||||
libraryId:this.printObject.relationId || null,
|
||||
@@ -724,21 +713,28 @@ export default defineComponent({
|
||||
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||
...this.getPrintLocation()
|
||||
}
|
||||
let formData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append("models", new Blob([JSON.stringify(models)], {type: "application/json"}));
|
||||
if(this.isShowMark){
|
||||
return
|
||||
}
|
||||
this.isShowMark = true
|
||||
Https.axiosPost(Https.httpUrls.libraryModelsDot, formData,{headers:{'Content-Type': 'multipart/form-data'}}).then(
|
||||
(rv: any) => {
|
||||
this.perviewUrl = rv
|
||||
this.isShowMark = false
|
||||
}
|
||||
).catch(res=>{
|
||||
this.isShowMark = false
|
||||
});
|
||||
let cropper:any = this.$refs.cropper
|
||||
await cropper.getCropData((value:any)=>{
|
||||
file = base64toFile(value,this.printObject.name);
|
||||
file.uid = this.printObject.file?.uid?this.printObject.file.uid:''
|
||||
let formData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append("models", new Blob([JSON.stringify(models)], {type: "application/json"}));
|
||||
if(this.isShowMark){
|
||||
return
|
||||
}
|
||||
this.isShowMark = true
|
||||
Https.axiosPost(Https.httpUrls.libraryModelsDot, formData,{headers:{'Content-Type': 'multipart/form-data'}}).then(
|
||||
(rv: any) => {
|
||||
this.perviewUrl = rv
|
||||
this.isShowMark = false
|
||||
}
|
||||
).catch(res=>{
|
||||
this.isShowMark = false
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
|
||||
backPreview(){
|
||||
|
||||
@@ -186,7 +186,9 @@ export default defineComponent({
|
||||
maxImgSize:'2000', //限制图片最大宽度和高度
|
||||
enlarge: 7, //图片根据截图框输出比例倍数
|
||||
mode: 'auto 90%', //图片默认渲染方式
|
||||
limitMinSize:'100%'
|
||||
limitMinSize:'100%',
|
||||
imgLoad:()=>{
|
||||
}
|
||||
})
|
||||
let {t} = useI18n()
|
||||
return {
|
||||
@@ -226,22 +228,9 @@ export default defineComponent({
|
||||
let userInfo:any = getCookie("userInfo")
|
||||
this.userInfo = JSON.parse(userInfo);
|
||||
this.getSex()
|
||||
},
|
||||
watch: {
|
||||
sex:{
|
||||
handler(newVal:any,oldVal:any){
|
||||
// let imgbox:any = this.$refs.imgbox
|
||||
// let imgBoxSizeBG = imgbox?.getElementsByClassName('cropper-view-box-BG')?.[0]
|
||||
// if(imgBoxSizeBG){
|
||||
// if(newVal == 'Male'){
|
||||
// imgBoxSizeBG.style.background = `url(./image/maleBG.png) no-repeat 0 0 / 100% 100%`
|
||||
// }else{
|
||||
// imgBoxSizeBG.style.background = `url(./image/femaleBG.png) no-repeat 0 0 / 100% 100%`
|
||||
// }
|
||||
// }
|
||||
|
||||
},
|
||||
},
|
||||
this.option.imgLoad = ()=>{
|
||||
this.setImageSize()
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
formatter(value:number){
|
||||
@@ -281,30 +270,33 @@ export default defineComponent({
|
||||
|
||||
}
|
||||
// imgBoxSize.style.backgroundImage = 'url('+require('@assets/images/library/lemaleBG.png')')'
|
||||
|
||||
let cropper:any = this.$refs.cropper
|
||||
cropper.cropH = cropper.scale*cropper.trueHeight
|
||||
cropper.cropW = cropper.cropH/2.125
|
||||
cropper.cropOffsertX = cropper.getImgAxis().x1+(cropper.scale*cropper.trueWidth/2-cropper.cropW/2)
|
||||
cropper.cropOffsertY = cropper.getImgAxis().y1
|
||||
imgBoxSize.addEventListener('touchmove',this.startMove)
|
||||
this.setImageSize()
|
||||
this.getDefaultPointList(this.imgBox,' ')
|
||||
|
||||
})
|
||||
|
||||
},800)
|
||||
},
|
||||
setCropperWH(){
|
||||
let cropper:any = this.$refs.cropper
|
||||
if(cropper.h != cropper.cropH){
|
||||
this.getDefaultPointList(this.imgBox,' ')
|
||||
return
|
||||
}
|
||||
cropper.cropH = cropper.scale*cropper.trueHeight
|
||||
cropper.cropW = cropper.cropH/2.125
|
||||
cropper.cropOffsertX = cropper.getImgAxis().x1+(cropper.scale*cropper.trueWidth/2-cropper.cropW/2)
|
||||
cropper.cropOffsertY = cropper.getImgAxis().y1
|
||||
},
|
||||
realTime(data:any) {
|
||||
clearTimeout(this.cropperTime)
|
||||
this.cropperTime = setTimeout(()=>{
|
||||
this.setImageSize()
|
||||
},1000)
|
||||
},100)
|
||||
|
||||
},
|
||||
setImageSize(){
|
||||
this.setCropperWH()
|
||||
let imgbox:any = this.$refs.imgbox
|
||||
let imgBoxSize = imgbox.getElementsByClassName('cropper-crop-box')[0]
|
||||
let imgBoxSize = imgbox.getElementsByClassName('cropper-crop-box')?.[0]
|
||||
let position = imgBoxSize.getBoundingClientRect()
|
||||
let position1 = imgbox.getBoundingClientRect()
|
||||
let cropper:any = this.$refs.cropper
|
||||
@@ -721,21 +713,26 @@ export default defineComponent({
|
||||
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||
...this.getPrintLocation()
|
||||
}
|
||||
let formData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append("models", new Blob([JSON.stringify(models)], {type: "application/json"}));
|
||||
if(this.isShowMark){
|
||||
return
|
||||
}
|
||||
this.isShowMark = true
|
||||
Https.axiosPost(Https.httpUrls.libraryModelsDot, formData,{headers:{'Content-Type': 'multipart/form-data'}}).then(
|
||||
(rv: any) => {
|
||||
this.perviewUrl = rv
|
||||
this.isShowMark = false
|
||||
}
|
||||
).catch(res=>{
|
||||
this.isShowMark = false
|
||||
});
|
||||
let cropper:any = this.$refs.cropper
|
||||
cropper.getCropData((value:any)=>{
|
||||
file = base64toFile(value,this.printObject.name);
|
||||
file.uid = this.printObject.file?.uid?this.printObject.file.uid:''
|
||||
let formData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append("models", new Blob([JSON.stringify(models)], {type: "application/json"}));
|
||||
if(this.isShowMark){
|
||||
return
|
||||
}
|
||||
this.isShowMark = true
|
||||
Https.axiosPost(Https.httpUrls.libraryModelsDot, formData,{headers:{'Content-Type': 'multipart/form-data'}}).then(
|
||||
(rv: any) => {
|
||||
this.perviewUrl = rv
|
||||
this.isShowMark = false
|
||||
}
|
||||
).catch(res=>{
|
||||
this.isShowMark = false
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
backPreview(){
|
||||
|
||||
Reference in New Issue
Block a user