mirror of
https://github.com/yangzongzhuan/RuoYi-Vue3.git
synced 2025-06-07 02:39:28 +00:00
代码生成列表支持按时间排序
This commit is contained in:
parent
3393757b8c
commit
094e300939
@ -87,33 +87,18 @@
|
|||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</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 type="selection" align="center" width="55"></el-table-column>
|
||||||
<el-table-column label="序号" type="index" width="50" align="center">
|
<el-table-column label="序号" type="index" width="50" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
|
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column label="表名称" align="center" prop="tableName" :show-overflow-tooltip="true" />
|
||||||
label="表名称"
|
<el-table-column label="表描述" align="center" prop="tableComment" :show-overflow-tooltip="true" />
|
||||||
align="center"
|
<el-table-column label="实体" align="center" prop="className" :show-overflow-tooltip="true" />
|
||||||
prop="tableName"
|
<el-table-column label="创建时间" align="center" prop="createTime" width="160" sortable="custom" :sort-orders="['descending', 'ascending']" />
|
||||||
:show-overflow-tooltip="true"
|
<el-table-column label="更新时间" align="center" prop="updateTime" width="160" sortable="custom" :sort-orders="['descending', 'ascending']" />
|
||||||
/>
|
|
||||||
<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" width="330" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" width="330" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip content="预览" placement="top">
|
<el-tooltip content="预览" placement="top">
|
||||||
@ -179,13 +164,16 @@ const total = ref(0);
|
|||||||
const tableNames = ref([]);
|
const tableNames = ref([]);
|
||||||
const dateRange = ref([]);
|
const dateRange = ref([]);
|
||||||
const uniqueId = ref("");
|
const uniqueId = ref("");
|
||||||
|
const defaultSort = ref({ prop: "createTime", order: "descending" });
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
tableName: undefined,
|
tableName: undefined,
|
||||||
tableComment: undefined
|
tableComment: undefined,
|
||||||
|
orderByColumn: defaultSort.value.prop,
|
||||||
|
isAsc: defaultSort.value.order
|
||||||
},
|
},
|
||||||
preview: {
|
preview: {
|
||||||
open: false,
|
open: false,
|
||||||
@ -264,7 +252,8 @@ function openCreateTable() {
|
|||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
dateRange.value = [];
|
dateRange.value = [];
|
||||||
proxy.resetForm("queryRef");
|
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;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 排序触发事件 */
|
||||||
|
function handleSortChange(column, prop, order) {
|
||||||
|
queryParams.value.orderByColumn = column.prop;
|
||||||
|
queryParams.value.isAsc = column.order;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleEditTable(row) {
|
function handleEditTable(row) {
|
||||||
const tableId = row.tableId || ids.value[0];
|
const tableId = row.tableId || ids.value[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user