统计分析

This commit is contained in:
pan
2024-08-31 16:12:39 +08:00
parent bc6f4a50ea
commit 398b49b910
9 changed files with 267 additions and 121 deletions

View File

@@ -85,7 +85,7 @@ export default {
},
series: [
{
name: 'WEEKLY WRITE ARTICLES',
name: '',
type: 'pie',
roseType: this.roseType,
radius: this.radius,

View File

@@ -1,11 +1,11 @@
<template>
<div class="app-container">
<div class="app-container" v-loading="pageloading">
<el-row :gutter="20">
<el-col :span="12">
<el-card>
<div slot="header" class="clearfix"><span class="tline">工具类别统计</span></div>
<!-- -->
<div class="tjbox2">
<div class="tjbox2" v-if="isPieChart">
<PieChart
height="207px"
:data="toolTypeData"
@@ -20,7 +20,7 @@
<el-col :span="12">
<el-card>
<div slot="header" class="clearfix"><span class="tline">工具状态统计</span></div>
<div class="tjbox2">
<div class="tjbox2" v-if="isPieChart">
<PieChart
height="207px"
:data="toolStatusData"
@@ -39,7 +39,7 @@
<el-col :span="12">
<el-card>
<div slot="header" class="clearfix"><span class="tline">工具来源统计</span></div>
<div class="tjbox2">
<div class="tjbox2" v-if="isPieChart">
<PieChart
height="207px"
:data="toolSourceData"
@@ -133,11 +133,15 @@
</template>
<script>
import { getStatistics } from "@/api/tool/tool";
import { listCount,userDownList } from "@/api/tool/downloadCount";
import PieChart from './PieChart'
import DownStatDetail from './DownStatDetail'
import { getToolDownStat, getToolDownDetailStatistics } from '@/api/statistic/statistic'
export default {
name: 'statistic',
dicts: ['tool_type', 'flow_status', 'tool_source'],
components: {
PieChart,
DownStatDetail
@@ -147,24 +151,27 @@ export default {
toolDownDetailStatList: [],
activeName: 'first',
toolTypeData: [
{ value: 320, name: '检测型' },
{ value: 240, name: '服务型' }
/*{ value: 320, name: '检测型' },
{ value: 240, name: '服务型' }*/
],
toolTypeLegendData:['检测型', '服务型'],
// toolTypeLegendData:['检测型', '服务型'],
toolTypeLegendData:[],
toolStatusData: [
{ value: 212, name: '已保存' },
/* { value: 212, name: '已保存' },
{ value: 76, name: '审批中' },
{ value: 32, name: '审批不通过' },
{ value: 971, name: '已发布' }
{ value: 971, name: '已发布' }*/
],
toolStatusLegendData: ['已保存','审批中','审批不通过','已发布'],
// toolStatusLegendData: ['已保存','审批中','审批不通过','已发布'],
toolStatusLegendData: [],
toolSourceData: [
{ value: 20, name: 'QQ' },
/*{ value: 20, name: 'QQ' },
{ value: 60, name: '微信' },
{ value: 18, name: '官网' },
{ value: 47, name: '熟人介绍' }
{ value: 47, name: '熟人介绍' }*/
],
toolSourceLegendData: ['QQ', '微信', '官网', '熟人介绍'],
// toolSourceLegendData: ['QQ', '微信', '官网', '熟人介绍'],
toolSourceLegendData: [],
// 日期范围
dateRange: [],
toolDownStatList: [],
@@ -174,12 +181,11 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
mesContent: ''
},
queryParams1: {
pageNum: 1,
pageSize: 10,
mesContent: ''
toolId: ''
},
// 工具下载统计详情组件控制属性
detailDrawerOpen: false,
@@ -188,10 +194,12 @@ export default {
// 工具名称
toolName: '',
total: 0,
loading: false
loading: false,
isPieChart: false,
}
},
created () {
this.getCountData()
this.getToolDownStatistics()
},
methods: {
@@ -199,16 +207,19 @@ export default {
this.getToolDownDetailStatistics()
},
getToolDownDetailStatistics() {
let self = this
this.loading = true
getToolDownDetailStatistics({ ...this.detailQueryParams, toolId: this.toolId }).then(response => {
this.total = response?.total
this.toolDownDetailStatList = response?.rows || []
this.loading = false
}).catch(() => { this.loading = false });
userDownList(this.addDateRange(this.queryParams1)).then(res => {
console.info("res=========", res)
self.total = res?.total
self.toolDownDetailStatList = res?.rows || []
self.loading = false
}).catch(() => { self.loading = false });
},
// 工具下载重置查询
reset() {
this.toolDownStatList = []
this.dateRange = []
this.resetForm("queryForm")
this.handleQuery()
},
@@ -223,18 +234,65 @@ export default {
* 获取工具下载列表数据
*/
getToolDownStatistics() {
let self = this
this.downLoading = true
getToolDownStat(this.queryParams).then(response => {
this.downTotal = response?.total
this.toolDownStatList = response?.rows || []
this.downLoading = false
}).catch(() => { this.downLoading = false });
listCount(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
console.info("res=========", res)
self.total = res?.total
self.toolDownStatList = res?.rows || []
self.downLoading = false
}).catch(() => { self.downLoading = false });
},
handleDetail(row){
this.toolId = row.id
this.toolName = row.toolName
this.$set(this.queryParams1, "toolId", row.toolId)
this.detailDrawerOpen = true
},
/** 统计类型、类别、状态**/
getCountData(){
let self = this
self.toolTypeData = []
self.toolTypeLegendData = []
self.toolStatusData = []
self.toolStatusLegendData = []
self.toolSourceData = []
self.toolSourceLegendData = []
self.pageloading = true
getStatistics(this.queryParams).then(res => {
console.info("res===========", res)
if(res.data){
//类别
self.toolTypeData = JSON.parse(JSON.stringify(res.data.countToolType))
self.toolTypeData.forEach(item => {
self.toolTypeLegendData.push(item.name)
})
//状态
self.toolStatusData = JSON.parse(JSON.stringify(res.data.recordStatus))
self.toolStatusData.forEach(item => {
self.toolStatusLegendData.push(item.name)
})
//来源
self.toolSourceData = JSON.parse(JSON.stringify(res.data.toolSource))
self.toolSourceData.forEach(item => {
self.toolSourceLegendData.push(item.name)
})
self.isPieChart= true
self.pageloading= false
}
/* console.info("countToolType==============", this.dict.type.tool_type)
console.info("res===========", res)*/
}).catch((err) => {
self.isPieChart= true
self.pageloading= false
console.error(err)
});
}
}
}
</script>