Browse Source

图稿库增加图片预览

lxf 1 year ago
parent
commit
c932544f3d
1 changed files with 10 additions and 4 deletions
  1. 10 4
      src/views/group/picLibrary/picture/index.vue

+ 10 - 4
src/views/group/picLibrary/picture/index.vue

@@ -12,10 +12,14 @@
         <template v-if="tableData && tableData.length > 0">
           <div v-for="(item, index) in tableData" :key="index" style="margin: 0 40px 40px 0; text-align: center">
             <div v-if="item.imgUrl">
-              <img
-                v-lazy="item.imgUrl"
-                style="cursor: pointer; border-radius: 5px; height: 26vh; object-fit: contain; object-position: 50% 50%; background: #fff"
-                @click="openFile(item.imgUrl)" />
+              <el-image
+                style="cursor: pointer; border-radius: 5px; height: 26vh"
+                :src="item.imgUrl"
+                :zoom-rate="1.2"
+                :preview-src-list="tableData.map((row) => row.imgUrl)"
+                :initial-index="index"
+                fit="cover" />
+              <!-- <img v-lazy="item.imgUrl" style="object-fit: contain; object-position: 50% 50%; background: #fff" @click="openFile(item.imgUrl)" /> -->
             </div>
             <div style="margin: 5px 0; white-space: nowrap; text-overflow: ellipsis">{{ item.artworkName }}</div>
             <div style="margin: 5px 0; display: flex; justify-content: space-between">
@@ -25,6 +29,8 @@
           </div>
         </template>
       </div>
+      <!-- <div class="demo-image__preview"> -->
+      <!-- </div> -->
     </el-card>
 
     <el-dialog :title="modalType == 'add' ? '新增图稿' : '编辑图稿'" v-if="openDialog" v-model="openDialog" width="700">