This commit is contained in:
yanran200730
2023-02-17 13:55:35 +08:00
parent 1e5085f4cc
commit dd0c6cf1ef
2 changed files with 26 additions and 24 deletions

View File

@@ -92,7 +92,7 @@
colConfigs: [ colConfigs: [
{ prop: 'examinationName', label: '考试名称', align: 'left' }, { prop: 'examinationName', label: '考试名称', align: 'left' },
{ prop: 'allSubjectNumber', label: '试题总数', align: 'center' }, { prop: 'allSubjectNumber', label: '试题总数', align: 'center' },
{ prop: 'beginTime', label: '通过分数', align: 'center' }, { prop: 'passScore', label: '通过分数', align: 'center' },
{ prop: 'status', label: '状态', align: 'center', format: v => this.dict.getLabel('qjEIStatus', v) }, { prop: 'status', label: '状态', align: 'center', format: v => this.dict.getLabel('qjEIStatus', v) },
{ prop: 'examinationNumber', label: '考试人数', align: 'center' }, { prop: 'examinationNumber', label: '考试人数', align: 'center' },
{ prop: 'passNumber', label: '通过人数', align: 'center' } { prop: 'passNumber', label: '通过人数', align: 'center' }

View File

@@ -139,7 +139,7 @@
</ai-card> </ai-card>
<ai-card class="resident" title="居民统计"> <ai-card class="resident" title="居民统计">
<template #right> <template #right>
<el-radio-group v-model="search4.dateRange" size="small" @change="getStatisticsHot"> <el-radio-group v-model="search4.dateRange" size="small" @change="search4.date = [], getStatisticsHot">
<el-radio-button label="0" >今天</el-radio-button> <el-radio-button label="0" >今天</el-radio-button>
<el-radio-button label="1">本周</el-radio-button> <el-radio-button label="1">本周</el-radio-button>
<el-radio-button label="2">本月</el-radio-button> <el-radio-button label="2">本月</el-radio-button>
@@ -148,7 +148,7 @@
style="width: 240px" style="width: 240px"
v-model="search4.date" v-model="search4.date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
@change="getStatisticsHot" @change="search4.dateRange = '', getStatisticsHot()"
type="daterange" type="daterange"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
@@ -166,6 +166,7 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import * as echarts from 'echarts'
export default { export default {
name: 'AppLearningStatistics', name: 'AppLearningStatistics',
label: '学习统计', label: '学习统计',
@@ -213,7 +214,8 @@
], ],
tableData1: [], tableData1: [],
tableData2: [], tableData2: [],
statisticsKeyData: {} statisticsKeyData: {},
statisticsUse: {}
} }
}, },
@@ -225,6 +227,7 @@
this.search1.areaId = this.user.info.areaId this.search1.areaId = this.user.info.areaId
this.getStatisticsKeyData() this.getStatisticsKeyData()
this.getStatisticsHot() this.getStatisticsHot()
this.getStatisticsUse()
}, },
methods: { methods: {
@@ -242,6 +245,20 @@
}) })
}, },
getStatisticsUse () {
this.instance.post(`/app/appwechatuserqujing/statisticsUse`, null, {
params: {
...this.search4,
beginDate: this.search4.date[0],
endDate: this.search4.date[1]
}
}).then(res => {
if (res.code == 0) {
res.data.length && this.initPieChart(res.data[0])
}
})
},
getStatisticsHot () { getStatisticsHot () {
this.instance.post(`/app/appexaminationinfo/statisticsHot`, null, { this.instance.post(`/app/appexaminationinfo/statisticsHot`, null, {
params: { params: {
@@ -268,31 +285,16 @@
tooltip: {}, tooltip: {},
color: ['#2896FF', '#09DBFE', '#61FDB9', '#FFBB69', '#8429FF', '#ea7ccc'], color: ['#2896FF', '#09DBFE', '#61FDB9', '#FFBB69', '#8429FF', '#ea7ccc'],
legend: { legend: {
right: '5%', show: true
top: 'center',
orient: 'vertical',
formatter: function(name) {
let data = option.series[0].data
let total = 0
let tarValue = 0
for (let i = 0, l = data.length; i < l; i++) {
total += data[i].value
if (data[i].name == name) {
tarValue = data[i].value
}
}
let p = total === 0 ? 0 : (tarValue / total * 100).toFixed(2)
return name + '' + tarValue + ' ' + p + '%'
}
}, },
series: [ series: [
{ {
type: 'pie', type: 'pie',
radius: '50%', radius: '50%',
data: data.map(v => { data: Object.keys(data).map(v => {
return { return {
value: v.c, value: data[v],
name: v.status name: v
} }
}), }),
label : { label : {
@@ -344,7 +346,7 @@
} }
.resident { .resident {
width: 560px; width: 660px;
margin-left: 20px; margin-left: 20px;
} }
} }