From c271ffc066c35beafe40acfb63679555f1ed7d18 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期二, 17 八月 2021 14:34:29 +0800
Subject: [PATCH] update 同步 ruoyi 自定义限流 新功能
---
ruoyi-ui/src/views/system/oss/index.vue | 61 +++++++++++++++++++++++++-----
1 files changed, 51 insertions(+), 10 deletions(-)
diff --git a/ruoyi-ui/src/views/system/oss/index.vue b/ruoyi-ui/src/views/system/oss/index.vue
index a183938..2bbbba0 100644
--- a/ruoyi-ui/src/views/system/oss/index.vue
+++ b/ruoyi-ui/src/views/system/oss/index.vue
@@ -96,7 +96,25 @@
v-hasPermi="['system:oss:remove']"
>鍒犻櫎</el-button>
</el-col>
-
+ <el-col :span="1.5">
+ <el-button
+ :type="previewListResource ? 'danger' : 'warning'"
+ plain
+ size="mini"
+ @click="handlePreviewListResource(!previewListResource)"
+ v-hasPermi="['system:oss:edit']"
+ >棰勮寮�鍏� : {{previewListResource ? "绂佺敤" : "鍚敤"}}</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>
@@ -169,7 +187,7 @@
</template>
<script>
-import { listOss, delOss } from "@/api/system/oss";
+import { listOss, delOss, changePreviewListResource } from "@/api/system/oss";
import { downLoadOss } from "@/utils/download";
export default {
@@ -282,6 +300,10 @@
this.single = selection.length!==1
this.multiple = !selection.length
},
+ /** 浠诲姟鏃ュ織鍒楄〃鏌ヨ */
+ handleOssConfig() {
+ this.$router.push({ path: '/system/oss-config/index'})
+ },
/** 鏂囦欢鎸夐挳鎿嶄綔 */
handleFile() {
this.reset();
@@ -312,14 +334,33 @@
confirmButtonText: "纭畾",
cancelButtonText: "鍙栨秷",
type: "warning"
- }).then(() => {
- this.loading = true;
- return delOss(ossIds);
- }).then(() => {
- this.loading = false;
- this.getList();
- this.msgSuccess("鍒犻櫎鎴愬姛");
- }).catch(() => {});
+ }).then(() => {
+ this.loading = true;
+ return delOss(ossIds);
+ }).then(() => {
+ this.loading = false;
+ this.getList();
+ this.msgSuccess("鍒犻櫎鎴愬姛");
+ }).finally(() => {
+ this.loading = false;
+ });
+ },
+ // 棰勮鍒楄〃鍥剧墖鐘舵�佷慨鏀�
+ handlePreviewListResource(previewListResource) {
+ let text = previewListResource ? "鍚敤" : "鍋滅敤";
+ this.$confirm(
+ '纭瑕�"' + text + '""棰勮鍒楄〃鍥剧墖"閰嶇疆鍚�?', "璀﹀憡", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ }).then(() => {
+ return changePreviewListResource(previewListResource);
+ }).then(() => {
+ this.getList()
+ this.msgSuccess(text + "鎴愬姛");
+ }).catch(() => {
+ this.previewListResource = previewListResource !== true;
+ })
}
}
};
--
Gitblit v1.9.3