Browse Source

管理员排行榜

pull/1/head
pengda 1 month ago
parent
commit
c910bf5202
  1. 10722
      package-lock.json
  2. 1
      src/assets/super/ranking-menu.svg
  3. 272
      src/components/super/RankingLeftMenu.vue
  4. 1
      src/main.js
  5. 76
      src/router/index.js
  6. 54
      src/views/super/Ranking/Ranking.vue
  7. 166
      src/views/super/Ranking/YearProfit.vue

10722
package-lock.json

File diff suppressed because it is too large

1
src/assets/super/ranking-menu.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_230_69103"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_230_69103)"><g><g><path d="M15.75,13.95L15.75,2.05Q15.75,1.304417,15.2228,0.77721Q14.6956,0.25,13.95,0.25L2.05,0.25Q1.304416,0.25,0.777208,0.777208Q0.25,1.304415,0.25,2.05L0.25,13.95Q0.25,14.6956,0.77721,15.2228Q1.304417,15.75,2.05,15.75L13.95,15.75Q14.6956,15.75,15.2228,15.2228Q15.75,14.6956,15.75,13.95ZM14.1621,1.8378649999999999Q14.25,1.925732,14.25,2.05L14.25,13.95Q14.25,14.25,13.95,14.25L2.05,14.25Q1.75,14.25,1.75,13.95L1.75,2.05Q1.75,1.75,2.05,1.75L13.95,1.75Q14.0743,1.75,14.1621,1.8378649999999999Z" fill-rule="evenodd" fill="#626573" fill-opacity="1"/></g><g><path d="M3.750000238418579,1Q3.750000238418579,0.9261315,3.764411238418579,0.853682Q3.778822238418579,0.7812330000000001,3.807090238418579,0.712987Q3.835359238418579,0.6447419999999999,3.876398238418579,0.583322Q3.917437238418579,0.521903,3.969670238418579,0.46967000000000003Q4.021903238418579,0.41743699999999995,4.083322238418579,0.376398Q4.144742238418579,0.33535899999999996,4.212987238418579,0.30709Q4.281233238418579,0.278822,4.353682238418579,0.26441099999999995Q4.426131738418579,0.25,4.500000238418579,0.25Q4.573868738418579,0.25,4.646318238418579,0.26441099999999995Q4.718767238418579,0.278822,4.787013238418579,0.30709Q4.855258238418579,0.33535899999999996,4.916678238418579,0.376398Q4.978097238418579,0.41743699999999995,5.030330238418579,0.46967000000000003Q5.0825632384185795,0.521903,5.123602238418579,0.583322Q5.164641238418579,0.6447419999999999,5.1929102384185795,0.712987Q5.221178238418579,0.7812330000000001,5.235589238418579,0.853682Q5.250000238418579,0.9261315,5.250000238418579,1L5.250000238418579,15Q5.250000238418579,15.0739,5.235589238418579,15.1463Q5.221178238418579,15.2188,5.1929102384185795,15.287Q5.164641238418579,15.3553,5.123602238418579,15.4167Q5.0825632384185795,15.4781,5.030330238418579,15.5303Q4.978097238418579,15.5826,4.916678238418579,15.6236Q4.855258238418579,15.6646,4.787013238418579,15.6929Q4.718767238418579,15.7212,4.646318238418579,15.7356Q4.573868738418579,15.75,4.500000238418579,15.75Q4.426131738418579,15.75,4.353682238418579,15.7356Q4.281233238418579,15.7212,4.212987238418579,15.6929Q4.144742238418579,15.6646,4.083322238418579,15.6236Q4.021903238418579,15.5826,3.969670238418579,15.5303Q3.917437238418579,15.4781,3.876398238418579,15.4167Q3.835359238418579,15.3553,3.807090238418579,15.287Q3.778822238418579,15.2188,3.764411238418579,15.1463Q3.750000238418579,15.0739,3.750000238418579,15L3.750000238418579,1Z" fill-rule="evenodd" fill="#626573" fill-opacity="1"/></g><g><path d="M1,4.52734375L15,4.52734375Q15.0739,4.52734375,15.1463,4.54175475Q15.2188,4.55616575,15.287,4.58443375Q15.3553,4.61270275,15.4167,4.65374175Q15.4781,4.69478075,15.5303,4.74701375Q15.5826,4.79924675,15.6236,4.86066575Q15.6646,4.92208575,15.6929,4.99033075Q15.7212,5.05857675,15.7356,5.13102575Q15.75,5.20347525,15.75,5.27734375Q15.75,5.35121225,15.7356,5.42366175Q15.7212,5.49611075,15.6929,5.56435675Q15.6646,5.63260175,15.6236,5.69402175Q15.5826,5.75544075,15.5303,5.80767375Q15.4781,5.85990675,15.4167,5.90094575Q15.3553,5.94198475,15.287,5.97025375Q15.2188,5.99852175,15.1463,6.01293275Q15.0739,6.02734375,15,6.02734375L1,6.02734375Q0.9261315,6.02734375,0.853682,6.01293275Q0.7812330000000001,5.99852175,0.712987,5.97025375Q0.6447419999999999,5.94198475,0.583322,5.90094575Q0.521903,5.85990675,0.46967000000000003,5.80767375Q0.41743699999999995,5.75544075,0.376398,5.69402175Q0.33535899999999996,5.63260175,0.30709,5.56435675Q0.278822,5.49611075,0.26441099999999995,5.42366175Q0.25,5.35121225,0.25,5.27734375Q0.25,5.20347525,0.26441099999999995,5.13102575Q0.278822,5.05857675,0.30709,4.99033075Q0.33535899999999996,4.92208575,0.376398,4.86066575Q0.41743699999999995,4.79924675,0.46967000000000003,4.74701375Q0.521903,4.69478075,0.583322,4.65374175Q0.6447419999999999,4.61270275,0.712987,4.58443375Q0.7812330000000001,4.55616575,0.853682,4.54175475Q0.9261315,4.52734375,1,4.52734375Z" fill-rule="evenodd" fill="#626573" fill-opacity="1"/></g></g></g></svg>

