| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="表名称" prop="tableName"> |
| | | <el-input |
| | | v-model="queryParams.tableName" |
| | |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| | | <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | v-hasPermi="['tool:gen:remove']" |
| | | >删除</el-button> |
| | | </el-col> |
| | | <div class="top-right-btn"> |
| | | <el-tooltip class="item" effect="dark" content="刷新" placement="top"> |
| | | <el-button size="mini" circle icon="el-icon-refresh" @click="handleQuery" /> |
| | | </el-tooltip> |
| | | <el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top"> |
| | | <el-button size="mini" circle icon="el-icon-search" @click="showSearch=!showSearch" /> |
| | | </el-tooltip> |
| | | </div> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column label="序号" align="center" prop="tableId" width="60px" /> |
| | | <el-table-column label="序号" type="index" width="50" align="center"> |
| | | <template slot-scope="scope"> |
| | | <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="表名称" |
| | | align="center" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { listTable, previewTable, delTable } from "@/api/tool/gen"; |
| | | import { listTable, previewTable, delTable, genCode } from "@/api/tool/gen"; |
| | | import importTable from "./importTable"; |
| | | import { downLoadZip } from "@/utils/zipdownload"; |
| | | export default { |
| | |
| | | single: true, |
| | | // 非多个禁用 |
| | | multiple: true, |
| | | // 显示搜索条件 |
| | | showSearch: true, |
| | | // 总条数 |
| | | total: 0, |
| | | // 表数据 |
| | |
| | | this.msgError("请选择要生成的数据"); |
| | | return; |
| | | } |
| | | downLoadZip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi"); |
| | | if(row.genType === "1") { |
| | | genCode(row.tableName).then(response => { |
| | | this.msgSuccess("成功生成到自定义路径:" + row.genPath); |
| | | }); |
| | | } else { |
| | | downLoadZip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi"); |
| | | } |
| | | }, |
| | | /** 打开导入表弹窗 */ |
| | | openImportTable() { |
| | |
| | | /** 修改按钮操作 */ |
| | | handleEditTable(row) { |
| | | const tableId = row.tableId || this.ids[0]; |
| | | this.$router.push({ path: "/gen/edit", query: { tableId: tableId } }); |
| | | this.$router.push("/gen/edit/" + tableId); |
| | | }, |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | </script> |