This commit is contained in:
白了个白 2024-11-04 11:27:32 +08:00
commit 4be888e39e
7 changed files with 72 additions and 49 deletions

View File

@ -29,7 +29,11 @@
<div class="avatar-container"> <div class="avatar-container">
<div class="avatar-wrapper flex"> <div class="avatar-wrapper flex">
<el-dropdown class="right-menu-item hover-effect" @command="handleCommand"> <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> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item @click="changePage('/profile')">个人中心</el-dropdown-item> <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 logoIco from '@/assets/images/logo.png'
import { listEvaluation } from '@/api/classManage/index' import { listEvaluation } from '@/api/classManage/index'
import { sessionStore } from '@/utils/store' import { sessionStore } from '@/utils/store'
import defaultUserImg from '@/assets/images/img-avatar.png'
// import Chat from '@/utils/chat' // im // import Chat from '@/utils/chat' // im
// if (!Chat.imChat) Chat.init() // if (!Chat.imChat) Chat.init()

View File

@ -242,7 +242,7 @@ const initData = () => {
} }
// def: type active: points: , accSum // 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 if (data.length === 0) return
useOverview.getAllData([...data]) useOverview.getAllData([...data])

View File

@ -27,7 +27,9 @@ const tableData = ref([])
const konwledge = ref([]) const konwledge = ref([])
const hasStudents = ref([]) const hasStudents = ref([])
// //
const allScore = ref([]) const allScore = ref(0)
//
const avatarScore = ref()
// //
const getKonwledge = () => { const getKonwledge = () => {
const getScoreRate = [] const getScoreRate = []
@ -41,7 +43,7 @@ const getKonwledge = () => {
if(!ledges.includes(title.id)){ if(!ledges.includes(title.id)){
ledges.push(title.id) ledges.push(title.id)
// 0 // 0
konwledge.value.push({title:title.title,allPoint:allScore.value,id:title.id}) konwledge.value.push({title:title.title,allPoint:allScore.value,id:title.id,point:avatarScore.value})
} }
// //
if(useOverview.allData[0].hasAnswers.includes(item.studentid)) if(useOverview.allData[0].hasAnswers.includes(item.studentid))
@ -51,29 +53,12 @@ const getKonwledge = () => {
// //
konwledge.value.forEach(item => { konwledge.value.forEach(item => {
let sunRate = 0
let num = 0
if(getScoreRate.length === 0) return
getScoreRate.forEach(item2 => {
if(item.id === item2.id){
sunRate += extractedNumber(item2.rate)
num ++
}
})
const scoreRate = sunRate / num
tableData.value.push({ tableData.value.push({
scoingRate:scoreRate.toFixed(2), scoingRate:(item.point / item.allPoint * 100).toFixed(2),
...item, ...item,
point:(item.allPoint * scoreRate / 100).toFixed(2)
}) })
}) })
} }
//
const extractedNumber = (score) => {
const match = score.match(/\d+/);
return match ? parseInt(match[0], 10) : null;
}
//tableList //tableList
watch(() => useOverview.tableList,() => { watch(() => useOverview.tableList,() => {
@ -93,6 +78,12 @@ watch(() => useOverview.tableList,() => {
allScore.value = useOverview.allData.reduce((acc, cur) => { allScore.value = useOverview.allData.reduce((acc, cur) => {
return acc + Number(cur.score) return acc + Number(cur.score)
},0) },0)
//
avatarScore.value = hasStudents.value.reduce((acc, cur) => {
return acc + Number(cur.getScore)
},0) / hasStudents.value.length
//
getKonwledge() getKonwledge()
}) })
</script> </script>

View File

@ -161,7 +161,7 @@ const getData = async (data) => {
const params = { const params = {
eid: curNode.value.id, eid: curNode.value.id,
workgroup: '1', workgroup: '1',
worktype: '不限', worktype: '999', // 使
workTypeId: '0', workTypeId: '0',
edusubject: curNode.value.edusubject, edusubject: curNode.value.edusubject,
edustage: curNode.value.edustage, edustage: curNode.value.edustage,

View File

@ -129,7 +129,7 @@ const sendHomework = (row,type) => {
} }
// //
const closeHomework = async() => { const closeHomework = async() => {
ipcMsgSend('tool-sphere:set:ignore', true) // ipcMsgSend('tool-sphere:set:ignore', true)
} }

View File

@ -34,7 +34,7 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { computed, defineProps, ref, reactive, watchEffect, onMounted } from 'vue' import { computed, defineProps, ref, reactive, watchEffect, onMounted} from 'vue'
import { sessionStore } from '@/utils/store' import { sessionStore } from '@/utils/store'
import homework from './homework.vue'; import homework from './homework.vue';
@ -49,7 +49,7 @@ const props = defineProps({
data: { // data: { //
type: Array, type: Array,
default: () => [ default: () => [
{ label: '课件', prop: 'book', isExtra: true, icon: 'icon--kejian' }, { label: '资源', prop: 'book', isExtra: true, icon: 'icon--kejian' },
{ label: '活动', prop: 'resource', icon: 'icon-kechengziyuan1' }, { label: '活动', prop: 'resource', icon: 'icon-kechengziyuan1' },
// { label: '', prop: 'interact', icon: 'icon-hudong' }, // { label: '', prop: 'interact', icon: 'icon-hudong' },
// { label: '', prop: 'win', icon: 'icon-tubiaozhizuomobanyihuifu-' }, // { label: '', prop: 'win', icon: 'icon-tubiaozhizuomobanyihuifu-' },
@ -74,6 +74,7 @@ const list = computed(() => props.data.map((o,i) => {
onMounted(() => { onMounted(() => {
posBtnAll = btnRef.value.getBoundingClientRect() posBtnAll = btnRef.value.getBoundingClientRect()
hPost.value = Math.round(posBtnAll.height) hPost.value = Math.round(posBtnAll.height)
// btnRef.value.style.marginTop = -hPost.value / 2 + 'px'
curNode = sessionStore?.get?.('subject.curNode') curNode = sessionStore?.get?.('subject.curNode')
}) })
// === === // === ===
@ -100,10 +101,13 @@ const clickHandel = (o, e) => {
} }
emit('change', o) emit('change', o)
} }
const closeActive = () =>{ const closeActive = () =>{
isVisible.value = false if (isVisible.value) { //
isVisible.value = false
emit('change', { prop: 'close' })
}
} }
defineExpose({closeActive})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.warp{ .warp{
@ -111,11 +115,17 @@ const closeActive = () =>{
position: fixed; position: fixed;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
z-index: 1;
right: 10px; right: 10px;
//min-height: 40vh;
min-width: 4em; min-width: 4em;
border-radius: 4em; border-radius: 4em;
background-color: #121212; background-color: rgba(18,18,18,0.3);
border-color: rgba(1, 1, 1, 0.1);
&:hover{
opacity: 1;
background-color: rgba(18,18,18,1);
border-color: rgba(1, 1, 1, 1);
}
.el-space{margin: 20px 0 0;} .el-space{margin: 20px 0 0;}
.c-btn{ .c-btn{
color: #d9dce3; color: #d9dce3;

View File

@ -1,10 +1,12 @@
<template> <template>
<div class="warp-all"> <div class="warp-all">
<!-- 遮罩层 -->
<div class="mask" v-show="isMask" @click="maskChange(true)"></div>
<!-- 画板 --> <!-- 画板 -->
<board-vue v-model="tabActive" v-show="isShow" ref="boardVueRef"></board-vue> <board-vue v-model="tabActive" v-show="isShow" ref="boardVueRef"></board-vue>
<!-- 侧边工具栏 --> <!-- 侧边工具栏 -->
<side-vue v-ignore @ignore-mounted="sideMouse" @change="sideChange"></side-vue> <side-vue ref="sideVueRef" v-ignore @ignore-mounted="sideMouse" @change="sideChange"></side-vue>
<!-- 点赞组件 --> <!-- 点赞组件 -->
<upvote-vue ref="upvoteRef" type="2"></upvote-vue> <upvote-vue ref="upvoteRef" type="2"></upvote-vue>
@ -13,7 +15,7 @@
<im-chat ref="imChatRef" @change="chatChange" group /> <im-chat ref="imChatRef" @change="chatChange" group />
<!-- 底部工具栏 --> <!-- 底部工具栏 -->
<div class="tool-bottom-all" <!-- <div class="tool-bottom-all"
@mouseenter="mouseChange(0)" @mouseleave="mouseChange(1)"> @mouseenter="mouseChange(0)" @mouseleave="mouseChange(1)">
<div v-drag="{handle:'.tool-bottom-all', dragtime}" <div v-drag="{handle:'.tool-bottom-all', dragtime}"
@v-drag-start="dragtime = Date.now()"> @v-drag-start="dragtime = Date.now()">
@ -34,7 +36,7 @@
</el-segmented> </el-segmented>
</div> </div>
</transition> </transition>
</div> </div> -->
</div> </div>
</template> </template>
@ -62,11 +64,13 @@ const isDrag = ref(false) // 开始拖拽
const dragtime = ref(0) // - const dragtime = ref(0) // -
const isShow = ref(false) // - const isShow = ref(false) // -
const isOver = ref(false) // const isOver = ref(false) //
const isOpenBook = ref(false) const isOpenBook = ref(false) // pdf
const isMask = ref(false) //
const toolStore = useToolState() // const toolStore = useToolState() //
const boardVueRef=ref(null) // ref const boardVueRef=ref(null) // ref
const upvoteRef = ref(null) // ref const upvoteRef = ref(null) // ref
const imChatRef = ref(null) // im-chat ref const imChatRef = ref(null) // im-chat ref
const sideVueRef = ref(null) // ref
const classObj = reactive({ // const classObj = reactive({ //
id: route.query.reservId, // id id: route.query.reservId, // id
data: {} // data: {} //
@ -83,6 +87,8 @@ const btnList = [ // 工具栏按钮列表
// { label: '', value: 'focus', icon: 'icon-jujiao' }, // { label: '', value: 'focus', icon: 'icon-jujiao' },
// { label: '', value: 'more', icon: 'icon-xiazai9' }, // { label: '', value: 'more', icon: 'icon-xiazai9' },
] ]
let timingSide = null // -
// === === // === ===
onMounted(async() => { onMounted(async() => {
if (!electron) return // if (!electron) return //
@ -90,7 +96,6 @@ onMounted(async() => {
// window.test1 = toolStore // window.test1 = toolStore
getClassInfo() // ex3 getClassInfo() // ex3
resetStatus() // - resetStatus() // -
}) })
// ==== === // ==== ===
@ -140,7 +145,8 @@ const logoHandle = (e,t) => {
// -穿 // -穿
const mouseChange = (bool) => { const mouseChange = (bool) => {
let resBool = false let resBool = false
if (bool == 0) return setIgnore(resBool) // 穿 // console.log('mouseChange:', bool, resBool)
if (!bool) return setIgnore(resBool) // 穿
if (tabActive.value == 'select') resBool = !!bool if (tabActive.value == 'select') resBool = !!bool
else { else {
if (!isShow.value) resBool = !!bool if (!isShow.value) resBool = !!bool
@ -148,12 +154,10 @@ const mouseChange = (bool) => {
const isPdf = !resBool && toolStore.isPdfWin const isPdf = !resBool && toolStore.isPdfWin
if (isPdf) resBool = true if (isPdf) resBool = true
} }
console.log('mouseChange:', bool, resBool) // console.log('mouseChange:', bool, resBool)
setIgnore(resBool) setIgnore(resBool)
} }
const touchChange = (e) => {
console.log(e)
}
// im-chat: {type, data} // im-chat: {type, data}
const chatChange = (type, data, ...args) => { const chatChange = (type, data, ...args) => {
if (type == 'createGroup') { // - if (type == 'createGroup') { // -
@ -185,14 +189,6 @@ const setIgnore = (bool) => {ipcMsgSend('tool-sphere:set:ignore', bool)}
// : | // : |
const resetStatus = () => { const resetStatus = () => {
if (toolStore.isToolWin) return // - if (toolStore.isToolWin) return // -
// -
// ipcMain?.removeHandler('tool-sphere:reset') //
// ipcMain?.handle?.('tool-sphere:reset', () => {
// setTimeout(() => {
// boardVueRef.value.handleMode(tabActive.value)
// mouseChange(1)
// }, 500)
// })
toolStore.isToolWin = true // toolStore.isToolWin = true //
} }
// : // :
@ -202,7 +198,10 @@ const sideMouse = e => {
setIgnore(false) // -穿 setIgnore(false) // -穿
return return
} }
mouseChange(type == 'mouseleave') //
const bool = isMask.value && type =='mouseleave'
if (bool) mouseChange(false) // 穿
else mouseChange(type == 'mouseleave')
} }
// : // :
const sideChange = async o => { const sideChange = async o => {
@ -218,7 +217,11 @@ const sideChange = async o => {
isOpenBook.value = true isOpenBook.value = true
} }
break break
case 'close': //
maskChange(false)
break
case 'resource': // case 'resource': //
isMask.value = !isMask.value
break break
case 'interact': // case 'interact': //
break break
@ -255,6 +258,13 @@ const sideChange = async o => {
} }
} }
// -
const maskChange = (bool) => {
isMask.value = false
bool && sideVueRef.value.closeActive() //
mouseChange(true) // 穿
}
// === === // === ===
watchEffect(() => { watchEffect(() => {
if (isOver.value) return // , if (isOver.value) return // ,
@ -274,6 +284,12 @@ watchEffect(() => {
.warp-all{ .warp-all{
position: relative; position: relative;
} }
//
.mask{
position: fixed;
inset: 0;
background: rgba(1, 1, 1, 0.3);
}
// //
.tool-bottom-all{ .tool-bottom-all{
// width: 45vw; // width: 45vw;
@ -316,6 +332,7 @@ watchEffect(() => {
} }
} }
} }
//
.a-fade-leave-active,.a-fade-enter-active{ .a-fade-leave-active,.a-fade-enter-active{
transition: all .3s; transition: all .3s;
} }