Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk into baigl
This commit is contained in:
commit
4be888e39e
|
@ -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()
|
||||
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -27,7 +27,9 @@ const tableData = ref([])
|
|||
const konwledge = ref([])
|
||||
const hasStudents = ref([])
|
||||
// 获取的所有得分
|
||||
const allScore = ref([])
|
||||
const allScore = ref(0)
|
||||
// 平均分
|
||||
const avatarScore = ref()
|
||||
//所有题目的知识点
|
||||
const getKonwledge = () => {
|
||||
const getScoreRate = []
|
||||
|
@ -41,7 +43,7 @@ const getKonwledge = () => {
|
|||
if(!ledges.includes(title.id)){
|
||||
ledges.push(title.id)
|
||||
// 假如分数是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))
|
||||
|
@ -51,29 +53,12 @@ const getKonwledge = () => {
|
|||
|
||||
// 看看有几个知识点
|
||||
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({
|
||||
scoingRate:scoreRate.toFixed(2),
|
||||
scoingRate:(item.point / item.allPoint * 100).toFixed(2),
|
||||
...item,
|
||||
point:(item.allPoint * scoreRate / 100).toFixed(2)
|
||||
})
|
||||
})
|
||||
}
|
||||
// 获取百分比的数字
|
||||
const extractedNumber = (score) => {
|
||||
const match = score.match(/\d+/);
|
||||
return match ? parseInt(match[0], 10) : null;
|
||||
}
|
||||
//组装tableList表格
|
||||
|
||||
watch(() => useOverview.tableList,() => {
|
||||
|
@ -93,6 +78,12 @@ watch(() => useOverview.tableList,() => {
|
|||
allScore.value = useOverview.allData.reduce((acc, cur) => {
|
||||
return acc + Number(cur.score)
|
||||
},0)
|
||||
// 平均分
|
||||
avatarScore.value = hasStudents.value.reduce((acc, cur) => {
|
||||
return acc + Number(cur.getScore)
|
||||
},0) / hasStudents.value.length
|
||||
|
||||
// 计算得分率
|
||||
getKonwledge()
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -161,7 +161,7 @@ const getData = async (data) => {
|
|||
const params = {
|
||||
eid: curNode.value.id,
|
||||
workgroup: '1',
|
||||
worktype: '不限',
|
||||
worktype: '999', // 这里需要传自定义不存在的字段,以使本地查询不到数据从而触发查询第三方
|
||||
workTypeId: '0',
|
||||
edusubject: curNode.value.edusubject,
|
||||
edustage: curNode.value.edustage,
|
||||
|
|
|
@ -129,7 +129,7 @@ const sendHomework = (row,type) => {
|
|||
}
|
||||
//
|
||||
const closeHomework = async() => {
|
||||
ipcMsgSend('tool-sphere:set:ignore', true)
|
||||
// ipcMsgSend('tool-sphere:set:ignore', true)
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<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 homework from './homework.vue';
|
||||
|
||||
|
@ -49,7 +49,7 @@ const props = defineProps({
|
|||
data: { // 数据
|
||||
type: Array,
|
||||
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: 'interact', icon: 'icon-hudong' },
|
||||
// { label: '窗口', prop: 'win', icon: 'icon-tubiaozhizuomobanyihuifu-' },
|
||||
|
@ -74,6 +74,7 @@ const list = computed(() => props.data.map((o,i) => {
|
|||
onMounted(() => {
|
||||
posBtnAll = btnRef.value.getBoundingClientRect()
|
||||
hPost.value = Math.round(posBtnAll.height)
|
||||
// btnRef.value.style.marginTop = -hPost.value / 2 + 'px'
|
||||
curNode = sessionStore?.get?.('subject.curNode')
|
||||
})
|
||||
// === 方法 ===
|
||||
|
@ -100,10 +101,13 @@ const clickHandel = (o, e) => {
|
|||
}
|
||||
emit('change', o)
|
||||
}
|
||||
|
||||
const closeActive = () =>{
|
||||
if (isVisible.value) { // 打开状态,关闭
|
||||
isVisible.value = false
|
||||
emit('change', { prop: 'close' })
|
||||
}
|
||||
}
|
||||
defineExpose({closeActive})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.warp{
|
||||
|
@ -111,11 +115,17 @@ const closeActive = () =>{
|
|||
position: fixed;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 1;
|
||||
right: 10px;
|
||||
//min-height: 40vh;
|
||||
min-width: 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;}
|
||||
.c-btn{
|
||||
color: #d9dce3;
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
<template>
|
||||
<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>
|
||||
|
||||
<!-- 侧边工具栏 -->
|
||||
<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>
|
||||
|
@ -13,7 +15,7 @@
|
|||
<im-chat ref="imChatRef" @change="chatChange" group />
|
||||
|
||||
<!-- 底部工具栏 -->
|
||||
<div class="tool-bottom-all"
|
||||
<!-- <div class="tool-bottom-all"
|
||||
@mouseenter="mouseChange(0)" @mouseleave="mouseChange(1)">
|
||||
<div v-drag="{handle:'.tool-bottom-all', dragtime}"
|
||||
@v-drag-start="dragtime = Date.now()">
|
||||
|
@ -34,7 +36,7 @@
|
|||
</el-segmented>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -62,11 +64,13 @@ const isDrag = ref(false) // 开始拖拽
|
|||
const dragtime = ref(0) // 拖拽时间-计算点击还是拖动
|
||||
const isShow = ref(false) // 是否显示-画板
|
||||
const isOver = ref(false) // 是否下课
|
||||
const isOpenBook = ref(false)
|
||||
const isOpenBook = ref(false) // 是否打开pdf课本
|
||||
const isMask = ref(false) // 是否显示遮罩层
|
||||
const toolStore = useToolState() // 状态管理
|
||||
const boardVueRef=ref(null) // 画板ref
|
||||
const upvoteRef = ref(null) // 点赞 ref
|
||||
const imChatRef = ref(null) // im-chat ref
|
||||
const sideVueRef = ref(null) // 侧边栏 ref
|
||||
const classObj = reactive({ // 课程相关
|
||||
id: route.query.reservId, // 课程id
|
||||
data: {} // 课程信息
|
||||
|
@ -83,6 +87,8 @@ const btnList = [ // 工具栏按钮列表
|
|||
// { label: '聚焦', value: 'focus', icon: 'icon-jujiao' },
|
||||
// { label: '更多', value: 'more', icon: 'icon-xiazai9' },
|
||||
]
|
||||
let timingSide = null // 计时器-侧边栏
|
||||
|
||||
// === 页面加载完毕 ===
|
||||
onMounted(async() => {
|
||||
if (!electron) return // 浏览器端
|
||||
|
@ -90,7 +96,6 @@ onMounted(async() => {
|
|||
// window.test1 = toolStore
|
||||
getClassInfo() // 获取课堂详情 ex3
|
||||
resetStatus() // 开启重置状态-监听
|
||||
|
||||
})
|
||||
|
||||
// ==== 方法 ===
|
||||
|
@ -140,7 +145,8 @@ const logoHandle = (e,t) => {
|
|||
// 底部工具栏:移入移出-是否穿透
|
||||
const mouseChange = (bool) => {
|
||||
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
|
||||
else {
|
||||
if (!isShow.value) resBool = !!bool
|
||||
|
@ -148,12 +154,10 @@ const mouseChange = (bool) => {
|
|||
const isPdf = !resBool && toolStore.isPdfWin
|
||||
if (isPdf) resBool = true
|
||||
}
|
||||
console.log('mouseChange:', bool, resBool)
|
||||
// console.log('mouseChange:', bool, resBool)
|
||||
setIgnore(resBool)
|
||||
}
|
||||
const touchChange = (e) => {
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
// im-chat: 聊天事件 {type, data}
|
||||
const chatChange = (type, data, ...args) => {
|
||||
if (type == 'createGroup') { // 创建群-监听
|
||||
|
@ -185,14 +189,6 @@ const setIgnore = (bool) => {ipcMsgSend('tool-sphere:set:ignore', bool)}
|
|||
// 重置状态: 鼠标|画板
|
||||
const resetStatus = () => {
|
||||
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 // 标记状态
|
||||
}
|
||||
// 侧边工具栏: 移入移出
|
||||
|
@ -202,7 +198,10 @@ const sideMouse = e => {
|
|||
setIgnore(false) // 关闭窗口鼠标-穿透
|
||||
return
|
||||
}
|
||||
mouseChange(type == 'mouseleave')
|
||||
// 打开内容且触发移出事件时
|
||||
const bool = isMask.value && type =='mouseleave'
|
||||
if (bool) mouseChange(false) // 不穿透
|
||||
else mouseChange(type == 'mouseleave')
|
||||
}
|
||||
// 侧边工具栏: 操作变化
|
||||
const sideChange = async o => {
|
||||
|
@ -218,7 +217,11 @@ const sideChange = async o => {
|
|||
isOpenBook.value = true
|
||||
}
|
||||
break
|
||||
case 'close': // 关闭
|
||||
maskChange(false)
|
||||
break
|
||||
case 'resource': // 资源
|
||||
isMask.value = !isMask.value
|
||||
break
|
||||
case 'interact': // 互动
|
||||
break
|
||||
|
@ -255,6 +258,13 @@ const sideChange = async o => {
|
|||
}
|
||||
}
|
||||
|
||||
// 遮罩层-触发事件
|
||||
const maskChange = (bool) => {
|
||||
isMask.value = false
|
||||
bool && sideVueRef.value.closeActive() // 关闭侧边栏内容窗口
|
||||
mouseChange(true) // 允许穿透
|
||||
}
|
||||
|
||||
// === 监听器 ===
|
||||
watchEffect(() => {
|
||||
if (isOver.value) return // 下课, 不往下执行
|
||||
|
@ -274,6 +284,12 @@ watchEffect(() => {
|
|||
.warp-all{
|
||||
position: relative;
|
||||
}
|
||||
// 遮罩层
|
||||
.mask{
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(1, 1, 1, 0.3);
|
||||
}
|
||||
// 底部工具栏
|
||||
.tool-bottom-all{
|
||||
// width: 45vw;
|
||||
|
@ -316,6 +332,7 @@ watchEffect(() => {
|
|||
}
|
||||
}
|
||||
}
|
||||
// 底部动画
|
||||
.a-fade-leave-active,.a-fade-enter-active{
|
||||
transition: all .3s;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue