Commit 05f8a283 authored by ww-xxy's avatar ww-xxy

优化数据埋点

parent 81057f5d
...@@ -30,4 +30,8 @@ export function getInformationFlow(params) { ...@@ -30,4 +30,8 @@ export function getInformationFlow(params) {
//产品接口 //产品接口
export function productLlist(params) { export function productLlist(params) {
return http.post(`${baseURL}/zwfw/page/info/product/list`, params); return http.post(`${baseURL}/zwfw/page/info/product/list`, params);
}
// 热力图对应的页面
export function pageLlist(params) {
return http.post(`${baseURL}/zwfw/page/info/list`, params);
} }
\ No newline at end of file
...@@ -9,6 +9,7 @@ export default { ...@@ -9,6 +9,7 @@ export default {
this.getProductLlist() this.getProductLlist()
}, },
methods: { methods: {
getProductLlist(){ getProductLlist(){
productLlist({"size":-1}).then(res=>{ productLlist({"size":-1}).then(res=>{
this.ProductLlist = res.data.data this.ProductLlist = res.data.data
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="list-dv"> <div class="list-dv">
<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 v-model="queryform.productId" style="width: 200px" placeholder="选择产品" @change="changeProductId">
<a-select-option :value="item.id" v-for="(item,index) in product" :key="index"> <a-select-option :value="item.id" v-for="(item,index) in product" :key="index">
{{item.title}} {{item.title}}
</a-select-option> </a-select-option>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<div class="main"> <div class="main">
<div class="total-dv"> <div class="total-dv">
<div>总点击次数</div> <div>总点击次数</div>
<div>312321</div> <div>{{clickSum}}</div>
</div> </div>
<div style="margin-bottom: 20px;">事件排名Top10</div> <div style="margin-bottom: 20px;">事件排名Top10</div>
<a-table :columns="columns" :data-source="data" :scroll="{ y: 590 }" :pagination="false"> <a-table :columns="columns" :data-source="data" :scroll="{ y: 590 }" :pagination="false">
...@@ -48,7 +48,8 @@ ...@@ -48,7 +48,8 @@
import Heatmap from 'heatmap.js'; import Heatmap from 'heatmap.js';
import moment from 'moment'; import moment from 'moment';
import { import {
getProductHotCensus getProductHotCensus,
pageLlist
} from '@/api/dataActuary.js' } from '@/api/dataActuary.js'
export default { export default {
mixins:[product], mixins:[product],
...@@ -101,21 +102,47 @@ ...@@ -101,21 +102,47 @@
heatmapInstance: null, heatmapInstance: null,
dataPoint: [], dataPoint: [],
img: '', img: '',
BASE_URL: process.env.VUE_APP_API_BASE_URL + '/' BASE_URL: process.env.VUE_APP_API_BASE_URL + '/',
clickSum:0,//总次数
ProductLlist:[]
} }
}, },
mounted() { mounted() {
this.init('queuing') this.init('queuing')
this.getPageLlist()
}, },
methods: { methods: {
// 选择产品
changeProductId(v){
this.getPageLlist(v)
},
// 查询页面
getPageLlist(productId = 1){
pageLlist({productId:productId,size:-1}).then(res=>{
const {data} = res.data
let arr = []
if(data && data.length > 0){
data.forEach(element => {
arr.push({title:element.pageName,id:element.pageCode})
});
this.page = arr
}else{
this.page = [{
title: '首页',
id: '/'
}]
}
})
},
getList() { getList() {
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
getProductHotCensus(this.queryform).then(res => { getProductHotCensus(this.queryform).then(res => {
this.clickSum = res.data.clickSum
this.data = res.data.data this.data = res.data.data
this.img = res.data.screenUrl this.img = (process.env.NODE_ENV == 'development')?`${this.BASE_URL}${res.data.screenUrl}`:res.data.screenUrl
let imgSize = new Image(); let imgSize = new Image();
imgSize.src = this.BASE_URL + this.img; imgSize.src = this.img;
imgSize.onload = () => { imgSize.onload = () => {
let w = this.$refs.img.width / imgSize.width let w = this.$refs.img.width / imgSize.width
let h = this.$refs.img.height / imgSize.height let h = this.$refs.img.height / imgSize.height
......
...@@ -184,7 +184,6 @@ export default { ...@@ -184,7 +184,6 @@ export default {
// 查看数据 // 查看数据
handleCkeck(path) { handleCkeck(path) {
if(path.indexOf('http')>-1){ if(path.indexOf('http')>-1){
alert(path)
window.open(path) window.open(path)
}else{ }else{
this.$router.push(path); this.$router.push(path);
......
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