From 8a84c8e9e646f234006c6bbf4607776a4c4ed6b4 Mon Sep 17 00:00:00 2001
From: hanbaoshan <hanbaoshan@aiotlink.com>
Date: 星期二, 29 十二月 2020 19:16:05 +0800
Subject: [PATCH] 轨迹图查询条件判空处理

---
 src/pages/panoramicView/components/SlideCanvas.vue |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/pages/panoramicView/components/SlideCanvas.vue b/src/pages/panoramicView/components/SlideCanvas.vue
index 14362f4..47b4182 100644
--- a/src/pages/panoramicView/components/SlideCanvas.vue
+++ b/src/pages/panoramicView/components/SlideCanvas.vue
@@ -83,10 +83,6 @@
   methods: {
     refresh(url,cameraId) {
       this.$emit('polygonDataUpdate')
-
-      //let camera = this.cameras.find(one => one.id == cameraId);
-      //camera.canvasData.snapshot_url = url;
-
     },
     getCanvasData(data) {
       let _this = this;
@@ -108,11 +104,17 @@
     },
 
     pre () {
-      this.swiper.activeIndex--
+      this.swiper.activeIndex--;
+      if(this.swiper.activeIndex == -1){
+        this.swiper.activeIndex = this.cameras.length-1;
+      }
       this.swiper.slideTo(this.swiper.activeIndex);
     },
     next () {
-      this.swiper.activeIndex++
+      this.swiper.activeIndex++;
+      if(this.swiper.activeIndex == this.cameras.length){
+        this.swiper.activeIndex = 0;
+      }
       this.swiper.slideTo(this.swiper.activeIndex);
     },
     drawBaseImg (id) {

--
Gitblit v1.8.0