Commit 3ba1aed8 authored by 王启林's avatar 王启林

对接画像接口

parent 18854792
This source diff could not be displayed because it is too large. You can view the blob instead.
import http from "../request/http";
let baseURL = process.env.VUE_APP_API_PHP_URL;
//群众画像-整体情况
export function peopleQs(params) {
return http.get(`${baseURL}/inter/Personas/peopleQs`, params);
}
//注册区域分析
export function registerProvince(params) {
return http.get(`${baseURL}/inter/Personas/registerProvince`, params);
}
//本外地注册区域分析
export function registerBwd(params) {
return http.get(`${baseURL}/inter/Personas/registerBwd`, params);
}
//注册性别分析
export function registerSex(params) {
return http.get(`${baseURL}/inter/Personas/registerSex`, params);
}
//注册年龄分析
export function registerAge(params) {
return http.get(`${baseURL}/inter/Personas/registerAge`, params);
}
//注册民族分析
export function registerNation(params) {
return http.get(`${baseURL}/inter/Personas/registerNation`, params);
}
//办件用户地域分析
export function provinceCase(params) {
return http.get(`${baseURL}/inter/statistic/provinceCase`, params);
}
//办件省份下地域分析
export function provinceStatistic(params) {
return http.get(`${baseURL}/inter/statistic/provinceStatistic`, params);
}
//本外地分析
export function bwdStatistic(params) {
return http.get(`${baseURL}/inter/statistic/bwdStatistic`, params);
}
//性别办件分析
export function genderRateType(params) {
return http.get(`${baseURL}/inter/Personas/genderRateType`, params);
}
//办件年龄分析
export function ageRate(params) {
return http.get(`${baseURL}/inter/statistic/ageRate`, params);
}
...@@ -9,17 +9,12 @@ ...@@ -9,17 +9,12 @@
</template> </template>
<a-row type="flex" align="middle"> <a-row type="flex" align="middle">
<a-col :span="4"> <a-col :span="4">
<div class="f_40 f_center warning">111</div> <div class="f_40 f_center warning">{{ massCount }}</div>
<div class="f_center">群众注册总量</div> <div class="f_center">群众注册总量</div>
<div class="f_center primary" @click="toTable">点击查看报表</div> <div class="f_center primary" @click="toTable">点击查看报表</div>
</a-col> </a-col>
<a-col :span="20"> <a-col :span="20">
<lineChart <lineChart :id="`one_line`" :title="`近30日注册情况分析`" :datas="oneLineData" :height="200" :width="1420" />
:id="`one_line`"
:title="`近30日注册情况分析`"
:datas="oneLineData"
:height="200"
:width="1420"/>
</a-col> </a-col>
</a-row> </a-row>
</a-card> </a-card>
...@@ -32,57 +27,27 @@ ...@@ -32,57 +27,27 @@
</template> </template>
<a-row> <a-row>
<a-col :span="8"> <a-col :span="8">
<map-chart <map-chart :id="`one_map`" :datas="oneMapData" :height="400" :width="550" />
:id="`one_map`"
:datas="oneMapData"
:height="400"
:width="550"
/>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-table <a-table :rowKey="(record, index) => { return index }" :dataSource="provinces"
:row-key="record => record.ranking" :dataSource="provinces" :columns="provincesColumns" :pagination="false"> :columns="provincesColumns" :scroll="{ y: 300 }" :pagination="false">
</a-table> </a-table>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<pieChart <pieChart :id="`one_pie`" :height="400" :width="550" :datas="onePieData" />
:id="`one_pie`"
:height="400"
:width="550"
:datas="onePieData"
/>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<doublePieChart <doublePieChart :id="`two_pie`" :height="300" :width="800" :datas="twoPieData" />
:id="`two_pie`"
:height="300"
:width="800"
:datas="twoPieData"
/>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<barChart <barChart :id="`one_bar`" :height="300" :width="800" :datas="oneBarData" />
:id="`one_bar`"
:height="300"
:width="800"
:datas="oneBarData"
/>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<barChart <barChart :id="`two_bar`" :height="300" :width="800" :datas="twoBarData" />
:id="`two_bar`"
:height="300"
:width="800"
:datas="twoBarData"
/>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<pieChart <pieChart :id="`three_pie`" :height="300" :width="800" :datas="threePieData" />
:id="`three_pie`"
:height="300"
:width="800"
:datas="threePieData"
/>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
</a-col> </a-col>
...@@ -100,57 +65,27 @@ ...@@ -100,57 +65,27 @@
<a-row type="flex" align="middle"> <a-row type="flex" align="middle">
<a-row> <a-row>
<a-col :span="8"> <a-col :span="8">
<map-chart <map-chart :id="`two_map`" :datas="oneMapData2" :height="400" :width="550" />
:id="`two_map`"
:datas="oneMapData"
:height="400"
:width="550"
/>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-table <a-table :rowKey="(record, index) => { return index }" :dataSource="provinces2"
:row-key="record => record.ranking" :dataSource="provinces" :columns="provincesColumns" :pagination="false"> :columns="provincesColumns2" :pagination="false" :scroll="{ y: 300 }">
</a-table> </a-table>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<pieChart <pieChart :id="`four_pie`" :height="400" :width="550" :datas="onePieData2" />
:id="`four_pie`"
:height="400"
:width="550"
:datas="onePieData"
/>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<doublePieChart <doublePieChart :id="`five_pie`" :height="300" :width="800" :datas="twoPieData2" />
:id="`five_pie`"
:height="300"
:width="800"
:datas="twoPieData"
/>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<barChart <barChart :id="`six_bar`" :height="300" :width="800" :datas="oneBarData2" />
:id="`six_bar`"
:height="300"
:width="800"
:datas="oneBarData"
/>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<barChart <barChart :id="`three_bar`" :height="300" :width="800" :datas="twoBarData2" />
:id="`three_bar`"
:height="300"
:width="800"
:datas="twoBarData"
/>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<pieChart <pieChart :id="`six_pie`" :height="300" :width="800" :datas="threePieData" />
:id="`six_pie`"
:height="300"
:width="800"
:datas="threePieData"
/>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
</a-col> </a-col>
...@@ -169,13 +104,14 @@ import pieChart from "../../business/Component/pie/index.vue" ...@@ -169,13 +104,14 @@ import pieChart from "../../business/Component/pie/index.vue"
import lineChart from "../../business/Component/line/index.vue" import lineChart from "../../business/Component/line/index.vue"
import mapChart from "../../business/Component/map/index.vue" import mapChart from "../../business/Component/map/index.vue"
import moment from "moment" import moment from "moment"
export default { import { peopleQs, registerProvince, registerBwd, registerSex, registerAge, registerNation, provinceCase, bwdStatistic, provinceStatistic, genderRateType, ageRate } from "@/api/userPortrait.js"
components:{ export default {
components: {
mapChart, pieChart, lineChart, doublePieChart, barChart mapChart, pieChart, lineChart, doublePieChart, barChart
}, },
data(){ data() {
return{ return {
options:[ options: [
{ {
value: '0', value: '0',
label: '今天', label: '今天',
...@@ -199,10 +135,15 @@ import moment from "moment" ...@@ -199,10 +135,15 @@ import moment from "moment"
], ],
oneLineData: {}, oneLineData: {},
oneMapData: {}, oneMapData: {},
oneMapData2: {},
onePieData: {}, onePieData: {},
onePieData2: {},
twoPieData: {}, twoPieData: {},
twoPieData2: {},
oneBarData: {}, oneBarData: {},
oneBarData2: {},
twoBarData: {}, twoBarData: {},
twoBarData2: {},
threePieData: {}, threePieData: {},
provinces: [ provinces: [
{ {
...@@ -218,165 +159,399 @@ import moment from "moment" ...@@ -218,165 +159,399 @@ import moment from "moment"
percent: '2' percent: '2'
}, },
], ],
provinces2: [
{
ranking: 1,
province: '四川省',
people: '999',
percent: '2'
},
{
ranking: 2,
province: '四川省',
people: '999',
percent: '2'
},
],
provincesColumns: [ provincesColumns: [
{ {
key:'ranking', key: 'ranking',
title: '序号', title: '序号',
dataIndex: 'ranking', dataIndex: 'id',
}, },
{ {
key:'province', key: 'province',
title: '省份', title: '省份',
dataIndex: 'province', dataIndex: 'province',
}, },
{ {
key:'people', key: 'value',
title: '注册人数', title: '注册人数',
dataIndex: 'people', dataIndex: 'value',
}, },
{ {
key:'percent', key: 'zb_lv',
title: '注册占比', title: '注册占比',
dataIndex: 'percent', dataIndex: 'zb_lv',
customRender(text, record, index) {
return parseFloat((text * 100).toFixed(2)) + "%"
}
},
],
provincesColumns2: [
{
key: 'ranking',
title: '序号',
dataIndex: 'id',
},
{
key: 'province',
title: '省份',
dataIndex: 'province',
},
{
key: 'value',
title: '办件人数',
dataIndex: 'value',
},
{
key: 'nums_val',
title: '办件占比',
dataIndex: 'nums_val',
customRender(text, record, index) {
return parseFloat((text * 100).toFixed(2)) + "%"
}
}, },
], ],
takeNumber: '0', takeNumber: '0',
nowDate: '' nowDate: '',
massCount: '0',//群众总量
timeArr: [],//群众注册时间
doTotal: 0
} }
}, },
mounted(){ created() {
this.test() this.getPeopleQs()
this.getRegisterProvince()
this.getRegisterBwd()
this.getRegisterSex()
this.getRegisterAge()
this.getRegisterNation()
this.getProvinceCase()
this.getProvinceStatistic()
this.getBwdStatistic()
this.getGenderRateType()
this.getAgeRate()
}, },
methods:{ mounted() {
handleChange(){}, this.nowDate = moment(new Date()).format('YYYY-MM-DD h:mm:ss')
toTable(){
this.$router.push({path:'register'})
}, },
test(){ methods: {
this.nowDate= moment(new Date()).format('YYYY-MM-DD h:mm:ss') handleChange() { },
this.oneLineData= { toTable() {
this.$router.push({ path: 'register' })
},
//整体情况
getPeopleQs() {
peopleQs({ siteid: localStorage.getItem('siteId') }).then(res => {
if (res.code == 1) {
this.massCount = res.data.count
let time = res.data.list.map(i => { //循环获取时间
return moment(i.datetime).format('MM-DD')
})
let take = []
res.data.list.forEach(i => { //循环获取排号机注册情况
i.row.forEach(j => {
if (j.register_type == 'take') {
return take.push(j.count)
}
})
})
let app = []
res.data.list.forEach(i => { //循环获取自助终端注册情况
i.row.forEach(j => {
if (j.register_type == 'app') {
return app.push(j.count)
}
})
})
let Applets = []
res.data.list.forEach(i => { //循环获取微官网注册情况
i.row.forEach(j => {
if (j.register_type == 'Applets') {
return Applets.push(j.count)
}
})
})
this.oneLineData = {
title: '近30日注册情况分析:', title: '近30日注册情况分析:',
legend: ['自助服务系统注册人数','微官网注册人数','排队系统注册人数'], legend: ['自助服务系统注册人数', '微官网注册人数', '排队系统注册人数'],
xData: ['3-15', '3-16', '3-17', '3-18', '3-19', '3-20'], xData: time,
dataList: [ dataList: [
{name: '自助服务系统注册人数', data: [120, 132, 101, 134, 90, 230, 210]}, { name: '自助服务系统注册人数', data: app },
{name: '微官网注册人数', data: [220, 182, 191, 234, 290, 330, 310]}, { name: '微官网注册人数', data: Applets },
{name: '排队系统注册人数', data: [150, 232, 201, 154, 190, 330, 410]}, { name: '排队系统注册人数', data: take },
] ]
} }
this.oneMapData={ }
})
},
//区域注册情况
getRegisterProvince() {
registerProvince({ siteid: localStorage.getItem('siteId') }).then(res => {
let arr2 = res.data.sort(function (a, b) {
return b.count - a.count;
})
let arr = arr2.map((i, j) => {
i.id = j + 1
i.name = i.province
i.value = i.count
return i
})
// console.log(arr)
this.oneMapData = {
title: "注册用户地域分析", title: "注册用户地域分析",
data:[ data: arr
{ name: '四川省', value: 20057.34 },
{ name: '广东省', value: 15477.48 },
{ name: '福建省', value: 31686.1 },
{ name: '河北省', value: 6992.6 },
{ name: '河南省', value: 44045.49 },
{ name: '江苏省', value: 40689.64 },
]
} }
this.onePieData={ this.provinces = arr
this.onePieData = {
title: '', title: '',
type: 'scroll', type: 'scroll',
legend: ['四川省', '广东省', '福建省','河北省','河南省','江苏省',], legend: arr.forEach(i => { return i.province }),
data: [ data: arr
{ name: '四川省', value: 20057.34 },
{ name: '广东省', value: 15477.48 },
{ name: '福建省', value: 31686.1 },
{ name: '河北省', value: 6992.6 },
{ name: '河南省', value: 44045.49 },
{ name: '江苏省', value: 40689.64 },
]
} }
this.twoPieData={ })
},
//注册分布情况
getRegisterBwd() {
registerBwd({ siteid: localStorage.getItem('siteId') }).then(res => {
this.twoPieData = {
title: '本地人与外地人注册分布', title: '本地人与外地人注册分布',
pieName: '分布详情', pieName: '分布详情',
firstName: '宜宾市本地人注册占比', firstName: '宜宾市本地人注册占比',
firstVal: '1', firstVal: res.data.bd_lv,
firstTotal: '10', firstTotal: 1,
secondName: '外地人注册占比', secondName: '外地人注册占比',
secondVal: '1', secondVal: res.data.wd_lv,
secondTotal: '10', secondTotal: 1,
} }
this.oneBarData={ })
},
//注册性别分布情况
getRegisterSex() {
registerSex({ siteid: localStorage.getItem('siteId') }).then(res => {
// console.log(res)
let man = res.data[0].row
let woman = res.data[1].row
this.oneBarData = {
title: '性别分布', title: '性别分布',
xData: ['', ''], xData: ['', ''],
data: [ data: [
{name: '自助服务系统注册人数', type: 'bar' ,data: [150, 232, 201, 154, 190, 330, 410]}, { name: '自助服务系统注册人数', type: 'bar', data: [man[1].count, woman[1].count] },
{name: '微官网注册人数', type: 'bar' ,data: [220, 182, 191, 234, 290, 330, 310]}, { name: '微官网注册人数', type: 'bar', data: [man[2].count, woman[2].count] },
{name: '排队系统注册人数', type: 'bar' ,data: [120, 132, 101, 134, 90, 230, 210]}, { name: '排队系统注册人数', type: 'bar', data: [man[0].count, woman[0].count] },
] ]
} }
this.twoBarData= { })
},
//注册年龄分布情况
getRegisterAge() {
registerAge({ siteid: localStorage.getItem('siteId') }).then(res => {
// console.log(res)
let age_area = res.data.map(i => {
return i.age_area
})
let total = 0
let count = res.data.map(i => {
total += i.nums
return i.nums
})
// console.log(total)
let zb = count.map(i => {
return parseFloat((i / total * 10000).toFixed(2))
})
// console.log(zb)
this.twoBarData2 = {
title: '年龄分布', title: '年龄分布',
xData: ['1-10', '10-20', '20-30', '30-40', '40-50'], xData: age_area,
data: [ data: [
{name: '办理次数', type: 'bar' ,data: [150, 232, 201, 154, 190, 330, 410]}, { name: '办理次数', type: 'bar', data: count },
{name: '占比', type: 'line' ,data: [220, 182, 191, 234, 290, 330, 310]}, { name: '占比', type: 'line', data: zb },
] ]
} }
this.threePieData={ })
},
//注册民族分布情况
getRegisterNation() {
registerNation({ siteid: localStorage.getItem('siteId') }).then(res => {
// console.log(res)
res.data.forEach(i => {
i.name = i.idcard_Nation
i.value = i.count
})
// console.log(res.data)
this.threePieData = {
title: '民族分布', title: '民族分布',
type: '', type: '',
legend: ['四川省', '广东省', '福建省','河北省','河南省','江苏省',], legend: res.data,
data: res.data
}
})
},
//办件用户地域分析
getProvinceCase() {
provinceCase({ siteid: localStorage.getItem('siteId'), selected: 2 }).then(res => {
// console.log(res)
let arr2 = res.data.sort(function (a, b) {
return b.nums - a.nums;
})
let arr = arr2.map((i, j) => {
i.id = j + 1
i.province = i.name
i.value = i.nums
this.doTotal += i.nums
return i
})
arr.forEach(i => {
i.nums_val = i.nums / this.doTotal
})
// console.log(arr)
this.oneMapData2 = {
title: "办件用户地域分析",
data: arr
}
this.provinces2 = arr
// this.onePieData2 = {
// title: '',
// type: 'scroll',
// legend: arr.forEach(i => { return i.province }),
// data: arr
// }
})
},
//办件用户地域分析
getProvinceStatistic() {
provinceStatistic({ siteid: localStorage.getItem('siteId'), selected: 2, province: '四川省' }).then(res => {
// console.log(res)
res.data.forEach(i => {
i.value = i.count
})
this.onePieData2 = {
title: '',
type: 'scroll',
legend: res.data,
data: res.data
}
})
},
//本外地分析
getBwdStatistic() {
bwdStatistic({ siteid: localStorage.getItem('siteId'), selected: 2 }).then(res => {
// console.log(res)
this.twoPieData2 = {
title: '本地人与外地人注册分布',
pieName: '分布详情',
firstName: '宜宾市本地人注册占比',
firstVal: res.data.bd_lv,
firstTotal: 1,
secondName: '外地人注册占比',
secondVal: res.data.wd_lv,
secondTotal: 1,
}
})
},
//性别办件分析
getGenderRateType() {
genderRateType({ siteid: localStorage.getItem('siteId'), selected: 2 }).then(res => {
let man = res.data[0].row
let woman = res.data[1].row
this.oneBarData2 = {
title: '性别分布',
xData: ['', ''],
data: [ data: [
{ name: '四川省', value: 20057.34 }, { name: '自助服务系统注册人数', type: 'bar', data: [man[1].nums, woman[1].nums] },
{ name: '广东省', value: 15477.48 }, { name: '微官网注册人数', type: 'bar', data: [man[2].nums, woman[2].nums] },
{ name: '福建省', value: 31686.1 }, { name: '排队系统注册人数', type: 'bar', data: [man[0].nums, woman[0].nums] },
{ name: '河北省', value: 6992.6 },
{ name: '河南省', value: 44045.49 },
{ name: '江苏省', value: 40689.64 },
] ]
} }
})
},
//办件年龄分析
getAgeRate() {
ageRate({ siteid: localStorage.getItem('siteId'), selected: 2 }).then(res => {
console.log(res)
})
} }
} }
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.head{ /deep/.ant-col {
margin-bottom: 20px;
}
.head {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
.head_title{
.head_title {
font-weight: 700; font-weight: 700;
font-style: normal; font-style: normal;
font-size: 16px; font-size: 16px;
color: #333; color: #333;
margin-right: 1.25rem; margin-right: 1.25rem;
} }
.head_desc{
.head_desc {
font-weight: 400; font-weight: 400;
font-style: normal; font-style: normal;
font-size: 14px; font-size: 14px;
color: #888888; color: #888888;
} }
} }
/deep/ .ant-table{
/deep/ .ant-table {
width: 100% !important; width: 100% !important;
} }
.f_20{
.f_20 {
font-size: 1.25rem; font-size: 1.25rem;
} }
.f_40{
.f_40 {
font-size: 2.5rem; font-size: 2.5rem;
} }
.f_center{
.f_center {
text-align: center; text-align: center;
} }
.warning{
.warning {
color: #FD6805 color: #FD6805
} }
.primary{
.primary {
color: #0595FD color: #0595FD
} }
.success{
.success {
color: #04CA8F color: #04CA8F
} }
.h_200{
.h_200 {
height: 12.5rem; height: 12.5rem;
} }
.mb_15{
.mb_15 {
margin-bottom: .9375rem; margin-bottom: .9375rem;
} }
</style> </style>
\ No newline at end of file
...@@ -50,8 +50,7 @@ ...@@ -50,8 +50,7 @@
</template> </template>
<template slot="操作" slot-scope="text, record"> <template slot="操作" slot-scope="text, record">
<a-button type="link" style="color: #ff7370" @click="handleDel(record.id)">删除</a-button> <a-button type="link" style="color: #ff7370" @click="handleDel(record.id)">删除</a-button>
<a-button type="link" @click="openHandlingDetails(record)" <a-button type="link" @click="openHandlingDetails(record)">详情</a-button>
v-if="record.queueid == 0 && record.pjxt != 1">详情</a-button>
</template> </template>
</a-table> </a-table>
<HandlingDetails ref="HandlingDetails" /> <HandlingDetails ref="HandlingDetails" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment