幸运24-个人-自定义排序
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
<div class="inquire">
|
<div class="inquire">
|
||||||
<span>时间</span>
|
<span>时间</span>
|
||||||
<el-date-picker v-model="inquire.time"
|
<el-date-picker v-model="inquire.time"
|
||||||
|
@change="handleDateChange"
|
||||||
type="date"
|
type="date"
|
||||||
placeholder="请选择">
|
placeholder="请选择">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
@@ -163,6 +164,7 @@
|
|||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
<el-table v-loading="loading"
|
<el-table v-loading="loading"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
|
@sort-change="handleSortChange"
|
||||||
border
|
border
|
||||||
style="width: 100%; margin-top: 25px">
|
style="width: 100%; margin-top: 25px">
|
||||||
<el-table-column prop="date"
|
<el-table-column prop="date"
|
||||||
@@ -178,15 +180,19 @@
|
|||||||
align="center"
|
align="center"
|
||||||
label="充值等级" />
|
label="充值等级" />
|
||||||
<el-table-column prop="totalInput"
|
<el-table-column prop="totalInput"
|
||||||
|
:sortable="inquire.sortable"
|
||||||
align="center"
|
align="center"
|
||||||
label="进入" />
|
label="进入" />
|
||||||
<el-table-column prop="totalOutput"
|
<el-table-column prop="totalOutput"
|
||||||
|
:sortable="inquire.sortable"
|
||||||
align="center"
|
align="center"
|
||||||
label="退出" />
|
label="退出" />
|
||||||
<el-table-column prop="production"
|
<el-table-column prop="production"
|
||||||
|
:sortable="inquire.sortable"
|
||||||
align="center"
|
align="center"
|
||||||
label="剩余" />
|
label="剩余" />
|
||||||
<el-table-column prop="productionRatio"
|
<el-table-column prop="productionRatio"
|
||||||
|
:sortable="inquire.sortable"
|
||||||
align="center"
|
align="center"
|
||||||
label="退出/进入" />
|
label="退出/进入" />
|
||||||
<el-table-column prop="avgInput"
|
<el-table-column prop="avgInput"
|
||||||
@@ -281,6 +287,9 @@ export default {
|
|||||||
value: undefined,
|
value: undefined,
|
||||||
userRechargeLevel: undefined,
|
userRechargeLevel: undefined,
|
||||||
poolType: undefined,
|
poolType: undefined,
|
||||||
|
sortable: false,
|
||||||
|
sortCol: undefined,
|
||||||
|
sortOrder: undefined
|
||||||
},
|
},
|
||||||
userRechargeLevelList: [],
|
userRechargeLevelList: [],
|
||||||
poolTypes: [],
|
poolTypes: [],
|
||||||
@@ -350,6 +359,8 @@ export default {
|
|||||||
partitionId: this.inquire.value,
|
partitionId: this.inquire.value,
|
||||||
userRechargeLevel: this.inquire.userRechargeLevel,
|
userRechargeLevel: this.inquire.userRechargeLevel,
|
||||||
poolType: this.inquire.poolType ? this.inquire.poolType : undefined,
|
poolType: this.inquire.poolType ? this.inquire.poolType : undefined,
|
||||||
|
sortCol: this.inquire.sortCol,
|
||||||
|
sortOrder: this.inquire.sortOrder
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.total = res.data.dataPage.total;
|
this.total = res.data.dataPage.total;
|
||||||
this.tableData = res.data.dataPage.rows;
|
this.tableData = res.data.dataPage.rows;
|
||||||
@@ -384,6 +395,28 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
handleDateChange (val) {
|
||||||
|
if (val && !this.inquire.sortable) {
|
||||||
|
this.inquire.sortable = 'custom';
|
||||||
|
this.inquire.sortCol = undefined;
|
||||||
|
this.inquire.sortOrder = undefined;
|
||||||
|
}
|
||||||
|
if (!val && this.inquire.sortable) {
|
||||||
|
this.inquire.sortable = false;
|
||||||
|
this.inquire.sortCol = undefined;
|
||||||
|
this.inquire.sortOrder = undefined;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleSortChange (data) {
|
||||||
|
if (data.order) {
|
||||||
|
this.inquire.sortCol = data.prop;
|
||||||
|
this.inquire.sortOrder = data.order == "ascending" ? "asc" : "desc";
|
||||||
|
} else {
|
||||||
|
this.inquire.sortCol = undefined;
|
||||||
|
this.inquire.sortOrder = undefined
|
||||||
|
}
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
// 分页导航
|
// 分页导航
|
||||||
handleSizeChange () {
|
handleSizeChange () {
|
||||||
this.getData();
|
this.getData();
|
||||||
|
Reference in New Issue
Block a user