This commit is contained in:
zdg 2024-10-31 20:16:03 +08:00
commit 674f98a53a
3 changed files with 9 additions and 7 deletions

View File

@ -29,7 +29,11 @@
<div class="avatar-container">
<div class="avatar-wrapper flex">
<el-dropdown class="right-menu-item hover-effect" @command="handleCommand">
<img :src="dev_api + userStore.user.avatar" class="user-avatar" style="float: left" />
<el-image :src="dev_api + userStore.user.avatar" class="user-avatar" style="float: left">
<template #error>
<el-image :src="defaultUserImg" class="user-avatar" style="float: left" />
</template>
</el-image>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="changePage('/profile')">个人中心</el-dropdown-item>
@ -80,6 +84,7 @@ import { updateUserInfo } from '@/api/system/user'
import logoIco from '@/assets/images/logo.png'
import { listEvaluation } from '@/api/classManage/index'
import { sessionStore } from '@/utils/store'
import defaultUserImg from '@/assets/images/img-avatar.png'
// import Chat from '@/utils/chat' // im
// if (!Chat.imChat) Chat.init()

View File

@ -242,7 +242,7 @@ const initData = () => {
}
// def: type active: points: , accSum
return { def: o, id: o.id, type: o.worktype, active: [], points, accSum, rightSum, children,hasAnswers,timeAnalyse,score:o.score }
return { def: o, id: o.id, type: o.worktype, active: [], points, accSum, rightSum, children,hasAnswers,timeAnalyse,score:o.workScore }
})
if (data.length === 0) return
useOverview.getAllData([...data])

View File

@ -79,12 +79,9 @@ watch(() => useOverview.tableList,() => {
return acc + Number(cur.score)
},0)
//
const studentList = useOverview.tableList.filter(item => useOverview.allData[0].hasAnswers.includes(item.studentid))
avatarScore.value = studentList.reduce((acc, cur) => {
avatarScore.value = hasStudents.value.reduce((acc, cur) => {
return acc + Number(cur.getScore)
},0) / studentList.length
console.log(avatarScore.value,'useOverview.tableList');
},0) / hasStudents.value.length
//
getKonwledge()