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/Pool/CardList.ts                  |    2 --
 src/components/cardWindow.vue         |   20 +++++++++++++++-----
 src/pages/cameraVideo/index/App.vue   |    8 +++++---
 src/components/subComponents/Card.vue |    1 -
 src/pages/search/index/App.vue        |    2 +-
 5 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/src/Pool/CardList.ts b/src/Pool/CardList.ts
index c68b8a9..eb66b79 100644
--- a/src/Pool/CardList.ts
+++ b/src/Pool/CardList.ts
@@ -22,10 +22,8 @@
       // }
       // 瑙e喅鑱斿姩浠诲姟璇︽儏涓嬩竴涓猙ug
       let ele = (this.datalist as any)[i].activeObject;
-      console.log(i)
       if ((ele as any).id === id && i !== 0) {
         if (i - 1 < 0) {
-          console.log('aaaaaaaaaaa')
           return false;
         }
         return this.datalist[i - 1];
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
     },
diff --git a/src/components/subComponents/Card.vue b/src/components/subComponents/Card.vue
index 3f52486..7749870 100644
--- a/src/components/subComponents/Card.vue
+++ b/src/components/subComponents/Card.vue
@@ -75,7 +75,6 @@
   },
   methods: {
     detailsClick(ev) {
-      debugger
       this.$emit("detailsClick", ev);
     },
     toAdd(item) {
diff --git a/src/pages/cameraVideo/index/App.vue b/src/pages/cameraVideo/index/App.vue
index 998da23..ccaf13f 100644
--- a/src/pages/cameraVideo/index/App.vue
+++ b/src/pages/cameraVideo/index/App.vue
@@ -10,19 +10,21 @@
     <div class="column-right" :style="`height:${screenHeight}px;`">
       <right-side />
     </div>
+    <card-window></card-window>
   </div>
 </template>
 
 <script>
 import LeftNav from "@/components/LeftNav";
-// import CameraVideo from "./components/Video.vue";
-import RightSide from "./Video"
+import RightSide from "./Video";
+import CardWindow from "@/components/cardWindow";
 
 export default {
   name: "CameraVideo",
   components: {
     LeftNav,
-    RightSide
+    RightSide,
+    CardWindow
   },
   data() {
     return {
diff --git a/src/pages/search/index/App.vue b/src/pages/search/index/App.vue
index afb18ec..b93a70b 100644
--- a/src/pages/search/index/App.vue
+++ b/src/pages/search/index/App.vue
@@ -18,7 +18,7 @@
 import LeftNav from "@/components/LeftNav";
 // import CameraVideo from "./components/Video.vue";
 import RightSide from "./Searching"
-import CardWindow from "../components/cardWindow";
+import CardWindow from "@/components/cardWindow";
 
 export default {
   name: "SearchPage",

--
Gitblit v1.8.0