diff --git a/src/renderer/src/views/classTask/container/classOverview/distribution/echarts.vue b/src/renderer/src/views/classTask/container/classOverview/distribution/echarts.vue index 9f6ae08..d139c2f 100644 --- a/src/renderer/src/views/classTask/container/classOverview/distribution/echarts.vue +++ b/src/renderer/src/views/classTask/container/classOverview/distribution/echarts.vue @@ -15,11 +15,11 @@ const chartRef = ref(null); // 数据源 const dataList = ref([ - {name: '优', value: 0,rating:1}, - {name: '优-', value: 0,rating:2}, - {name: '良', value: 0,rating:3}, - {name: '良-', value: 0,rating:4}, - {name: '差', value: 0,rating:5}, + {name: '完美', value: 0,rating:1,max:100,min:100,}, + {name: '优秀', value: 0,rating:2,max:99,min:80,}, + {name: '良好', value: 0,rating:3,max:79,min:70,}, + {name: '及格', value: 0,rating:4,max:69,min:60,}, + {name: '不及格', value: 0,rating:5,max:59,min:0,}, ]); // 根据数据生成不同的颜色 @@ -81,10 +81,13 @@ function initChart() { } // 获取表的数据 const showEcharts =() => { - useOverview.tableList.forEach(item => { - const index = dataList.value.findIndex(item1 => item1.rating === item.rating) - if(index !== -1) - dataList.value[index].value ++ + useOverview.tableList.forEach((item,index) => { + if(item.rating === 0) return // 没批改不计数 + dataList.value.forEach((item1,index1) => { + if(item1.min <= Number(item.scoingRate) && Number(item.scoingRate) <= item1.max ){ + item1.value ++ + } + }) }) } watch(() => useOverview.tableList,() => { diff --git a/src/renderer/src/views/classTask/container/classOverview/distribution/stuList.vue b/src/renderer/src/views/classTask/container/classOverview/distribution/stuList.vue index df21f66..c1de098 100644 --- a/src/renderer/src/views/classTask/container/classOverview/distribution/stuList.vue +++ b/src/renderer/src/views/classTask/container/classOverview/distribution/stuList.vue @@ -1,7 +1,7 @@