| | |
| | | 删除 |
| | | </el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar> |
| | | <right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar> |
| | | </el-row> |
| | | </template> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script setup name="Gen" lang="ts"> |
| | | import { listTable, previewTable, delTable, genCode, synchDb, getDataNames } from '@/api/tool/gen'; |
| | | import { TableQuery, TableVO } from '@/api/tool/gen/types'; |
| | | import {delTable, genCode, getDataNames, listTable, previewTable, synchDb} from '@/api/tool/gen'; |
| | | import {TableQuery, TableVO} from '@/api/tool/gen/types'; |
| | | import router from '@/router'; |
| | | import ImportTable from './importTable.vue'; |
| | | |
| | |
| | | title: '代码预览' |
| | | }); |
| | | |
| | | onActivated(() => { |
| | | const time = route.query.t; |
| | | if (time != null && time != uniqueId.value) { |
| | | uniqueId.value = time as string; |
| | | queryParams.value.pageNum = Number(route.query.pageNum); |
| | | dateRange.value = ['', '']; |
| | | queryFormRef.value?.resetFields(); |
| | | getList(); |
| | | } |
| | | }); |
| | | |
| | | /** 查询多数据源名称 */ |
| | | const getDataNameList = async () => { |
| | | const res = await getDataNames(); |
| | |
| | | /** 同步数据库操作 */ |
| | | const handleSynchDb = async (row: TableVO) => { |
| | | const tableId = row.tableId; |
| | | await proxy?.$modal.confirm('确认要强制同步"' + row.tableName + '"表结构吗?').catch(() => {}); |
| | | await proxy?.$modal.confirm('确认要强制同步"' + row.tableName + '"表结构吗?'); |
| | | await synchDb(tableId); |
| | | proxy?.$modal.msgSuccess('同步成功'); |
| | | }; |
| | |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | const time = route.query.t; |
| | | if (time != null && time != uniqueId.value) { |
| | | uniqueId.value = time as string; |
| | | queryParams.value.pageNum = Number(route.query.pageNum); |
| | | dateRange.value = ['', '']; |
| | | queryFormRef.value?.resetFields(); |
| | | } |
| | | getList(); |
| | | getDataNameList(); |
| | | }); |