Commit 0ada2b45 authored by “yiyousong”'s avatar “yiyousong”
parents 0daa4acb f251984b
...@@ -80,13 +80,20 @@ export default { ...@@ -80,13 +80,20 @@ export default {
this.queryform.dateTimeStart = this.time ? this.time[0] : null; this.queryform.dateTimeStart = this.time ? this.time[0] : null;
this.queryform.dateTimeStart = this.time ? this.time[1] : null; this.queryform.dateTimeStart = this.time ? this.time[1] : null;
getWayAccessAnalyse(this.queryform).then((res) => { getWayAccessAnalyse(this.queryform).then((res) => {
let data = res.data.data.map((item, i) => let newobj = {};
item.code != "/sceneSignIn" let data = res.data.data.reduce((preVal, curVal) => {
? { newobj[curVal.name]
name: item.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) => ({ let links = res.data.links.map((item) => ({
source: item.sourceName, source: item.sourceName,
target: item.targetName, target: item.targetName,
...@@ -96,7 +103,7 @@ export default { ...@@ -96,7 +103,7 @@ export default {
}, },
})); }));
data = data.filter((v) => v); 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); this.init(data, links);
}); });
}, },
......
...@@ -217,12 +217,14 @@ export default { ...@@ -217,12 +217,14 @@ export default {
display: flex; display: flex;
.img-dv { .img-dv {
width: 60%; flex: 1;
margin: 100px; margin: 100px;
height: 600px;
position: relative; position: relative;
img { img {
width: 100%; width: 100%;
height: 100%;
} }
#queuing { #queuing {
...@@ -236,7 +238,7 @@ export default { ...@@ -236,7 +238,7 @@ export default {
} }
.list-dv { .list-dv {
width: 40%; width: 55%;
min-height: 100%; min-height: 100%;
border-left: solid 1px #efefef; border-left: solid 1px #efefef;
box-sizing: border-box; box-sizing: border-box;
......
<template> <template>
<!-- 使用习惯分析 --> <!-- 使用习惯分析 -->
<div class="page"> <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-form-model-item>
<a-select v-model="queryform.productId" style="width: 200px" placeholder="选择产品"> <a-select
<a-select-option :value="item.id" v-for="(item,index) in product" :key="index"> v-model="queryform.productId"
{{item.title}} 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-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
<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-form-model-item> <a-form-model-item>
<a-button type="primary" class="addclass" @click="getData"> <a-button type="primary" class="addclass" @click="getData">
...@@ -27,187 +45,229 @@ ...@@ -27,187 +45,229 @@
</template> </template>
<script> <script>
import * as echarts from 'echarts' import * as echarts from "echarts";
import moment from 'moment'; import moment from "moment";
import {getUsageCensus} from '@/api/dataActuary.js' import { getUsageCensus } from "@/api/dataActuary.js";
import product from "../mixins/product" import product from "../mixins/product";
export default { export default {
mixins:[product], mixins: [product],
data() { data() {
return { return {
queryform: { queryform: {
productId: 1, productId: 1,
dateTimeStart: moment().format('yyyy-MM-DD'), dateTimeStart: moment().format("yyyy-MM-DD"),
dateTimeEnd: moment().format('yyyy-MM-DD'), dateTimeEnd: moment().format("yyyy-MM-DD"),
pageCode: '/' pageCode: "/",
}, },
time: [moment().format('yyyy-MM-DD'), moment().format('yyyy-MM-DD')], time: [moment().format("yyyy-MM-DD"), moment().format("yyyy-MM-DD")],
product: [{ product: [
title: '排队机', {
id: 1 title: "排队机",
}], id: 1,
},
],
labelCol: { labelCol: {
span: 1 span: 1,
}, },
wrapperCol: { wrapperCol: {
span: 14 span: 14,
}, },
} };
}, },
mounted() { mounted() {
this.getData() this.getData();
}, },
methods: { methods: {
getData() { getData() {
this.queryform.dateTimeStart = this.time ? this.time[0] : null this.queryform.dateTimeStart = this.time ? this.time[0] : null;
this.queryform.dateTimeEnd = this.time ? this.time[1] : null this.queryform.dateTimeEnd = this.time ? this.time[1] : null;
getUsageCensus(this.queryform).then(res=>{ this.queryform.productId == 1
let data = res.data.map(({businessName,propValue})=>({name:businessName,value:propValue * 100})) ? (this.queryform.businessCodeList = [
this.initType(data) "iDCardSignIn",
}) "mobCheck_in",
}, "qrCode",
initWay(){ ])
let chartDom = document.getElementById('way') : "";
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); let myChart = echarts.init(chartDom);
myChart.setOption({ myChart.setOption({
title: { title: {
text: '取号方式分析', text: "取号方式分析",
left: 'center' left: "center",
}, },
tooltip: { tooltip: {
trigger: 'item', trigger: "item",
}, },
legend: { legend: {
bottom: 0, bottom: 0,
left: 'center', left: "center",
itemWidth: 10, itemWidth: 10,
itemHeight: 10 itemHeight: 10,
}, },
color: ['#6395F9', '#64DAAB', '#647798', '#F6C02D', '#7567FA', '#75CBED'], color: [
series: [{ "#6395F9",
name: 'Access From', "#64DAAB",
type: 'pie', "#647798",
radius: '65%', "#F6C02D",
"#7567FA",
"#75CBED",
],
series: [
{
name: "Access From",
type: "pie",
radius: "65%",
label: { label: {
normal: { normal: {
formatter: '{d}%' //自定义显示格式(b:name, c:value, d:百分比) formatter: "{d}%", //自定义显示格式(b:name, c:value, d:百分比)
} },
}, },
labelLine: { labelLine: {
normal: { normal: {
length: 1 length: 1,
} },
}, },
data: [{ data: [
{
value: 1048, value: 1048,
name: 'Search Engine' name: "Search Engine",
}, },
{ {
value: 735, value: 735,
name: 'Direct' name: "Direct",
}, },
{ {
value: 580, value: 580,
name: 'Email' name: "Email",
}, },
{ {
value: 484, value: 484,
name: 'Union Ads' name: "Union Ads",
}, },
{ {
value: 300, value: 300,
name: 'Video Ads' name: "Video Ads",
} },
], ],
}] },
}) ],
});
}, },
initType(data) { initType(data) {
console.log(data) console.log(data);
let chartDom = document.getElementById('type') let chartDom = document.getElementById("type");
let myChart = echarts.init(chartDom); let myChart = echarts.init(chartDom);
myChart.setOption({ myChart.setOption({
title: { title: {
text: this.queryform.productId==1?'取号类型分析':'功能使用分布', text: this.queryform.productId == 1 ? "取号类型分析" : "功能使用分布",
left: 'center' left: "center",
}, },
tooltip: { tooltip: {
trigger: 'item', trigger: "item",
}, },
legend: { legend: {
bottom: 0, bottom: 0,
left: 'center', left: "center",
itemWidth: 10, itemWidth: 10,
itemHeight: 10 itemHeight: 10,
}, },
color: ['#6395F9', '#64DAAB', '#647798', '#F6C02D', '#7567FA', '#75CBED'], color: [
series: [{ "#6395F9",
type: 'pie', "#64DAAB",
radius: '65%', "#647798",
"#F6C02D",
"#7567FA",
"#75CBED",
],
series: [
{
type: "pie",
radius: "65%",
label: { label: {
normal: { normal: {
formatter: '{d}%' //自定义显示格式(b:name, c:value, d:百分比) formatter: "{d}%", //自定义显示格式(b:name, c:value, d:百分比)
} },
}, },
labelLine: { labelLine: {
normal: { normal: {
length: 1 length: 1,
} },
},
data: data,
}, },
data: data ],
}] });
})
}, },
initCanal() { initCanal() {
let chartDom = document.getElementById('canal') let chartDom = document.getElementById("canal");
let myChart = echarts.init(chartDom); let myChart = echarts.init(chartDom);
myChart.setOption({ myChart.setOption({
title: { title: {
text: '取号渠道分析', text: "取号渠道分析",
left: 'center' left: "center",
}, },
tooltip: { tooltip: {
trigger: 'item', trigger: "item",
}, },
legend: { legend: {
bottom: 0, bottom: 0,
left: 'center', left: "center",
itemWidth: 10, itemWidth: 10,
itemHeight: 10 itemHeight: 10,
}, },
color: ['#6395F9', '#64DAAB', '#647798', '#F6C02D', '#7567FA', '#75CBED'], color: [
series: [{ "#6395F9",
name: 'Access From', "#64DAAB",
type: 'pie', "#647798",
radius: '65%', "#F6C02D",
"#7567FA",
"#75CBED",
],
series: [
{
name: "Access From",
type: "pie",
radius: "65%",
label: { label: {
normal: { normal: {
formatter: '{d}%' //自定义显示格式(b:name, c:value, d:百分比) formatter: "{d}%", //自定义显示格式(b:name, c:value, d:百分比)
} },
}, },
labelLine: { labelLine: {
normal: { normal: {
length: 1 length: 1,
}
}, },
data: [{ },
data: [
{
value: 1048, value: 1048,
name: '终端取号' name: "终端取号",
}, },
{ {
value: 735, value: 735,
name: '在线取号' name: "在线取号",
} },
] ],
}] },
}) ],
} });
} },
}; },
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.page { .page {
height: calc(100% - 50px); height: calc(100% - 50px);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -222,10 +282,12 @@ ...@@ -222,10 +282,12 @@
justify-content: center; justify-content: center;
padding: 50px 0; padding: 50px 0;
#canal,#type,#way { #canal,
#type,
#way {
width: 30%; width: 30%;
height: 100%; height: 100%;
} }
} }
} }
</style> </style>
package com.mortals.xhx.module.page.service.impl; package com.mortals.xhx.module.page.service.impl;
import com.alibaba.fastjson.JSONObject; 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.exception.AppException;
import com.mortals.framework.model.Context; 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.dao.PageAccessDao;
import com.mortals.xhx.module.page.model.PageAccessEntity; 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 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.DecimalFormat;
import java.text.ParseException; import java.text.ParseException;
...@@ -122,7 +121,7 @@ public class PageAccessServiceImpl extends AbstractCRUDServiceImpl<PageAccessDao ...@@ -122,7 +121,7 @@ public class PageAccessServiceImpl extends AbstractCRUDServiceImpl<PageAccessDao
if(CollectionUtils.isNotEmpty(todayList)){ if(CollectionUtils.isNotEmpty(todayList)){
for (PageAccessEntity item:todayList){ for (PageAccessEntity item:todayList){
if(item!=null) { 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(); String key = item.getTimeStr() + "_" + item.getFirstCode() + "_" + item.getSecondCode() + "_" + item.getThirdCode() + "_" + item.getFourthCode();
if (mp.containsKey(key)) { if (mp.containsKey(key)) {
PageAccessEntity last = mp.get(key); PageAccessEntity last = mp.get(key);
......
...@@ -127,7 +127,7 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao, ...@@ -127,7 +127,7 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
float a = (float)vo.getValue(); float a = (float)vo.getValue();
float b = (float)clickSum; float b = (float)clickSum;
float p = a/b; float p = a/b;
DecimalFormat decimalFormat=new DecimalFormat(".00%"); DecimalFormat decimalFormat=new DecimalFormat("#0.00%");
String s = decimalFormat.format(p); String s = decimalFormat.format(p);
vo.setProportion(s); vo.setProportion(s);
} }
...@@ -173,7 +173,7 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao, ...@@ -173,7 +173,7 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
float a = (float)clickSum; float a = (float)clickSum;
float b = (float)trendCensusVos.size(); float b = (float)trendCensusVos.size();
float p = a/b; float p = a/b;
DecimalFormat decimalFormat=new DecimalFormat(".00"); DecimalFormat decimalFormat=new DecimalFormat("#0.00");
String s = decimalFormat.format(p); String s = decimalFormat.format(p);
dayAccessAvg = Float.valueOf(s); dayAccessAvg = Float.valueOf(s);
} }
...@@ -232,8 +232,8 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao, ...@@ -232,8 +232,8 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
float a = (float)clickSum; float a = (float)clickSum;
float b = (float)item.getAccessCount(); float b = (float)item.getAccessCount();
float p = b/a; float p = b/a;
DecimalFormat decimalFormat=new DecimalFormat(".00%"); DecimalFormat decimalFormat=new DecimalFormat("#0.00%");
DecimalFormat df=new DecimalFormat(".00"); DecimalFormat df=new DecimalFormat("#0.00");
String s = decimalFormat.format(p); String s = decimalFormat.format(p);
String s1 = df.format(p); String s1 = df.format(p);
item.setProportion(s); item.setProportion(s);
......
...@@ -75,7 +75,15 @@ public class PageRouteServiceImpl extends AbstractCRUDServiceImpl<PageRouteDao, ...@@ -75,7 +75,15 @@ public class PageRouteServiceImpl extends AbstractCRUDServiceImpl<PageRouteDao,
} }
Map<String,Object> result = new HashMap<>(); Map<String,Object> result = new HashMap<>();
List<PageWayCensusVo> pageWayCensusVos = dao.getPageWayCensus(pdu); 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); List<Map<String, Object>> pageCodes = dao.getPageWayCode(pdu);
result.put("data",pageCodes); result.put("data",pageCodes);
return result; 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