| | |
| | | type="primary"
|
| | | plain
|
| | | icon="Download"
|
| | | :disabled="multiple"
|
| | | @click="handleGenTable"
|
| | | v-hasPermi="['tool:gen:code']"
|
| | | >生成</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="primary"
|
| | | plain
|
| | | icon="Plus"
|
| | | @click="openCreateTable"
|
| | | v-hasRole="['admin']"
|
| | | >创建</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | |
| | | </el-tabs>
|
| | | </el-dialog>
|
| | | <import-table ref="importRef" @ok="handleQuery" />
|
| | | <create-table ref="createRef" @ok="handleQuery" />
|
| | | </div>
|
| | | </template>
|
| | |
|
| | |
| | | import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen";
|
| | | import router from "@/router";
|
| | | import importTable from "./importTable";
|
| | | import createTable from "./createTable";
|
| | |
|
| | | const route = useRoute();
|
| | | const { proxy } = getCurrentInstance();
|
| | |
| | | loading.value = false;
|
| | | });
|
| | | }
|
| | |
|
| | | /** 搜索按钮操作 */
|
| | | function handleQuery() {
|
| | | queryParams.value.pageNum = 1;
|
| | | getList();
|
| | | }
|
| | |
|
| | | /** 生成代码操作 */
|
| | | function handleGenTable(row) {
|
| | | const tbNames = row.tableName || tableNames.value;
|
| | |
| | | proxy.$modal.msgSuccess("成功生成到自定义路径:" + row.genPath);
|
| | | });
|
| | | } else {
|
| | | proxy.$download.zip("/tool/gen/batchGenCode?tables=" + tbNames, "ruoyi");
|
| | | proxy.$download.zip("/tool/gen/batchGenCode?tables=" + tbNames, "ruoyi.zip");
|
| | | }
|
| | | }
|
| | |
|
| | | /** 同步数据库操作 */
|
| | | function handleSynchDb(row) {
|
| | | const tableName = row.tableName;
|
| | |
| | | proxy.$modal.msgSuccess("同步成功");
|
| | | }).catch(() => {});
|
| | | }
|
| | |
|
| | | /** 打开导入表弹窗 */
|
| | | function openImportTable() {
|
| | | proxy.$refs["importRef"].show();
|
| | | }
|
| | |
|
| | | /** 打开创建表弹窗 */
|
| | | function openCreateTable() {
|
| | | proxy.$refs["createRef"].show();
|
| | | }
|
| | |
|
| | | /** 重置按钮操作 */
|
| | | function resetQuery() {
|
| | | dateRange.value = [];
|
| | | proxy.resetForm("queryRef");
|
| | | handleQuery();
|
| | | }
|
| | |
|
| | | /** 预览按钮 */
|
| | | function handlePreview(row) {
|
| | | previewTable(row.tableId).then(response => {
|
| | |
| | | preview.value.activeName = "domain.java";
|
| | | });
|
| | | }
|
| | |
|
| | | /** 复制代码成功 */
|
| | | function copyTextSuccess() {
|
| | | proxy.$modal.msgSuccess("复制成功");
|
| | | }
|
| | |
|
| | | // 多选框选中数据
|
| | | function handleSelectionChange(selection) {
|
| | | ids.value = selection.map(item => item.tableId);
|
| | |
| | | single.value = selection.length != 1;
|
| | | multiple.value = !selection.length;
|
| | | }
|
| | |
|
| | | /** 修改按钮操作 */
|
| | | function handleEditTable(row) {
|
| | | const tableId = row.tableId || ids.value[0];
|
| | | router.push({ path: "/tool/gen-edit/index/" + tableId, query: { pageNum: queryParams.value.pageNum } });
|
| | | }
|
| | |
|
| | | /** 删除按钮操作 */
|
| | | function handleDelete(row) {
|
| | | const tableIds = row.tableId || ids.value;
|