From 824635df7f95b68ff493b904071e6c053fad9f9b Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期五, 13 八月 2021 12:37:34 +0800 Subject: [PATCH] update 修正 PR 相关问题 --- ruoyi-ui/src/views/system/oss/index.vue | 35 +++++++++++++++++++++++++++-------- 1 files changed, 27 insertions(+), 8 deletions(-) diff --git a/ruoyi-ui/src/views/system/oss/index.vue b/ruoyi-ui/src/views/system/oss/index.vue index 8312454..e8e471e 100644 --- a/ruoyi-ui/src/views/system/oss/index.vue +++ b/ruoyi-ui/src/views/system/oss/index.vue @@ -96,7 +96,16 @@ v-hasPermi="['system:oss:remove']" >鍒犻櫎</el-button> </el-col> - + <el-col :span="1.5"> + <el-button + type="info" + plain + icon="el-icon-s-operation" + size="mini" + @click="handleOssConfig" + v-hasPermi="['system:oss:list']" + >閰嶇疆绠$悊</el-button> + </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> @@ -106,13 +115,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" > - <template slot-scope="scope" v-if="previewListResource"> + <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 && checkFileSuffix(scope.row.fileSuffix)" style="width: 100px; height: 100px;" :src="scope.row.url" :preview-src-list="[scope.row.url]"/> + <span v-text="scope.row.url" + v-if="!checkFileSuffix(scope.row.fileSuffix) || !previewListResource"/> </template> </el-table-column> <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" width="180"> @@ -168,9 +179,7 @@ <script> import { listOss, delOss } from "@/api/system/oss"; -import { downLoadOss } from "@/utils/ossdownload"; -import { updateConfig } from "@/api/system/config"; - +import { downLoadOss } from "@/utils/download"; export default { name: "Oss", @@ -239,12 +248,18 @@ this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1]; } this.getConfigKey("sys.oss.previewListResource").then(response => { - this.previewListResource = response.msg; + this.previewListResource = response.msg === undefined ? true : response.msg === 'true'; }); listOss(this.queryParams).then(response => { this.ossList = response.rows; this.total = response.total; this.loading = false; + }); + }, + checkFileSuffix(fileSuffix) { + let arr = ["png", "jpg", "jpeg"]; + return arr.some(type => { + return fileSuffix.indexOf(type) > -1; }); }, // 鍙栨秷鎸夐挳 @@ -276,6 +291,10 @@ this.single = selection.length!==1 this.multiple = !selection.length }, + /** 浠诲姟鏃ュ織鍒楄〃鏌ヨ */ + handleOssConfig() { + this.$router.push({ path: '/system/oss-config/index'}) + }, /** 鏂囦欢鎸夐挳鎿嶄綔 */ handleFile() { this.reset(); -- Gitblit v1.9.3