From ae4290bdda94767281c1aab0e4a6b5a24e9c89a4 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期六, 03 十月 2020 20:05:24 +0800 Subject: [PATCH] 修复页签关闭所有固定标签路由不刷新问题 --- ruoyi-ui/src/views/tool/gen/index.vue | 29 ++++++++++++++++++++++++++--- 1 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ruoyi-ui/src/views/tool/gen/index.vue b/ruoyi-ui/src/views/tool/gen/index.vue index 06306c2..beebfe2 100644 --- a/ruoyi-ui/src/views/tool/gen/index.vue +++ b/ruoyi-ui/src/views/tool/gen/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="tableName"> <el-input v-model="queryParams.tableName" @@ -32,7 +32,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> @@ -76,6 +76,7 @@ v-hasPermi="['tool:gen:remove']" >删除</el-button> </el-col> + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> <el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange"> @@ -134,6 +135,13 @@ <el-button type="text" size="small" + icon="el-icon-refresh" + @click="handleSynchDb(scope.row)" + v-hasPermi="['tool:gen:edit']" + >同步</el-button> + <el-button + type="text" + size="small" icon="el-icon-download" @click="handleGenTable(scope.row)" v-hasPermi="['tool:gen:code']" @@ -166,7 +174,7 @@ </template> <script> -import { listTable, previewTable, delTable, genCode } from "@/api/tool/gen"; +import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen"; import importTable from "./importTable"; import { downLoadZip } from "@/utils/zipdownload"; export default { @@ -186,6 +194,8 @@ single: true, // 非多个禁用 multiple: true, + // 显示搜索条件 + showSearch: true, // 总条数 total: 0, // 表数据 @@ -249,6 +259,19 @@ downLoadZip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi"); } }, + /** 同步数据库操作 */ + handleSynchDb(row) { + const tableName = row.tableName; + this.$confirm('确认要强制同步"' + tableName + '"表结构吗?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }).then(function() { + return synchDb(tableName); + }).then(() => { + this.msgSuccess("同步成功"); + }).catch(function() {}); + }, /** 打开导入表弹窗 */ openImportTable() { this.$refs.import.show(); -- Gitblit v1.9.2