From f0e70039e87eab0a013d12ca5dac973dd261de20 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Mon, 12 Apr 2021 10:35:20 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/jfpt-Vue

---
 src/views/animalHeat/animalHeat.vue |   73 ++++++++++++++++++++++++++++--------
 1 files changed, 57 insertions(+), 16 deletions(-)

diff --git a/src/views/animalHeat/animalHeat.vue b/src/views/animalHeat/animalHeat.vue
index 1df821a..ce28534 100644
--- a/src/views/animalHeat/animalHeat.vue
+++ b/src/views/animalHeat/animalHeat.vue
@@ -12,6 +12,7 @@
                @row-update="rowUpdate"
                @row-save="rowSave"
                @row-del="rowDel"
+               @row-click="rowClick"
                @search-change="searchChange"
                @search-reset="searchReset"
                @selection-change="selectionChange"
@@ -40,18 +41,33 @@
           </el-button>
         </template>
     </avue-crud>
+
+    <template>
+      <div>
+          <el-image-viewer
+              class="img"
+              v-if="showViewer"
+              :on-close="closeViewer"
+              :url-list="[imgUrl]" />
+      </div>
+    </template>
   </basic-container>
 </template>
 
 <script>
   import {getList} from "@/api/animalHeat/animalHeat";
   import {mapGetters} from "vuex";
+  import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
 
   export default {
+    name:'index',
+    components: { ElImageViewer },
     data() {
       return {
         form: {},
         query: {},
+        showViewer:false,
+        imgUrl:'',
         loading: true,
         page: {
           pageSize: 10,
@@ -96,21 +112,15 @@
               label: "体温",
               prop: "tempRed"
             },
-            {
-              label: '图片',
-              prop: 'picture',
-              type: 'upload',
-              width: 300,
-              listType: 'picture-img',
-              span: 24,
-              propsHttp: {
-                res: 'data'
-              },
-              canvasOption: {
-                text: 'avue',
-                ratio: 0.1
-              }
-            },
+            // {
+            //   label: '图片',
+            //   prop: 'picture',
+            //   type: 'img',
+            //   alone:false,
+            //   width: 300,
+            //   //listType: 'picture-img',
+            //   span: 24
+            // },
             {
               label: "检测时间",
               prop: "dateTime",
@@ -118,6 +128,7 @@
               format: "yyyy-MM-dd",
               valueFormat: "yyyy-MM-dd",
               searchRange: true,
+              searchValue:[this.getStartTime(),this.getEndTime()],
               searchSpan: 5,
               hide: true,
               addDisplay: false,
@@ -206,12 +217,36 @@
       refreshChange() {
         this.onLoad(this.page, this.query);
       },
+      getStartTime(){
+           if (this.$route.query.startTime != undefined && this.$route.query.startTime != null && this.$route.query.startTime != "" ) {
+             return this.$route.query.startTime
+           }
+           return '';
+      },
+      getEndTime(){
+           if (this.$route.query.endTime != undefined && this.$route.query.endTime != null && this.$route.query.endTime != "" ) {
+             return this.$route.query.endTime
+           }
+           return '';
+      },
+      //修改行颜色
       rowStyle({row, column, rowIndex}){
          if(row.status=="1"){
            return {
              color:"#fe1515"
            }
          }
+      },
+      //图片行点击事件
+      rowClick(row){
+        var that = this;
+        that.imgUrl = row.picture;
+        console.log(that.imgUrl,111);
+        this.showViewer = true
+      },
+      // 关闭查看器
+      closeViewer() {
+        this.showViewer = false
       },
       getAnimalData(e) {
         this.activeClass=e;
@@ -295,10 +330,16 @@
     }
   };
 </script>
-<style scoped>
+<style lang="scss">
   .el-button.btn-color {
     color: rgb(255, 255, 255);
     background-color: rgb(64, 158, 255);
     border-color: rgb(64, 158, 255);
   }
+
+  .img {
+      .el-icon-circle-close {
+        color: white;
+      }
+  }
 </style>

--
Gitblit v1.9.3