From eb2be90e74adfa06ee251f80c08243d0301ce467 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期三, 28 七月 2021 10:49:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev'

---
 ruoyi-ui/src/views/system/oss/index.vue |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/ruoyi-ui/src/views/system/oss/index.vue b/ruoyi-ui/src/views/system/oss/index.vue
index 12bc5d3..1171cc9 100644
--- a/ruoyi-ui/src/views/system/oss/index.vue
+++ b/ruoyi-ui/src/views/system/oss/index.vue
@@ -96,6 +96,7 @@
           v-hasPermi="['system:oss:remove']"
         >鍒犻櫎</el-button>
       </el-col>
+
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -105,13 +106,15 @@
       <el-table-column label="鏂囦欢鍚�" align="center" prop="fileName" />
       <el-table-column label="鍘熷悕" align="center" prop="originalName" />
       <el-table-column label="鏂囦欢鍚庣紑" align="center" prop="fileSuffix" />
-      <el-table-column label="鏂囦欢灞曠ず" align="center" prop="url" >
+      <el-table-column label="鏂囦欢灞曠ず" align="center" prop="url">
         <template slot-scope="scope">
           <el-image
-            v-if="scope.row.fileSuffix.indexOf('png','jpg','jpeg') > 0"
+            v-if="previewListResource && scope.row.fileSuffix.indexOf('png','jpg','jpeg') > 0"
             style="width: 100px; height: 100px;"
             :src="scope.row.url"
             :preview-src-list="[scope.row.url]"/>
+          <span v-text="scope.row.url"
+                v-if="scope.row.fileSuffix.indexOf('png','jpg','jpeg') < 0 || !previewListResource"/>
         </template>
       </el-table-column>
       <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" width="180">
@@ -168,6 +171,8 @@
 <script>
 import { listOss, delOss } from "@/api/system/oss";
 import { downLoadOss } from "@/utils/ossdownload";
+import { updateConfig } from "@/api/system/config";
+
 
 export default {
   name: "Oss",
@@ -197,6 +202,8 @@
       type: 0,
       // 鏄惁鏄剧ず寮瑰嚭灞�
       open: false,
+      // 棰勮鍒楄〃鍥剧墖
+      previewListResource: true,
       // 鍒涘缓鏃堕棿鏃堕棿鑼冨洿
       daterangeCreateTime: [],
       // 鏌ヨ鍙傛暟
@@ -233,6 +240,9 @@
         this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
         this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
       }
+      this.getConfigKey("sys.oss.previewListResource").then(response => {
+        this.previewListResource = response.msg === undefined ? true : response.msg === 'true';
+      });
       listOss(this.queryParams).then(response => {
         this.ossList = response.rows;
         this.total = response.total;
@@ -289,7 +299,7 @@
     },
     /** 涓嬭浇鎸夐挳鎿嶄綔 */
     handleDownload(row) {
-      downLoadOss(row.ossId, row.originalName)
+      downLoadOss(row.ossId)
     },
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
     handleDelete(row) {

--
Gitblit v1.9.3