From 1a87ee7c196e2d5d17dbe7a8a29d36858ccaed98 Mon Sep 17 00:00:00 2001
From: 若依 <yzz_ivy@163.com>
Date: Tue, 22 Dec 2020 16:19:51 +0800
Subject: [PATCH] 防止get请求参数值为false或0等特殊值会导致无法正确的传参 Merge pull request !146 from wugh/hotfix/gitee-issue_I2A5FU
---
ruoyi-ui/src/views/tool/gen/index.vue | 42 ++++++++++++++++++++++++++++--------------
1 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/ruoyi-ui/src/views/tool/gen/index.vue b/ruoyi-ui/src/views/tool/gen/index.vue
index fcbbfe5..a9145f8 100644
--- a/ruoyi-ui/src/views/tool/gen/index.vue
+++ b/ruoyi-ui/src/views/tool/gen/index.vue
@@ -76,14 +76,7 @@
v-hasPermi="['tool:gen: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>
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
@@ -98,21 +91,21 @@
align="center"
prop="tableName"
:show-overflow-tooltip="true"
- width="130"
+ width="120"
/>
<el-table-column
label="表描述"
align="center"
prop="tableComment"
:show-overflow-tooltip="true"
- width="130"
+ width="120"
/>
<el-table-column
label="实体"
align="center"
prop="className"
:show-overflow-tooltip="true"
- width="130"
+ width="120"
/>
<el-table-column label="创建时间" align="center" prop="createTime" width="160" />
<el-table-column label="更新时间" align="center" prop="updateTime" width="160" />
@@ -142,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']"
@@ -165,7 +165,7 @@
:name="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
:key="key"
>
- <pre>{{ value }}</pre>
+ <highlightjs autodetect :code="value" />
</el-tab-pane>
</el-tabs>
</el-dialog>
@@ -174,9 +174,10 @@
</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 {
name: "Gen",
components: { importTable },
@@ -259,6 +260,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("同步成功");
+ })
+ },
/** 打开导入表弹窗 */
openImportTable() {
this.$refs.import.show();
@@ -300,7 +314,7 @@
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
- }).catch(function() {});
+ })
}
}
};
--
Gitblit v1.9.2