| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682 |
- <template>
- <div class="page">
- <div class="top adfac">
- <div class="top-pre">
- <div class="top-pre-num adfacjb">
- <div class="top-pre-num-l">
- <p>累计注册用户总数</p>
- <p class="n">{{ 24589 }}</p>
- </div>
- <div class="top-pre-num-r">
- <img src="@/assets/images/agent/user_img1.png">
- </div>
- </div>
- <div class="top-pre-text adfac">
- <div class="tn">较昨日 {{ 23345 }}% <i class="el-icon-caret-bottom" style="color: #FD4F66;"></i></div>
- </div>
- </div>
- <div class="top-pre">
- <div class="top-pre-num adfacjb">
- <div class="top-pre-num-l">
- <p>今日新增用户总数</p>
- <p class="n">{{ 679 }}</p>
- </div>
- <div class="top-pre-num-r">
- <img src="@/assets/images/agent/user_img2.png">
- </div>
- </div>
- <div class="top-pre-text adfac">
- <div class="tn">较昨日 {{ 345 }}% <i class="el-icon-caret-top" style="color: #33A7A7;"></i></div>
- </div>
- </div>
- <div class="top-pre">
- <div class="top-pre-num adfacjb">
- <div class="top-pre-num-l">
- <p>创衡运营邀请渠道</p>
- <p class="n">{{ 2458 }}</p>
- </div>
- <div class="top-pre-num-r">
- <img src="@/assets/images/agent/user_img3.png">
- </div>
- </div>
- <div class="top-pre-text adfac">
- <div class="tn">较昨日 {{ 345 }}% <i class="el-icon-caret-top" style="color: #33A7A7;"></i></div>
- </div>
- </div>
- <div class="top-pre">
- <div class="top-pre-num adfacjb">
- <div class="top-pre-num-l">
- <p>用户推荐转发</p>
- <p class="n">{{ 7289 }}</p>
- </div>
- <div class="top-pre-num-r">
- <img src="@/assets/images/agent/user_img4.png">
- </div>
- </div>
- <div class="top-pre-text adfac">
- <div class="tn">较昨日 {{ 345 }}% <i class="el-icon-caret-top" style="color: #33A7A7;"></i></div>
- </div>
- </div>
- <div class="top-pre">
- <div class="top-pre-num adfacjb">
- <div class="top-pre-num-l">
- <p>团队教练转发问卷任务</p>
- <p class="n">{{ 4589 }}</p>
- </div>
- <div class="top-pre-num-r">
- <img src="@/assets/images/agent/user_img5.png">
- </div>
- </div>
- <div class="top-pre-text adfac">
- <div class="tn">较昨日 {{ 345 }}% <i class="el-icon-caret-bottom" style="color: #FD4F66;"></i></div>
- </div>
- </div>
- </div>
- <div class="middle adfacjb">
- <div class="box box1 adffc">
- <div class="box-title">用户注册渠道</div>
- <div class="box-echart adfac">
- <div class="box-echart-qd">
- <div ref="yhzcqdRef" style="width: 100%; height: 100%;"></div>
- </div>
- <div class="box-echart-type adfacjb">
- <div class="box-echart-type-pre" v-for="(item,index) in yhzcqdTypeList" :key="index">
- <div class="box-echart-type-pre-top adfac">
- <div class="circle" :style="{'background-color':item.color}"></div>
- <div class="text">{{ item.name }}</div>
- </div>
- <div class="box-echart-type-pre-num">{{ item.num }}</div>
- </div>
- </div>
- </div>
- </div>
- <div class="box box1 adffc">
- <div class="box-title">行业分布</div>
- <div class="box-echart">
- <div class="list">
- <div class="list-item adfac" v-for="(item,index) in hyfbData" :key="index">
- <div class="list-item-name">{{ item.name }}</div>
- <div class="list-item-num">
- <div class="list-item-num-current" :style="{width:item.bl+'%'}"></div>
- </div>
- <div class="list-item-bl">{{ item.bl }}%</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="middle adfacjb">
- <div class="box box2 adffc">
- <div class="date adfac">
- <div class="date-pre" :class="{'active':didx==1}" @click="changeDate(1)">本周</div>
- <div class="date-pre" :class="{'active':didx==2}" @click="changeDate(2)">本月</div>
- <el-select v-model="queryDate" placeholder="自定义时间" @change="changeCusDate" style="width: 167px;">
- <el-option label="近10天" value="10"></el-option>
- </el-select>
- </div>
- <div class="box-title">用户概览</div>
- <div class="box-echart">
- <div ref="yhglRef" style="width: 100%; height: 100%;"></div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script setup name="">
- import * as echarts from "echarts";
- import {
- getRegisterChannelStats,
- getIndustryScattergram
- } from '@/api/agent/indexTwo.js'
- import { ref, getCurrentInstance, onMounted } from 'vue'
- const { proxy } = getCurrentInstance();
-
- const didx = ref(1)
- const queryDate = ref('')
- const yhglRef = ref(null)
- const yhzcqdRef = ref(null)
- const yhhxRef = ref(null)
- const hyfbData = ref([])
- const nlfbRef1 = ref(null)
- const nlfbRef2 = ref(null)
- const nlfbRef3 = ref(null)
- const nlfbRef4 = ref(null)
- const yhzcqdTypeList = ref([])
- const changeDate = (idx) => {
- didx.value = idx
- }
- const changeCusDate = () => {
- didx.value = ''
- }
- const getRegisterChannelStatsFn = () => {
- let colors = ['#009191','#35CBCA','#7CC5C5','#FBD438']
- getRegisterChannelStats().then(res => {
- yhzcqdTypeList.value = res.data.map((item,index) => {
- return { color:colors[index],name:item.channelName,num:item.registerCount??0 }
- })
- let data = yhzcqdTypeList.value.map(d=>({name:d.name,value:d.num}))
- let sum = data.reduce((total,item)=>{return total+item.value},0)
- initYhzcqdData(colors,data,sum)
- })
- }
- const initYhglEchart = () => {
- const chart = echarts.init(yhglRef.value)
- let option = {
- color: ['#01A79C','#0177B3'],
- xAxis: {
- type: 'category',
- boundaryGap: false,
- data: ['11-01', '11-02', '11-03', '11-04', '11-05', '11-06', '11-07']
- },
- yAxis: {
- type: 'value'
- },
- grid: {
- left: '1%',
- right: '1%',
- top: '20%',
- bottom: '1%',
- containLabel: true
- },
- legend: {
- data: ['新增用户', '累计用户'],
- top:'3%',
- left:'1%'
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- label: {
- backgroundColor: '#6a7985'
- }
- }
- },
- series: [
- {
- name:'新增用户',
- data: [30,170,30,80,50,160,20],
- type: 'line',
- smooth: true,
- lineStyle: {
- width: 4,
- },
- showSymbol: false,
- },
- {
- name:'累计用户',
- data: [200,90,130,90,220,60,80],
- type: 'line',
- smooth: true,
- lineStyle: {
- width: 4,
- },
- showSymbol: false,
- }
- ]
- }
- chart.setOption(option)
- }
- const initHyfbData = () => {
- getIndustryScattergram().then(res => {
- hyfbData.value = res.data.map(item => {
- return {name:item.industryName,num:item.industryCount||0}
- })
- let sum = hyfbData.value.reduce((total,item)=>{return total+item.num},0)||1
- hyfbData.value.forEach(item=>{
- item.bl = (item.num/sum*100).toFixed(2)
- })
- })
- }
- const initYhhxEchart = () => {
- const data = [
- { name: '男', value: '58' },
- { name: '女', value: '42' }
- ]
- const chart = echarts.init(yhhxRef.value)
- let option = {
- color: [
- new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- { offset: 0, color: '#33A7A7' },
- { offset: 1, color: '#06C6BF' },
- ]),
- '#FFDF73'
- ],
- tooltip: {
- trigger: 'item',
- backgroundColor: 'rgba(3,50,86,0.8)',
- textStyle: {
- fontSize: 16,
- color: '#ffffff',
- },
- formatter: (params) => {
- return params.name + ': ' + params.value + '%'
- }
- },
- series: [
- {
- type: 'pie',
- roseType: 'radius',
- radius: ['50%', '95%'],
- center: ['50%', '50%'],
- data: data,
- itemStyle: {
- borderWidth: 2
- },
- labelLine: {
- length: 0
- },
- label: {
- formatter: (params) => {
- return '{name|' + params.name + ': }{value|' + params.value + '%}'
- },
- rich: {
- name: {
- fontSize: 14,
- color: '#002846',
- },
- value: {
- fontSize: 32,
- color: '#002846',
- },
- }
- }
- }
- ]
- }
- chart.setOption(option)
- }
- const initNlfbEcharts = () => {
- let refs = [nlfbRef1.value,nlfbRef2.value,nlfbRef3.value,nlfbRef4.value]
- let arr = [
- {color:'#FFDF73',data:[{value:38},{value:62}]},
- {color:'#35CBCA',data:[{value:52},{value:62}]},
- {color:'#3AA1FF',data:[{value:7},{value:62}]},
- {color:'#F3637C',data:[{value:3},{value:62}]}
- ]
- arr.forEach((item,index)=>{
- initNlfbEchart(item.color,item.data,refs[index])
- })
- }
- const initYhzcqdData = (color,data,sum) => {
- const chart = echarts.init(yhzcqdRef.value)
- let option = {
- color,
- grid: {
- left: 20,
- right: 20,
- bottom: 10,
- top: 10,
- containLabel: true
- },
- title: {
- show: true,
- text: '{a|'+sum+'}\n{b|注册总数}',
- x: '38%',
- y: '46%',
- textStyle: {
- rich: {
- a: {
- align: 'center',
- fontSize: 28,
- fontWeight:'bold',
- color: '#002846',
- padding: [0, 0, 10, 0],
- },
- b: {
- align: 'center',
- fontSize: 14,
- color: '#667E90'
- },
- },
- }
- },
- tooltip: {
- trigger: 'item',
- formatter: '{b}:{c}({d}%)'
- },
- series: [{
- type: 'pie',
- startAngle: 90,
- radius: ['55%', '90%'],
- center: ['50%', '53%'],
- hoverAnimation: false,
- roseType: 'radius',
- data,
- label: {
- show: false
- },
- labelLine: {
- show: false
- }
- }]
- }
- chart.setOption(option)
- }
- const initNlfbEchart = (color,data,ref) => {
- const chart = echarts.init(ref)
- let option = {
- color:[color,'#F1F2F6'],
- series: [
- {
- type: 'pie',
- radius: ['40%', '70%'],
- padAngle: 3,
- itemStyle: {
- borderRadius: 5
- },
- labelLine: {
- show: false
- },
- data
- }
- ]
- }
- chart.setOption(option)
- }
- onMounted(()=>{
- getRegisterChannelStatsFn()
- initYhglEchart()
- initHyfbData()
- initYhhxEchart()
- initNlfbEcharts()
- proxy.$nextTick(()=>{
-
- })
- })
- </script>
- <style scoped lang="scss">
- .page{
- padding: 16px;
- .top{
- justify-content: space-between;
- &-pre{
- width: calc(20% - 9.6px);
- background: #FFFFFF;
- box-shadow: 0px 2px 12px 0px rgba(0,0,0,0.06);
- border-radius: 6px;
- padding: 24px 20px;
- box-sizing: border-box;
- &-num{
- &-l{
- p{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #335368;
- line-height: 14px;
- &.n{
- font-family: DINAlternate, DINAlternate;
- font-weight: bold;
- font-size: 28px;
- color: #002846;
- line-height: 28px;
- margin-top: 16px;
- }
- }
- }
- &-r{
- img{
- width: 60px;
- height: 60px;
- }
- }
- }
- &-text{
- margin-top: 16px;
- .tn{
- width: 100%;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #667E90;
- line-height: 14px;
- }
- }
- }
- }
-
- .box{
- background: #FFFFFF;
- box-shadow: 0px 2px 12px 0px rgba(0,0,0,0.06);
- border-radius: 6px;
- padding: 20px;
- box-sizing: border-box;
- height: 420px;
- position: relative;
- &.box1{
- width: calc(50% - 8px);
- }
- &.box2{
- width: 100%;
- }
- }
-
- .box-title{
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 16px;
- color: #002846;
- line-height: 16px;
- }
- .box-echart{
- flex: 1;
- margin-top: 10px;
- overflow-y: auto;
- &-half{
- width: 50%;
- height: 100%;
- &-title{
- padding-left: 7px;
- margin-top: 10px;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #002846;
- line-height: 14px;
- position: relative;
- &::before{
- content: '';
- width: 3px;
- height: 14px;
- background: #33A7A7;
- position: absolute;
- left: 0;
- top: 50%;
- transform: translateY(-50%);
- }
- }
- &-tb{
- flex: 1;
- }
- &-num{
- margin-top: 60px;
- padding-bottom: 30px;
- &-pre{
- width: 50%;
- img{
- width: 43px;
- height: 43px;
- }
- &-info{
- margin-left: 12px;
- p{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #667E90;
- line-height: 14px;
- &.num{
- margin-top: 6px;
- span{
- font-family: D-DINCondensed, D-DINCondensed;
- font-weight: bold;
- font-size: 24px;
- color: #002846;
- line-height: 24px;
- }
- }
- }
- }
- }
- }
- &-boxs{
- flex-wrap: wrap;
- &-box{
- width: calc(50% - 18px);
- background: #FCFCFE;
- border-radius: 6px;
- padding: 24px 20px;
- box-sizing: border-box;
- margin-top: 15px;
- &-l{
- padding-right: 20px;
- .p1{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #002846;
- line-height: 14px;
- }
- .p2{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #99A9B5;
- line-height: 14px;
- margin-top: 16px;
- }
- .p3{
- font-family: D-DINCondensed, D-DINCondensed;
- font-weight: bold;
- font-size: 32px;
- color: #002846;
- line-height: 32px;
- margin-top: 8px;
- }
- }
- }
- }
- }
- &-qd{
- width: 380px;
- height: 100%;
- }
- &-type{
- flex: 1;
- margin-top: -80px;
- flex-wrap: wrap;
- &-pre{
- width: 50%;
- margin-top: 80px;
- &-top{
- .circle{
- width: 8px;
- height: 8px;
- border-radius: 50%;
- }
- .text{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #667E90;
- line-height: 16px;
- margin-left: 8px;
- }
- }
- &-num{
- margin: 16px 0 0 12px;
- font-family: D-DINCondensed, D-DINCondensed;
- font-weight: bold;
- font-size: 24px;
- color: #002846;
- line-height: 24px;
- }
- }
- }
- }
- .middle{
- margin-top: 16px;
- }
-
- .date{
- position: absolute;
- top: 42px;
- right: 20px;
- &-pre{
- width: 54px;
- height: 40px;
- border-radius: 6px;
- border: 1px solid #DDE0E6;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #335368;
- line-height: 40px;
- text-align: center;
- margin-right: 16px;
- cursor: pointer;
- &.active{
- background: rgba(51,167,167,0.08);
- border-radius: 6px;
- border: 1px solid #33A7A7;
- color: #009191;
- }
- }
- }
- .list{
- &-item{
- margin-top: 19px;
- &-name{
- width: 158px;
- padding-right: 18px;
- box-sizing: border-box;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #33536B;
- line-height: 20px;
- text-align: right;
- }
- &-num{
- flex: 1;
- height: 8px;
- background: #F3F4FA;
- position: relative;
- &-current{
- height: 8px;
- background: #4CB2B2;
- }
- }
- &-bl{
- width: 82px;
- padding-left: 16px;
- box-sizing: border-box;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #536387;
- line-height: 20px;
- text-align: left;
- }
- }
- }
- }
- </style>
|