|
|
|
@ -87,33 +87,18 @@ |
|
|
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange"> |
|
|
|
<el-table ref="genRef" v-loading="loading" :data="tableList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange"> |
|
|
|
<el-table-column type="selection" align="center" width="55"></el-table-column> |
|
|
|
<el-table-column label="序号" type="index" width="50" align="center"> |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
label="表名称" |
|
|
|
align="center" |
|
|
|
prop="tableName" |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
/> |
|
|
|
<el-table-column |
|
|
|
label="表描述" |
|
|
|
align="center" |
|
|
|
prop="tableComment" |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
/> |
|
|
|
<el-table-column |
|
|
|
label="实体" |
|
|
|
align="center" |
|
|
|
prop="className" |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
/> |
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="160" /> |
|
|
|
<el-table-column label="更新时间" align="center" prop="updateTime" width="160" /> |
|
|
|
<el-table-column label="表名称" align="center" prop="tableName" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column label="表描述" align="center" prop="tableComment" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column label="实体" align="center" prop="className" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="160" sortable="custom" :sort-orders="['descending', 'ascending']" /> |
|
|
|
<el-table-column label="更新时间" align="center" prop="updateTime" width="160" sortable="custom" :sort-orders="['descending', 'ascending']" /> |
|
|
|
<el-table-column label="操作" align="center" width="330" class-name="small-padding fixed-width"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-tooltip content="预览" placement="top"> |
|
|
|
@ -179,13 +164,16 @@ const total = ref(0); |
|
|
|
const tableNames = ref([]); |
|
|
|
const dateRange = ref([]); |
|
|
|
const uniqueId = ref(""); |
|
|
|
const defaultSort = ref({ prop: "createTime", order: "descending" }); |
|
|
|
|
|
|
|
const data = reactive({ |
|
|
|
queryParams: { |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10, |
|
|
|
tableName: undefined, |
|
|
|
tableComment: undefined |
|
|
|
tableComment: undefined, |
|
|
|
orderByColumn: defaultSort.value.prop, |
|
|
|
isAsc: defaultSort.value.order |
|
|
|
}, |
|
|
|
preview: { |
|
|
|
open: false, |
|
|
|
@ -264,7 +252,8 @@ function openCreateTable() { |
|
|
|
function resetQuery() { |
|
|
|
dateRange.value = []; |
|
|
|
proxy.resetForm("queryRef"); |
|
|
|
handleQuery(); |
|
|
|
queryParams.value.pageNum = 1; |
|
|
|
proxy.$refs["genRef"].sort(defaultSort.value.prop, defaultSort.value.order); |
|
|
|
} |
|
|
|
|
|
|
|
/** 预览按钮 */ |
|
|
|
@ -289,6 +278,13 @@ function handleSelectionChange(selection) { |
|
|
|
multiple.value = !selection.length; |
|
|
|
} |
|
|
|
|
|
|
|
/** 排序触发事件 */ |
|
|
|
function handleSortChange(column, prop, order) { |
|
|
|
queryParams.value.orderByColumn = column.prop; |
|
|
|
queryParams.value.isAsc = column.order; |
|
|
|
getList(); |
|
|
|
} |
|
|
|
|
|
|
|
/** 修改按钮操作 */ |
|
|
|
function handleEditTable(row) { |
|
|
|
const tableId = row.tableId || ids.value[0]; |
|
|
|
|