|
@@ -35,12 +35,12 @@
|
|
|
:claStuNum="claStuNum"
|
|
|
:year="year"
|
|
|
:radarData="radarData"
|
|
|
- :key="radarData.toString()"
|
|
|
></fieldMap>
|
|
|
+ <!-- :key="radarData.toString()" -->
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="noData" v-if="!chartData.length">
|
|
|
- 暂未评分
|
|
|
+ <div class="noData" v-if="!chartData.length && !chartDataShow">
|
|
|
+ 暂未评分
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -76,6 +76,8 @@ export default {
|
|
|
classAvaScoreData: [],
|
|
|
// 雷达图数据
|
|
|
chartData: [], //数据
|
|
|
+ chartDataShow: 0, //数据
|
|
|
+
|
|
|
categories: [], //标签 雷达图与平均分共用
|
|
|
value: '',
|
|
|
VeidooList: [], //大分类
|
|
@@ -88,8 +90,8 @@ export default {
|
|
|
year: '',
|
|
|
// userid: '698ab9e3-4017-11ee-91d8-005056b86db5',
|
|
|
userid: '',
|
|
|
- oid: '',
|
|
|
- org: '',
|
|
|
+ oid: '', //学校id
|
|
|
+ org: '', //组织id
|
|
|
cid: ''
|
|
|
}
|
|
|
},
|
|
@@ -98,7 +100,7 @@ export default {
|
|
|
selTerm() {
|
|
|
this.termList = []
|
|
|
selectTerm().then(res => {
|
|
|
- console.log('获取学期筛选框', res[0])
|
|
|
+ // console.log('获取学期筛选框', res[0])
|
|
|
res[0].forEach(e => {
|
|
|
if (e.defaultC === 1) {
|
|
|
this.termData = e.id
|
|
@@ -116,6 +118,7 @@ export default {
|
|
|
},
|
|
|
// 获取打分数据
|
|
|
getData() {
|
|
|
+ this.chartDataShow = 1
|
|
|
this.chartData = [] //数据
|
|
|
this.categories = [] //标签 雷达图与平均分共用
|
|
|
|
|
@@ -123,10 +126,10 @@ export default {
|
|
|
uid: this.userid,
|
|
|
year: this.year
|
|
|
}
|
|
|
- console.log('params', params)
|
|
|
+ // console.log('params', params)
|
|
|
selectMapStuScore(params).then(res => {
|
|
|
// console.log('获取打分数据', res)
|
|
|
- if (!res[0].length) return (this.radarData = [])
|
|
|
+ if (!res[0].length) return (this.radarData = {},this.chartDataShow = 0)
|
|
|
let data = res[0][0]
|
|
|
this.radarData = JSON.parse(data.json)
|
|
|
this.getVeidooType()
|
|
@@ -138,20 +141,6 @@ export default {
|
|
|
}
|
|
|
selectStudentDetail(stuData).then(res => {
|
|
|
this.studentInfo = res[0][0]
|
|
|
- console.log('获取学生信息', this.studentInfo)
|
|
|
-
|
|
|
- // // 获取班学生列表
|
|
|
- // const data2 = {
|
|
|
- // cid: this.studentInfo.classid,
|
|
|
- // uid: localStorage.getItem('userId')
|
|
|
- // }
|
|
|
- // // console.log('获取班学生列表', data2)
|
|
|
- // selectManyClassStudent(data2).then(res => {
|
|
|
- // this.studentList = res[0].filter(i => {
|
|
|
- // return i.id !== localStorage.getItem('userId')
|
|
|
- // })
|
|
|
- // console.log('班级同学列表', this.studentList)
|
|
|
- // })
|
|
|
})
|
|
|
},
|
|
|
//获取分类
|
|
@@ -222,7 +211,7 @@ export default {
|
|
|
})
|
|
|
// 数据分类底部标签
|
|
|
this.categories = aaa
|
|
|
- console.log(this.categories)
|
|
|
+ // console.log(this.categories)
|
|
|
// 处理数据数据
|
|
|
this.countRadar()
|
|
|
// console.log(222);
|
|
@@ -243,9 +232,12 @@ export default {
|
|
|
countRadar() {
|
|
|
// 分数数据并进行处理
|
|
|
// 个人平均分数据开始
|
|
|
+
|
|
|
+ // let raData = JSON.parse(JSON.stringify(this.radarData))
|
|
|
let raData = this.radarData
|
|
|
- console.log('raData', raData)
|
|
|
- console.log('this.VeidooList', this.VeidooList)
|
|
|
+
|
|
|
+ // console.log('raData', raData)
|
|
|
+ // console.log('this.VeidooList', this.VeidooList)
|
|
|
// 分数与分类是两个数组
|
|
|
// 将分数数据复制在大分类里面用child来存储
|
|
|
this.VeidooList.forEach(e => {
|
|
@@ -261,7 +253,7 @@ export default {
|
|
|
e.child2.push(i[i.id])
|
|
|
})
|
|
|
})
|
|
|
- console.log('iiiiiiiiiiiii')
|
|
|
+ // console.log('iiiiiiiiiiiii')
|
|
|
|
|
|
// 第三次提取,将每个小分类的数据进行相加再除以小分类的长度得到平均值,再将平均值存储在大分类的num中
|
|
|
|
|
@@ -293,7 +285,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- console.log(' this.classScoreData', this.classScoreData)
|
|
|
|
|
|
// 将学生每个大分类的平均分整合
|
|
|
this.classScoreData.forEach(i => {
|
|
@@ -331,7 +322,7 @@ export default {
|
|
|
this.classScoreData.forEach(i => {
|
|
|
ClaAvaArr.push(i.arr)
|
|
|
})
|
|
|
- // console.log(ClaAvaArr);
|
|
|
+ console.log('ClaAvaArr', ClaAvaArr)
|
|
|
|
|
|
let AvaArrItem = []
|
|
|
ClaAvaArr.forEach((i, index) => {
|
|
@@ -357,15 +348,18 @@ export default {
|
|
|
raDataCopy[2].push(e.num[2])
|
|
|
})
|
|
|
this.chartData = raDataCopy
|
|
|
+ // this.chartDataShow = 0
|
|
|
|
|
|
- console.log('raDataCopy', raDataCopy)
|
|
|
+ // console.log('raDataCopy', raDataCopy)
|
|
|
},
|
|
|
// 获取班级平均
|
|
|
getClassAva() {
|
|
|
- ;(this.claStuNum = 0),
|
|
|
- // 班级分数数据
|
|
|
- // this.classScoreData= []
|
|
|
- (this.classScoreData = []) //数据
|
|
|
+ this.chartDataShow = 1
|
|
|
+
|
|
|
+ this.claStuNum = 0
|
|
|
+ // 班级分数数据
|
|
|
+ // this.classScoreData= []
|
|
|
+ this.classScoreData = [] //数据
|
|
|
let params = {
|
|
|
cid: this.cid,
|
|
|
trm: this.year
|
|
@@ -377,7 +371,7 @@ export default {
|
|
|
AvaData.forEach((item, index) => {
|
|
|
this.classScoreData.push(JSON.parse(item.json))
|
|
|
})
|
|
|
- // console.log('this.classScoreData',JSON.parse(JSON.stringify(this.classScoreData)) );
|
|
|
+ // console.log('this.classScoreData',this.classScoreData);
|
|
|
// 第一次渲染,要放在这里,不然没有办法循环班级平均数
|
|
|
this.getData()
|
|
|
|
|
@@ -399,7 +393,7 @@ export default {
|
|
|
let k = [this.croColumnarData, this.classAvaScoreData]
|
|
|
|
|
|
this.croColumnarData = k
|
|
|
- console.log('this.croColumnarData', this.croColumnarData)
|
|
|
+ // console.log('this.croColumnarData', this.croColumnarData)
|
|
|
},
|
|
|
// 数组相加
|
|
|
addArrays(array1, array2) {
|