Przeglądaj źródła

fix:修改测报灯图片不展示问题

yf_zhb 2 lat temu
rodzic
commit
0284b1e49b
1 zmienionych plików z 99 dodań i 99 usunięć
  1. 99 99
      pingpu_vue/src/page/join/joincbd.vue

+ 99 - 99
pingpu_vue/src/page/join/joincbd.vue

@@ -77,7 +77,7 @@
         >
           <el-card class="box-card" style="margin-bottom: 15px">
             <img
-              v-lazy="item.thumb_url"
+              v-lazy="item.img_url"
               alt=""
               class="img"
               @click="seeimg(index)"
@@ -113,158 +113,158 @@
 </template>
 
 <script>
-//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 
 export default {
-  //import引入的组件需要注入到对象中才能使用
+  // import引入的组件需要注入到对象中才能使用
   components: {},
-  data() {
-    //这里存放数据
+  data () {
+    // 这里存放数据
     return {
       options: [],
-      device_id: "",
-      time: "",
+      device_id: '',
+      time: '',
       timeindex: 1,
       baseimglist: [],
       totalNum: 12,
       imageListtData: [],
       imageListtstatus: false,
       imgIndexNumber: 0,
-      end_time: "",
-      start_time: "",
-      page: "1",
+      end_time: '',
+      start_time: '',
+      page: '1',
       page_size: 12,
-      pagekey:1
-    };
+      pagekey: 1
+    }
   },
-  //监听属性 类似于data概念
+  // 监听属性 类似于data概念
   computed: {},
-  //监控data中的数据变化
+  // 监控data中的数据变化
   watch: {},
-  //方法集合
+  // 方法集合
   methods: {
-    getbaselist() {
+    getbaselist () {
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=device.device_picture.pp_device_list",
+        method: 'POST',
+        url: '/api/api_gateway?method=device.device_picture.pp_device_list',
         data: this.qs.stringify({
           device_type: 3,
-          page: "1",
-          page_size: "9999999",
-        }),
+          page: '1',
+          page_size: '9999999'
+        })
       }).then((res) => {
-        console.log(res);
-        if (res.data.message == "") {
-          var data = res.data.data.data;
+        console.log(res)
+        if (res.data.message == '') {
+          var data = res.data.data.data
           for (let i = 0; i < data.length; i++) {
             var obj = {
               value: data[i].device_id,
-              label: data[i].device_name + "/" + data[i].device_id,
-            };
-            this.options.push(obj);
+              label: data[i].device_name + '/' + data[i].device_id
+            }
+            this.options.push(obj)
           }
-          this.device_id = data[0].device_id;
-          this.getbaseimglist();
+          this.device_id = data[0].device_id
+          this.getbaseimglist()
         }
-      });
+      })
     },
-    empty(index) {
-      this.timeindex = index;
-      this.end_time = Math.floor(+new Date() / 1000);
-      var time = new Date();
+    empty (index) {
+      this.timeindex = index
+      this.end_time = Math.floor(+new Date() / 1000)
+      var time = new Date()
       if (index == 1) {
-        this.start_time = this.end_time - 24 * 60 * 60;
+        this.start_time = this.end_time - 24 * 60 * 60
       } else if (index == 2) {
-        this.start_time = this.end_time - 7 * 24 * 60 * 60;
+        this.start_time = this.end_time - 7 * 24 * 60 * 60
       } else if (index == 3) {
-        var mouth = time.getMonth();
-        this.start_time = Math.floor(time.setMonth(mouth - 1) / 1000);
+        var mouth = time.getMonth()
+        this.start_time = Math.floor(time.setMonth(mouth - 1) / 1000)
         // console.log(time2)
       } else if (index == 4) {
-        var mouth = time.getMonth();
-        this.start_time = Math.floor(time.setMonth(mouth - 3) / 1000);
+        var mouth = time.getMonth()
+        this.start_time = Math.floor(time.setMonth(mouth - 3) / 1000)
       }
-      this.page = 1;
-      this.pagekey = Math.random() * 10 + 1;
-      this.getbaseimglist();
+      this.page = 1
+      this.pagekey = Math.random() * 10 + 1
+      this.getbaseimglist()
     },
-    timechange(e) {
+    timechange (e) {
       if (e) {
-        this.start_time = Math.floor(+new Date(e[0]) / 1000);
-        this.end_time = Math.floor(+new Date(e[1]) / 1000);
-        this.page = 1;
-        this.pagekey = Math.random() * 10 + 1;
-        this.getbaseimglist();
+        this.start_time = Math.floor(+new Date(e[0]) / 1000)
+        this.end_time = Math.floor(+new Date(e[1]) / 1000)
+        this.page = 1
+        this.pagekey = Math.random() * 10 + 1
+        this.getbaseimglist()
       } else {
-        this.empty(1);
+        this.empty(1)
       }
     },
-    idchange(e) {
-      this.device_id = e;
-      this.page = 1;
-      this.pagekey = Math.random() * 10 + 1;
-      this.getbaseimglist();
+    idchange (e) {
+      this.device_id = e
+      this.page = 1
+      this.pagekey = Math.random() * 10 + 1
+      this.getbaseimglist()
     },
-    getbaseimglist() {
+    getbaseimglist () {
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=device.device_picture.pp_cbd_img_list",
+        method: 'POST',
+        url: '/api/api_gateway?method=device.device_picture.pp_cbd_img_list',
         data: this.qs.stringify({
           device_id: this.device_id,
           start_time: this.formatTime(this.start_time * 1000),
           end_time: this.formatTime(this.end_time * 1000),
           page: this.page,
-          page_size: this.page_size,
-        }),
+          page_size: this.page_size
+        })
       }).then((res) => {
-        if (res.data.message == "") {
-          this.baseimglist = res.data.data.data;
-          this.totalNum = res.data.data.num;
+        if (res.data.message == '') {
+          this.baseimglist = res.data.data.data
+          this.totalNum = res.data.data.num
         } else {
-          this.baseimglist = [];
-          this.totalNum = 12;
+          this.baseimglist = []
+          this.totalNum = 12
         }
-      });
+      })
     },
