|
@ -7,30 +7,50 @@ |
|
|
|
|
|
|
|
|
<div ref="area" id="area"></div> |
|
|
<div ref="area" id="area"></div> |
|
|
<div class="info"> |
|
|
<div class="info"> |
|
|
<p><span>股东:</span>1,000</p> |
|
|
|
|
|
<p><span>分公司:</span>100,000,000</p> |
|
|
|
|
|
<p><span>分公司:</span>100,000</p> |
|
|
|
|
|
<p><span>总代:</span>1,000</p> |
|
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
<p v-for="(item,index) of cityInfo" :key="index"><span>{{item.name}}:</span>{{item.value}}</p> |
|
|
|
|
|
</div> |
|
|
<div ref='chartBar' id="home"></div> |
|
|
<div ref='chartBar' id="home"></div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="ranking"> |
|
|
<div class="ranking"> |
|
|
<p class="title">代理城市排名</p> |
|
|
<p class="title">代理城市排名</p> |
|
|
<div class="rankingCity"> |
|
|
<div class="rankingCity"> |
|
|
<div class="item"> |
|
|
|
|
|
<p class="city">广东省</p> |
|
|
|
|
|
<p class="number">1,000</p> |
|
|
|
|
|
|
|
|
<div v-for="(item,index) in rankArea" :key="index"> |
|
|
|
|
|
<div class="item" v-if="item.top == 1"> |
|
|
|
|
|
<div class="city"> |
|
|
|
|
|
<p class="rankNum">1</p> |
|
|
|
|
|
<p class="cityName">{{item.cityName}}</p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<p class="number">{{item.counts | capitalize}}</p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="item" v-if="item.top == 2"> |
|
|
|
|
|
<div class="city"> |
|
|
|
|
|
<p class="rankNum">2</p> |
|
|
|
|
|
<p class="cityName">{{item.cityName}}</p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<p class="number">{{item.counts | capitalize}}</p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="item" v-if="item.top == 3"> |
|
|
|
|
|
<div class="city"> |
|
|
|
|
|
<p class="rankNum">3</p> |
|
|
|
|
|
<p class="cityName">{{item.cityName}}</p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<p class="number">{{item.counts | capitalize}}</p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="item" v-if="item.top == 4"> |
|
|
|
|
|
<div class="city"> |
|
|
|
|
|
<p class="rankNum">4</p> |
|
|
|
|
|
<p class="cityName">{{item.cityName}}</p> |
|
|
</div> |
|
|
</div> |
|
|
<div class="item"> |
|
|
|
|
|
<p class="city">湖南省</p> |
|
|
|
|
|
<p class="number">100,000,00</p> |
|
|
|
|
|
|
|
|
<p class="number">{{item.counts |capitalize}}</p> |
|
|
</div> |
|
|
</div> |
|
|
<div class="item"> |
|
|
|
|
|
<p class="city">上海市</p> |
|
|
|
|
|
<p class="number">100,000</p> |
|
|
|
|
|
|
|
|
<div class="item" v-if="item.top == 5"> |
|
|
|
|
|
<div class="city"> |
|
|
|
|
|
<p class="rankNum">5</p> |
|
|
|
|
|
<p class="cityName">{{item.cityName}}</p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<p class="number">{{item.counts | capitalize}}</p> |
|
|
</div> |
|
|
</div> |
|
|
<div class="item"> |
|
|
|
|
|
<p class="city">四川省</p> |
|
|
|
|
|
<p class="number">1,000</p> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -49,7 +69,10 @@ |
|
|
poxy_sum: '', |
|
|
poxy_sum: '', |
|
|
city: {}, |
|
|
city: {}, |
|
|
cityName: '广东', |
|
|
cityName: '广东', |
|
|
cityInfo:{}, |
|
|
|
|
|
|
|
|
cityInfo: [], |
|
|
|
|
|
rankArea: [], |
|
|
|
|
|
selectArea: [], |
|
|
|
|
|
regions: [], |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
filters: { |
|
|
filters: { |
|
@ -60,16 +83,37 @@ |
|
|
async mounted() { |
|
|
async mounted() { |
|
|
await this.getData() |
|
|
await this.getData() |
|
|
this.drawarea(); |
|
|
this.drawarea(); |
|
|
this.aa() |
|
|
|
|
|
|
|
|
this.aa(this.cityInfo) |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
async getData() { |
|
|
async getData() { |
|
|
const res = await data.dataDistribution(); |
|
|
const res = await data.dataDistribution(); |
|
|
console.log(res,'-----res'); |
|
|
|
|
|
this.poxy_sum = res.data.poxy_sum |
|
|
this.poxy_sum = res.data.poxy_sum |
|
|
this.city = res.data.city |
|
|
this.city = res.data.city |
|
|
console.log(this.city, '---res'); |
|
|
|
|
|
this.cityInfo = this.city[this.cityName] |
|
|
|
|
|
|
|
|
this.city[this.cityName] |
|
|
|
|
|
console.log(this.city[this.cityName], '---this.city[this.cityName]'); |
|
|
|
|
|
this.cityInfo.push({ |
|
|
|
|
|
value: this.city[this.cityName].level_id_1, |
|
|
|
|
|
name: 'vip' |
|
|
|
|
|
}, { |
|
|
|
|
|
value: this.city[this.cityName].level_id_2, |
|
|
|
|
|
name: '总代' |
|
|
|
|
|
}, { |
|
|
|
|
|
value: this.city[this.cityName].level_id_3, |
|
|
|
|
|
name: '合伙人' |
|
|
|
|
|
}, { |
|
|
|
|
|
value: this.city[this.cityName].level_id_4, |
|
|
|
|
|
name: '分公司' |
|
|
|
|
|
}, { |
|
|
|
|
|
value: this.city[this.cityName].level_id_5, |
|
|
|
|
|
name: '股东' |
|
|
|
|
|
}) |
|
|
|
|
|
let top5 = res.data.top5 |
|
|
|
|
|
for (let i in top5) { |
|
|
|
|
|
top5[i].cityName = i |
|
|
|
|
|
this.rankArea.push(top5[i]) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
drawarea() { |
|
|
drawarea() { |
|
|
const _this = this |
|
|
const _this = this |
|
@ -77,12 +121,31 @@ |
|
|
_this.myChinaMap = echarts.init(this.$refs.area) |
|
|
_this.myChinaMap = echarts.init(this.$refs.area) |
|
|
|
|
|
|
|
|
_this.myChinaMap.on('click', function (param) { |
|
|
_this.myChinaMap.on('click', function (param) { |
|
|
console.log(param.name) |
|
|
|
|
|
|
|
|
console.log(param, '--------------data'); |
|
|
|
|
|
_this.cityInfo = [] |
|
|
|
|
|
_this.cityName = param.name |
|
|
|
|
|
_this.cityInfo.push({ |
|
|
|
|
|
value: _this.city[_this.cityName].level_id_1, |
|
|
|
|
|
name: 'vip' |
|
|
|
|
|
}, { |
|
|
|
|
|
value: _this.city[_this.cityName].level_id_2, |
|
|
|
|
|
name: '总代' |
|
|
|
|
|
}, { |
|
|
|
|
|
value: _this.city[_this.cityName].level_id_3, |
|
|
|
|
|
name: '合伙人' |
|
|
|
|
|
}, { |
|
|
|
|
|
value: _this.city[_this.cityName].level_id_4, |
|
|
|
|
|
name: '分公司' |
|
|
|
|
|
}, { |
|
|
|
|
|
value: _this.city[_this.cityName].level_id_5, |
|
|
|
|
|
name: '股东' |
|
|
|
|
|
}) |
|
|
|
|
|
_this.aa(_this.cityInfo) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
_this.myChinaMap.setOption({ // 进行相关配置 |
|
|
_this.myChinaMap.setOption({ // 进行相关配置 |
|
|
backgroundColor: '#fff', |
|
|
|
|
|
tooltip: {}, // 鼠标移到图里面的浮动提示框 |
|
|
|
|
|
|
|
|
backgroundColor: '#3C3F50', |
|
|
|
|
|
// tooltip: {}, // 鼠标移到图里面的浮动提示框 |
|
|
dataRange: { |
|
|
dataRange: { |
|
|
show: false, |
|
|
show: false, |
|
|
min: 0, |
|
|
min: 0, |
|
@ -93,6 +156,7 @@ |
|
|
color: ['orangered', 'yellow', 'lightskyblue'] |
|
|
color: ['orangered', 'yellow', 'lightskyblue'] |
|
|
}, |
|
|
}, |
|
|
geo: { // 这个是重点配置区 |
|
|
geo: { // 这个是重点配置区 |
|
|
|
|
|
backgroundColor: '#000', |
|
|
map: 'china', // 表示中国地图 |
|
|
map: 'china', // 表示中国地图 |
|
|
roam: false, // 缩小放大 |
|
|
roam: false, // 缩小放大 |
|
|
selectedMode: 'single', |
|
|
selectedMode: 'single', |
|
@ -100,35 +164,55 @@ |
|
|
normal: { |
|
|
normal: { |
|
|
show: false, // 是否显示对应地名 |
|
|
show: false, // 是否显示对应地名 |
|
|
textStyle: { |
|
|
textStyle: { |
|
|
color: 'rgba(0,0,0,0.4)' |
|
|
|
|
|
|
|
|
color: '#fff' |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
select: { |
|
|
|
|
|
label: { |
|
|
|
|
|
color: '#fff' |
|
|
|
|
|
}, |
|
|
itemStyle: { |
|
|
itemStyle: { |
|
|
normal: { |
|
|
|
|
|
borderColor: 'rgba(0, 0, 0, 0.2)' |
|
|
|
|
|
|
|
|
areaColor: '#729EFF', |
|
|
}, |
|
|
}, |
|
|
emphasis: { |
|
|
|
|
|
areaColor: null, |
|
|
|
|
|
shadowOffsetX: 0, |
|
|
|
|
|
shadowOffsetY: 0, |
|
|
|
|
|
shadowBlur: 20, |
|
|
|
|
|
borderWidth: 0, |
|
|
|
|
|
shadowColor: 'rgba(0, 0, 0, 0.5)' |
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
regions: [{ |
|
|
|
|
|
name: "南海诸岛", |
|
|
|
|
|
value: 0, |
|
|
|
|
|
itemStyle: { |
|
|
|
|
|
normal: { |
|
|
|
|
|
opacity: 0, |
|
|
|
|
|
label: { |
|
|
|
|
|
show: false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}, { |
|
|
|
|
|
name: "广东", |
|
|
|
|
|
selected: true, |
|
|
|
|
|
}], |
|
|
|
|
|
itemStyle: { |
|
|
|
|
|
normal: { |
|
|
|
|
|
borderColor: 'rgba(255, 255, 255, 0.2)', |
|
|
|
|
|
// areaColor: '#fff', |
|
|
|
|
|
areaColor: 'rgba(255, 255, 255, 0.4)', |
|
|
|
|
|
}, |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
aa() { |
|
|
|
|
|
|
|
|
aa(cityInfo) { |
|
|
var chartBar = echarts.init((this.$refs.chartBar)); |
|
|
var chartBar = echarts.init((this.$refs.chartBar)); |
|
|
var option = { |
|
|
var option = { |
|
|
// title: { |
|
|
|
|
|
// text: '某站点用户访问来源', |
|
|
|
|
|
// subtext: '纯属虚构', |
|
|
|
|
|
// x: 'center' |
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
|
title: { |
|
|
|
|
|
text: this.cityName + '数据占比', |
|
|
|
|
|
subtext: '纯属虚构', |
|
|
|
|
|
textStyle: { |
|
|
|
|
|
color: "#fff", |
|
|
|
|
|
}, |
|
|
|
|
|
x: 'center' |
|
|
|
|
|
}, |
|
|
tooltip: { |
|
|
tooltip: { |
|
|
trigger: 'item', |
|
|
trigger: 'item', |
|
|
formatter: "{a} <br/>{b} : {c} ({d}%)" |
|
|
formatter: "{a} <br/>{b} : {c} ({d}%)" |
|
@ -139,27 +223,11 @@ |
|
|
// data: ['直接访问', '邮件营销', '联盟广告'] |
|
|
// data: ['直接访问', '邮件营销', '联盟广告'] |
|
|
// }, |
|
|
// }, |
|
|
series: [{ |
|
|
series: [{ |
|
|
name: '访问来源', |
|
|
|
|
|
|
|
|
name: '数据', |
|
|
type: 'pie', |
|
|
type: 'pie', |
|
|
radius: '55%', |
|
|
radius: '55%', |
|
|
center: ['50%', '60%'], |
|
|
center: ['50%', '60%'], |
|
|
data: [{ |
|
|
|
|
|
value: 335, |
|
|
|
|
|
name: '总代' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
value: 3101, |
|
|
|
|
|
name: '分公司' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
value: 234, |
|
|
|
|
|
name: '分公司1' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
value: 2344, |
|
|
|
|
|
name: '股东' |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
data: cityInfo, |
|
|
itemStyle: { |
|
|
itemStyle: { |
|
|
emphasis: { |
|
|
emphasis: { |
|
|
shadowBlur: 10, |
|
|
shadowBlur: 10, |
|
@ -178,6 +246,7 @@ |
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
.cityDistribution { |
|
|
.cityDistribution { |
|
|
min-height: 100vh; |
|
|
min-height: 100vh; |
|
|
|
|
|
background: #3C3F50; |
|
|
// background: linear-gradient(0deg, #424558, #202335); |
|
|
// background: linear-gradient(0deg, #424558, #202335); |
|
|
|
|
|
|
|
|
.top { |
|
|
.top { |
|
@ -216,8 +285,10 @@ |
|
|
#home { |
|
|
#home { |
|
|
width: 690px; |
|
|
width: 690px; |
|
|
height: 364px; |
|
|
height: 364px; |
|
|
margin: 0 auto; |
|
|
|
|
|
margin-top: 60px; |
|
|
|
|
|
|
|
|
// margin: 0 auto; |
|
|
|
|
|
// margin-top: 60px; |
|
|
|
|
|
left: 50%; |
|
|
|
|
|
transform: translateX(-50%); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.info { |
|
|
.info { |
|
@ -234,6 +305,7 @@ |
|
|
font-family: Microsoft YaHei; |
|
|
font-family: Microsoft YaHei; |
|
|
font-weight: 400; |
|
|
font-weight: 400; |
|
|
color: #FFFFFF; |
|
|
color: #FFFFFF; |
|
|
|
|
|
margin-bottom: 10px; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -264,7 +336,24 @@ |
|
|
padding: 0 30px; |
|
|
padding: 0 30px; |
|
|
border-bottom: 1px solid #fff; |
|
|
border-bottom: 1px solid #fff; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.city { |
|
|
.city { |
|
|
|
|
|
display: flex; |
|
|
|
|
|
.rankNum { |
|
|
|
|
|
display: inline-block; |
|
|
|
|
|
width: 48px; |
|
|
|
|
|
height: 48px; |
|
|
|
|
|
background: linear-gradient(0deg, #729EFF, #5D48E1); |
|
|
|
|
|
border-radius: 50%; |
|
|
|
|
|
margin: auto 0; |
|
|
|
|
|
margin-right: 20px; |
|
|
|
|
|
text-align: center; |
|
|
|
|
|
line-height: 48px; |
|
|
|
|
|
color: #fff; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.cityName { |
|
|
font-size: 34px; |
|
|
font-size: 34px; |
|
|
font-family: Microsoft YaHei; |
|
|
font-family: Microsoft YaHei; |
|
|
font-weight: 400; |
|
|
font-weight: 400; |
|
@ -272,6 +361,7 @@ |
|
|
line-height: 94px; |
|
|
line-height: 94px; |
|
|
height: 94px; |
|
|
height: 94px; |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.number { |
|
|
.number { |
|
|
font-size: 34px; |
|
|
font-size: 34px; |
|
|