From a7eb07c7a0afb7da1eb9eb1bd902b0cec77921e2 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期五, 07 八月 2020 16:07:02 +0800 Subject: [PATCH] Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue --- ruoyi-ui/src/views/system/dict/index.vue | 40 ++++++++++++++++++++++++++++++++-------- 1 files changed, 32 insertions(+), 8 deletions(-) diff --git a/ruoyi-ui/src/views/system/dict/index.vue b/ruoyi-ui/src/views/system/dict/index.vue index 2dd211f..6da26ab 100644 --- a/ruoyi-ui/src/views/system/dict/index.vue +++ b/ruoyi-ui/src/views/system/dict/index.vue @@ -1,6 +1,6 @@ <template> <div class="app-container"> - <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"> + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form-item label="字典名称" prop="dictName"> <el-input v-model="queryParams.dictName" @@ -50,7 +50,7 @@ ></el-date-picker> </el-form-item> <el-form-item> - <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> + <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> </el-form-item> </el-form> @@ -94,6 +94,23 @@ v-hasPermi="['system:dict:export']" >导出</el-button> </el-col> + <el-col :span="1.5"> + <el-button + type="danger" + icon="el-icon-refresh" + size="mini" + @click="handleClearCache" + v-hasPermi="['system:dict:remove']" + >清理缓存</el-button> + </el-col> + <div class="top-right-btn"> + <el-tooltip class="item" effect="dark" content="刷新" placement="top"> + <el-button size="mini" circle icon="el-icon-refresh" @click="handleQuery" /> + </el-tooltip> + <el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top"> + <el-button size="mini" circle icon="el-icon-search" @click="showSearch=!showSearch" /> + </el-tooltip> + </div> </el-row> <el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange"> @@ -143,7 +160,7 @@ /> <!-- 添加或修改参数配置对话框 --> - <el-dialog :title="title" :visible.sync="open" width="500px"> + <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form-item label="字典名称" prop="dictName"> <el-input v-model="form.dictName" placeholder="请输入字典名称" /> @@ -173,9 +190,10 @@ </template> <script> -import { listType, getType, delType, addType, updateType, exportType } from "@/api/system/dict/type"; +import { listType, getType, delType, addType, updateType, exportType, clearCache } from "@/api/system/dict/type"; export default { + name: "Dict", data() { return { // 遮罩层 @@ -186,6 +204,8 @@ single: true, // 非多个禁用 multiple: true, + // 显示搜索条件 + showSearch: true, // 总条数 total: 0, // 字典表格数据 @@ -299,8 +319,6 @@ this.msgSuccess("修改成功"); this.open = false; this.getList(); - } else { - this.msgError(response.msg); } }); } else { @@ -309,8 +327,6 @@ this.msgSuccess("新增成功"); this.open = false; this.getList(); - } else { - this.msgError(response.msg); } }); } @@ -343,6 +359,14 @@ }).then(response => { this.download(response.msg); }).catch(function() {}); + }, + /** 清理缓存按钮操作 */ + handleClearCache() { + clearCache().then(response => { + if (response.code === 200) { + this.msgSuccess("清理成功"); + } + }); } } }; -- Gitblit v1.9.2