| | |
| | | <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']"
|
| | |
| | | <!-- 预览界面 -->
|
| | | <el-dialog :title="preview.title" :visible.sync="preview.open" width="80%" top="5vh" append-to-body>
|
| | | <el-tabs v-model="preview.activeName">
|
| | | <el-tab-pane
|
| | | <el-tab-pane style="overflow-x: scroll;"
|
| | | v-for="(value, key) in preview.data"
|
| | | :label="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
|
| | | :name="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
|
| | |
| | | </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 {
|
| | |
| | | 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();
|
| | |
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("删除成功");
|
| | | }).catch(function() {});
|
| | | })
|
| | | }
|
| | | }
|
| | | };
|