|
@@ -91,36 +91,18 @@ |
|
@@ -91,36 +91,18 @@ |
|
91
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
91
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
92
|
</el-row>
|
92
|
</el-row>
|
|
93
|
|
93
|
|
|
94
|
- <el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
|
94
|
+ <el-table ref="tables" v-loading="loading" :data="tableList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
|
|
95
|
<el-table-column type="selection" align="center" width="55"></el-table-column>
|
95
|
<el-table-column type="selection" align="center" width="55"></el-table-column>
|
|
96
|
<el-table-column label="序号" type="index" width="50" align="center">
|
96
|
<el-table-column label="序号" type="index" width="50" align="center">
|
|
97
|
<template slot-scope="scope">
|
97
|
<template slot-scope="scope">
|
|
98
|
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
|
98
|
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
|
|
99
|
</template>
|
99
|
</template>
|
|
100
|
</el-table-column>
|
100
|
</el-table-column>
|
|
101
|
- <el-table-column
|
|
|
|
102
|
- label="表名称"
|
|
|
|
103
|
- align="center"
|
|
|
|
104
|
- prop="tableName"
|
|
|
|
105
|
- :show-overflow-tooltip="true"
|
|
|
|
106
|
- width="120"
|
|
|
|
107
|
- />
|
|
|
|
108
|
- <el-table-column
|
|
|
|
109
|
- label="表描述"
|
|
|
|
110
|
- align="center"
|
|
|
|
111
|
- prop="tableComment"
|
|
|
|
112
|
- :show-overflow-tooltip="true"
|
|
|
|
113
|
- width="120"
|
|
|
|
114
|
- />
|
|
|
|
115
|
- <el-table-column
|
|
|
|
116
|
- label="实体"
|
|
|
|
117
|
- align="center"
|
|
|
|
118
|
- prop="className"
|
|
|
|
119
|
- :show-overflow-tooltip="true"
|
|
|
|
120
|
- width="120"
|
|
|
|
121
|
- />
|
|
|
|
122
|
- <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
|
|
|
|
123
|
- <el-table-column label="更新时间" align="center" prop="updateTime" width="160" />
|
101
|
+ <el-table-column label="表名称" align="center" prop="tableName" :show-overflow-tooltip="true" width="120" />
|
|
|
|
102
|
+ <el-table-column label="表描述" align="center" prop="tableComment" :show-overflow-tooltip="true" width="120" />
|
|
|
|
103
|
+ <el-table-column label="实体" align="center" prop="className" :show-overflow-tooltip="true" width="120" />
|
|
|
|
104
|
+ <el-table-column label="创建时间" align="center" prop="createTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="160" />
|
|
|
|
105
|
+ <el-table-column label="更新时间" align="center" prop="updateTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="160" />
|
|
124
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
106
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
125
|
<template slot-scope="scope">
|
107
|
<template slot-scope="scope">
|
|
126
|
<el-button
|
108
|
<el-button
|
|
@@ -225,6 +207,8 @@ export default { |
|
@@ -225,6 +207,8 @@ export default { |
|
225
|
tableList: [],
|
207
|
tableList: [],
|
|
226
|
// 日期范围
|
208
|
// 日期范围
|
|
227
|
dateRange: "",
|
209
|
dateRange: "",
|
|
|
|
210
|
+ // 默认排序
|
|
|
|
211
|
+ defaultSort: { prop: "createTime", order: "descending" },
|
|
228
|
// 查询参数
|
212
|
// 查询参数
|
|
229
|
queryParams: {
|
213
|
queryParams: {
|
|
230
|
pageNum: 1,
|
214
|
pageNum: 1,
|
|
@@ -242,6 +226,8 @@ export default { |
|
@@ -242,6 +226,8 @@ export default { |
|
242
|
};
|
226
|
};
|
|
243
|
},
|
227
|
},
|
|
244
|
created() {
|
228
|
created() {
|
|
|
|
229
|
+ this.queryParams.orderByColumn = this.defaultSort.prop;
|
|
|
|
230
|
+ this.queryParams.isAsc = this.defaultSort.order;
|
|
245
|
this.getList();
|
231
|
this.getList();
|
|
246
|
},
|
232
|
},
|
|
247
|
activated() {
|
233
|
activated() {
|
|
@@ -304,7 +290,8 @@ export default { |
|
@@ -304,7 +290,8 @@ export default { |
|
304
|
resetQuery() {
|
290
|
resetQuery() {
|
|
305
|
this.dateRange = [];
|
291
|
this.dateRange = [];
|
|
306
|
this.resetForm("queryForm");
|
292
|
this.resetForm("queryForm");
|
|
307
|
- this.handleQuery();
|
293
|
+ this.queryParams.pageNum = 1;
|
|
|
|
294
|
+ this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
|
|
308
|
},
|
295
|
},
|
|
309
|
/** 预览按钮 */
|
296
|
/** 预览按钮 */
|
|
310
|
handlePreview(row) {
|
297
|
handlePreview(row) {
|
|
@@ -332,6 +319,12 @@ export default { |
|
@@ -332,6 +319,12 @@ export default { |
|
332
|
this.single = selection.length != 1;
|
319
|
this.single = selection.length != 1;
|
|
333
|
this.multiple = !selection.length;
|
320
|
this.multiple = !selection.length;
|
|
334
|
},
|
321
|
},
|
|
|
|
322
|
+ /** 排序触发事件 */
|
|
|
|
323
|
+ handleSortChange(column, prop, order) {
|
|
|
|
324
|
+ this.queryParams.orderByColumn = column.prop;
|
|
|
|
325
|
+ this.queryParams.isAsc = column.order;
|
|
|
|
326
|
+ this.getList();
|
|
|
|
327
|
+ },
|
|
335
|
/** 修改按钮操作 */
|
328
|
/** 修改按钮操作 */
|
|
336
|
handleEditTable(row) {
|
329
|
handleEditTable(row) {
|
|
337
|
const tableId = row.tableId || this.ids[0];
|
330
|
const tableId = row.tableId || this.ids[0];
|