After

Width:  |  Height:  |  Size: 4.2 KiB

272
src/components/super/RankingLeftMenu.vue

@ -0,0 +1,272 @@
<template>
<aside class="sidebar">
<ul>
<li v-for="(item, index) in menuList" :key="item.path">
<div :class="[$route.path == item.path ? 'active' : '', 'flex', $route.path == item.path ? curIndex = index : '']"
@click="gotoPath(item.path,index)">
<img v-if="$route.path == item.path" :src="item.imgActive" alt="">
<img v-else :src="item.img" alt="">
{{ item.name }}
</div>
<p :class="['flex', activeFloor == item1.desc ? 'curActive' : '']"
v-for="(item1) in item.list" @click="setActiveCur(item1.desc,item)" :key="item1.name">{{ item1.name }}</p>
</li>
</ul>
</aside>
</template>
<script>
// :class="[$route.path != item.path ? 'not-point' : '', 'flex', activeFloor == item1.desc ? 'curActive' : '']"
import { mapState } from 'vuex';
import store from '../../store';
export default {
name: 'Sidebar',
props: {
// menuList: {
// type: Array,
// required: true
// },
// activeFloor:{
// type:String
// },
// curIndex:{
// type:Number
// }
},
data() {
return {
activeFloor: null,
curIndex: 0,
scrollLock: false,
menuList: [
{
name: '总利润',
img: require('@/assets/super/ranking-menu.svg'),
imgActive: require('@/assets/super/ranking-menu.svg'),
list: [
{
name: '年排行',
path: '/super/ranking/yearProfit',
desc: 'siteMessage1'
},
{
name: '月排行',
path: '/super/ranking/yearProfit',
desc: 'siteMessage2'
},
]
},
{
name: '产品',
img: require('@/assets/super/ranking-menu.svg'),
imgActive: require('@/assets/super/ranking-menu.svg'),
list: [
{
name: '毛利润排行',
path: '/super/ranking/yearProfit',
desc: 'siteMessage4'
},
{
name: '订单数排行',
path: '/super/ranking/yearProfit',
desc: 'siteMessage5'
},
{
name: '退单数排行',
path: '/super/ranking/yearProfit',
desc: 'siteMessage6'
},
]
},
{
name: '代理商',
img: require('@/assets/super/ranking-menu.svg'),
imgActive: require('@/assets/super/ranking-menu.svg'),
list: [
{
name: '毛利润排行',
path: '/super/ranking/yearProfit',
desc: 'siteMessage9'
},
{
name: '充值排行',
path: '/super/ranking/yearProfit',
desc: 'siteMessage10'
},
{
name: '新加盟',
path: '/super/ranking/yearProfit',
desc: 'siteMessage11'
},
]
},
]
}
},
mounted() {
// console.log(this.curIndex,'this.curIndex');
this.activeFloor = this.menuList[this.curIndex]['list'][0]['desc'];
this.calculateFloorOffsets();
this.$nextTick(() => {
// console.log(this.$parent.$refs.scrollContainer, 'this.$refs.scrollContainer--');
})
this.$parent.$refs.scrollContainer.addEventListener('scroll', this.handleScroll);
},
created() {
// console.log(this.$parent.$refs.scrollContainer,'this.$refs.sc--rollContainer--');
},
computed: {
...mapState(['pageTitle']) // VuexshowSidebar
},
beforeDestroy() {
this.$parent.$refs.scrollContainer.removeEventListener('scroll', this.handleScroll);
},
methods: {
calculateFloorOffsets() {
this.menuList.forEach(item => {
item.list.forEach(every => {
const el = document.getElementById(every.desc);
if (el) {
every.offsetTop = el.offsetTop;
}
})
});
},
handleScroll() {
if (this.scrollLock) return
const scrollContainer = this.$parent.$refs.scrollContainer;
const scrollHeight = scrollContainer.scrollTop;
let activeFloor = this.menuList[this.curIndex]['list'][0]['desc'];
this.menuList[this.curIndex]['list'].forEach(item => {
if (scrollHeight + 72 >= item.offsetTop) {
activeFloor = item.desc; // ID
} else {
return false; //
}
});
this.activeFloor = activeFloor; //
},
setActiveCur(dom,item) {
if(this.$route.path != item.path){
this.$router.push(item.path)
store.commit('SET_PAGETITLE', item.name);
}
setTimeout(()=>{
this.activeFloor = dom;
this.setHighActive(dom)
},500)
},
gotoPath(path,index) {
if(this.$route.path != path){
this.curIndex = index
this.scrollLock = false;
this.handleScroll()
//
const dom = document.getElementById('main-content')
dom.scrollTop = 0
this.$router.push(path)
}
},
activeArea(type) {
console.log(type);
},
setHighActive(dom) {
this.scrollLock = true;
const ele = document.getElementById(dom)
if(!ele)return
ele.classList.add('ceshi')
ele.scrollIntoView({ behavior: 'smooth', block: 'start' })
setTimeout(() => {
ele.classList.remove('ceshi')
}, 1000)
}
}
}
</script>
<style scoped lang="scss">
.sidebar {
width: 158px;
padding: 21px;
box-sizing: border-box;
background: #FFFFFF;
box-shadow: 0px 0px 11px 2px rgba(147, 147, 147, 0.11);
}
.ceshi {
// animation: fadeInOut 2s infinite;
}
ul {
list-style: none;
padding: 0;
}
.not-point {
pointer-events: none;
/* 阻止鼠标事件 */
opacity: 0.5;
/* 可选,降低透明度以视觉上表示不可用 */
cursor: not-allowed;
/* 改变鼠标光标样式,表示不可用 */
}
li {
margin-bottom: 10px;
div {
letter-spacing: 0.08em;
color: #1E2226;
margin: 11px 0;
cursor: pointer;
img {
margin-right: 6px;
}
}
p {
margin: 9px 0;
letter-spacing: 0.08em;
line-height: 18px;
color: #8A9099;
cursor: pointer;
&:hover {
color: #006AFF;
}
}
.curActive {
color: #006AFF;
}
}
/* {
display: block;
padding: 8px 12px;
text-decoration: none;
color: #333;
border-radius: 4px;
} */
/*
:hover {
background: #e0e0e0;
} */
.active {
font-weight: bold;
letter-spacing: 0.08em;
color: #006AFF;
}
.item-active {
color: #006AFF;
}
/*
.exact-active {
background: #1976d2;
color: white;
} */
</style>

