|
@@ -828,17 +828,13 @@
|
|
this.$set(this, 'subjectOptions', [{ id: response.data.subId, name: response.data.subName }])
|
|
this.$set(this, 'subjectOptions', [{ id: response.data.subId, name: response.data.subName }])
|
|
let newData = JSON.parse(JSON.stringify(this.buildingList));
|
|
let newData = JSON.parse(JSON.stringify(this.buildingList));
|
|
for(let i=0;i<newData.mapList.length;i++){
|
|
for(let i=0;i<newData.mapList.length;i++){
|
|
- console.log('response.data.subId',response.data.subId)
|
|
|
|
- console.log('newData.mapList[i].subId',newData.mapList[i].subId)
|
|
|
|
- console.log('response.data.roomName',response.data.roomName)
|
|
|
|
- console.log('newData.mapList[i].roomName',newData.mapList[i].roomName)
|
|
|
|
if( response.data.subId == newData.mapList[i].subId || response.data.roomName == newData.mapList[i].roomName){
|
|
if( response.data.subId == newData.mapList[i].subId || response.data.roomName == newData.mapList[i].roomName){
|
|
newData.mapList[i].checkType = true;
|
|
newData.mapList[i].checkType = true;
|
|
}else{
|
|
}else{
|
|
newData.mapList[i].checkType = false;
|
|
newData.mapList[i].checkType = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- let newObj = this.calculateMapMax(newData.mapList,260,550,'min')
|
|
|
|
|
|
+ let newObj = this.calculateMapMax(newData.mapList,285,575,'min')
|
|
newData.width = newObj.maxWidth
|
|
newData.width = newObj.maxWidth
|
|
newData.height = newObj.maxHeight
|
|
newData.height = newObj.maxHeight
|
|
newData.zoomData = newObj.zoomData
|
|
newData.zoomData = newObj.zoomData
|
|
@@ -1001,49 +997,26 @@
|
|
maxWidth++
|
|
maxWidth++
|
|
}
|
|
}
|
|
//缩放判断
|
|
//缩放判断
|
|
- if(maxHeight>height&&maxWidth>width){
|
|
|
|
- if((maxHeight-height)>(maxWidth-width)){
|
|
|
|
- zoomData = height/maxHeight;
|
|
|
|
- this.$set(this,'zoomData',height/maxHeight);
|
|
|
|
- if(type == 'min'){
|
|
|
|
- this.$set(this,'minZoomData',height/maxHeight);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- zoomData = width / maxWidth;
|
|
|
|
- this.$set(this,'zoomData',width / maxWidth);
|
|
|
|
- if(type == 'min'){
|
|
|
|
- this.$set(this,'minZoomData',width / maxWidth);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }else if(maxHeight<height&&maxWidth<width){
|
|
|
|
- if((height-maxHeight)>(width-maxWidth)){
|
|
|
|
- zoomData = width / maxWidth;
|
|
|
|
- this.$set(this,'zoomData',width / maxWidth);
|
|
|
|
- if(type == 'min'){
|
|
|
|
- this.$set(this,'minZoomData',width / maxWidth);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- zoomData = height / maxHeight;
|
|
|
|
- this.$set(this,'zoomData',height / maxHeight);
|
|
|
|
- if(type == 'min'){
|
|
|
|
- this.$set(this,'minZoomData',height / maxHeight);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }else if(maxHeight<height&&maxWidth>width){
|
|
|
|
- zoomData = width / maxWidth;
|
|
|
|
- this.$set(this,'zoomData',width / maxWidth);
|
|
|
|
- if(type == 'min'){
|
|
|
|
- this.$set(this,'minZoomData',width / maxWidth);
|
|
|
|
- }
|
|
|
|
- }else if(maxHeight>height&&maxWidth<width){
|
|
|
|
- zoomData = height / maxHeight;
|
|
|
|
- this.$set(this,'zoomData',height / maxHeight);
|
|
|
|
- if(type == 'min'){
|
|
|
|
- this.$set(this,'minZoomData',height / maxHeight);
|
|
|
|
- }
|
|
|
|
|
|
+ let zoomNumOne = height / maxHeight;
|
|
|
|
+ if(parseInt(this.accMul(zoomNumOne,maxHeight)) <= height && parseInt(this.accMul(zoomNumOne,maxWidth)) <= width){
|
|
|
|
+ zoomData = zoomNumOne;
|
|
|
|
+ this.$set(this,'zoomData',zoomNumOne);
|
|
|
|
+ this.$set(this,'minZoomData',zoomNumOne);
|
|
|
|
+ }
|
|
|
|
+ let zoomNumTwo = width / maxWidth;
|
|
|
|
+ if(parseInt(this.accMul(zoomNumTwo,maxHeight)) <= height && parseInt(this.accMul(zoomNumTwo,maxWidth)) <= width){
|
|
|
|
+ zoomData = zoomNumTwo;
|
|
|
|
+ this.$set(this,'zoomData',zoomNumTwo);
|
|
|
|
+ this.$set(this,'minZoomData',zoomNumTwo);
|
|
}
|
|
}
|
|
return { maxWidth: maxWidth, maxHeight: maxHeight,zoomData:zoomData }
|
|
return { maxWidth: maxWidth, maxHeight: maxHeight,zoomData:zoomData }
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ accMul(arg1,arg2){
|
|
|
|
+ var m=0,s1=arg1.toString(),s2=arg2.toString();
|
|
|
|
+ try{m+=s1.split(".")[1].length}catch(e){}
|
|
|
|
+ try{m+=s2.split(".")[1].length}catch(e){}
|
|
|
|
+ return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)
|
|
|
|
+ },
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|