فهرست منبع

工时管家——管理系统异常统计增加图片显示

ZhouRuiTing 5 سال پیش
والد
کامیت
181307e83b
1فایلهای تغییر یافته به همراه15 افزوده شده و 3 حذف شده
  1. 15 3
      fhKeeper/formulahousekeeper/timesheet/src/views/desktop/unusual.vue

+ 15 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/desktop/unusual.vue

@@ -20,7 +20,11 @@
         </el-table-column>
         <el-table-column label="图片" width="200">
             <template slot-scope="scope">
-                <el-image :src="scope.row.picUrl"></el-image>
+                <el-image :src="scope.row.picUrl" :preview-src-list="getSrcList(index)" lazy>
+                    <div slot="error" class="image-slot">
+                        <el-image :src="require('../../assets/image/noPic.png')" class="image" lazy></el-image>
+                    </div>
+                </el-image>
             </template>
         </el-table-column>
         <el-table-column prop="time" label="时间" width="140" sortable></el-table-column>
@@ -53,7 +57,8 @@ export default {
       total: 0,
       page: 1,
       size: 20,
-      list: []
+      list: [],
+      srcList: [],
     };
   },
   methods: {
@@ -67,6 +72,10 @@ export default {
           this.listLoading = false;
           if (res.code == "ok") {
             this.list = res.data.records;
+            this.srcList = [];
+            for(var i in this.list) {
+                this.srcList.push(this.list[i].picUrl)
+            }
             this.total = res.data.total;
           } else {
             this.$message({
@@ -122,7 +131,10 @@ export default {
         default:
           return "未知";
       }
-    }
+    },
+    getSrcList(index) {
+        return this.srcList.slice(index).concat(this.srcList.slice(0, index));
+    },
   },
   created() {
     let height = window.innerHeight;