Compare commits

..

No commits in common. "d068d4e71abbb7659214781ea35fe3b8f90e3f08" and "a853214741f865649ab8fcc1a80c8cddb2e66110" have entirely different histories.

2 changed files with 24 additions and 41 deletions

View File

@ -15,11 +15,11 @@ const chartRef = ref(null);
//
const dataList = ref([
{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,},
{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},
]);
//
@ -81,13 +81,10 @@ function initChart() {
}
//
const showEcharts =() => {
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 ++
}
})
useOverview.tableList.forEach(item => {
const index = dataList.value.findIndex(item1 => item1.rating === item.rating)
if(index !== -1)
dataList.value[index].value ++
})
}
watch(() => useOverview.tableList,() => {

View File

@ -1,7 +1,7 @@
<template>
<el-tabs :tab-position="tabPosition" style="height: 100%" class="demo-tabs" @tabChange="handelChange">
<template v-for="(item,index) in leftList" :key="index">
<el-tab-pane :label="item.label" style="text-align:left" stretch="true">
<el-tab-pane :label="item.label" style="text-align:left">
<template v-if="item.stuList.length > 0">
<template v-for="(stuItem,stuIndex) in item.stuList" :key="stuIndex">
<el-tag style="margin:5px 10px 0 0" type="primary">{{stuItem.studentname}}</el-tag>
@ -23,40 +23,29 @@ const useOverview = overviewStore()
const tabPosition = ref('left')
const leftList = ref([
{
label:'完美',
label:'',
stuList:[],
rating:1,
max:100,
min:100,
rating:1
},
{
label:'优',
label:'优-',
stuList:[],
rating:2,
max:99,
min:80,
rating:2
},
{
label:'良',
label:'良',
stuList:[],
rating:3,
max:79,
min:70,
rating:3
},
{
label:'及格',
label:'良-',
stuList:[],
rating:4,
max:69,
min:60,
rating:4
},
{
label:'不及格',
label:'',
stuList:[],
rating:5,
max:59,
min:0,
rating:5
},
])
//
@ -65,12 +54,9 @@ const handelChange = (item) => {
}
//
const showStudents = (index) => {
console.log(useOverview.tableList,'lef')
leftList.value[index].stuList = useOverview.tableList.filter(item => {
if(item.rating > 0){
if(leftList.value[index].min <= Number(item.scoingRate || 0) && Number(item.scoingRate || 0) <= leftList.value[index].max ){
return item
}
}
if(item.rating == leftList.value[index].rating) return item
})
}
watch(() => useOverview.tableList,() => {
@ -121,9 +107,9 @@ watch(() => useOverview.tableList,() => {
:deep(.el-tabs__item.is-active){
background-color: rgb(238, 241, 246);
}
:deep(.el-tabs--left .el-tabs__item.is-left, .el-tabs--right .el-tabs__item.is-left){
:deep(.el-tabs--left .el-tabs__item.is-left){
text-align: left;
justify-content: flex-start !important;
justify-content: flex-start;
}
</style>