Browse Source

管理员排行榜

pull/1/head
pengda 1 month ago
parent
commit
78af5d7a81
  1. 1
      src/assets/super/list-detail.svg
  2. 102
      src/views/super/Ranking/YearProfit.vue

1
src/assets/super/list-detail.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

102
src/views/super/Ranking/YearProfit.vue

@ -2,41 +2,35 @@
<div class="demo-wrap min-flex-right"> <div class="demo-wrap min-flex-right">
<div class="flex-between"> <div class="flex-between">
<h2>总利润 - 年排行</h2> <h2>总利润 - 年排行</h2>
<el-form :model="form"> <GuipForm />
<GuipSelect v-model="form.payword" :defaultValue="form.payword" prop="payword" width="100%"
:options="options_payword" />
</el-form>
</div> </div>
<div class=" flex-common" id=""> <div class=" flex-common" id="">
<el-form> <el-form>
<el-table :data="tableData.slice((currentPage - 1) * pageSize, currentPage * pageSize)" <el-table :data="tableData" style="width: 100%" @sort-change="handleSortChange" @cell-mouse-enter="handleRowHover">
style="width: 100%" :key="random()">
<el-table-column type="index" label="排序" width="100"> <el-table-column type="index" label="排序" width="100">
<template slot-scope="scope"> <template #default="scope">
{{ scope.row.sort }} {{ scope.row.sort }}
</template> </template>
</el-table-column> </el-table-column>
<!-- 其他列 --> <!-- 其他列 -->
<el-table-column prop="name" label="年份"> <el-table-column prop="1" label="年份" sortable="custom">
<template slot-scope="scope"> <template #default="scope">
{{ scope.row.value_1 }} {{ scope.row.value_1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="count" label="总利润/元" sortable> <el-table-column prop="2" label="总利润/元" sortable="custom">
<template slot-scope="scope"> <template #default="scope">
<div class="flex"> <div class="flex">
{{ scope.row.value_2 }} {{ scope.row.value_2 }}
{{scope.row.value }}%上年持平
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="count" label="代理商排行"> <el-table-column label="代理商排行">
<template slot-scope="scope"> <template #default="scope">
<div class="flex"> <span v-if="profit_top_list[scope.row.id]['name']">
{{ scope.row.value_1 }} No.1 {{ profit_top_list[scope.row.id]['name'] }} <img v-if="show_detail_index == scope.row.sort" class="detail_icon" src="../../../assets/super/list-detail.svg" alt="">
<span class="flex"><img class="edit_icon" src="../../../assets/site/form_link.svg" alt=""></span> </span>
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -49,35 +43,16 @@
</div> </div>
</template> </template>
<script> <script>
import GuipSelect from '@/components/GuipSelect.vue' import GuipForm from '@/components/GuipForm.vue'
export default { export default {
// //
name: '', name: '',
props: [''], props: [''],
components: { components: {
GuipSelect, GuipForm
// GuipSelectFilter,
}, },
data() { data() {
return { return {
phoneService: [
{
text: '不限',
value: '0'
},
{
text: 'H5',
value: '1'
},
{
text: '小程序',
value: '2'
},
{
text: 'H5以及小程序',
value: '3'
},
],
currentPage: 1, // currentPage: 1, //
pageSize: 20, // pageSize: 20, //
total: 0, // total: 0, //
@ -97,15 +72,9 @@ export default {
], ],
filteredOptions: this.options, filteredOptions: this.options,
phoneServicelist:
{
0: '不限',
1: ' H5',
2: '小程序',
3: '无手机服务'
},
tableData: [], tableData: [],
profit_top_list: [],
show_detail_index:0,
form: { form: {
payword: '0', payword: '0',
} }
@ -116,16 +85,40 @@ export default {
this.getRankingData(); this.getRankingData();
}, },
methods: { methods: {
getRankingData(){ handleSortChange({ prop, order }) {
this.currentPage = 1;
let sortBy = 0;
let sortOrder = 0;
if(order == 'ascending'){
sortBy = prop;
sortOrder = 1;
}
if(order == 'descending'){
sortBy = prop;
sortOrder = 2;
}
this.getRankingData({sortBy:sortBy,sortOrder:sortOrder})
},
handleRowHover(row) {
this.show_detail_index = row.sort
},
getRankingData(obj){
const that = this const that = this
this.$http('POST', this.reqUri + '/super/ajax_get_rank_detail',{ this.$http('POST', this.reqUri + '/super/ajax_get_rank_detail',{
rank_type:1, rank_type:1,
cur_page:that.currentPage,
page_size:that.pageSize,
...obj
}).then(response => { }).then(response => {
that.tableData = response.data.list this.$nextTick(() => {
console.log(response.data.list, '0001') that.tableData = response.data.list
that.profit_top_list = response.data.profit_top_list
that.total = response.data.total
})
}) })
.catch(error => { .catch(error => {
console.error(error, '-----') console.error(error, 'error')
}) })
}, },
// //
@ -151,10 +144,6 @@ export default {
handleCurrentChange(val) { handleCurrentChange(val) {
this.currentPage = val this.currentPage = val
}, },
random() {
var randomNumber = Math.random();
return randomNumber
},
} }
} }
</script> </script>
@ -163,4 +152,7 @@ export default {
width: 100%; width: 100%;
letter-spacing: 0.08em; letter-spacing: 0.08em;
} }
.detail_icon{
vertical-align: text-top;
}
</style> </style>
Loading…
Cancel
Save