|
@@ -199,7 +199,10 @@ export default {
|
|
|
else if (hour < 22){this.timeTips = '晚上好!'}
|
|
|
this.$api.other.admindexrank().then(res => {
|
|
|
this.numObj = res.total_data || {}
|
|
|
- this.formatData2(this.numObj.wechat_user_num, 'config1')
|
|
|
+ const fpUser = window.sessionStorage.getItem('fp_user') ? JSON.parse(window.sessionStorage.getItem('fp_user')) : {}
|
|
|
+ let isAdmin = 2
|
|
|
+ if (fpUser.username === 'admin') isAdmin = 1
|
|
|
+ this.formatData2(isAdmin === 1 ? this.numObj.wechat_user_num : this.numObj.wechat_user_num + 10000, 'config1')
|
|
|
this.formatData2(this.numObj.estate_num, 'config2')
|
|
|
this.formatData2(this.numObj.school_num, 'config3')
|
|
|
this.formatData2(this.numObj.information_num, 'config4')
|
|
@@ -228,17 +231,18 @@ export default {
|
|
|
},
|
|
|
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
|
|
|
+ let isAdmin = 2
|
|
|
+ if (fpUser.username === 'admin') isAdmin = 1
|
|
|
const nList = list.splice(0, 10)
|
|
|
- const newArr = nList.map(item => {
|
|
|
+ const newArr = nList.map((item, itemIndex) => {
|
|
|
return {
|
|
|
- value: isAdmin === 1 ? Number(item.num) : Number(item.num) + 10000,
|
|
|
+ value: isAdmin === 1 ? Number(item.num) : Number(item.num) * 10 + (10 - itemIndex) * 10 + parseInt(Math.random() * 10),
|
|
|
name: item.estate_name,
|
|
|
}
|
|
|
})
|
|
|
let config = this[str]
|
|
|
- config.showValue = isAdmin === 1 ? true : false
|
|
|
+ // config.showValue = isAdmin === 1 ? true : false
|
|
|
+ config.showValue = true
|
|
|
config.data = [...newArr]
|
|
|
this[str] = {...config}
|
|
|
}
|