居民活动统计页面
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<ai-list class="statistics" isTabs style="width: 100%">
|
||||
<ai-list class="statistics" isTabs style="width: 100%" v-loading="loading">
|
||||
<template #left>
|
||||
<div class="villagecode-left">
|
||||
<div class="villagecode-left__title">
|
||||
@@ -30,27 +30,60 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template slot="content" v-loading="loading">
|
||||
<div class="statistics-top">
|
||||
<div class="statistics-top__item">
|
||||
<span>居民总数</span>
|
||||
<h2 style="color: #2266FF;">{{ info.total }}</h2>
|
||||
</div>
|
||||
<div class="statistics-top__item">
|
||||
<span>今日新增</span>
|
||||
<h2 style="color: #22AA99;">{{ info.increase }}</h2>
|
||||
</div>
|
||||
<div class="statistics-top__item">
|
||||
<span>今日流失</span>
|
||||
<h2 style="color: #F8B425">{{ info.decrease }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<ai-card title="趋势图">
|
||||
<template slot="content">
|
||||
<ai-card title="近12个月居民参与活动人数统计">
|
||||
<template #content>
|
||||
<div class="chart" style="height: 340px; width: 100%;"></div>
|
||||
<div class="chart1" style="height: 300px; width: 100%;"></div>
|
||||
<ai-empty v-if="false" style="height: 148px;"></ai-empty>
|
||||
</template>
|
||||
</ai-card>
|
||||
<ai-card title="活动统计">
|
||||
<template #right>
|
||||
<el-date-picker
|
||||
v-model="time1"
|
||||
type="month"
|
||||
size="small"
|
||||
value-format="yyyy-MM"
|
||||
placeholder="请选择月份">
|
||||
</el-date-picker>
|
||||
</template>
|
||||
<template #content>
|
||||
<div class="middle">
|
||||
<div class="left">
|
||||
<div class="left-item">
|
||||
<h2>活动发布数量</h2>
|
||||
<div>
|
||||
<span style="color: rgb(34, 102, 255);">{{ info['活动发布数量'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="left-item">
|
||||
<h2>活动报名人数</h2>
|
||||
<div>
|
||||
<span style="color: rgb(34, 170, 153);">{{ info['活动报名人数'] || 0 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="left-item">
|
||||
<h2>发布动态条数</h2>
|
||||
<div>
|
||||
<span style="color: rgb(248, 180, 37);">{{ info['发布动态条数'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="left-item">
|
||||
<h2>发布动态人员占比</h2>
|
||||
<div>
|
||||
<span style="color: red;">{{ info['发布动态人员占比'] }}%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<h2>居民参与类型占比</h2>
|
||||
<div class="right-chart">
|
||||
<div class="chart2" style="height: 200px; width: 100%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
</ai-list>
|
||||
</template>
|
||||
@@ -68,7 +101,7 @@
|
||||
|
||||
data () {
|
||||
return {
|
||||
chart: null,
|
||||
chart1: null,
|
||||
info: {},
|
||||
chartWidth: '',
|
||||
loading: false,
|
||||
@@ -79,6 +112,8 @@
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
time1: '',
|
||||
chart2: '',
|
||||
areaId: '',
|
||||
currIndex: -1,
|
||||
areaList: [],
|
||||
@@ -107,7 +142,8 @@
|
||||
this.getAreaList()
|
||||
this.loading = true
|
||||
this.$nextTick(() => {
|
||||
this.chart = echarts.init(document.querySelector('.chart'))
|
||||
this.chart1 = echarts.init(document.querySelector('.chart1'))
|
||||
this.chart2 = echarts.init(document.querySelector('.chart2'))
|
||||
window.addEventListener('resize', this.onResize)
|
||||
this.getInfo()
|
||||
})
|
||||
@@ -119,7 +155,7 @@
|
||||
|
||||
methods: {
|
||||
onResize () {
|
||||
this.chart.resize()
|
||||
this.chart1.resize()
|
||||
},
|
||||
|
||||
onTreeChange (e) {
|
||||
@@ -128,7 +164,8 @@
|
||||
this.search.current = 1
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.getList()
|
||||
this.loading = true
|
||||
this.getInfo()
|
||||
})
|
||||
},
|
||||
|
||||
@@ -180,10 +217,11 @@
|
||||
},
|
||||
|
||||
getInfo () {
|
||||
this.instance.post(`/app/wxcp/wxcustomerlog/customerStatistic`).then(res => {
|
||||
this.instance.post(`/app/appvillageactivityinfo/statistic?time1=${this.time1}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.info = res.data.today
|
||||
this.initChart(res.data.list)
|
||||
this.info = res.data.total
|
||||
this.initChart1(res.data.twelve)
|
||||
this.initChart2(res.data.gender)
|
||||
this.loading = false
|
||||
} else {
|
||||
this.loading = false
|
||||
@@ -191,9 +229,65 @@
|
||||
})
|
||||
},
|
||||
|
||||
initChart (data) {
|
||||
const x = Object.keys(data)
|
||||
const y = Object.values(data)
|
||||
initChart2 (data) {
|
||||
const values = Object.keys(data).map(v => {
|
||||
return {
|
||||
value: data[v],
|
||||
name: v
|
||||
}
|
||||
})
|
||||
let option = {
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
right: '5%',
|
||||
top: 'center',
|
||||
orient: 'vertical'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['40%', '70%'],
|
||||
avoidLabelOverlap: false,
|
||||
label: {
|
||||
show: false,
|
||||
position: 'center'
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
fontSize: '20',
|
||||
color: '#2266FF'
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
emphasis: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
},
|
||||
normal:{
|
||||
label:{
|
||||
show: true,
|
||||
formatter: '{b} : {c} ({d}%)'
|
||||
},
|
||||
labelLine :{show:true}
|
||||
}
|
||||
},
|
||||
labelLine: {
|
||||
show: false
|
||||
},
|
||||
color: ['#2266FF', '#22AA99', '#F8B425'],
|
||||
data: values
|
||||
}
|
||||
]
|
||||
}
|
||||
this.chart2.setOption(option)
|
||||
},
|
||||
|
||||
initChart1 (data) {
|
||||
const x = data.map(v => v.time)
|
||||
let option = {
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
@@ -202,8 +296,8 @@
|
||||
type: "plain"
|
||||
},
|
||||
grid: {
|
||||
left: '20px',
|
||||
right: '38px',
|
||||
left: '10px',
|
||||
right: '28px',
|
||||
bottom: '14px',
|
||||
top: '30px',
|
||||
containLabel: true
|
||||
@@ -253,41 +347,24 @@
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '居民总数',
|
||||
name: '活动报名人数',
|
||||
type: 'line',
|
||||
data: y.map(v => v.total)
|
||||
data: data.map(v => v.active)
|
||||
},
|
||||
{
|
||||
name: '新增居民数',
|
||||
name: '发布动态人数',
|
||||
type: 'line',
|
||||
data: y.map(v => v.increase)
|
||||
},
|
||||
{
|
||||
name: '流失居民数',
|
||||
type: 'line',
|
||||
data: y.map(v => v.decrease)
|
||||
data: data.map(v => v.total)
|
||||
}
|
||||
]
|
||||
}
|
||||
this.chart.setOption(option)
|
||||
this.chart1.setOption(option)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.villagecode {
|
||||
.table-tags {
|
||||
.el-tag {
|
||||
margin-right: 8px;
|
||||
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.statistics {
|
||||
padding: 0!important;
|
||||
::v-deep .ai-list__content--right-wrapper {
|
||||
@@ -300,166 +377,225 @@
|
||||
padding: 0!important;
|
||||
}
|
||||
|
||||
.addressBook-left__list {
|
||||
height: calc(100% - 40px);
|
||||
padding: 8px 8px;
|
||||
overflow: auto;
|
||||
|
||||
.addressBook-left__tags--item {
|
||||
.middle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 40px;
|
||||
padding: 0 8px 0 16px;
|
||||
color: #222222;
|
||||
height: 220px;
|
||||
|
||||
&.addressBook-left__tags--item-active, &:hover {
|
||||
background: #E8EFFF;
|
||||
color: #2266FF;
|
||||
& > div {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
i, span {
|
||||
color: #2266FF;
|
||||
.right {
|
||||
h2 {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
i {
|
||||
cursor: pointer;
|
||||
color: #8e9ebf;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.addressBook-left__list--title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 8px;
|
||||
|
||||
.addressBook-left__list--search {
|
||||
.left {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
flex: 1;
|
||||
::v-deep input {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
padding-right: 20px;
|
||||
|
||||
.el-button {
|
||||
width: 84px;
|
||||
flex-shrink: 1;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
.left-item {
|
||||
width: calc((100% - 10px) / 2);
|
||||
padding: 16px;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
background: #f9f9f9;
|
||||
-webkit-box-shadow: 0 4px 6px -2px rgb(15 15 21 / 15%);
|
||||
box-shadow: 0 4px 6px -2px rgb(15 15 21 / 15%);
|
||||
border-radius: 4px;
|
||||
|
||||
span {
|
||||
color: #222222;
|
||||
font-size: 14px;
|
||||
}
|
||||
&:nth-of-type(2n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
::v-deep .el-tree {
|
||||
background: transparent;
|
||||
h2 {
|
||||
margin-bottom: 16px;
|
||||
color: #888;
|
||||
font-size: 16px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.el-tree-node__expand-icon.is-leaf {
|
||||
color: transparent!important;
|
||||
}
|
||||
div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.el-tree-node__content > .el-tree-node__expand-icon {
|
||||
padding: 4px;
|
||||
}
|
||||
i {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.el-tree-node__content {
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.el-tree__empty-text {
|
||||
color: #222;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.el-tree-node__children .el-tree-node__content {
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.el-tree-node__content:hover {
|
||||
background: #E8EFFF;
|
||||
color: #222222;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.is-current > .el-tree-node__content {
|
||||
&:hover {
|
||||
background: #2266FF;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
background: #2266FF;
|
||||
|
||||
span {
|
||||
color: #fff;
|
||||
span {
|
||||
font-size: 1.5em;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .ai-list__content--left {
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.villagecode-left {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
background: #FAFAFB;
|
||||
|
||||
.villagecode-left__title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 40px;
|
||||
padding: 0 16px;
|
||||
background: #fff;
|
||||
|
||||
h2 {
|
||||
color: #222;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.villagecode-left__list {
|
||||
.addressBook-left__list {
|
||||
height: calc(100% - 40px);
|
||||
padding: 8px 0;
|
||||
padding: 8px 8px;
|
||||
overflow: auto;
|
||||
|
||||
span {
|
||||
display: block;
|
||||
.addressBook-left__tags--item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 24px;
|
||||
padding: 0 8px 0 16px;
|
||||
color: #222222;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
border-right: 2px solid transparent;
|
||||
background: transparent;
|
||||
|
||||
&:hover {
|
||||
color: #2266FF;
|
||||
&.addressBook-left__tags--item-active, &:hover {
|
||||
background: #E8EFFF;
|
||||
color: #2266FF;
|
||||
|
||||
i, span {
|
||||
color: #2266FF;
|
||||
}
|
||||
}
|
||||
|
||||
&.left-active {
|
||||
color: #2266FF;
|
||||
border-color: #2266FF;
|
||||
span {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
i {
|
||||
cursor: pointer;
|
||||
color: #8e9ebf;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.addressBook-left__list--title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 8px;
|
||||
|
||||
.addressBook-left__list--search {
|
||||
flex: 1;
|
||||
::v-deep input {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.el-button {
|
||||
width: 84px;
|
||||
flex-shrink: 1;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
span {
|
||||
color: #222222;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
::v-deep .el-tree {
|
||||
background: transparent;
|
||||
|
||||
.el-tree-node__expand-icon.is-leaf {
|
||||
color: transparent!important;
|
||||
}
|
||||
|
||||
.el-tree-node__content > .el-tree-node__expand-icon {
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.el-tree-node__content {
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.el-tree__empty-text {
|
||||
color: #222;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.el-tree-node__children .el-tree-node__content {
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.el-tree-node__content:hover {
|
||||
background: #E8EFFF;
|
||||
color: #222222;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.is-current > .el-tree-node__content {
|
||||
&:hover {
|
||||
background: #2266FF;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
background: #2266FF;
|
||||
|
||||
span {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .ai-list__content--right {
|
||||
|
||||
.ai-list__content--right-wrapper {
|
||||
min-height: 100%;
|
||||
::v-deep .ai-list__content--left {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.villagecode-left {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
background: #FAFAFB;
|
||||
|
||||
.villagecode-left__title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 40px;
|
||||
padding: 0 16px;
|
||||
background: #fff;
|
||||
|
||||
h2 {
|
||||
color: #222;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.villagecode-left__list {
|
||||
height: calc(100% - 40px);
|
||||
padding: 8px 0;
|
||||
overflow: auto;
|
||||
|
||||
span {
|
||||
display: block;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 24px;
|
||||
color: #222222;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
border-right: 2px solid transparent;
|
||||
background: transparent;
|
||||
|
||||
&:hover {
|
||||
color: #2266FF;
|
||||
background: #E8EFFF;
|
||||
}
|
||||
|
||||
&.left-active {
|
||||
color: #2266FF;
|
||||
border-color: #2266FF;
|
||||
background: #E8EFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .ai-list__content--right {
|
||||
|
||||
.ai-list__content--right-wrapper {
|
||||
min-height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.statistics-top {
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user