From 7eb7f23312ccc759af42c8a9736b1bb8be091a9a Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@iotlink.com>
Date: 星期三, 05 八月 2020 18:24:03 +0800
Subject: [PATCH] 修复实时监控card弹窗

---
 src/components/cardWindow.vue |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/pages/search/components/cardWindow.vue b/src/components/cardWindow.vue
similarity index 95%
rename from src/pages/search/components/cardWindow.vue
rename to src/components/cardWindow.vue
index fc543e6..d862113 100644
--- a/src/pages/search/components/cardWindow.vue
+++ b/src/components/cardWindow.vue
@@ -25,11 +25,7 @@
           <model-card :data="item.list[0]"></model-card>
         </div>
         <el-carousel v-else height="calc(100% - 50px);" :autoplay="false">
-          <el-carousel-item
-            v-for="(subitem, subindex) in item.list"
-            :key="subindex"
-            height="100%"
-          >
+          <el-carousel-item v-for="(subitem, subindex) in item.list" :key="subindex" height="100%">
             <model-card
               :data="subitem"
               :activeName="type"
@@ -67,7 +63,21 @@
       defaultWidth: 600
     }
   },
+  mounted() {
+    this.getCenter();
+    window.onresize = () => {
+      return (() => {
+        this.getCenter();
+      })();
+    };
+  },
   methods: {
+    getCenter() {
+      this.center = {
+        x: document.documentElement.clientWidth / 2 - 250,
+        y: document.documentElement.clientHeight / 2 - 200
+      };
+    },
     resizeWidth(w) {
       this.defaultWidth = w
     },

--
Gitblit v1.8.0