Commit a7b445d7 authored by 王启林's avatar 王启林

用户画像界面对接接口

parent eee1e1e9
...@@ -44,3 +44,7 @@ export function genderRateType(params) { ...@@ -44,3 +44,7 @@ export function genderRateType(params) {
export function ageRate(params) { export function ageRate(params) {
return http.get(`${baseURL}/inter/statistic/ageRate`, params); return http.get(`${baseURL}/inter/statistic/ageRate`, params);
} }
//民族办件次数分析
export function TopNationStatistic(params) {
return http.get(`${baseURL}/inter/statistic/TopNationStatistic`, params);
}
...@@ -82,10 +82,10 @@ ...@@ -82,10 +82,10 @@
<barChart :id="`six_bar`" :height="300" :width="800" :datas="oneBarData2" /> <barChart :id="`six_bar`" :height="300" :width="800" :datas="oneBarData2" />
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<barChart :id="`three_bar`" :height="300" :width="800" :datas="twoBarData" /> <barChart :id="`three_bar`" :height="300" :width="800" :datas="twoBarData2" />
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<pieChart :id="`six_pie`" :height="300" :width="800" :datas="threePieData" /> <pieChart :id="`six_pie`" :height="300" :width="800" :datas="threePieData2" />
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
</a-col> </a-col>
...@@ -104,7 +104,10 @@ import pieChart from "../../business/Component/pie/index.vue" ...@@ -104,7 +104,10 @@ 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"
import { peopleQs, registerProvince, registerBwd, registerSex, registerAge, registerNation, provinceCase, bwdStatistic, provinceStatistic, genderRateType, ageRate } from "@/api/userPortrait.js" import {
peopleQs, registerProvince, registerBwd, registerSex, registerAge, registerNation, provinceCase, bwdStatistic,
provinceStatistic, genderRateType, ageRate, TopNationStatistic
} from "@/api/userPortrait.js"
export default { export default {
components: { components: {
mapChart, pieChart, lineChart, doublePieChart, barChart mapChart, pieChart, lineChart, doublePieChart, barChart
...@@ -143,7 +146,9 @@ export default { ...@@ -143,7 +146,9 @@ export default {
oneBarData: {}, oneBarData: {},
oneBarData2: {}, oneBarData2: {},
twoBarData: {}, twoBarData: {},
twoBarData2: {},
threePieData: {}, threePieData: {},
threePieData2: {},
provinces: [ provinces: [
{ {
ranking: 1, ranking: 1,
...@@ -247,6 +252,7 @@ export default { ...@@ -247,6 +252,7 @@ export default {
this.getBwdStatistic() this.getBwdStatistic()
this.getGenderRateType() this.getGenderRateType()
this.getAgeRate() this.getAgeRate()
this.getTopNationStatistic()
}, },
mounted() { mounted() {
this.nowDate = moment(new Date()).format('YYYY-MM-DD h:mm:ss') this.nowDate = moment(new Date()).format('YYYY-MM-DD h:mm:ss')
...@@ -486,8 +492,46 @@ export default { ...@@ -486,8 +492,46 @@ export default {
getAgeRate() { getAgeRate() {
ageRate({ siteid: localStorage.getItem('siteId'), selected: 2 }).then(res => { ageRate({ siteid: localStorage.getItem('siteId'), selected: 2 }).then(res => {
// console.log(res) // console.log(res)
// console.log(res)
let age_area = res.data.list.map(i => {
return i.age_area
})
let total = 0
let count = res.data.list.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: '年龄分布',
xData: age_area,
data: [
{ name: '办理次数', type: 'bar', data: count },
{ name: '占比', type: 'line', data: zb },
]
}
}) })
} },
getTopNationStatistic() {
TopNationStatistic({ siteid: localStorage.getItem('siteId'), selected: 2 }).then(res => {
console.log(res)
res.data.forEach(i => {
i.name = i.idcard_Nation
i.value = i.count
})
// console.log(res.data)
this.threePieData2 = {
title: '民族分布',
type: '',
legend: res.data,
data: res.data
}
})
},
} }
} }
</script> </script>
......
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