|
@@ -3,6 +3,10 @@
|
|
|
<vuescroll ref="art-dasboard">
|
|
|
<Loading v-show="isLoading"></Loading>
|
|
|
<back-to-top @on-to-top="backToTop"></back-to-top>
|
|
|
+ <div class="export-box" @click="exportArtTable">
|
|
|
+ <span class="icon iconfont icon-download" style="margin-right:5px;margin-top: 5px;" :title="`下载艺术评测数据表`"></span>
|
|
|
+ <span>下载数据总表</span>
|
|
|
+ </div>
|
|
|
<div class="tab-box" style="padding:0px 20px 5px 20px;">
|
|
|
<span class="pane" v-for="item in periodList" style="line-height:30px;padding:2px;" @click="tabClick(item.value)" :class="{ active: periodId === item.value }">
|
|
|
{{item.label}}
|
|
@@ -126,6 +130,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import excel from '@/utils/excel.js'
|
|
|
import Overall from './echart/Overall.vue'
|
|
|
import KngLevel from './echart/KngLevel.vue'
|
|
|
import KngPoint from './echart/KngPoint.vue'
|
|
@@ -159,6 +164,7 @@ export default {
|
|
|
curPeriodData() {
|
|
|
let data = {}
|
|
|
data.areaSchool = this.allData.areaSchool || {}
|
|
|
+ data.periodAll = this.allData.periodAll || {}
|
|
|
data.overall = this.allData.periodAll?.subject || []
|
|
|
data.knData = this.allData.allBlock?.sub || []
|
|
|
data.examData = this.allData.periodAll?.schoolScore || []
|
|
@@ -168,12 +174,20 @@ export default {
|
|
|
// 头部统计数据
|
|
|
topData() {
|
|
|
let { scCount, classCount, stuCount, subjectCount } = this.curPeriodData.areaSchool
|
|
|
+ let joinCount = this.curPeriodData.periodAll ? this.curPeriodData.periodAll.schoolScore?.length : 0
|
|
|
let topData = [
|
|
|
{
|
|
|
icon: 'md-cube',
|
|
|
color: '#2d8cf0',
|
|
|
number: scCount || 0,
|
|
|
- text: '学校数量',
|
|
|
+ text: '区域学校数',
|
|
|
+ type: 'num'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: 'md-cube',
|
|
|
+ color: '#6acd7f',
|
|
|
+ number: joinCount || 0,
|
|
|
+ text: '参与学校数',
|
|
|
type: 'num'
|
|
|
},
|
|
|
{
|
|
@@ -285,6 +299,124 @@ export default {
|
|
|
this.getAreaArtList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ exportArtTable(){
|
|
|
+ let sheets = []
|
|
|
+ // 区级概况
|
|
|
+ let areaHeaders = ['学校总数量', '参与学校数量', '班级数量','学科数量','学生人数','音乐最高分','音乐最低分','音乐平均分','音乐优秀率','音乐合格率', '美术最高分', '美术最低分', '美术平均分', '美术优秀率', '美术合格率']
|
|
|
+ let areaKeys = ['scCount', 'scJoinCount', 'classCount','subjectCount','stuCount','m_max','m_min','m_average','m_excellent','m_pass','p_max','p_min','p_average','p_excellent','p_pass']
|
|
|
+ let mScore = this.allData.periodAll.subject.find(i => i.name === 'subject_music')
|
|
|
+ let pScore = this.allData.periodAll.subject.find(i => i.name === 'subject_painting')
|
|
|
+ let areaDatas = [
|
|
|
+ {
|
|
|
+ scCount: this.allData.areaSchool.scCount,
|
|
|
+ scJoinCount: this.allData.periodAll.schoolScore.length,
|
|
|
+ classCount: this.allData.areaSchool.classCount,
|
|
|
+ subjectCount: this.allData.areaSchool.subjectCount,
|
|
|
+ stuCount: this.allData.areaSchool.stuCount,
|
|
|
+ m_max: mScore.max,
|
|
|
+ m_min: mScore.min,
|
|
|
+ m_average: mScore.average,
|
|
|
+ m_excellent: parseInt(mScore.excellent * 100) + '%',
|
|
|
+ m_pass: parseInt(mScore.pass * 100) + '%',
|
|
|
+ p_max: pScore.max,
|
|
|
+ p_min: pScore.min,
|
|
|
+ p_average: pScore.average,
|
|
|
+ p_excellent: parseInt(pScore.excellent * 100) + '%',
|
|
|
+ p_pass: parseInt(pScore.pass * 100) + '%'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ const areaSheet = {
|
|
|
+ title: areaHeaders,
|
|
|
+ key: areaKeys,
|
|
|
+ data: areaDatas,
|
|
|
+ filename: '区级概况',
|
|
|
+ autoWidth: true
|
|
|
+ }
|
|
|
+ sheets.push(areaSheet)
|
|
|
+ // 各学校数据
|
|
|
+ let schoolHeaders = ['学校名称', '音乐最高分', '音乐平均分', '音乐优秀率', '音乐合格率', '美术最高分', '美术平均分', '美术优秀率', '美术合格率']
|
|
|
+ let schoolKeys = ['name', 'm_max','m_average','m_excellent','m_pass', 'p_max', 'p_average', 'p_excellent', 'p_pass']
|
|
|
+ let schoolDatas = []
|
|
|
+ this.allData.periodAll.schoolScore.forEach(school => {
|
|
|
+ let sch_music_score = school.scores.find(i => i.subjectId === 'subject_music')
|
|
|
+ let sch_paint_score = school.scores.find(i => i.subjectId === 'subject_painting')
|
|
|
+ schoolDatas.push({
|
|
|
+ name: school.name,
|
|
|
+ m_max: sch_music_score.max,
|
|
|
+ m_average: sch_music_score.average,
|
|
|
+ m_excellent: parseInt(sch_music_score.excellent * 100) + '%',
|
|
|
+ m_pass: parseInt(sch_music_score.pass * 100) + '%',
|
|
|
+ p_max: sch_paint_score.max,
|
|
|
+ p_average: sch_paint_score.average,
|
|
|
+ p_excellent: parseInt(sch_paint_score.excellent * 100) + '%',
|
|
|
+ p_pass: parseInt(sch_paint_score.pass * 100) + '%'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ const schSheet = {
|
|
|
+ title: schoolHeaders,
|
|
|
+ key: schoolKeys,
|
|
|
+ data: schoolDatas,
|
|
|
+ filename: '各学校测评详情',
|
|
|
+ autoWidth: true
|
|
|
+ }
|
|
|
+ sheets.push(schSheet)
|
|
|
+ // 音乐数据sheet
|
|
|
+ let m_knoHeaders = ['知识点名称', '知识块名称', '知识块配分', '知识块维度', '知识点得分率']
|
|
|
+ let m_knoKeys = ['pointName', 'blockName', 'blockScore', 'dim', 'pointScoreRate']
|
|
|
+ let m_knoDatas = []
|
|
|
+ let musicKnoItem = this.allData.allBlock.sub.find(i => i.key === 'subject_music')
|
|
|
+ musicKnoItem.sl.forEach(point => {
|
|
|
+ point.kno.forEach(block => {
|
|
|
+ m_knoDatas.push(
|
|
|
+ {
|
|
|
+ pointName: point.key,
|
|
|
+ blockName: block,
|
|
|
+ blockScore: musicKnoItem.blk.find(i => i.name === block).score,
|
|
|
+ dim: musicKnoItem.blk.find(i => i.name === block).dim[0],
|
|
|
+ pointScoreRate: parseInt(point.scores * 100) + '%'
|
|
|
+ }
|
|
|
+ )
|
|
|
+ })
|
|
|
+ })
|
|
|
+ const m_knoSheet = {
|
|
|
+ title: m_knoHeaders,
|
|
|
+ key: m_knoKeys,
|
|
|
+ data: m_knoDatas,
|
|
|
+ filename: '音乐知识点得分率',
|
|
|
+ autoWidth: true
|
|
|
+ }
|
|
|
+ sheets.push(m_knoSheet)
|
|
|
+ // 美术得分率sheet
|
|
|
+ let p_knoHeaders = ['知识点名称', '知识块名称', '知识块配分', '知识块维度', '知识点得分率']
|
|
|
+ let p_knoKeys = ['pointName', 'blockName', 'blockScore', 'dim', 'pointScoreRate']
|
|
|
+ let p_knoDatas = []
|
|
|
+ let paintKnoItem = this.allData.allBlock.sub.find(i => i.key === 'subject_painting')
|
|
|
+ paintKnoItem.sl.forEach(point => {
|
|
|
+ point.kno.forEach(block => {
|
|
|
+ p_knoDatas.push(
|
|
|
+ {
|
|
|
+ pointName: point.key,
|
|
|
+ blockName: block,
|
|
|
+ blockScore: paintKnoItem.blk.find(i => i.name === block).score,
|
|
|
+ dim: paintKnoItem.blk.find(i => i.name === block).dim[0],
|
|
|
+ pointScoreRate: parseInt(point.scores * 100) + '%'
|
|
|
+ }
|
|
|
+ )
|
|
|
+ })
|
|
|
+ })
|
|
|
+ const p_knoSheet = {
|
|
|
+ title: p_knoHeaders,
|
|
|
+ key: p_knoKeys,
|
|
|
+ data: p_knoDatas,
|
|
|
+ filename: '美术知识点得分率',
|
|
|
+ autoWidth: true
|
|
|
+ }
|
|
|
+ sheets.push(p_knoSheet)
|
|
|
+ console.log(this.periodList);
|
|
|
+ console.log(this.periodId);
|
|
|
+ let curPeriodName = this.periodList.find(i => i.value === this.periodId).label
|
|
|
+ excel.export_array_to_sheet(sheets, `${sessionStorage.getItem('areaName')} - 艺术评测报告(${ curPeriodName })`)
|
|
|
+ },
|
|
|
getAreaArtList() {
|
|
|
this.$api.areaArt.findAreaArtList({
|
|
|
id: sessionStorage.getItem('areaId'),
|
|
@@ -548,7 +680,7 @@ export default {
|
|
|
border-radius: 4px;
|
|
|
}
|
|
|
.content-con-item {
|
|
|
- width: 23%;
|
|
|
+ width: 18%;
|
|
|
height: 110px;
|
|
|
position: relative;
|
|
|
border-radius: 2px;
|
|
@@ -582,9 +714,17 @@ export default {
|
|
|
padding: 0px 20px 0px 20px;
|
|
|
}
|
|
|
.area-data-container {
|
|
|
+ position: relative;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
background: #ededed;
|
|
|
+
|
|
|
+ .export-box{
|
|
|
+ position: absolute;
|
|
|
+ right: 20px;
|
|
|
+ top: 20px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|
|
|
<style lang="less">
|