|
@@ -1,44 +1,58 @@
|
|
|
<template>
|
|
|
<div class="dashboard-container">
|
|
|
- <!-- <div class="scoped-count">
|
|
|
+ <div class="scoped-count">
|
|
|
<dv-border-box-1>
|
|
|
<div class="sc-row">
|
|
|
- <div class="sc-col">
|
|
|
+ <div class="sc-user">
|
|
|
+ <dv-decoration-12 style="width:150px;height:150px;display: inline-block;" />
|
|
|
+ <dv-decoration-3 style="width:300px;height:30px;display: inline-block;" />
|
|
|
+ <div class="t">{{timeTips}}{{sysUser.nickname}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="sc-col" v-if="configClickTotal.data.length > 0">
|
|
|
<dv-border-box-11 title="搜索总榜">
|
|
|
<div class="sc-wrap">
|
|
|
- <dv-capsule-chart :config="configSearch" style="width:400px;height:300px" />
|
|
|
+ <dv-capsule-chart :config="configSearchTotal" style="width:360px;height:300px" />
|
|
|
+ </div>
|
|
|
+ </dv-border-box-11>
|
|
|
+ </div>
|
|
|
+ <div class="sc-col" v-if="configClickTotal.data.length > 0">
|
|
|
+ <dv-border-box-11 title="点击总榜">
|
|
|
+ <div class="sc-wrap">
|
|
|
+ <dv-capsule-chart :config="configClickTotal" style="width:360px;height:300px" />
|
|
|
+ </div>
|
|
|
+ </dv-border-box-11>
|
|
|
+ </div>
|
|
|
+ <div class="sc-col" v-if="configClickTotal.data.length > 0">
|
|
|
+ <dv-border-box-11 title="今日点击榜">
|
|
|
+ <div class="sc-wrap">
|
|
|
+ <dv-capsule-chart :config="configClickToday" style="width:360px;height:300px" />
|
|
|
+ </div>
|
|
|
+ </dv-border-box-11>
|
|
|
+ </div>
|
|
|
+ <div class="sc-col" v-if="configClickTotal.data.length > 0">
|
|
|
+ <dv-border-box-11 title="昨日点击榜">
|
|
|
+ <div class="sc-wrap">
|
|
|
+ <dv-capsule-chart :config="configClickYesterday" style="width:360px;height:300px" />
|
|
|
+ </div>
|
|
|
+ </dv-border-box-11>
|
|
|
+ </div>
|
|
|
+ <div class="sc-col" v-if="configClickTotal.data.length > 0">
|
|
|
+ <dv-border-box-11 title="近七天点击榜">
|
|
|
+ <div class="sc-wrap">
|
|
|
+ <dv-capsule-chart :config="configClickWeek" style="width:360px;height:300px" />
|
|
|
+ </div>
|
|
|
+ </dv-border-box-11>
|
|
|
+ </div>
|
|
|
+ <div class="sc-col" v-if="configClickTotal.data.length > 0">
|
|
|
+ <dv-border-box-11 title="近一月点击榜">
|
|
|
+ <div class="sc-wrap">
|
|
|
+ <dv-capsule-chart :config="configClickMonth" style="width:360px;height:300px" />
|
|
|
</div>
|
|
|
</dv-border-box-11>
|
|
|
</div>
|
|
|
- <div class="sc-col"></div>
|
|
|
- <div class="sc-col"></div>
|
|
|
- </div>
|
|
|
- </dv-border-box-1>
|
|
|
- </div> -->
|
|
|
- <!-- <div class="scoped-rank">
|
|
|
- <div class="sr-top-left">
|
|
|
- <dv-decoration-3 style="width:250px;height:30px;" />
|
|
|
- <div style="width: 100%;padding-top: 10px;text-align: center;">{{timeTips}}{{sysUser.nickname}}</div>
|
|
|
- </div>
|
|
|
- <div class="sr-top-right">
|
|
|
- <dv-decoration-12 style="width:150px;height:150px;margin-left: 20px;" />
|
|
|
- <dv-decoration-11 style="width:200px;height:60px;color: #1dc1f5;">楼盘点击总榜</dv-decoration-11>
|
|
|
</div>
|
|
|
- <dv-decoration-10 style="width:100%;height:5px;margin: 30px 0;"/>
|
|
|
- <dv-border-box-1>
|
|
|
- <div class="sr-wrap">
|
|
|
- <dv-scroll-ranking-board :config="configClick" style="width:500px;height:300px" />
|
|
|
- </div>
|
|
|
</dv-border-box-1>
|
|
|
- <dv-decoration-6 style="width:100%;height:30px;margin: 30px 0;" />
|
|
|
</div>
|
|
|
- <div class="scoped-rank">
|
|
|
- <dv-border-box-11 title="搜索总榜">
|
|
|
- <div class="sr-wrap2">
|
|
|
- <dv-capsule-chart :config="configSearch" style="width:500px;height:610px" />
|
|
|
- </div>
|
|
|
- </dv-border-box-11>
|
|
|
- </div> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -48,25 +62,51 @@ export default {
|
|
|
name: 'Dashboard',
|
|
|
data () {
|
|
|
return {
|
|
|
- configClick: {
|
|
|
+ configClickTotal: {
|
|
|
data: [],
|
|
|
unit: '次',
|
|
|
+ colors: ['#ff3f40', '#fa6544', '#f16b22', '#f1a124', '#f1a124', '#c7f123', '#c7f123', '#22f294', '#24f1b9', '#23f1dc',
|
|
|
+ '#35f8fe', '#00a8ff', '#0083ff', '#0060ff', '#003cff', '#0018ff', '#4800fe', '#7800ff', '#a201ff', '#e300ff',
|
|
|
+ ],
|
|
|
},
|
|
|
- configSearch: {
|
|
|
+ configClickWeek: {
|
|
|
data: [],
|
|
|
unit: '次',
|
|
|
- showValue: true,
|
|
|
colors: ['#ff3f40', '#fa6544', '#f16b22', '#f1a124', '#f1a124', '#c7f123', '#c7f123', '#22f294', '#24f1b9', '#23f1dc',
|
|
|
'#35f8fe', '#00a8ff', '#0083ff', '#0060ff', '#003cff', '#0018ff', '#4800fe', '#7800ff', '#a201ff', '#e300ff',
|
|
|
],
|
|
|
},
|
|
|
+ configClickMonth: {
|
|
|
+ data: [],
|
|
|
+ unit: '次',
|
|
|
+ colors: ['#ff3f40', '#fa6544', '#f16b22', '#f1a124', '#f1a124', '#c7f123', '#c7f123', '#22f294', '#24f1b9', '#23f1dc',
|
|
|
+ '#35f8fe', '#00a8ff', '#0083ff', '#0060ff', '#003cff', '#0018ff', '#4800fe', '#7800ff', '#a201ff', '#e300ff',
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ configClickYesterday: {
|
|
|
+ data: [],
|
|
|
+ unit: '次',
|
|
|
+ colors: ['#ff3f40', '#fa6544', '#f16b22', '#f1a124', '#f1a124', '#c7f123', '#c7f123', '#22f294', '#24f1b9', '#23f1dc',
|
|
|
+ '#35f8fe', '#00a8ff', '#0083ff', '#0060ff', '#003cff', '#0018ff', '#4800fe', '#7800ff', '#a201ff', '#e300ff',
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ configClickToday: {
|
|
|
+ data: [],
|
|
|
+ unit: '次',
|
|
|
+ colors: ['#ff3f40', '#fa6544', '#f16b22', '#f1a124', '#f1a124', '#c7f123', '#c7f123', '#22f294', '#24f1b9', '#23f1dc',
|
|
|
+ '#35f8fe', '#00a8ff', '#0083ff', '#0060ff', '#003cff', '#0018ff', '#4800fe', '#7800ff', '#a201ff', '#e300ff',
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ configSearchTotal: {
|
|
|
+ data: [],
|
|
|
+ unit: '次',
|
|
|
+ // showValue: true,
|
|
|
+ colors: ['#37a2da', '#32c5e9', '#67e0e3', '#9fe6b8', '#f1a124', '#ffdb5c', '#ff9f7f', '#fb7293', '#22f294', '#e300ff'],
|
|
|
+ },
|
|
|
timeTips: '',
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
- const fpUser = window.sessionStorage.getItem('fp_user') ? JSON.parse(window.sessionStorage.getItem('fp_user')) : {}
|
|
|
- let isAdmin = 2
|
|
|
- if (fpUser.username === 'admin') isAdmin = 1
|
|
|
let now = new Date()
|
|
|
let hour = now.getHours()
|
|
|
if(hour < 6){this.timeTips = '凌晨好!'}
|
|
@@ -76,37 +116,38 @@ export default {
|
|
|
else if (hour < 17){this.timeTips = '下午好!'}
|
|
|
else if (hour < 19){this.timeTips = '傍晚好!'}
|
|
|
else if (hour < 22){this.timeTips = '晚上好!'}
|
|
|
- this.$api.other.admindexrankclick().then(res => {
|
|
|
- const list = res.estate_click_rank || []
|
|
|
- const newArr = list.map(item => {
|
|
|
- return {
|
|
|
- value: isAdmin === 1 ? Number(item.click_num) : Number(item.click_num) + 10000,
|
|
|
- name: item.estate_name,
|
|
|
- }
|
|
|
- })
|
|
|
- let config = this.configClick
|
|
|
- config.data = [...newArr]
|
|
|
- this.configClick = {...config}
|
|
|
+ this.$api.other.admindexrank().then(res => {
|
|
|
+ console.log(res)
|
|
|
+ this.formatData(res.estate_click_rank, 'configClickTotal')
|
|
|
+ this.formatData(res.estate_week_rank, 'configClickWeek')
|
|
|
+ this.formatData(res.estate_month_rank, 'configClickMonth')
|
|
|
+ this.formatData(res.estate_yesterday_rank, 'configClickYesterday')
|
|
|
+ this.formatData(res.estate_today_rank, 'configClickToday')
|
|
|
+ this.formatData(res.estate_search_rank, 'configSearchTotal')
|
|
|
})
|
|
|
- this.$api.other.admindexrankweek().then(res => {
|
|
|
- const list = res || []
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters([
|
|
|
+ 'sysUser',
|
|
|
+ ])
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ formatData (list, str) {
|
|
|
+ const fpUser = window.sessionStorage.getItem('fp_user') ? JSON.parse(window.sessionStorage.getItem('fp_user')) : {}
|
|
|
+ let isAdmin = 1
|
|
|
+ // if (fpUser.username === 'admin' || fpUser.username === 'laoluo' || fpUser.username === 'wanchao' || fpUser.username === 'kangchao') isAdmin = 1
|
|
|
const nList = list.splice(0, 10)
|
|
|
const newArr = nList.map(item => {
|
|
|
return {
|
|
|
- value: isAdmin === 1 ? Number(item.week_click_num) : Number(item.week_click_num) + 10000,
|
|
|
+ value: isAdmin === 1 ? Number(item.num) : Number(item.num) + 10000,
|
|
|
name: item.estate_name,
|
|
|
}
|
|
|
})
|
|
|
- let config = this.configSearch
|
|
|
+ let config = this[str]
|
|
|
+ config.showValue = isAdmin === 1 ? true : false
|
|
|
config.data = [...newArr]
|
|
|
- this.configSearch = {...config}
|
|
|
- })
|
|
|
-
|
|
|
- },
|
|
|
- computed: {
|
|
|
- ...mapGetters([
|
|
|
- 'sysUser',
|
|
|
- ])
|
|
|
+ this[str] = {...config}
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -124,49 +165,38 @@ export default {
|
|
|
.dashboard-container {
|
|
|
width: 100%;
|
|
|
height: calc(100vh - 84px);
|
|
|
+ overflow-y: auto;
|
|
|
// background: url(./bg.jpg) no-repeat center;
|
|
|
background-color: #1f2d3d;
|
|
|
}
|
|
|
-.scoped-rank {
|
|
|
- width: 600px;
|
|
|
- margin-right: 20px;
|
|
|
- box-sizing: border-box;
|
|
|
- padding: 20px;
|
|
|
- display: inline-block;
|
|
|
- vertical-align: top;
|
|
|
- .sr-top-left {
|
|
|
- display: inline-block;
|
|
|
- vertical-align: middle;
|
|
|
- padding-right: 20px;
|
|
|
- color: #1e9bec;
|
|
|
- font-weight: bold;
|
|
|
- }
|
|
|
- .sr-top-right {
|
|
|
- display: inline-block;
|
|
|
- vertical-align: middle;
|
|
|
- width: 200px;
|
|
|
- }
|
|
|
- .sr-wrap {
|
|
|
- padding: 30px;
|
|
|
- }
|
|
|
- .sr-wrap2 {
|
|
|
- padding: 60px 20px 20px;
|
|
|
- }
|
|
|
-}
|
|
|
+
|
|
|
|
|
|
.scoped-count {
|
|
|
+ padding-top: 20px;
|
|
|
+ display: inline-block;
|
|
|
.sc-row {
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
+ padding: 10px 20px;
|
|
|
}
|
|
|
.sc-col {
|
|
|
- flex: 1;
|
|
|
- padding: 20px;
|
|
|
- margin: 20px;
|
|
|
- border: 1px solid #fff;
|
|
|
+ width: 400px;
|
|
|
+ padding: 10px;
|
|
|
}
|
|
|
.sc-wrap {
|
|
|
- padding: 50px 20px 30px;
|
|
|
+ padding: 50px 20px 20px;
|
|
|
+ }
|
|
|
+ .sc-user {
|
|
|
+ width: 400px;
|
|
|
+ height: 300px;
|
|
|
+ padding-top: 60px;
|
|
|
+ text-align: center;
|
|
|
+ .t {
|
|
|
+ color: #fff;
|
|
|
+ font-size: 20px;
|
|
|
+ padding-top: 10px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|