|
@@ -1,10 +1,12 @@
|
|
|
<template>
|
|
|
<div class="school-dash-container">
|
|
|
- <div class="schoolanalysebox" >
|
|
|
+ <div class="schoolanalysebox">
|
|
|
+ <Loading v-if="detailsLoding"></Loading>
|
|
|
<div class="school-analyse-header bgimg">
|
|
|
<div class="school-analyse-headersbox">
|
|
|
<div class="school-analyse-headersbox-name">
|
|
|
- <span>123456</span>
|
|
|
+ <img :src="schoolDeatils.picture"/>
|
|
|
+ <span>{{schoolDeatils.name}}</span>
|
|
|
</div>
|
|
|
<div class="school-analyse-headersbox-basics">
|
|
|
<div class="items-basics">
|
|
@@ -42,7 +44,7 @@
|
|
|
</div>
|
|
|
<div class="class-total">
|
|
|
<div class="class-box total-box total1" v-for="itemD in classroomsData.details" :key="itemD.id">
|
|
|
- <div class="classbox-num total-num">{{itemD.value}}</div>
|
|
|
+ <div class="classbox-num total-num">{{itemD.value}} <span v-show="itemD.id ===1" class="hours">H</span></div>
|
|
|
<div class="classbox-title total-title">{{itemD.name}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -131,7 +133,8 @@ export default {
|
|
|
data(){
|
|
|
return{
|
|
|
schoolDeatils:{
|
|
|
- name:'123456'
|
|
|
+ name:'',
|
|
|
+ picture:'',
|
|
|
},
|
|
|
anSchool:{
|
|
|
teachNum: 0,
|
|
@@ -145,7 +148,7 @@ export default {
|
|
|
classed: [],
|
|
|
activitys: [],
|
|
|
interacts: [],
|
|
|
- times: ['11','22'],
|
|
|
+ times: [],
|
|
|
},
|
|
|
classroomsData:{
|
|
|
attend: [
|
|
@@ -195,7 +198,7 @@ export default {
|
|
|
show: true,
|
|
|
type: 'shadow',
|
|
|
},
|
|
|
- data: ['1月','2月','3月','4月','5月',],
|
|
|
+ data: [],
|
|
|
},
|
|
|
],
|
|
|
yAxis: [
|
|
@@ -228,7 +231,7 @@ export default {
|
|
|
name: '课例',
|
|
|
type: 'bar',
|
|
|
barWidth: '20',
|
|
|
- data: [11,15,16,18,17],
|
|
|
+ data: [],
|
|
|
itemStyle: {
|
|
|
//lenged文本
|
|
|
opacity: 1,
|
|
@@ -286,7 +289,7 @@ export default {
|
|
|
show: true,
|
|
|
type: 'shadow',
|
|
|
},
|
|
|
- data: ['1月','2月','3月','4月','5月',],
|
|
|
+ data: [],
|
|
|
},
|
|
|
],
|
|
|
yAxis: [
|
|
@@ -320,7 +323,7 @@ export default {
|
|
|
name: '活动',
|
|
|
type: 'bar',
|
|
|
barWidth: '20',
|
|
|
- data: [11,15,16,14,18],
|
|
|
+ data: [],
|
|
|
itemStyle: {
|
|
|
//lenged文本
|
|
|
opacity: 1,
|
|
@@ -378,7 +381,7 @@ export default {
|
|
|
show: true,
|
|
|
type: 'shadow',
|
|
|
},
|
|
|
- data: ['1月','2月','3月','4月','5月',],
|
|
|
+ data: [],
|
|
|
},
|
|
|
],
|
|
|
yAxis: [
|
|
@@ -412,7 +415,7 @@ export default {
|
|
|
name: '互动',
|
|
|
type: 'bar',
|
|
|
barWidth: '20',
|
|
|
- data: [10,5,9,78,12],
|
|
|
+ data: [],
|
|
|
itemStyle: {
|
|
|
//lenged文本
|
|
|
opacity: 1,
|
|
@@ -464,8 +467,7 @@ export default {
|
|
|
},
|
|
|
legend: {
|
|
|
show: true,
|
|
|
- // data: this.anSchool.times,
|
|
|
- data:['1月','2月','3月','4月','5月'],
|
|
|
+ data:[],
|
|
|
textStyle: {
|
|
|
color: '#000',
|
|
|
},
|
|
@@ -474,7 +476,7 @@ export default {
|
|
|
},
|
|
|
xAxis: {
|
|
|
type: 'category',
|
|
|
- data:['1月','2月','3月','4月','5月'],
|
|
|
+ data:[],
|
|
|
boundaryGap: false,
|
|
|
},
|
|
|
yAxis: {
|
|
@@ -560,10 +562,12 @@ export default {
|
|
|
{
|
|
|
name: '科目占比',
|
|
|
type: 'pie',
|
|
|
- radius: '80%',
|
|
|
+ radius: ['35%', '75%'],
|
|
|
center: ['45%', '50%'],
|
|
|
itemStyle: {
|
|
|
- borderRadius: 2,
|
|
|
+ borderRadius: 25,
|
|
|
+ borderWidth:2,
|
|
|
+ borderColor:'#fff',
|
|
|
},
|
|
|
label: {
|
|
|
normal: {
|
|
@@ -576,18 +580,7 @@ export default {
|
|
|
],
|
|
|
},
|
|
|
},
|
|
|
- detailsGrade:[ {
|
|
|
- value: 0,
|
|
|
- name: '123',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 0,
|
|
|
- name: '456',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 0,
|
|
|
- name: '789',
|
|
|
- },],
|
|
|
+ detailsGrade:[],
|
|
|
detailsbasics:[
|
|
|
{
|
|
|
id: 1,
|
|
@@ -650,11 +643,143 @@ export default {
|
|
|
todayNum: 0,
|
|
|
},
|
|
|
],
|
|
|
+ detailsLoding:false,
|
|
|
}
|
|
|
},
|
|
|
+ created(){
|
|
|
+ this.init()
|
|
|
+ },
|
|
|
methods:{
|
|
|
detailsback(){
|
|
|
this.$router.push('/dashCenter')
|
|
|
+ },
|
|
|
+ init(){
|
|
|
+ let schoolCode=localStorage.cur_schoolCode
|
|
|
+ let data={schoolId:schoolCode}
|
|
|
+ this.detailsLoding=true
|
|
|
+ this.$api.schoolDashborad.schoolData(data).then((res)=>{
|
|
|
+ console.log(res,'school Back')
|
|
|
+ if(res.state == 200){
|
|
|
+ let {lessonStats,scStats,school}=res
|
|
|
+ //基础信息
|
|
|
+ this.schoolDeatils.name=school.name
|
|
|
+ this.schoolDeatils.picture=school.picture
|
|
|
+ this.anSchool.teachNum=scStats.tch
|
|
|
+ this.anSchool.studentNum=scStats.stu
|
|
|
+ this.anSchool.classNum=scStats.room
|
|
|
+ this.anSchool.classInfoNum=lessonStats.resourcesCount
|
|
|
+ //header data
|
|
|
+ this.classroomsData.attend[0].value=lessonStats.cnt
|
|
|
+ this.classroomsData.attend[1].value=lessonStats.dayCnt
|
|
|
+ this.classroomsData.attend[2].value=lessonStats.weekCnt
|
|
|
+ this.classroomsData.attend[3].value=lessonStats.monthCnt
|
|
|
+ this.classroomsData.attend[4].value=0
|
|
|
+
|
|
|
+ this.classroomsData.details[0].value=lessonStats.duration === 0 ? 0 : Number((lessonStats.duration / 60).toFixed(2))
|
|
|
+ this.classroomsData.details[1].value=lessonStats.attendCount
|
|
|
+ this.classroomsData.details[2].value=lessonStats.clientInteractionCount
|
|
|
+ this.classroomsData.details[3].value=lessonStats.workCount
|
|
|
+ this.classroomsData.details[4].value=lessonStats.interactionCount
|
|
|
+
|
|
|
+ //Bar data
|
|
|
+ //课例
|
|
|
+ scStats.lessStats.year.forEach((item) => {
|
|
|
+ this.anSchool.classed.push(item.cnt)
|
|
|
+ this.anSchool.class += item.cnt
|
|
|
+ //处理时间
|
|
|
+ this.anSchool.times.push(item.id)
|
|
|
+ })
|
|
|
+ //活动
|
|
|
+ scStats.actStats.year.forEach((item) => {
|
|
|
+ this.anSchool.activitys.push(item.cnt)
|
|
|
+ this.anSchool.activity += item.cnt
|
|
|
+ })
|
|
|
+ //互动
|
|
|
+ scStats.lessStats.yearInters.forEach((item) => {
|
|
|
+ this.anSchool.interacts.push(item.cnt)
|
|
|
+ this.anSchool.interact += item.cnt
|
|
|
+ })
|
|
|
+ this.detailsEchart.bar1.timeline.data = this.anSchool.times
|
|
|
+ this.detailsEchart.bar1.xAxis[0].data = this.anSchool.times
|
|
|
+ this.detailsEchart.bar1.series[0].data = this.anSchool.classed
|
|
|
+
|
|
|
+ this.detailsEchart.bar2.timeline.data = this.anSchool.times
|
|
|
+ this.detailsEchart.bar2.xAxis[0].data = this.anSchool.times
|
|
|
+ this.detailsEchart.bar2.series[0].data = this.anSchool.activitys
|
|
|
+
|
|
|
+ this.detailsEchart.bar3.timeline.data = this.anSchool.times
|
|
|
+ this.detailsEchart.bar3.xAxis[0].data = this.anSchool.times
|
|
|
+ this.detailsEchart.bar3.series[0].data = this.anSchool.interacts
|
|
|
+
|
|
|
+ //center data
|
|
|
+ //课例
|
|
|
+ this.detailsbasics[0].num=scStats.lessStats.all
|
|
|
+ this.detailsbasics[0].todayNum =scStats.lessStats.day
|
|
|
+ this.detailsbasics[0].subheadingNum =scStats.lessStats.lastDay === 0 && scStats.lessStats.day === 0 ? '0%' : scStats.lessStats.lastDay === 0 ? '100%' : ((scStats.lessStats.day - scStats.lessStats.lastDay) / scStats.lessStats.lastDay).toFixed(2) * 100 + '%'
|
|
|
+ this.detailsbasics[0].subheadNum = this.anSchool.classed[this.anSchool.classed.length - 2] === 0 && this.anSchool.classed[this.anSchool.classed.length - 1] === 0 ? '0%' : this.anSchool.classed[this.anSchool.classed.length - 2] === 0 ? '100%' : ((this.anSchool.classed[this.anSchool.classed.length - 1] - this.anSchool.classed[this.anSchool.classed.length - 2]) / this.anSchool.classed[this.anSchool.classed.length - 2] * 100).toFixed(2) + '%'
|
|
|
+ //活动
|
|
|
+ this.detailsbasics[1].num = scStats.actStats.all
|
|
|
+ this.detailsbasics[1].todayNum = scStats.actStats.dayCnt
|
|
|
+ this.detailsbasics[1].subheadingNum = scStats.actStats.lastDay === 0 && scStats.actStats.dayCnt === 0 ? '0%' : scStats.actStats.lastDay === 0 ? '100%' : ((scStats.actStats.dayCnt - scStats.actStats.lastDay) / scStats.actStats.lastDay).toFixed(2) * 100 + '%'
|
|
|
+ this.detailsbasics[1].subheadNum = this.anSchool.activitys[this.anSchool.activitys.length - 2] === 0 && this.anSchool.activitys[this.anSchool.activitys.length - 1] === 0 ? '0%' : this.anSchool.activitys[this.anSchool.activitys.length - 2] === 0 ? '100%' : ((this.anSchool.activitys[this.anSchool.activitys.length - 1] - this.anSchool.activitys[this.anSchool.activitys.length - 2]) / this.anSchool.activitys[this.anSchool.activitys.length - 2] * 100).toFixed(2) + '%'
|
|
|
+ //互动
|
|
|
+ let alls = scStats.lessStats.yearInters.reduce(function (total, currentValue) { ; return Number(total) + Number(currentValue.cnt) }, 0)
|
|
|
+ this.detailsbasics[2].num = alls
|
|
|
+ this.detailsbasics[2].todayNum = scStats.lessStats.dayInter
|
|
|
+ this.detailsbasics[2].subheadingNum = scStats.lessStats.lastDayInter === 0 && scStats.lessStats.dayInter === 0 ? '0%' : scStats.lessStats.lastDayInter === 0 ? '100%' : ((scStats.lessStats.dayInter - scStats.lessStats.lastDayInter) / scStats.lessStats.lastDayInter).toFixed(2) * 100 + '%'
|
|
|
+ this.detailsbasics[2].subheadNum = this.anSchool.interacts[this.anSchool.interacts.length - 2] === 0 && this.anSchool.interacts[this.anSchool.interacts.length - 1] === 0 ? '0%' : this.anSchool.interacts[this.anSchool.interacts.length - 2] === 0 ? '100%' : ((this.anSchool.interacts[this.anSchool.interacts.length - 1] - this.anSchool.interacts[this.anSchool.interacts.length - 2]) / this.anSchool.interacts[this.anSchool.interacts.length - 2] * 100).toFixed(2) + '%'
|
|
|
+ //总数据
|
|
|
+ let nowYear = scStats.lessStats.all + scStats.actStats.all
|
|
|
+ let lastYear = scStats.lessStats.lastYear + scStats.actStats.lastYear
|
|
|
+ this.detailsbasics[3].subheadNum = nowYear === 0 && lastYear === 0 ? '0%' : lastYear === 0 ? '100%' : (((nowYear - lastYear) / lastYear) * 100).toFixed(2) + '%'
|
|
|
+ let classedDatas = this.anSchool.classed; let activitysDatas = this.anSchool.activitys; let interactDatas = this.anSchool.interacts
|
|
|
+ let tataldata1 = classedDatas.map((index, item) => { return index + activitysDatas[item]; })
|
|
|
+ this.detailsEchart.line.legend.data=this.anSchool.times
|
|
|
+ this.detailsEchart.line.xAxis.data=this.anSchool.times
|
|
|
+ this.detailsEchart.line.series[0].data = tataldata1
|
|
|
+
|
|
|
+ //处理年纪占比
|
|
|
+ let Xdata = [];
|
|
|
+ if(lessonStats.gradeCnt.length >0){
|
|
|
+ lessonStats.gradeCnt.forEach((item)=>{
|
|
|
+ let nameNum = Number(item.name)
|
|
|
+ let stuId = item.periodId
|
|
|
+ let values = item.value
|
|
|
+ for(let y in school.period){
|
|
|
+ if(school.period[y].id === stuId){
|
|
|
+ let names=school.period[y].grades[nameNum]
|
|
|
+ Xdata.push({ name: names, value: values })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.detailsGrade = Xdata
|
|
|
+ }else{
|
|
|
+ this.detailsGrade=[]
|
|
|
+ }
|
|
|
+ //处理科目占比
|
|
|
+ let subjectData = []
|
|
|
+ if(lessonStats.subCnt.length >0){
|
|
|
+ lessonStats.subCnt.forEach((item)=>{
|
|
|
+ let nameId = item.name
|
|
|
+ let values = item.value
|
|
|
+ for(let i in school.period){
|
|
|
+ let phaseData = school.period[i].subjects
|
|
|
+ for (let a in phaseData) {
|
|
|
+ if (phaseData[a].id === nameId) {
|
|
|
+ subjectData.push({ name: phaseData[a].name, value: values })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.detailsEchart.subject.series[0].data = subjectData
|
|
|
+ }else{
|
|
|
+ this.detailsEchart.subject.series[0].data =[]
|
|
|
+ }
|
|
|
+ this.detailsLoding=false
|
|
|
+ }
|
|
|
+ }).catch((error)=>{
|
|
|
+ this.$Message.error(error)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -706,6 +831,9 @@ export default {
|
|
|
text-align: center;
|
|
|
margin-bottom: 2px;
|
|
|
margin-top: 2%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
}
|
|
|
.school-analyse-headersbox-basics {
|
|
|
width: 100%;
|
|
@@ -889,6 +1017,16 @@ export default {
|
|
|
color: #fff;
|
|
|
margin-right:5px;
|
|
|
}
|
|
|
+.hours{
|
|
|
+ font-size:20px;
|
|
|
+ color:#409EFF;
|
|
|
+ margin-left:2px;
|
|
|
+}
|
|
|
+.school-analyse-headersbox-name img{
|
|
|
+ width:55px;
|
|
|
+ height:55px;
|
|
|
+ margin-right:1%;
|
|
|
+}
|
|
|
.purples {
|
|
|
/* background: rgba(112, 103, 245, 0.3); */
|
|
|
background-image: linear-gradient(62deg, #8EC5FC 0%, #E0C3FC 100%);
|