Commit 0ada2b45 authored by “yiyousong”'s avatar “yiyousong”
parents 0daa4acb f251984b
......@@ -80,13 +80,20 @@ export default {
this.queryform.dateTimeStart = this.time ? this.time[0] : null;
this.queryform.dateTimeStart = this.time ? this.time[1] : null;
getWayAccessAnalyse(this.queryform).then((res) => {
let data = res.data.data.map((item, i) =>
item.code != "/sceneSignIn"
? {
name: item.name,
}
: ""
);
let newobj = {};
let data = res.data.data.reduce((preVal, curVal) => {
newobj[curVal.name]
? ""
: (newobj[curVal.name] = preVal.push(curVal));
return preVal;
}, []);
// let data = res.data.data.map((item, i) =>
// item.code != "/sceneSignIn"
// ? {
// name: item.name,
// }
// : ""
// );
let links = res.data.links.map((item) => ({
source: item.sourceName,
target: item.targetName,
......@@ -96,7 +103,7 @@ export default {
},
}));
data = data.filter((v) => v);
links = links.filter((v) => v.target != "首页");
links = links.filter((v) => v.target != "首页" && v.target != v.source);
this.init(data, links);
});
},
......
......@@ -217,12 +217,14 @@ export default {
display: flex;
.img-dv {
width: 60%;
flex: 1;
margin: 100px;
height: 600px;
position: relative;
img {
width: 100%;
height: 100%;
}
#queuing {
......@@ -236,7 +238,7 @@ export default {
}
.list-dv {
width: 40%;
width: 55%;
min-height: 100%;
border-left: solid 1px #efefef;
box-sizing: border-box;
......
<template>
<!-- 使用习惯分析 -->
<div class="page">
<a-form-model :model="queryform" :label-col="labelCol" :wrapper-col="wrapperCol" layout="inline">
<a-form-model
:model="queryform"
:label-col="labelCol"
:wrapper-col="wrapperCol"
layout="inline"
>
<a-form-model-item>
<a-select v-model="queryform.productId" style="width: 200px" placeholder="选择产品">
<a-select-option :value="item.id" v-for="(item,index) in product" :key="index">
{{item.title}}
<a-select
v-model="queryform.productId"
style="width: 200px"
placeholder="选择产品"
>
<a-select-option
:value="item.id"
v-for="(item, index) in product"
:key="index"
>
{{ item.title }}
</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item>
<a-range-picker valueFormat="yyyy-MM-DD" v-model="time" style="width: 300px" :allowClear="false"/>
<a-range-picker
valueFormat="yyyy-MM-DD"
v-model="time"
style="width: 300px"
:allowClear="false"
/>
</a-form-model-item>
<a-form-model-item>
<a-button type="primary" class="addclass" @click="getData">
......@@ -27,187 +45,229 @@
</template>
<script>
import * as echarts from 'echarts'
import moment from 'moment';
import {getUsageCensus} from '@/api/dataActuary.js'
import product from "../mixins/product"
export default {
mixins:[product],
import * as echarts from "echarts";
import moment from "moment";
import { getUsageCensus } from "@/api/dataActuary.js";
import product from "../mixins/product";
export default {
mixins: [product],
data() {
return {
queryform: {
productId: 1,
dateTimeStart: moment().format('yyyy-MM-DD'),
dateTimeEnd: moment().format('yyyy-MM-DD'),
pageCode: '/'
},
time: [moment().format('yyyy-MM-DD'), moment().format('yyyy-MM-DD')],
product: [{
title: '排队机',
id: 1
}],
dateTimeStart: moment().format("yyyy-MM-DD"),
dateTimeEnd: moment().format("yyyy-MM-DD"),
pageCode: "/",
},
time: [moment().format("yyyy-MM-DD"), moment().format("yyyy-MM-DD")],
product: [
{
title: "排队机",
id: 1,
},
],
labelCol: {
span: 1
span: 1,
},
wrapperCol: {
span: 14
span: 14,
},
}
};
},
mounted() {
this.getData()
this.getData();
},
methods: {
getData() {
this.queryform.dateTimeStart = this.time ? this.time[0] : null
this.queryform.dateTimeEnd = this.time ? this.time[1] : null
getUsageCensus(this.queryform).then(res=>{
let data = res.data.map(({businessName,propValue})=>({name:businessName,value:propValue * 100}))
this.initType(data)
})
},
initWay(){
let chartDom = document.getElementById('way')
this.queryform.dateTimeStart = this.time ? this.time[0] : null;
this.queryform.dateTimeEnd = this.time ? this.time[1] : null;
this.queryform.productId == 1
? (this.queryform.businessCodeList = [
"iDCardSignIn",
"mobCheck_in",
"qrCode",
])
: "";
console.log(this.queryform);
getUsageCensus(this.queryform).then((res) => {
let data = res.data.map(({ businessName, propValue }) => ({
name: businessName,
value: propValue * 100,
}));
this.initType(data);
});
},
initWay() {
let chartDom = document.getElementById("way");
let myChart = echarts.init(chartDom);
myChart.setOption({
title: {
text: '取号方式分析',
left: 'center'
text: "取号方式分析",
left: "center",
},
tooltip: {
trigger: 'item',
trigger: "item",
},
legend: {
bottom: 0,
left: 'center',
left: "center",
itemWidth: 10,
itemHeight: 10
itemHeight: 10,
},
color: ['#6395F9', '#64DAAB', '#647798', '#F6C02D', '#7567FA', '#75CBED'],
series: [{
name: 'Access From',
type: 'pie',
radius: '65%',
color: [
"#6395F9",
"#64DAAB",
"#647798",
"#F6C02D",
"#7567FA",
"#75CBED",
],
series: [
{
name: "Access From",
type: "pie",
radius: "65%",
label: {
normal: {
formatter: '{d}%' //自定义显示格式(b:name, c:value, d:百分比)
}
formatter: "{d}%", //自定义显示格式(b:name, c:value, d:百分比)
},
},
labelLine: {
normal: {
length: 1
}
length: 1,
},
},
data: [{
data: [
{
value: 1048,
name: 'Search Engine'
name: "Search Engine",
},
{
value: 735,
name: 'Direct'
name: "Direct",
},
{
value: 580,
name: 'Email'
name: "Email",
},
{
value: 484,
name: 'Union Ads'
name: "Union Ads",
},
{
value: 300,
name: 'Video Ads'
}
name: "Video Ads",
},
],
}]
})
},
],
});
},
initType(data) {
console.log(data)
let chartDom = document.getElementById('type')
console.log(data);
let chartDom = document.getElementById("type");
let myChart = echarts.init(chartDom);
myChart.setOption({
title: {
text: this.queryform.productId==1?'取号类型分析':'功能使用分布',
left: 'center'
text: this.queryform.productId == 1 ? "取号类型分析" : "功能使用分布",
left: "center",
},
tooltip: {
trigger: 'item',
trigger: "item",
},
legend: {
bottom: 0,
left: 'center',
left: "center",
itemWidth: 10,
itemHeight: 10
itemHeight: 10,
},
color: ['#6395F9', '#64DAAB', '#647798', '#F6C02D', '#7567FA', '#75CBED'],
series: [{
type: 'pie',
radius: '65%',
color: [
"#6395F9",
"#64DAAB",
"#647798",
"#F6C02D",
"#7567FA",
"#75CBED",
],
series: [
{
type: "pie",
radius: "65%",
label: {
normal: {
formatter: '{d}%' //自定义显示格式(b:name, c:value, d:百分比)
}
formatter: "{d}%", //自定义显示格式(b:name, c:value, d:百分比)
},
},
labelLine: {
normal: {
length: 1
}
length: 1,
},
},
data: data,
},
data: data
}]
})
],
});
},
initCanal() {
let chartDom = document.getElementById('canal')
let chartDom = document.getElementById("canal");
let myChart = echarts.init(chartDom);
myChart.setOption({
title: {
text: '取号渠道分析',
left: 'center'
text: "取号渠道分析",
left: "center",
},
tooltip: {
trigger: 'item',
trigger: "item",
},
legend: {
bottom: 0,
left: 'center',
left: "center",
itemWidth: 10,
itemHeight: 10
itemHeight: 10,
},
color: ['#6395F9', '#64DAAB', '#647798', '#F6C02D', '#7567FA', '#75CBED'],
series: [{
name: 'Access From',
type: 'pie',
radius: '65%',
color: [
"#6395F9",
"#64DAAB",
"#647798",
"#F6C02D",
"#7567FA",
"#75CBED",
],
series: [
{
name: "Access From",
type: "pie",
radius: "65%",
label: {
normal: {
formatter: '{d}%' //自定义显示格式(b:name, c:value, d:百分比)
}
formatter: "{d}%", //自定义显示格式(b:name, c:value, d:百分比)
},
},
labelLine: {
normal: {
length: 1
}
length: 1,
},
data: [{
},
data: [
{
value: 1048,
name: '终端取号'
name: "终端取号",
},
{
value: 735,
name: '在线取号'
}
]
}]
})
}
}
};
name: "在线取号",
},
],
},
],
});
},
},
};
</script>
<style lang="less" scoped>
.page {
.page {
height: calc(100% - 50px);
display: flex;
flex-direction: column;
......@@ -222,10 +282,12 @@
justify-content: center;
padding: 50px 0;
#canal,#type,#way {
#canal,
#type,
#way {
width: 30%;
height: 100%;
}
}
}
}
</style>
......@@ -14,7 +14,13 @@
<!-- <div class="f_center primary" @click="toTable">点击查看报表</div> -->
</a-col>
<a-col :span="20">
<lineChart :id="`one_line`" :title="`近30日注册情况分析`" :datas="oneLineData" :height="200" :width="1420" />
<lineChart
:id="`one_line`"
:title="`近30日注册情况分析`"
:datas="oneLineData"
:height="200"
:width="1420"
/>
</a-col>
</a-row>
</a-card>
......@@ -27,32 +33,69 @@
</template>
<a-row>
<a-col :span="8">
<map-chart :id="`one_map`" :datas="oneMapData" :height="400" :width="550" />
<map-chart
:id="`one_map`"
:datas="oneMapData"
:height="400"
:width="550"
/>
</a-col>
<a-col :span="8">
<a-table :rowKey="(record, index) => { return index }" :dataSource="provinces"
:columns="provincesColumns" :scroll="{ y: 300 }" :pagination="false">
<a-table
:rowKey="
(record, index) => {
return index;
}
"
:dataSource="provinces"
:columns="provincesColumns"
:scroll="{ y: 300 }"
:pagination="false"
>
</a-table>
</a-col>
<a-col :span="8">
<pieChart :id="`one_pie`" :height="400" :width="550" :datas="onePieData" />
</a-col>
<a-col :span="12">
<doublePieChart :id="`two_pie`" :height="300" :width="800" :datas="twoPieData" />
<pieChart
:id="`one_pie`"
:height="400"
:width="550"
:datas="onePieData"
/>
</a-col>
<a-col :span="12">
<barChart :id="`one_bar`" :height="300" :width="800" :datas="oneBarData" />
<doublePieChart
:id="`two_pie`"
:height="300"
:width="800"
:datas="twoPieData"
/>
</a-col>
<a-col :span="12">
<barChart :id="`two_bar`" :height="300" :width="800" :datas="twoBarData" />
</a-col>
<a-col :span="12">
<pieChart :id="`three_pie`" :height="300" :width="800" :datas="threePieData" />
<barChart
:id="`one_bar`"
:height="300"
:width="800"
:datas="oneBarData"
/>
</a-col>
<a-col :span="12">
<barChart
:id="`two_bar`"
:height="300"
:width="800"
:datas="twoBarData"
/>
</a-col>
<a-col :span="12">
<pieChart
:id="`three_pie`"
:height="300"
:width="800"
:datas="threePieData"
/>
</a-col>
<a-col :span="12"> </a-col>
<a-col :span="12"> </a-col>
</a-row>
</a-card>
<a-card :bordered="false" class="mb_15">
......@@ -65,75 +108,126 @@
<a-row type="flex" align="middle">
<a-row>
<a-col :span="8">
<map-chart :id="`two_map`" :datas="oneMapData2" :height="400" :width="550" />
<map-chart
:id="`two_map`"
:datas="oneMapData2"
:height="400"
:width="550"
/>
</a-col>
<a-col :span="8">
<a-table :rowKey="(record, index) => { return index }" :dataSource="provinces2"
:columns="provincesColumns2" :pagination="false" :scroll="{ y: 300 }">
<a-table
:rowKey="
(record, index) => {
return index;
}
"
:dataSource="provinces2"
:columns="provincesColumns2"
:pagination="false"
:scroll="{ y: 300 }"
>
</a-table>
</a-col>
<a-col :span="8">
<pieChart :id="`four_pie`" :height="400" :width="550" :datas="onePieData2" />
</a-col>
<a-col :span="12">
<doublePieChart :id="`five_pie`" :height="300" :width="800" :datas="twoPieData2" />
</a-col>
<a-col :span="12">
<barChart :id="`six_bar`" :height="300" :width="800" :datas="oneBarData2" />
<pieChart
:id="`four_pie`"
:height="400"
:width="550"
:datas="onePieData2"
/>
</a-col>
<a-col :span="12">
<barChart :id="`three_bar`" :height="300" :width="800" :datas="twoBarData2" />
<doublePieChart
:id="`five_pie`"
:height="300"
:width="800"
:datas="twoPieData2"
/>
</a-col>
<a-col :span="12">
<pieChart :id="`six_pie`" :height="300" :width="800" :datas="threePieData2" />
<barChart
:id="`six_bar`"
:height="300"
:width="800"
:datas="oneBarData2"
/>
</a-col>
<a-col :span="12">
<barChart
:id="`three_bar`"
:height="300"
:width="800"
:datas="twoBarData2"
/>
</a-col>
<a-col :span="12">
<pieChart
:id="`six_pie`"
:height="300"
:width="800"
:datas="threePieData2"
/>
</a-col>
<a-col :span="12"> </a-col>
<a-col :span="12"> </a-col>
</a-row>
</a-row>
</a-card>
</div>
</template>
<script >
import barChart from '../../business/Component/bar/index.vue'
import doublePieChart from "../../business/Component/doublePie/index.vue"
import pieChart from "../../business/Component/pie/index.vue"
import lineChart from "../../business/Component/line/index.vue"
import mapChart from "../../business/Component/map/index.vue"
import moment from "moment"
<script>
import barChart from "../../business/Component/bar/index.vue";
import doublePieChart from "../../business/Component/doublePie/index.vue";
import pieChart from "../../business/Component/pie/index.vue";
import lineChart from "../../business/Component/line/index.vue";
import mapChart from "../../business/Component/map/index.vue";
import moment from "moment";
import {
peopleQs, registerProvince, registerBwd, registerSex, registerAge, registerNation, provinceCase, bwdStatistic,
provinceStatistic, genderRateType, ageRate, TopNationStatistic,
} from "@/api/userPortrait.js"
peopleQs,
registerProvince,
registerBwd,
registerSex,
registerAge,
registerNation,
provinceCase,
bwdStatistic,
provinceStatistic,
genderRateType,
ageRate,
TopNationStatistic,
} from "@/api/userPortrait.js";
export default {
components: {
mapChart, pieChart, lineChart, doublePieChart, barChart
mapChart,
pieChart,
lineChart,
doublePieChart,
barChart,
},
data() {
return {
options: [
{
value: '0',
label: '今天',
value: "0",
label: "今天",
},
{
value: '1',
label: '近7日',
value: "1",
label: "近7日",
},
{
value: '2',
label: '近30日',
value: "2",
label: "近30日",
},
{
value: '3',
label: '近3个月',
value: "3",
label: "近3个月",
},
{
value: '4',
label: '本年度',
value: "4",
label: "本年度",
},
],
oneLineData: {},
......@@ -152,363 +246,417 @@ export default {
provinces: [
{
ranking: 1,
province: '四川省',
people: '999',
percent: '2'
province: "四川省",
people: "999",
percent: "2",
},
{
ranking: 2,
province: '四川省',
people: '999',
percent: '2'
province: "四川省",
people: "999",
percent: "2",
},
],
provinces2: [
{
ranking: 1,
province: '四川省',
people: '999',
percent: '2'
province: "四川省",
people: "999",
percent: "2",
},
{
ranking: 2,
province: '四川省',
people: '999',
percent: '2'
province: "四川省",
people: "999",
percent: "2",
},
],
provincesColumns: [
{
key: 'ranking',
title: '序号',
dataIndex: 'id',
key: "ranking",
title: "序号",
dataIndex: "id",
},
{
key: 'province',
title: '省份',
dataIndex: 'province',
key: "province",
title: "省份",
dataIndex: "province",
},
{
key: 'value',
title: '注册人数',
dataIndex: 'value',
key: "value",
title: "注册人数",
dataIndex: "value",
},
{
key: 'zb_lv',
title: '注册占比',
dataIndex: 'zb_lv',
key: "zb_lv",
title: "注册占比",
dataIndex: "zb_lv",
customRender(text, record, index) {
return parseFloat((text * 100).toFixed(2)) + "%"
}
return parseFloat((text * 100).toFixed(2)) + "%";
},
},
],
provincesColumns2: [
{
key: 'ranking',
title: '序号',
dataIndex: 'id',
key: "ranking",
title: "序号",
dataIndex: "id",
},
{
key: 'province',
title: '省份',
dataIndex: 'province',
key: "province",
title: "省份",
dataIndex: "province",
},
{
key: 'value',
title: '办件人数',
dataIndex: 'value',
key: "value",
title: "办件人数",
dataIndex: "value",
},
{
key: 'nums_val',
title: '办件占比',
dataIndex: 'nums_val',
key: "nums_val",
title: "办件占比",
dataIndex: "nums_val",
customRender(text, record, index) {
return parseFloat((text * 100).toFixed(2)) + "%"
}
return parseFloat((text * 100).toFixed(2)) + "%";
},
},
],
takeNumber: '0',
nowDate: '',
takeNumber: "0",
nowDate: "",
massCount: '0',//群众总量
timeArr: [],//群众注册时间
massCount: "0", //群众总量
timeArr: [], //群众注册时间
doTotal: 0,
}
},
created() {
};
},
created() {},
mounted() {
this.getPeopleQs()
this.getRegisterProvince()
this.getRegisterBwd()
this.getRegisterSex()
this.getRegisterAge()
this.getRegisterNation()
this.getPeopleQs();
this.getRegisterProvince();
this.getRegisterBwd();
this.getRegisterSex();
this.getRegisterAge();
this.getRegisterNation();
this.getProvinceCase()
this.getProvinceStatistic()
this.getBwdStatistic()
this.getGenderRateType()
this.getAgeRate()
this.getTopNationStatistic()
this.nowDate = moment(new Date()).format('YYYY-MM-DD h:mm:ss')
this.getProvinceCase();
this.getProvinceStatistic();
this.getBwdStatistic();
this.getGenderRateType();
this.getAgeRate();
this.getTopNationStatistic();
this.nowDate = moment(new Date()).format("YYYY-MM-DD h:mm:ss");
},
methods: {
toTable() {
this.$router.push({ path: 'register' })
this.$router.push({ path: "register" });
},
//整体情况
async getPeopleQs() {
let res = await peopleQs({ siteid: localStorage.getItem('siteId') })
let res = await peopleQs({ siteid: localStorage.getItem("siteId") });
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 = []
let app = []
let Applets = []
res.data.list?.forEach(i => {
i.row.forEach(j => {
if (j.register_type == 'take') {//循环获取排号机注册情况
return take.push(j.count)
this.massCount = res.data.count;
let time = res.data.list?.map((i) => {
//循环获取时间
return moment(i.datetime).format("MM-DD");
});
let take = [];
let app = [];
let Applets = [];
res.data.list?.forEach((i) => {
i.row.forEach((j) => {
if (j.register_type == "take") {
//循环获取排号机注册情况
return take.push(j.count);
}
if (j.register_type == 'app') {//循环获取自助终端注册情况
return app.push(j.count)
if (j.register_type == "app") {
//循环获取自助终端注册情况
return app.push(j.count);
}
if (j.register_type == 'Applets') {//循环获取微官网注册情况
return Applets.push(j.count)
if (j.register_type == "Applets") {
//循环获取微官网注册情况
return Applets.push(j.count);
}
})
})
});
});
this.oneLineData = {
title: '近30日注册情况分析:',
legend: ['自助服务系统注册人数', '微官网注册人数', '排队系统注册人数'],
title: "近30日注册情况分析:",
legend: [
"自助服务系统注册人数",
"微官网注册人数",
"排队系统注册人数",
],
xData: time,
dataList: [
{ name: '自助服务系统注册人数', data: app },
{ name: '微官网注册人数', data: Applets },
{ name: '排队系统注册人数', data: take },
]
}
{ name: "自助服务系统注册人数", data: app },
{ name: "微官网注册人数", data: Applets },
{ name: "排队系统注册人数", data: take },
],
};
this.$forceUpdate(this.oneLineData);
}
},
//区域注册情况
async getRegisterProvince() {
let res = await registerProvince({ siteid: localStorage.getItem('siteId') })
let res = await registerProvince({
siteid: localStorage.getItem("siteId"),
});
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
})
i.id = j + 1;
i.name = i.province;
i.value = i.count;
return i;
});
// console.log(arr)
this.oneMapData = {
title: "注册用户地域分析",
data: arr
}
this.provinces = arr
data: arr,
};
this.provinces = arr;
this.onePieData = {
title: '',
type: 'scroll',
legend: arr.forEach(i => { return i.province }),
data: arr
}
title: "",
type: "scroll",
legend: arr.forEach((i) => {
return i.province;
}),
data: arr,
};
},
//注册分布情况
async getRegisterBwd() {
let res = await registerBwd({ siteid: localStorage.getItem('siteId') })
let res = await registerBwd({ siteid: localStorage.getItem("siteId") });
this.twoPieData = {
title: '本地人与外地人注册分布',
pieName: '分布详情',
firstName: '宜宾市本地人注册占比',
title: "本地人与外地人注册分布",
pieName: "分布详情",
firstName: "宜宾市本地人注册占比",
firstVal: res.data.bd_lv,
firstTotal: 1,
secondName: '外地人注册占比',
secondName: "外地人注册占比",
secondVal: res.data.wd_lv,
secondTotal: 1,
}
};
},
//注册性别分布情况
async getRegisterSex() {
let res = await registerSex({ siteid: localStorage.getItem('siteId') })
let res = await registerSex({ siteid: localStorage.getItem("siteId") });
// console.log(res)
if (res.data ? res.data.length > 0 : '') {
let man = res.data[0].row
let woman = res.data[1].row
if (res.data ? res.data.length > 0 : "") {
let man = res.data[0].row;
let woman = res.data[1].row;
this.oneBarData = {
title: '性别分布',
xData: ['', ''],
title: "性别分布",
xData: ["", ""],
data: [
{ name: '自助服务系统注册人数', type: 'bar', data: [man[1].count || 0, woman[1].count || 0] },
{ name: '微官网注册人数', type: 'bar', data: [man[2].count || 0, woman[2].count || 0] },
{ name: '排队系统注册人数', type: 'bar', data: [man[0].count || 0, woman[0].count || 0] },
]
}
{
name: "自助服务系统注册人数",
type: "bar",
data: [man[1].count || 0, woman[1].count || 0],
},
{
name: "微官网注册人数",
type: "bar",
data: [man[2].count || 0, woman[2].count || 0],
},
{
name: "排队系统注册人数",
type: "bar",
data: [man[0].count || 0, woman[0].count || 0],
},
],
};
}
},
//注册年龄分布情况
async getRegisterAge() {
let res = await registerAge({ siteid: localStorage.getItem('siteId') })
let res = await registerAge({ siteid: localStorage.getItem("siteId") });
// 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
})
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))
})
let zb = count.map((i) => {
return parseFloat(((i / total) * 10000).toFixed(2));
});
// console.log(zb)
this.twoBarData = {
title: '年龄分布',
title: "年龄分布",
xData: age_area,
data: [
{ name: '办理次数', type: 'bar', data: count },
{ name: '占比', type: 'line', data: zb },
]
}
{ name: "办理次数", type: "bar", data: count },
{ name: "占比", type: "line", data: zb },
],
};
},
//注册民族分布情况
async getRegisterNation() {
let res = await registerNation({ siteid: localStorage.getItem('siteId') })
let res = await registerNation({
siteid: localStorage.getItem("siteId"),
});
// console.log(res)
res.data.forEach(i => {
i.name = i.idcard_Nation
i.value = i.count
})
res.data.forEach((i) => {
i.name = i.idcard_Nation;
i.value = i.count;
});
// console.log(res.data)
this.threePieData = {
title: '民族分布',
type: '',
title: "民族分布",
type: "",
legend: res.data,
data: res.data
}
data: res.data,
};
},
//办件用户地域分析
async getProvinceCase() {
let res = await provinceCase({ siteid: localStorage.getItem('siteId'), selected: 2 })
let res = await provinceCase({
siteid: localStorage.getItem("siteId"),
selected: 2,
});
// 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
})
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
data: arr,
};
this.provinces2 = arr;
},
//办件用户地域分析
async getProvinceStatistic() {
let res = await provinceStatistic({ siteid: localStorage.getItem('siteId'), selected: 2, province: '四川省' })
let res = await provinceStatistic({
siteid: localStorage.getItem("siteId"),
selected: 2,
province: "四川省",
});
// console.log(res)
res.data.forEach(i => {
i.value = i.count
})
res.data.forEach((i) => {
i.value = i.count;
});
this.onePieData2 = {
title: '',
type: 'scroll',
title: "",
type: "scroll",
legend: res.data,
data: res.data
}
data: res.data,
};
},
//本外地分析
async getBwdStatistic() {
let res = await bwdStatistic({ siteid: localStorage.getItem('siteId'), selected: 2 })
let res = await bwdStatistic({
siteid: localStorage.getItem("siteId"),
selected: 2,
});
// console.log(res)
this.twoPieData2 = {
title: '本地人与外地人办件分布',
pieName: '分布详情',
firstName: '宜宾市本地人办件占比',
title: "本地人与外地人办件分布",
pieName: "分布详情",
firstName: "宜宾市本地人办件占比",
firstVal: res.data.bd_lv,
firstTotal: 1,
secondName: '外地人办件占比',
secondName: "外地人办件占比",
secondVal: res.data.wd_lv,
secondTotal: 1,
}
};
},
//性别办件分析
async getGenderRateType() {
let res = await genderRateType({ siteid: localStorage.getItem('siteId'), selected: 2 })
if (res.data ? res.data.length > 0 : '') {
let man = res.data[0].row
let woman = res.data[1].row
let res = await genderRateType({
siteid: localStorage.getItem("siteId"),
selected: 2,
});
if (res.data ? res.data.length > 0 : "") {
let man = res.data[0].row;
let woman = res.data[1].row;
this.oneBarData2 = {
title: '性别分布',
xData: ['', ''],
title: "性别分布",
xData: ["", ""],
data: [
{ name: '自助服务系统注册人数', type: 'bar', data: [man[1].nums || 0, woman[1].nums || 0] },
{ name: '微官网注册人数', type: 'bar', data: [man[2].nums || 0, woman[2].nums || 0] },
{ name: '排队系统注册人数', type: 'bar', data: [man[0].nums || 0, woman[0].nums || 0] },
]
}
{
name: "自助服务系统注册人数",
type: "bar",
data: [man[1].nums || 0, woman[1].nums || 0],
},
{
name: "微官网注册人数",
type: "bar",
data: [man[2].nums || 0, woman[2].nums || 0],
},
{
name: "排队系统注册人数",
type: "bar",
data: [man[0].nums || 0, woman[0].nums || 0],
},
],
};
}
},
//办件年龄分析
async getAgeRate() {
let res = await ageRate({ siteid: localStorage.getItem('siteId'), selected: 2 })
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
})
let res = await ageRate({
siteid: localStorage.getItem("siteId"),
selected: 2,
});
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))
})
let zb = count.map((i) => {
return parseFloat(((i / total) * 10000).toFixed(2));
});
// console.log(zb)
this.twoBarData2 = {
title: '年龄分布',
title: "年龄分布",
xData: age_area,
data: [
{ name: '办理次数', type: 'bar', data: count },
{ name: '占比', type: 'line', data: zb },
]
}
{ name: "办理次数", type: "bar", data: count },
{ name: "占比", type: "line", data: zb },
],
};
},
async getTopNationStatistic() {
let res = await TopNationStatistic({ siteid: localStorage.getItem('siteId'), selected: 2 })
let res = await TopNationStatistic({
siteid: localStorage.getItem("siteId"),
selected: 2,
});
// console.log(res)
res.data.forEach(i => {
i.name = i.idcard_Nation
i.value = i.count
})
res.data.forEach((i) => {
i.name = i.idcard_Nation;
i.value = i.count;
});
// console.log(res.data)
this.threePieData2 = {
title: '民族分布',
type: '',
title: "民族分布",
type: "",
legend: res.data,
data: res.data
}
data: res.data,
};
},
}
}
},
};
</script>
<style scoped lang="less">
......@@ -554,15 +702,15 @@ export default {
}
.warning {
color: #FD6805
color: #fd6805;
}
.primary {
color: #0595FD
color: #0595fd;
}
.success {
color: #04CA8F
color: #04ca8f;
}
.h_200 {
......@@ -570,6 +718,6 @@ export default {
}
.mb_15 {
margin-bottom: .9375rem;
margin-bottom: 0.9375rem;
}
</style>
package com.mortals.xhx.module.page.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.module.page.model.pdu.BuryPointPdu;
import com.mortals.xhx.module.page.model.pdu.PageCensusPdu;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.module.page.dao.PageAccessDao;
import com.mortals.xhx.module.page.model.PageAccessEntity;
import com.mortals.xhx.module.page.model.pdu.BuryPointPdu;
import com.mortals.xhx.module.page.model.pdu.PageCensusPdu;
import com.mortals.xhx.module.page.service.PageAccessService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import java.text.DecimalFormat;
import java.text.ParseException;
......@@ -122,7 +121,7 @@ public class PageAccessServiceImpl extends AbstractCRUDServiceImpl<PageAccessDao
if(CollectionUtils.isNotEmpty(todayList)){
for (PageAccessEntity item:todayList){
if(item!=null) {
DecimalFormat decimalFormat=new DecimalFormat(".00");
DecimalFormat decimalFormat=new DecimalFormat("#0.00");
String key = item.getTimeStr() + "_" + item.getFirstCode() + "_" + item.getSecondCode() + "_" + item.getThirdCode() + "_" + item.getFourthCode();
if (mp.containsKey(key)) {
PageAccessEntity last = mp.get(key);
......
......@@ -127,7 +127,7 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
float a = (float)vo.getValue();
float b = (float)clickSum;
float p = a/b;
DecimalFormat decimalFormat=new DecimalFormat(".00%");
DecimalFormat decimalFormat=new DecimalFormat("#0.00%");
String s = decimalFormat.format(p);
vo.setProportion(s);
}
......@@ -173,7 +173,7 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
float a = (float)clickSum;
float b = (float)trendCensusVos.size();
float p = a/b;
DecimalFormat decimalFormat=new DecimalFormat(".00");
DecimalFormat decimalFormat=new DecimalFormat("#0.00");
String s = decimalFormat.format(p);
dayAccessAvg = Float.valueOf(s);
}
......@@ -232,8 +232,8 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
float a = (float)clickSum;
float b = (float)item.getAccessCount();
float p = b/a;
DecimalFormat decimalFormat=new DecimalFormat(".00%");
DecimalFormat df=new DecimalFormat(".00");
DecimalFormat decimalFormat=new DecimalFormat("#0.00%");
DecimalFormat df=new DecimalFormat("#0.00");
String s = decimalFormat.format(p);
String s1 = df.format(p);
item.setProportion(s);
......
......@@ -75,7 +75,15 @@ public class PageRouteServiceImpl extends AbstractCRUDServiceImpl<PageRouteDao,
}
Map<String,Object> result = new HashMap<>();
List<PageWayCensusVo> pageWayCensusVos = dao.getPageWayCensus(pdu);
result.put("links",pageWayCensusVos);
List<PageWayCensusVo> list = new ArrayList<>();
Map<String,String> source = new HashMap<>();
for(PageWayCensusVo item:pageWayCensusVos){
source.put(item.getSource(),item.getSourceName());
if(!source.containsKey(item.getTarget())){
list.add(item);
}
}
result.put("links",list);
List<Map<String, Object>> pageCodes = dao.getPageWayCode(pdu);
result.put("data",pageCodes);
return result;
......
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