|
@@ -74,6 +74,7 @@ export default {
|
|
|
originalHeight: 0,
|
|
|
onResize: null,
|
|
|
observer: null,
|
|
|
+ isInnerPage: false
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -94,10 +95,11 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
initSize() {
|
|
|
+ this.isInnerPage = this.$route.path.indexOf("bigStatistics")>=0
|
|
|
return new Promise((resolve, reject) => {
|
|
|
// console.log("初始化样式");
|
|
|
//给父元素设置 overflow:hidden
|
|
|
- this.screenWrapper.parentNode.style.overflow = "hidden";
|
|
|
+ this.screenWrapper.parentNode.style.overflow = !this.isInnerPage ? "hidden" : 'auto';
|
|
|
this.screenWrapper.parentNode.scrollLeft = 0;
|
|
|
this.screenWrapper.parentNode.scrollTop = 0;
|
|
|
|
|
@@ -135,8 +137,8 @@ export default {
|
|
|
const screenWrapper = this.screenWrapper;
|
|
|
const domWidth = screenWrapper.clientWidth;
|
|
|
const domHeight = screenWrapper.clientHeight;
|
|
|
- const currentWidth = document.body.clientWidth;
|
|
|
- const currentHeight = document.body.clientHeight;
|
|
|
+ const currentWidth = !this.isInnerPage ? document.body.clientWidth : screenWrapper.parentNode.clientWidth;
|
|
|
+ const currentHeight = !this.isInnerPage ? document.body.clientHeight : screenWrapper.parentNode.clientHeight;
|
|
|
screenWrapper.style.transform = `scale(${scale},${scale}) `;
|
|
|
let mx = Math.max((currentWidth - domWidth * scale) / 2, 0);
|
|
|
let my = Math.max((currentHeight - domHeight * scale) / 2, 0);
|
|
@@ -160,8 +162,8 @@ export default {
|
|
|
updateScale() {
|
|
|
const screenWrapper = this.screenWrapper;
|
|
|
// 获取真实视口尺寸
|
|
|
- const currentWidth = document.body.clientWidth;
|
|
|
- const currentHeight = document.body.clientHeight;
|
|
|
+ const currentWidth = !this.isInnerPage ? document.body.clientWidth : screenWrapper.parentNode.clientWidth;
|
|
|
+ const currentHeight = !this.isInnerPage ? document.body.clientHeight : screenWrapper.parentNode.clientHeight;
|
|
|
// 获取大屏最终的宽高onResize
|
|
|
const realWidth = this.currentWidth || this.originalWidth;
|
|
|
const realHeight = this.currentHeight || this.originalHeight;
|