|
|
@ -2,58 +2,101 @@ |
|
|
|
<div class="demo-wrap min-flex-right"> |
|
|
|
<div class="flex-between"> |
|
|
|
<h2>{{ pageTitle }}</h2> |
|
|
|
<CustomDropdown ref="dropdownRef" :placeholder="'('+viewDesc[this.view]+')'+text" width="280px"> |
|
|
|
<DateSelect slot="normal" :view="view" v-model="selectedDate" @update-count="handleUpdateView" @change="handleDateChange" /> |
|
|
|
<CustomDropdown ref="dropdownRef" |
|
|
|
:placeholder="'('+viewDesc[this.view]+')'+text" |
|
|
|
width="280px"> |
|
|
|
<DateSelect slot="normal" |
|
|
|
:view="view" |
|
|
|
v-model="selectedDate" |
|
|
|
@update-count="handleUpdateView" |
|
|
|
@change="handleDateChange"/> |
|
|
|
</CustomDropdown> |
|
|
|
</div> |
|
|
|
<div class=" flex-common" id=""> |
|
|
|
<el-form> |
|
|
|
<el-table :data="tableData" style="width: 100%" @sort-change="handleSortChange" @cell-mouse-enter="handleRowHover"> |
|
|
|
<el-table :data="tableData" |
|
|
|
style="width: 100%" |
|
|
|
@sort-change="handleSortChange" |
|
|
|
@cell-mouse-enter="handleRowHover"> |
|
|
|
|
|
|
|
<el-table-column prop="sort" label="排序" width="100"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-if="(dataRank == 1 || dataRank == 2) && (dataType == 'ver_type' || dataType == 'check_type')" prop="name" :key="selectedType" :label="type_select[selectedType]"> |
|
|
|
<el-table-column |
|
|
|
v-if="(dataRank == 1 || dataRank == 2) && (dataType == 'ver_type' || dataType == 'check_type')" |
|
|
|
prop="name" |
|
|
|
:key="selectedType" |
|
|
|
:label="type_select[selectedType]"> |
|
|
|
|
|
|
|
<template slot="header"> |
|
|
|
<el-select class="custom-select" v-model="selectedType" @change="changeRankType"> |
|
|
|
<el-option v-for="(item,type) in type_select" :key="type" :label="item" :value="type"></el-option> |
|
|
|
<el-option v-for="(item,type) in type_select" |
|
|
|
:key="type" |
|
|
|
:label="item" |
|
|
|
:value="type"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row.name }} |
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-else prop="name" :label="type_desc[dataType]" width="150"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-for="(field, index) in valueFields" :key="field" :label="labels[index]" :prop="String(index + 1)" sortable="custom"> |
|
|
|
<el-table-column v-for="(field, index) in valueFields" |
|
|
|
:key="field" |
|
|
|
:label="labels[index]" |
|
|
|
:prop="String(index + 1)" |
|
|
|
sortable="custom"> |
|
|
|
|
|
|
|
<template v-if="index == 3 && dataRank == 1 && type != 'agent'" v-slot="{ row, $index }"> |
|
|
|
<el-popover v-model="row.id_popover" placement="top" trigger="manual" :ref="`popover-${$index}`" @show="popshow"> |
|
|
|
<el-popover v-model="row.id_popover" |
|
|
|
placement="top" |
|
|
|
trigger="manual" |
|
|
|
:ref="`popover-${$index}`" |
|
|
|
@show="popshow"> |
|
|
|
|
|
|
|
<div class="pop-wrap"> |
|
|
|
<div class="flex-between flex pop-top"> |
|
|
|
<h3>{{ text }} {{ row.name }} <span @click="goLookMoreData(row.id)">查看更多</span></h3> |
|
|
|
<span class="flex point" @click="closePop(row,'id')">关闭 <img src="@/assets/register/close.svg" alt=""></span> |
|
|
|
<h3> |
|
|
|
{{ text }} {{ row.name }} |
|
|
|
<span @click="goLookMoreData(row.id)">查看更多</span> |
|
|
|
</h3> |
|
|
|
<span class="flex point" @click="closePop(row,'id')"> |
|
|
|
关闭<img src="@/assets/register/close.svg"> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
<el-table :data="tableData1" style="width: 100%"> |
|
|
|
<el-table-column prop="value_1" width="208" label="日期"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column width="348" :label="rank_type_desc[dataRank]"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div class="flex"> |
|
|
|
{{ scope.row.value_2 }} |
|
|
|
<template v-if="Object.keys(growth_list1).length > 0"> |
|
|
|
<span class="flex growth-text" v-if="growth_list1[scope.row.id]"> |
|
|
|
<span v-if="growth_list1[scope.row.id]" |
|
|
|
class="flex growth-text"> |
|
|
|
<span v-if="growth_list1[scope.row.id].value>0"> |
|
|
|
<span class="growth-up"> |
|
|
|
<img class="edit_icon" src="@/assets/super/growth-up.svg" alt="">{{growth_list1[scope.row.id].value}}% |
|
|
|
<img class="edit_icon" |
|
|
|
src="@/assets/super/growth-up.svg"> |
|
|
|
{{ growth_list1[scope.row.id].value }}% |
|
|
|
</span>同比上年 |
|
|
|
</span> |
|
|
|
<span v-if="growth_list1[scope.row.id].value<0"> |
|
|
|
<span class="growth-down"> |
|
|
|
<img class="edit_icon" src="@/assets/super/growth-down.svg" alt="">{{growth_list1[scope.row.id].value}}% |
|
|
|
<img class="edit_icon" |
|
|
|
src="@/assets/super/growth-down.svg"> |
|
|
|
{{ growth_list1[scope.row.id].value }}% |
|
|
|
</span>同比上年 |
|
|
|
</span> |
|
|
|
<span v-if="growth_list1[scope.row.id].value==0"> |
|
|
|
<img class="edit_icon" src="@/assets/super/growth-flat.svg" alt="">同比上年持平 |
|
|
|
<img class="edit_icon" |
|
|
|
src="@/assets/super/growth-flat.svg">同比上年持平 |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<span class="flex growth-text" v-else>上年无数据</span> |
|
|
|
<span v-else class="flex growth-text">上年无数据</span> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</template> |
|
|
@ -67,23 +110,25 @@ |
|
|
|
<template v-if="growth_list[row.id] && growth_list[row.id][field]"> |
|
|
|
<span v-if="growth_list[row.id][field].value > 0" class="growth-text"> |
|
|
|
<span class="growth-up"> |
|
|
|
<img class="edit_icon" src="@/assets/super/growth-up.svg" alt="" /> |
|
|
|
<img class="edit_icon" src="@/assets/super/growth-up.svg"/> |
|
|
|
{{ growth_list[row.id][field].value }}% |
|
|
|
</span>同比上年 |
|
|
|
</span> |
|
|
|
<span v-else-if="growth_list[row.id][field].value < 0" class="growth-text"> |
|
|
|
<span class="growth-down"> |
|
|
|
<img class="edit_icon" src="@/assets/super/growth-down.svg" alt="" /> |
|
|
|
<img class="edit_icon" src="@/assets/super/growth-down.svg"/> |
|
|
|
{{ growth_list[row.id][field].value }}% |
|
|
|
</span>同比上年 |
|
|
|
</span> |
|
|
|
<span v-else class="growth-text"> |
|
|
|
<img class="edit_icon" src="@/assets/super/growth-flat.svg" alt="" />同比上年持平 |
|
|
|
<img class="edit_icon" src="@/assets/super/growth-flat.svg"/>同比上年持平 |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
<span v-else class="growth-text">上年无数据</span> |
|
|
|
</template> |
|
|
|
<img @click="handleClick(row, $index, 'id')" v-if="show_detail_index == row.sort" class="detail_icon" src="@/assets/super/list-detail.svg" alt=""> |
|
|
|
<img v-if="show_detail_index == row.sort" |
|
|
|
@click="handleClick(row, $index, 'id')" |
|
|
|
class="detail_icon" src="@/assets/super/list-detail.svg"> |
|
|
|
</div> |
|
|
|
</el-popover> |
|
|
|
</template> |
|
|
@ -94,21 +139,19 @@ |
|
|
|
<template v-if="growth_list[scope.row.id] && growth_list[scope.row.id][field]"> |
|
|
|
<span v-if="growth_list[scope.row.id][field].value > 0" class="growth-text"> |
|
|
|
<span class="growth-up"> |
|
|
|
<img class="edit_icon" src="@/assets/super/growth-up.svg" alt="" /> |
|
|
|
<img class="edit_icon" src="@/assets/super/growth-up.svg"/> |
|
|
|
{{ growth_list[scope.row.id][field].value }}% |
|
|
|
</span>同比上年 |
|
|
|
</span> |
|
|
|
同比上年 |
|
|
|
</span> |
|
|
|
<span v-else-if="growth_list[scope.row.id][field].value < 0" class="growth-text"> |
|
|
|
<span v-else-if="growth_list[scope.row.id][field].value < 0" |
|
|
|
class="growth-text"> |
|
|
|
<span class="growth-down"> |
|
|
|
<img class="edit_icon" src="@/assets/super/growth-down.svg" alt="" /> |
|
|
|
<img class="edit_icon" src="@/assets/super/growth-down.svg"/> |
|
|
|
{{ growth_list[scope.row.id][field].value }}% |
|
|
|
</span> |
|
|
|
同比上年 |
|
|
|
</span>同比上年 |
|
|
|
</span> |
|
|
|
<span v-else class="growth-text"> |
|
|
|
<img class="edit_icon" src="@/assets/super/growth-flat.svg" alt="" /> |
|
|
|
同比上年持平 |
|
|
|
<img class="edit_icon" src="@/assets/super/growth-flat.svg"/>同比上年持平 |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
<span v-else class="growth-text">上年无数据</span> |
|
|
@ -117,8 +160,12 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<el-pagination background @size-change='handleSizeChange' @current-change='handleCurrentChange' |
|
|
|
:current-page="currentPage" :page-size=pageSize layout="prev, pager, next,jumper" |
|
|
|
<el-pagination background |
|
|
|
@size-change='handleSizeChange' |
|
|
|
@current-change='handleCurrentChange' |
|
|
|
:current-page="currentPage" |
|
|
|
:page-size=pageSize |
|
|
|
layout="prev, pager, next,jumper" |
|
|
|
:total="total"> |
|
|
|
</el-pagination> |
|
|
|
</el-form> |
|
|
@ -126,7 +173,6 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
// import GuipForm from '@/components/GuipForm.vue' |
|
|
|
import DateSelect from '@/components/super/DateSelect.vue'; |
|
|
|
import CustomDropdown from '@/components/CustomDropdown.vue'; |
|
|
|
|
|
|
@ -195,8 +241,7 @@ export default { |
|
|
|
mounted() { |
|
|
|
this.init() |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
}, |
|
|
|
computed: {}, |
|
|
|
watch: { |
|
|
|
'$route'() { |
|
|
|
this.init() |
|
|
@ -204,12 +249,11 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
init() { |
|
|
|
this.text = this.getNowDate()//初始赋值 |
|
|
|
|
|
|
|
this.text = this.getNowDate() |
|
|
|
this.dataType = this.type |
|
|
|
this.dataRank = this.rank_type |
|
|
|
|
|
|
|
this.getRankingData(); // 每次路由变化都重新获取数据 |
|
|
|
this.getRankingData(); |
|
|
|
}, |
|
|
|
handleUpdateView(newView) { |
|
|
|
this.view = newView; |
|
|
@ -320,8 +364,12 @@ export default { |
|
|
|
this.setLabelText(); |
|
|
|
|
|
|
|
if (this.dataType == 'agent') { |
|
|
|
if (this.dataRank == 4) { |
|
|
|
this.getAgentRecharge() |
|
|
|
} else { |
|
|
|
this.getAgentRanking() |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.dataType == 'ver_type') { |
|
|
|
this.getVerRanking() |
|
|
|
} |
|
|
@ -331,8 +379,8 @@ export default { |
|
|
|
}, |
|
|
|
setLabelText() { |
|
|
|
const date = new Date(this.text); |
|
|
|
const year = date.getFullYear(); // 2025 |
|
|
|
const month = date.getMonth() + 1; // 3 (表示3月) |
|
|
|
const year = date.getFullYear(); |
|
|
|
const month = date.getMonth() + 1; |
|
|
|
|
|
|
|
this.labels = []; |
|
|
|
if (this.view === 'year') { |
|
|
@ -350,11 +398,11 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
getAgentRanking() { |
|
|
|
//代理商排行 |
|
|
|
const that = this |
|
|
|
//充值排行 |
|
|
|
if(that.dataRank == 4){ |
|
|
|
this.$http('POST', '/supernew/ajax_get_rank_recharge', { |
|
|
|
this.$http('POST', '/supernew/ajax_get_agent_batch_list', { |
|
|
|
date: that.text, |
|
|
|
rank_type: that.dataRank, |
|
|
|
sortBy: that.sortBy, |
|
|
|
sortOrder: that.sortOrder, |
|
|
|
cur_page: that.currentPage, |
|
|
@ -368,12 +416,12 @@ export default { |
|
|
|
}).catch(error => { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.$http('POST', '/supernew/ajax_get_agent_batch_list', { |
|
|
|
}, |
|
|
|
getAgentRecharge() { |
|
|
|
//充值排行 |
|
|
|
const that = this |
|
|
|
this.$http('POST', '/supernew/ajax_get_rank_recharge', { |
|
|
|
date: that.text, |
|
|
|
rank_type: that.dataRank, |
|
|
|
sortBy: that.sortBy, |
|
|
|
sortOrder: that.sortOrder, |
|
|
|
cur_page: that.currentPage, |
|
|
@ -389,6 +437,7 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
getVerRanking() { |
|
|
|
//品牌排行 |
|
|
|
const that = this |
|
|
|
this.$http('POST', '/supernew/ajax_get_ver_batch_list', { |
|
|
|
date: that.text, |
|
|
@ -409,6 +458,7 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
getTypeRanking() { |
|
|
|
//产品排行 |
|
|
|
const that = this |
|
|
|
this.$http('POST', '/supernew/ajax_get_type_batch_list', { |
|
|
|
date: that.text, |
|
|
@ -463,28 +513,36 @@ export default { |
|
|
|
padding: 0 5px; |
|
|
|
color: #22C55E; |
|
|
|
} |
|
|
|
|
|
|
|
.growth-down { |
|
|
|
padding: 0 5px; |
|
|
|
color: #EF4444; |
|
|
|
} |
|
|
|
|
|
|
|
.growth-text { |
|
|
|
color: #9CA3AF; |
|
|
|
padding-left: 5px; |
|
|
|
} |
|
|
|
|
|
|
|
.edit_icon { |
|
|
|
padding: 0 5px; |
|
|
|
vertical-align: middle; |
|
|
|
} |
|
|
|
|
|
|
|
.demo-wrap { |
|
|
|
width: 100%; |
|
|
|
letter-spacing: 0.08em; |
|
|
|
} |
|
|
|
|
|
|
|
.custom-select { |
|
|
|
width: 120px; |
|
|
|
width: 210px; |
|
|
|
border: none; |
|
|
|
border-radius: 0; |
|
|
|
font-size: 14px; |
|
|
|
line-height: 18px; |
|
|
|
height: 30px; |
|
|
|
} |
|
|
|
|
|
|
|
.custom-select ::v-deep(.el-input__inner) { |
|
|
|
background: none; |
|
|
|
border: 1px solid transparent; |
|
|
@ -495,6 +553,7 @@ export default { |
|
|
|
font-weight: bold; |
|
|
|
padding: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.custom-select ::v-deep(.el-input:focus-within) { |
|
|
|
background: none; |
|
|
|
border-color: #F5F7FA !important; |
|
|
@ -503,6 +562,42 @@ export default { |
|
|
|
outline: none; |
|
|
|
} |
|
|
|
|
|
|
|
.el-select-dropdown__item { |
|
|
|
color: #1E2226; |
|
|
|
margin: 0 12px; |
|
|
|
padding: 0 12px; |
|
|
|
} |
|
|
|
|
|
|
|
.el-select-dropdown__item:first-child { |
|
|
|
margin-top: 6px; |
|
|
|
} |
|
|
|
|
|
|
|
.el-select-dropdown__item:last-child { |
|
|
|
margin-bottom: 6px; |
|
|
|
} |
|
|
|
|
|
|
|
.el-select-dropdown__item:hover { |
|
|
|
background: #F6F7FA; |
|
|
|
} |
|
|
|
|
|
|
|
.el-select-dropdown__item.selected { |
|
|
|
font-weight: normal; |
|
|
|
} |
|
|
|
|
|
|
|
.el-select-dropdown__item.selected::after { |
|
|
|
content: ""; |
|
|
|
position: absolute; |
|
|
|
top: 50%; |
|
|
|
right: 10px; |
|
|
|
transform: translateY(-50%); |
|
|
|
width: 16px; |
|
|
|
height: 16px; |
|
|
|
background-image: url('../../../assets/super/select-active.svg'); |
|
|
|
background-size: contain; |
|
|
|
background-repeat: no-repeat; |
|
|
|
opacity: 1; |
|
|
|
} |
|
|
|
|
|
|
|
.detail_icon { |
|
|
|
vertical-align: text-top; |
|
|
|
padding-left: 5px; |
|
|
@ -511,22 +606,15 @@ export default { |
|
|
|
::v-deep .el-popover.el-popper { |
|
|
|
padding: 20px; |
|
|
|
} |
|
|
|
|
|
|
|
.pop-wrap { |
|
|
|
// width: 596px; |
|
|
|
// height: 320px; |
|
|
|
/* 自动布局 */ |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
// padding: 20px; |
|
|
|
gap: 20px; |
|
|
|
box-sizing: border-box; |
|
|
|
|
|
|
|
// background: #FFFFFF; |
|
|
|
/* 阴影/常规阴影 */ |
|
|
|
// box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.16); |
|
|
|
.pop-top { |
|
|
|
h3 { |
|
|
|
/* body/body 1_bold */ |
|
|
|
font-family: Microsoft YaHei UI; |
|
|
|
font-size: 16px; |
|
|
|
font-weight: bold; |
|
|
@ -543,6 +631,7 @@ export default { |
|
|
|
color: #006AFF; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
img { |
|
|
|
width: 20px; |
|
|
|
height: 20px; |
|
|
|