-    handleSizeChange(e) {
-      this.page_size = e;
-      this.page = 1;
-      this.pagekey = Math.random() * 10 + 1;
-      this.getbaseimglist();
+    handleSizeChange (e) {
+      this.page_size = e
+      this.page = 1
+      this.pagekey = Math.random() * 10 + 1
+      this.getbaseimglist()
     },
-    handleCurrentChange(e) {
-      this.page = e;
-      this.getbaseimglist();
+    handleCurrentChange (e) {
+      this.page = e
+      this.getbaseimglist()
     },
-    seeimg(index) {
-      this.$viewer.show();
-      this.imageListtData = [];
+    seeimg (index) {
+      this.$viewer.show()
+      this.imageListtData = []
       for (var i = 0; i < this.baseimglist.length; i++) {
-        this.imageListtData.push(this.baseimglist[i].img_url);
+        this.imageListtData.push(this.baseimglist[i].img_url)
       }
-      this.imgIndexNumber = index;
-    },
-    inited(viewer) {
-      this.$viewer = viewer;
-      this.$viewer.view(this.imgIndexNumber);
+      this.imgIndexNumber = index
     },
+    inited (viewer) {
+      this.$viewer = viewer
+      this.$viewer.view(this.imgIndexNumber)
+    }
   },
-  beforeCreate() {}, //生命周期 - 创建之前
-  //生命周期 - 创建完成(可以访问当前this实例)
-  created() {
-    this.end_time = Math.floor(+new Date() / 1000);
-    this.start_time = this.end_time - 24 * 60 * 60;
-    this.getbaselist();
+  beforeCreate () {}, // 生命周期 - 创建之前
+  // 生命周期 - 创建完成(可以访问当前this实例)
+  created () {
+    this.end_time = Math.floor(+new Date() / 1000)
+    this.start_time = this.end_time - 24 * 60 * 60
+    this.getbaselist()
   },
-  beforeMount() {}, //生命周期 - 挂载之前
-  //生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {},
-  beforeUpdate() {}, //生命周期 - 更新之前
-  updated() {}, //生命周期 - 更新之后
-  beforeDestroy() {}, //生命周期 - 销毁之前
-  destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
-};
+  beforeMount () {}, // 生命周期 - 挂载之前
+  // 生命周期 - 挂载完成(可以访问DOM元素)
+  mounted () {},
+  beforeUpdate () {}, // 生命周期 - 更新之前
+  updated () {}, // 生命周期 - 更新之后
+  beforeDestroy () {}, // 生命周期 - 销毁之前
+  destroyed () {}, // 生命周期 - 销毁完成
+  activated () {} // 如果页面有keep-alive缓存功能,这个函数会触发
+}
 </script>
 <style lang="less" scoped>
 .cbdbox {
@@ -376,4 +376,4 @@ export default {
     }
   }
 }
-</style>
+</style>