From a38281e697cde9f45926a6af0c88bec14501fec0 Mon Sep 17 00:00:00 2001
From: liuyg <liuyg@qq.com>
Date: Tue, 15 Feb 2022 11:06:34 +0800
Subject: [PATCH] 68个表格在1366*768下的适配,保安单位情况智能分析中的图表的适配以及其按钮会被遮住不能点击

---
 src/store/onresize.js |   51 ++++++++++++++++++++++++++++++---------------------
 1 files changed, 30 insertions(+), 21 deletions(-)

diff --git a/src/store/onresize.js b/src/store/onresize.js
index 2169b6b..507ae13 100644
--- a/src/store/onresize.js
+++ b/src/store/onresize.js
@@ -1,21 +1,26 @@
-import _this from '../main'
-
+import _this from "../main";
 
 // 设置 init 函数
 function init() {
-    if (_this) {
-        let innerWH = {
-            innerWidth: window.innerWidth,
-            innerHeight: window.innerHeight,
-            // innerWidth: document.documentElement.clientWidth,
-            // innerHeight: document.documentElement.clientHeight,
-        }
-        _this.$store.commit('setWindowSize', innerWH);
-        // console.log(' window.innerWidth', window.innerWidth);
-        // console.log(' window.innerHeight', window.innerHeight);
-        _this.$store.dispatch("changeZoom");
+  if (_this) {
+    let innerWH = {
+      innerWidth: window.innerWidth,
+      innerHeight: window.innerHeight
+      // innerWidth: document.documentElement.clientWidth,
+      // innerHeight: document.documentElement.clientHeight,
+    };
+    _this.$store.commit("setWindowSize", innerWH);
+    _this.$store.commit("setWindowSizeHeight", innerWH.innerHeight);
+    _this.$store.commit("setScreenSize", {
+      w: window.screen.width,
+      h: window.screen.height
+    });
 
-    }
+    // console.log("第下次判断屏幕分辨率");
+    // console.log(' window.innerWidth', window.innerWidth);
+    // console.log(' window.innerHeight', window.innerHeight);
+    _this.$store.dispatch("changeZoom");
+  }
 }
 
 // 节流 ms 触发间隔毫秒
@@ -23,20 +28,24 @@
 var lastClick = Date.now() - ms;
 // 初始化
 setTimeout(() => {
-    init();
+  init();
 }, 500);
 // 改变窗口大小时重新设置 rem
 // window.onresize = function () {
-//     // 节流 
+//     // 节流
 //     if (Date.now() - lastClick >= ms) {
 //         init();
 //         lastClick = Date.now();
 //     }
 // }
-window.addEventListener('resize', () => {
-    // 节流 
+window.addEventListener(
+  "resize",
+  () => {
+    // 节流
     if (Date.now() - lastClick >= ms) {
-        init();
-        lastClick = Date.now();
+      init();
+      lastClick = Date.now();
     }
-}, false)
\ No newline at end of file
+  },
+  false
+);

--
Gitblit v1.9.3