add
This commit is contained in:
@ -68,9 +68,9 @@ export function genCode(tableName) {
|
||||
}
|
||||
|
||||
// 同步数据库
|
||||
export function synchDb(tableName) {
|
||||
export function syncTable(tableId) {
|
||||
return request({
|
||||
url: "/tool/gen/synchDb/" + tableName,
|
||||
url: "/tool/gen/syncTable/" + tableId,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
@ -33,16 +33,6 @@
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleGenTable"
|
||||
v-hasPermi="['tool:gen:code']"
|
||||
>生成
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
@ -167,7 +157,7 @@
|
||||
link
|
||||
type="primary"
|
||||
icon="Refresh"
|
||||
@click="handleSynchDb(scope.row)"
|
||||
@click="handlesyncTable(scope.row)"
|
||||
v-hasPermi="['tool:gen:edit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
@ -223,7 +213,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Gen" lang="jsx">
|
||||
import { delTable, listTable, previewTable, synchDb } from "@/api/tool/gen";
|
||||
import { delTable, listTable, previewTable, syncTable } from "@/api/tool/gen";
|
||||
import router from "@/router";
|
||||
import importTable from "./importTable";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
@ -318,12 +308,12 @@ function handleGenTable(row) {
|
||||
}
|
||||
|
||||
/** 同步数据库操作 */
|
||||
function handleSynchDb(row) {
|
||||
function handlesyncTable(row) {
|
||||
const tableName = row.tableName;
|
||||
proxy.$modal
|
||||
.confirm('确认要强制同步"' + tableName + '"表结构吗?')
|
||||
.then(function () {
|
||||
return synchDb(tableName);
|
||||
return syncTable(row.tableId);
|
||||
})
|
||||
.then(() => {
|
||||
proxy.$modal.msgSuccess("同步成功");
|
||||
|
Reference in New Issue
Block a user