Compare commits
9 Commits
ada6659666
...
8cffee606a
Author | SHA1 | Date |
---|---|---|
yangws | 8cffee606a | |
小杨 | 9e24b6111d | |
yangws | 0433febf06 | |
小杨 | 6370086c85 | |
zhengdegang | 7da598b30e | |
zdg | eafdb718b6 | |
zdg | d44516226e | |
yangws | 4afa20808c | |
小杨 | a0327ad556 |
|
@ -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])
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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';
|
||||||
|
|
||||||
|
@ -100,10 +100,10 @@ const clickHandel = (o, e) => {
|
||||||
}
|
}
|
||||||
emit('change', o)
|
emit('change', o)
|
||||||
}
|
}
|
||||||
|
|
||||||
const closeActive = () =>{
|
const closeActive = () =>{
|
||||||
isVisible.value = false
|
isVisible.value = false
|
||||||
}
|
}
|
||||||
|
defineExpose({closeActive})
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.warp{
|
.warp{
|
||||||
|
@ -115,7 +115,13 @@ const closeActive = () =>{
|
||||||
//min-height: 40vh;
|
//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;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<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 +13,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 +34,7 @@
|
||||||
</el-segmented>
|
</el-segmented>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -67,6 +67,7 @@ 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 +84,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 // 浏览器端
|
||||||
|
@ -140,7 +143,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
|
||||||
|
@ -203,6 +207,14 @@ const sideMouse = e => {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
mouseChange(type == 'mouseleave')
|
mouseChange(type == 'mouseleave')
|
||||||
|
// 关闭侧边工具内容窗口
|
||||||
|
if (type == 'mouseleave') {
|
||||||
|
timingSide = setTimeout(() => {
|
||||||
|
sideVueRef.value.closeActive()
|
||||||
|
}, 500)
|
||||||
|
} else { // 移入
|
||||||
|
if (!!timingSide) clearTimeout(timingSide)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 侧边工具栏: 操作变化
|
// 侧边工具栏: 操作变化
|
||||||
const sideChange = async o => {
|
const sideChange = async o => {
|
||||||
|
|
Loading…
Reference in New Issue