Conflicts:
	ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java
	ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java
	ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java
	ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java
	ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml
	ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
	ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
	ruoyi-ui/src/api/tool/gen.js
	ruoyi-ui/src/assets/styles/ruoyi.scss
	ruoyi-ui/src/views/system/user/index.vue
	ruoyi-ui/src/views/tool/gen/index.vue
This commit is contained in:
疯狂的狮子li
2020-09-18 17:38:23 +08:00
13 changed files with 110 additions and 12 deletions

View File

@ -132,6 +132,13 @@
@click="handleDelete(scope.row)"
v-hasPermi="['tool:gen:remove']"
>删除</el-button>
<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"
@ -167,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 {
@ -252,6 +259,19 @@ export default {
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();