1
src/main.js

@ -11,6 +11,7 @@ import 'core-js/stable';
import 'regenerator-runtime/runtime'; import 'regenerator-runtime/runtime';
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$http = request; Vue.prototype.$http = request;
Vue.prototype.reqUri = '//admin.pengda.checkcopy.com';
Vue.use(ElementUI); Vue.use(ElementUI);
new Vue({ new Vue({
router, router,

76
src/router/index.js

@ -8,9 +8,9 @@ import HomeView from '../views/HomeView.vue';
Vue.use(VueRouter) Vue.use(VueRouter)
const whiteSlideList = ['/', '/ui', '/siteList']; //侧边导航白名单 const whiteSlideList = ['/', '/ui', '/siteList']; //侧边导航白名单
const whiteHeaderList = ['/', '/ui', '/register', '/configureServicePrices', '/siteList','/siteSetting/siteBaseSetting','/siteSetting/sitePersonalization' const whiteHeaderList = ['/', '/ui', '/register', '/configureServicePrices', '/siteList','/siteSetting/siteBaseSetting','/siteSetting/sitePersonalization'
,'/siteSetting/siteH5','/siteSetting/siteSem','/pageTemplete','/demo' ,'/siteSetting/siteH5','/siteSetting/siteSem','/pageTemplete','/demo', '/super/ranking/yearProfit'
]; //头部导航白名单 ]; //头部导航白名单
const whiteFooterList = ['/', '/ui', '/configureServicePrices']; //底部白名单 const whiteFooterList = ['/', '/ui', '/configureServicePrices', '/super/ranking/yearProfit']; //底部白名单
const routes = [{ const routes = [{
path: '/', path: '/',
name: '首页', name: '首页',
@ -90,18 +90,18 @@ const routes = [{
name: '营销推广', name: '营销推广',
component: () => import( /* webpackChunkName: "siteSem" */ '../views/SiteSem.vue') component: () => import( /* webpackChunkName: "siteSem" */ '../views/SiteSem.vue')
}, },
{ // {
path: 'demoTable', // 默认子路由 // path: 'demoTable', // 默认子路由
name: '测试页面', // name: '测试页面',
redirect: () => import( /* webpackChunkName: "demoTable" */ '../views/DemoTable.vue') // 重定向到第一个页面 // redirect: () => import( /* webpackChunkName: "demoTable" */ '../views/DemoTable.vue') // 重定向到第一个页面
}, // },
] ]
}, },
{ // {
path: '/pageTemplete', // path: '/pageTemplete',
name: '网页模板', // name: '网页模板',
component: () => import( /* webpackChunkName: "pageTemplete" */ '../views/PageTemplete.vue') // component: () => import( /* webpackChunkName: "pageTemplete" */ '../views/PageTemplete.vue')
}, // },
// { // {
// path: '/demo', // path: '/demo',
// name: 'demo页面', // name: 'demo页面',
@ -113,6 +113,58 @@ const routes = [{
// }, // },
// ] // ]
// } // }
{
path: '/super/ranking',
name: '站点设置',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/Ranking.vue'),
children: [
{
path: '', // 默认子路由
redirect: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/YearProfit.vue') // 重定向到第一个页面
},
{
path: 'yearProfit',
name: '年排行',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/YearProfit.vue'),
},
{
path: 'monthProfit',
name: '月排行',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/YearProfit.vue')
},
{
path: 'checkProfit',
name: '毛利润排行',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/YearProfit.vue')
},
{
path: 'checkOrdernum',
name: '订单数排行',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/YearProfit.vue')
},
{
path: 'checkRefund',
name: '退单数排行',
redirect: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/YearProfit.vue')
},
{
path: 'agentProfit',
name: '毛利润排行',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/YearProfit.vue')
},
{
path: 'agentRecharge',
name: '充值排行',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/YearProfit.vue')
},
{
path: 'agentNew',
name: '新加盟',
redirect: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/YearProfit.vue')
},
]
},
] ]
const router = new VueRouter({ const router = new VueRouter({

54
src/views/super/Ranking/Ranking.vue

@ -0,0 +1,54 @@
<template>
<div class="siteSetting-wrap">
<RankingLeftMenu />
<!--:menuList="menuList" :activeFloor="activeFloor" :curIndex="curIndex" -->
<!-- 主内容区域 -->
<main class="main-content" ref="scrollContainer">
<router-view></router-view>
<Footer></Footer>
</main>
</div>
</template>
<script>
import Footer from '@/components/Footer.vue';
import RankingLeftMenu from '@/components/super/RankingLeftMenu.vue'
export default {
//
name: '',
props: [''],
components: {
Footer,
RankingLeftMenu,
},
data() {
return {
path:''
}
},
mounted(){
this.path =this.$route.path;
console.log(this.$route.path,'090-9090');
// this.$refs.scrollContainer.scrollTo(0)
},
methods: {
}
}
</script>
<style scoped lang="scss">
.siteSetting-wrap {
display: flex;
height: 100%;
}
// .sidebar {
// width: 250px;
// background: #f5f5f5;
// padding: 20px;
// }
.main-content {
flex: 1;
padding: 12px;
overflow-y: auto;
}
</style>

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

@ -0,0 +1,166 @@
<template>
<div class="demo-wrap min-flex-right">
<div class="flex-between">
<h2>总利润 - 年排行</h2>
<el-form :model="form">
<GuipSelect v-model="form.payword" :defaultValue="form.payword" prop="payword" width="100%"
:options="options_payword" />
</el-form>
</div>
<div class=" flex-common" id="">
<el-form>
<el-table :data="tableData.slice((currentPage - 1) * pageSize, currentPage * pageSize)"
style="width: 100%" :key="random()">
<el-table-column type="index" label="排序" width="100">
<template slot-scope="scope">
{{ scope.row.sort }}
</template>
</el-table-column>
<!-- 其他列 -->
<el-table-column prop="name" label="年份">
<template slot-scope="scope">
{{ scope.row.value_1 }}
</template>
</el-table-column>
<el-table-column prop="count" label="总利润/元" sortable>
<template slot-scope="scope">
<div class="flex">
{{ scope.row.value_2 }}
{{scope.row.value }}%上年持平
</div>
</template>
</el-table-column>
<el-table-column prop="count" label="代理商排行">
<template slot-scope="scope">
<div class="flex">
{{ scope.row.value_1 }}
<span class="flex"><img class="edit_icon" src="../../../assets/site/form_link.svg" alt=""></span>
</div>
</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"
:total="tableData.length">
</el-pagination>
</el-form>
</div>
</div>
</template>
<script>
import GuipSelect from '@/components/GuipSelect.vue'
export default {
//
name: '',
props: [''],
components: {
GuipSelect,
// GuipSelectFilter,
},
data() {
return {
phoneService: [
{
text: '不限',
value: '0'
},
{
text: 'H5',
value: '1'
},
{
text: '小程序',
value: '2'
},
{
text: 'H5以及小程序',
value: '3'
},
],
currentPage: 1, //
pageSize: 20, //
total: 0, //
options_payword: [
{
label: '按篇', value: '0'
},
{
label: '按字符', value: '1'
},
],
options: [
{ label: '选项1', value: '1' },
{ label: '选项2', value: '2' },
{ label: '选项3', value: '3' },
// ...
],
filteredOptions: this.options,
phoneServicelist:
{
0: '不限',
1: ' H5',
2: '小程序',
3: '无手机服务'
},
tableData: [],
form: {
payword: '0',
}
}
},
mounted() {
// this.$refs.scrollContainer.scrollTo(0)
this.getRankingData();
},
methods: {
getRankingData(){
const that = this
this.$http('POST', this.reqUri + '/super/ajax_get_rank_detail',{
rank_type:1,
}).then(response => {
that.tableData = response.data.list
console.log(response.data.list, '0001')
})
.catch(error => {
console.error(error, '-----')
})
},
//
filterHandler(value, row, column) {
// console.log(value, row, column,'======');
const property = column['property'];
if (value == 0) {
return row[property] != value
}
return row[property] === value;
},
//
customFilter(keyword, options) {
if (!keyword) return options
return options.filter(item => {
//
return item.label.includes(keyword) || item.value.includes(keyword)
})
},
handleSizeChange(val) {
this.pageSize = val
},
handleCurrentChange(val) {
this.currentPage = val
},
random() {
var randomNumber = Math.random();
return randomNumber
},
}
}
</script>
<style scoped lang="scss">
.demo-wrap {
width: 100%;
letter-spacing: 0.08em;
}
</style>
Loading…
Cancel
Save