|
|
@@ -80,36 +80,18 @@
|
|
80
|
80
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
81
|
81
|
</el-row>
|
|
82
|
82
|
|
|
83
|
|
- <el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
|
|
|
83
|
+ <el-table ref="tables" v-loading="loading" :data="tableList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
|
|
84
|
84
|
<el-table-column type="selection" align="center" width="55"></el-table-column>
|
|
85
|
85
|
<el-table-column label="序号" type="index" width="50" align="center">
|
|
86
|
86
|
<template slot-scope="scope">
|
|
87
|
87
|
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
|
|
88
|
88
|
</template>
|
|
89
|
89
|
</el-table-column>
|
|
90
|
|
- <el-table-column
|
|
91
|
|
- label="表名称"
|
|
92
|
|
- align="center"
|
|
93
|
|
- prop="tableName"
|
|
94
|
|
- :show-overflow-tooltip="true"
|
|
95
|
|
- width="120"
|
|
96
|
|
- />
|
|
97
|
|
- <el-table-column
|
|
98
|
|
- label="表描述"
|
|
99
|
|
- align="center"
|
|
100
|
|
- prop="tableComment"
|
|
101
|
|
- :show-overflow-tooltip="true"
|
|
102
|
|
- width="120"
|
|
103
|
|
- />
|
|
104
|
|
- <el-table-column
|
|
105
|
|
- label="实体"
|
|
106
|
|
- align="center"
|
|
107
|
|
- prop="className"
|
|
108
|
|
- :show-overflow-tooltip="true"
|
|
109
|
|
- width="120"
|
|
110
|
|
- />
|
|
111
|
|
- <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
|
|
112
|
|
- <el-table-column label="更新时间" align="center" prop="updateTime" width="160" />
|
|
|
90
|
+ <el-table-column label="表名称" align="center" prop="tableName" :show-overflow-tooltip="true" width="120" />
|
|
|
91
|
+ <el-table-column label="表描述" align="center" prop="tableComment" :show-overflow-tooltip="true" width="120" />
|
|
|
92
|
+ <el-table-column label="实体" align="center" prop="className" :show-overflow-tooltip="true" width="120" />
|
|
|
93
|
+ <el-table-column label="创建时间" align="center" prop="createTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="160" />
|
|
|
94
|
+ <el-table-column label="更新时间" align="center" prop="updateTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="160" />
|
|
113
|
95
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
114
|
96
|
<template slot-scope="scope">
|
|
115
|
97
|
<el-button
|
|
|
@@ -212,6 +194,8 @@ export default {
|
|
212
|
194
|
tableList: [],
|
|
213
|
195
|
// 日期范围
|
|
214
|
196
|
dateRange: "",
|
|
|
197
|
+ // 默认排序
|
|
|
198
|
+ defaultSort: { prop: "createTime", order: "descending" },
|
|
215
|
199
|
// 查询参数
|
|
216
|
200
|
queryParams: {
|
|
217
|
201
|
pageNum: 1,
|
|
|
@@ -229,6 +213,8 @@ export default {
|
|
229
|
213
|
};
|
|
230
|
214
|
},
|
|
231
|
215
|
created() {
|
|
|
216
|
+ this.queryParams.orderByColumn = this.defaultSort.prop;
|
|
|
217
|
+ this.queryParams.isAsc = this.defaultSort.order;
|
|
232
|
218
|
this.getList();
|
|
233
|
219
|
},
|
|
234
|
220
|
activated() {
|
|
|
@@ -287,7 +273,8 @@ export default {
|
|
287
|
273
|
resetQuery() {
|
|
288
|
274
|
this.dateRange = [];
|
|
289
|
275
|
this.resetForm("queryForm");
|
|
290
|
|
- this.handleQuery();
|
|
|
276
|
+ this.queryParams.pageNum = 1;
|
|
|
277
|
+ this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
|
|
291
|
278
|
},
|
|
292
|
279
|
/** 预览按钮 */
|
|
293
|
280
|
handlePreview(row) {
|
|
|
@@ -315,6 +302,12 @@ export default {
|
|
315
|
302
|
this.single = selection.length != 1;
|
|
316
|
303
|
this.multiple = !selection.length;
|
|
317
|
304
|
},
|
|
|
305
|
+ /** 排序触发事件 */
|
|
|
306
|
+ handleSortChange(column, prop, order) {
|
|
|
307
|
+ this.queryParams.orderByColumn = column.prop;
|
|
|
308
|
+ this.queryParams.isAsc = column.order;
|
|
|
309
|
+ this.getList();
|
|
|
310
|
+ },
|
|
318
|
311
|
/** 修改按钮操作 */
|
|
319
|
312
|
handleEditTable(row) {
|
|
320
|
313
|
const tableId = row.tableId || this.ids[0];
|