fix
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
:closable="false"
|
||||
:keyboard="false"
|
||||
:mask="true"
|
||||
:destroyOnClose="true"
|
||||
>
|
||||
<div class="designOpenrtion_content">
|
||||
<div class="design_title_text">
|
||||
@@ -635,51 +636,55 @@ export default defineComponent({
|
||||
let sketch = document.getElementsByClassName("designOpenrtion_modal")[0]?.getElementsByClassName('designOpenrtion_sketch')[0]
|
||||
let width
|
||||
let scale
|
||||
if(sketch.width<sketch.height){
|
||||
width = Math.trunc(Math.random()*(sketch?.width-sketch?.width/2))+sketch?.width/4
|
||||
if(boor){
|
||||
width = Math.trunc((sketch?.width-sketch?.width/2))+sketch?.width/4
|
||||
let img = new Image()
|
||||
img.onload = ()=>{
|
||||
if(sketch.width<sketch.height){
|
||||
width = Math.trunc(Math.random()*(sketch?.width-sketch?.width/2))+sketch?.width/4
|
||||
if(boor){
|
||||
width = Math.trunc((sketch?.width-sketch?.width/2))+sketch?.width/4
|
||||
}
|
||||
scale = width / this.print.width.replace(/px/g,'')
|
||||
}else{
|
||||
width = Math.trunc(Math.random()*(sketch?.height-sketch?.height/2))+sketch?.height/4
|
||||
if(boor){
|
||||
width = Math.trunc((sketch?.height-sketch?.height/2))+sketch?.height/4
|
||||
}
|
||||
scale = width / this.print.height.replace(/px/g,'')
|
||||
}
|
||||
scale = width / this.print.width.replace(/px/g,'')
|
||||
}else{
|
||||
width = Math.trunc(Math.random()*(sketch?.height-sketch?.height/2))+sketch?.height/4
|
||||
if(boor){
|
||||
width = Math.trunc((sketch?.height-sketch?.height/2))+sketch?.height/4
|
||||
let x = sketch?.width - this.print.width.replace(/px/g,'')*scale
|
||||
if(!this.overallSingle){
|
||||
x = sketch?.width - this.print.width.replace(/px/g,'')*scale/2
|
||||
}
|
||||
let y = sketch?.height-this.print.height.replace(/px/g,'')*scale
|
||||
let left = sketch.offsetWidth/2-this.print.width.replace(/px/g,'')*scale/2
|
||||
let top = sketch.offsetHeight/2-this.print.height.replace(/px/g,'')*scale/2
|
||||
if(this.stateOverallSingle == 'overall'){
|
||||
left = sketch.offsetWidth/2-5
|
||||
top = sketch.offsetHeight/2-5
|
||||
}
|
||||
this.printStyleList[this.stateOverallSingle][index]={
|
||||
centers:{
|
||||
left:0,
|
||||
top:0,
|
||||
},
|
||||
style:{
|
||||
left:(boor?left:Math.trunc(Math.random()*x)+1)+"px",
|
||||
top:(boor?top:Math.trunc(Math.random()*y)+1)+"px",
|
||||
right:"auto",
|
||||
bottom:"auto",
|
||||
width:this.print.width.replace(/px/g,'')*scale+'px',
|
||||
height:this.print.height.replace(/px/g,'')*scale+'px',
|
||||
zIndex:this.printZIndex++
|
||||
},
|
||||
transform:{
|
||||
// scale:scale<.2?.2:scale,//0.2-3
|
||||
// rotateZ:rotateZ1-rotateZ2,
|
||||
rotateZ:this.printStyleList[this.stateOverallSingle][index].transform.rotateZ?this.printStyleList[this.stateOverallSingle][index].transform.rotateZ:0
|
||||
},
|
||||
designOpenrtionBtn:false
|
||||
}
|
||||
scale = width / this.print.height.replace(/px/g,'')
|
||||
}
|
||||
let x = sketch?.width - this.print.width.replace(/px/g,'')*scale
|
||||
if(!this.overallSingle){
|
||||
x = sketch?.width - this.print.width.replace(/px/g,'')*scale/2
|
||||
}
|
||||
let y = sketch?.height-this.print.height.replace(/px/g,'')*scale
|
||||
let left = sketch.offsetWidth/2-this.print.width.replace(/px/g,'')*scale/2
|
||||
let top = sketch.offsetHeight/2-this.print.height.replace(/px/g,'')*scale/2
|
||||
if(this.stateOverallSingle == 'overall'){
|
||||
left = sketch.offsetWidth/2-5
|
||||
top = sketch.offsetHeight/2-5
|
||||
}
|
||||
this.printStyleList[this.stateOverallSingle][index]={
|
||||
centers:{
|
||||
left:0,
|
||||
top:0,
|
||||
},
|
||||
style:{
|
||||
left:(boor?left:Math.trunc(Math.random()*x)+1)+"px",
|
||||
top:(boor?top:Math.trunc(Math.random()*y)+1)+"px",
|
||||
right:"auto",
|
||||
bottom:"auto",
|
||||
width:this.print.width.replace(/px/g,'')*scale+'px',
|
||||
height:this.print.height.replace(/px/g,'')*scale+'px',
|
||||
zIndex:this.printZIndex++
|
||||
},
|
||||
transform:{
|
||||
// scale:scale<.2?.2:scale,//0.2-3
|
||||
// rotateZ:rotateZ1-rotateZ2,
|
||||
rotateZ:this.printStyleList[this.stateOverallSingle][index].transform.rotateZ?this.printStyleList[this.stateOverallSingle][index].transform.rotateZ:0
|
||||
},
|
||||
designOpenrtionBtn:false
|
||||
}
|
||||
img.src = sketch.src
|
||||
},
|
||||
//设置图片
|
||||
async setTemplate(item,index,str) {
|
||||
@@ -784,8 +789,15 @@ export default defineComponent({
|
||||
for (let index = 0; index < arr.length; index++) {
|
||||
if(!this.overallSingle){
|
||||
scale = this.systemDesignerPercentage/100
|
||||
console.log(this.print);
|
||||
let overallScale = (arr[index].style.width.replace(/px/g,'')*sketchNum/this.print.width.replace(/px/g,''))
|
||||
let x = Number(arr[index].style.left.replace(/px/g,''))
|
||||
let y = Number(arr[index].style.top.replace(/px/g,''))
|
||||
let width = Number(this.print.width.replace(/px/g,''))
|
||||
let height = Number(this.print.height.replace(/px/g,''))
|
||||
|
||||
// location = [arr[index].style.left.replace(/px/g,'')*sketchNum+this.print.width.replace(/px/g,'')/2-7,arr[index].style.top.replace(/px/g,'')*sketchNum+this.print.height.replace(/px/g,'')/2-7]
|
||||
location = [arr[index].style.left.replace(/px/g,'')*sketchNum,arr[index].style.top.replace(/px/g,'')*sketchNum]
|
||||
location = [(x)*sketchNum ,(y )*sketchNum]
|
||||
}else{
|
||||
await this.setPrintWH(this.exhibitionOpenrtionList[this.stateOverallSingle][index].path)
|
||||
scale = (arr[index].style.width.replace(/px/g,'')*sketchNum/this.print.width.replace(/px/g,''))
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="input_border" >
|
||||
<div class="input_box Guide_1_5" :class="[inputShow?'active':'',type_.type2 =='Sketchboard'?'Guide_1_9_2':'']">
|
||||
<div class="input_box Guide_1_5" :class="[inputShow?'active':'',type_.type2 =='Sketchboard'?'Guide_1_9_2':'',driver__.driver?'showEvents':'']">
|
||||
<div class="input_box_btnBox" v-if="scene?.value != 'extract'">
|
||||
<div class="upload_item">
|
||||
<div
|
||||
@@ -146,7 +146,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="generage_img Guide_1_6" :class="{Guide_1_13_2:type_.type2 == 'Sketchboard',Guide_1_2_9:type_.type2 == 'Printboard'}" :style="[isGenerate?'overflow:hidden':'']">
|
||||
<div class="generage_img Guide_1_6" :class="{Guide_1_13_2:type_.type2 == 'Sketchboard',Guide_1_2_9:type_.type2 == 'Printboard',showEvents : driver__.driver}" :style="[isGenerate?'overflow:hidden':'']">
|
||||
<div
|
||||
class="generage_img_item"
|
||||
v-for="(item, index) in fileList"
|
||||
|
||||
Reference in New Issue
Block a user