2023-11-13-dist
This commit is contained in:
@@ -130,7 +130,7 @@
|
||||
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent,ref,createVNode} from 'vue'
|
||||
import { defineComponent,ref,createVNode,nextTick} from 'vue'
|
||||
import { Https } from "@/tool/https";
|
||||
import {dataURLtoFile,base64toFile} from "@/tool/util"
|
||||
import { getCookie } from "@/tool/cookie";
|
||||
@@ -255,44 +255,49 @@ export default defineComponent({
|
||||
this.option.img = this.printObject.url
|
||||
|
||||
setTimeout(()=>{
|
||||
let imgbox:any = this.$refs.imgbox
|
||||
nextTick().then(()=>{
|
||||
let image:any = new Image()
|
||||
image.src = this.option.img
|
||||
let imgbox:any = this.$refs.imgbox
|
||||
console.log(imgbox);
|
||||
let imgBoxSize = imgbox.getElementsByClassName('cropper-crop-box')[0]
|
||||
let imgBoxSizeBG = imgbox.getElementsByClassName('cropper-view-box')[0]
|
||||
let divTop:any = document.createElement('div');
|
||||
let divBottom:any = document.createElement('div');
|
||||
let divCenter:any = document.createElement('div');
|
||||
if(imgbox.getElementsByClassName('cropper-view-box-Bg').length >= 1){
|
||||
}else{
|
||||
divTop.classList.add('cropper-view-box-Bg')
|
||||
divBottom.classList.add('cropper-view-box-Bg')
|
||||
divCenter.classList.add('cropper-view-box-Bg')
|
||||
divTop.classList.add('cropper-view-box-Top')
|
||||
divBottom.classList.add('cropper-view-box-Bottom')
|
||||
divCenter.classList.add('cropper-view-box-Center')
|
||||
|
||||
let imgBoxSize = imgbox.getElementsByClassName('cropper-crop-box')[0]
|
||||
let imgBoxSizeBG = imgbox.getElementsByClassName('cropper-view-box')[0]
|
||||
let divTop:any = document.createElement('div');
|
||||
let divBottom:any = document.createElement('div');
|
||||
let divCenter:any = document.createElement('div');
|
||||
if(imgbox.getElementsByClassName('cropper-view-box-Bg').length >= 1){
|
||||
}else{
|
||||
divTop.classList.add('cropper-view-box-Bg')
|
||||
divBottom.classList.add('cropper-view-box-Bg')
|
||||
divCenter.classList.add('cropper-view-box-Bg')
|
||||
divTop.classList.add('cropper-view-box-Top')
|
||||
divBottom.classList.add('cropper-view-box-Bottom')
|
||||
divCenter.classList.add('cropper-view-box-Center')
|
||||
imgBoxSizeBG.appendChild(divTop)
|
||||
imgBoxSizeBG.appendChild(divBottom)
|
||||
imgBoxSizeBG.appendChild(divCenter)
|
||||
// imgBoxSizeBG.appendChild(div)
|
||||
|
||||
imgBoxSizeBG.appendChild(divTop)
|
||||
imgBoxSizeBG.appendChild(divBottom)
|
||||
imgBoxSizeBG.appendChild(divCenter)
|
||||
// imgBoxSizeBG.appendChild(div)
|
||||
}
|
||||
// imgBoxSize.style.backgroundImage = 'url('+require('@assets/images/library/lemaleBG.png')')'
|
||||
|
||||
}
|
||||
// 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,' ')
|
||||
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,' ')
|
||||
|
||||
})
|
||||
|
||||
},300)
|
||||
},
|
||||
realTime(data:any) {
|
||||
clearTimeout(this.cropperTime)
|
||||
this.cropperTime = setTimeout(()=>{
|
||||
|
||||
this.setImageSize()
|
||||
},1000)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user