|
|
|
|
@ -15,6 +15,7 @@ |
|
|
|
|
@refresh-change="refreshChange" |
|
|
|
|
@on-load="onLoad" |
|
|
|
|
@cell-click="cellClick" |
|
|
|
|
@sort-change="sortChange" |
|
|
|
|
> |
|
|
|
|
</avue-crud> |
|
|
|
|
<prefDetail |
|
|
|
|
@ -287,6 +288,20 @@ export default { |
|
|
|
|
this.onLoad(this.page, this.query); |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
// 表格排序 |
|
|
|
|
sortChange({ prop, order }) { |
|
|
|
|
if (!prop) { |
|
|
|
|
// 如果取消排序,清空排序参数 |
|
|
|
|
this.query.orderByField = undefined; |
|
|
|
|
this.query.isAsc = undefined; |
|
|
|
|
} else { |
|
|
|
|
const orderByField = prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase(); |
|
|
|
|
this.query.orderByField = orderByField; |
|
|
|
|
this.query.isAsc = order === 'ascending' ? true : false; |
|
|
|
|
} |
|
|
|
|
// // 重新加载数据 |
|
|
|
|
this.onLoad(); |
|
|
|
|
}, |
|
|
|
|
// 列表加载 |
|
|
|
|
async onLoad() { |
|
|
|
|
this.loading = true; |
|
|
|
|
|