Compare commits

..

No commits in common. "eaaba2b5e86adb0a6fac5f4023905508dd768ad1" and "5790e87a850857c2854afd4422d7c031f1bf5ba5" have entirely different histories.

4 changed files with 68 additions and 43 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "aix-win", "name": "aix-win",
"version": "2.1.19", "version": "2.1.18",
"description": "", "description": "",
"main": "./out/main/index.js", "main": "./out/main/index.js",
"author": "上海交大重庆人工智能研究院", "author": "上海交大重庆人工智能研究院",

View File

@ -20,58 +20,82 @@
<script setup> <script setup>
import {ref, watch} from 'vue' import {ref, watch} from 'vue'
import overviewStore from '@/store/modules/overview' import overviewStore from '@/store/modules/overview'
import {listEntpcoursework} from '@/api/education/entpCourseWork'
const useOverview = overviewStore() const useOverview = overviewStore()
const tableData = ref([]) const tableData = ref([])
//id
const ids = ref('')
//
const allScore = ref(0)
// //
const konwledge = ref([]) const konwledge = ref([])
// //
const getKonwledge = () => { const getKonwledge = () => {
const getScoreRate = []
//
const ledges = []
useOverview.tableList.forEach(item => { useOverview.tableList.forEach(item => {
//
if(item.knowledgePoint){ if(item.knowledgePoint){
const title = JSON.parse(item.knowledgePoint) konwledge.value.push({...JSON.parse(item.knowledgePoint),...{scoingRate:Number(item.scoingRate),point:item.point,allPoint:allScore.value}})
//
if(!ledges.includes(title.id)){
ledges.push(title.id)
konwledge.value.push({title:title.title,allPoint:item.point,id:title.id})
}
//
if(useOverview.allData[0].hasAnswers.includes(item.studentid))
getScoreRate.push({rate:item.scoingRate,id:title.id})
} }
}) })
tableData.value = getTableList(konwledge.value)
// tableData.value = tableData.value.map(item => {
konwledge.value.forEach(item => { return{
let sunRate = 0
let num = 0
getScoreRate.forEach(item2 => {
if(item.id === item2.id){
sunRate += extractedNumber(item2.rate)
num ++
}
})
const scoreRate = sunRate / num
tableData.value.push({
scoingRate:scoreRate.toFixed(2),
...item, ...item,
point:(item.allPoint * scoreRate / 100).toFixed(2) allPoint: allScore.value
}) }
}) })
console.log(tableData.value,'tableData.value')
} }
// //
const extractedNumber = (score) => { const getScore = async () => {
const match = score.match(/\d+/); const scoreId = useOverview.tableList[0].entpcourseworklist
return match ? parseInt(match[0], 10) : null; const fixedJsonString = `[${scoreId}]`;
const objects = JSON.parse(fixedJsonString);
const id = objects.map(obj => obj.id);
ids.value = id.join(',')
const res = await listEntpcoursework({ids: ids.value, pageSize: 500})
if(res.code === 200){
allScore.value = res.rows.reduce((acc, cur) => acc + cur.workScore, 0);
getKonwledge()
}
} }
//tableList //tableList
const getTableList = (data) => {
const result = [];
data.forEach(item => {
const existingItem = result.find(i => i.id === item.id);
if (existingItem) {
// pointscoingRate
existingItem.pointTotal += parseInt(item.point);
existingItem.scoingRateTotal += parseFloat(item.scoingRate);
existingItem.count++;
} else {
//
result.push({
id: item.id,
title: item.title,
pointTotal: item.point,
scoingRateTotal: parseFloat(item.scoingRate),
count: 1
});
}
});
//
result.forEach(item => {
item.point = Math.round(item.pointTotal / item.count);
// item.scoingRate = Math.round((item.scoingRateTotal / item.count) * 100) / 100;
item.scoingRate = Math.round((item.point / allScore.value) * 100);
delete item.pointTotal;
delete item.scoingRateTotal;
delete item.count;
});
return result;
}
watch(() => useOverview.tableList,() => { watch(() => useOverview.tableList,() => {
getKonwledge() console.log(useOverview.tableList,'useOverview.tableList')
getScore()
}) })
</script> </script>

View File

@ -73,8 +73,9 @@ 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 = posBtnAll.height
curNode = sessionStore?.get?.('subject.curNode')
curNode = sessionStore.get('subject.curNode')
}) })
// === === // === ===
// //
@ -96,7 +97,7 @@ const clickHandel = (o, e) => {
isVisible.value = !isColse // isVisible.value = !isColse //
activeObj.value = o activeObj.value = o
const nodeH = parseInt(node.height / 2) // const nodeH = parseInt(node.height / 2) //
topPos.value = Math.round(parseInt(node.top) - posBtnAll.top + nodeH) topPos.value = parseInt(node.top) - posBtnAll.top + nodeH
} }
emit('change', o) emit('change', o)
} }
@ -148,8 +149,8 @@ const closeActive = () =>{
--top: 30px; --top: 30px;
--height: 40vh; --height: 40vh;
position: fixed; position: fixed;
inset: 0 75px auto auto; inset: 50% 75px auto auto;
// transform: translateY(-50%); transform: translateY(-50%);
background-color: #121212; background-color: #121212;
padding: 10px; padding: 10px;
border-radius: 4px; border-radius: 4px;

View File

@ -1,6 +1,6 @@
<template> <template>
<div v-if="props.test"> <div v-if="props.test">
<el-button type="primary" @click="trigger(1)" v-tap:trigger="[1,'']">点赞</el-button> <el-button type="primary" @click="trigger" v-tap:trigger="">点赞</el-button>
<el-button type="primary" @click="trigger(2, '学生A')" v-tap:trigger="[2,'学生A']">疑惑</el-button> <el-button type="primary" @click="trigger(2, '学生A')" v-tap:trigger="[2,'学生A']">疑惑</el-button>
</div> </div>
<!-- 温度计-模式 --> <!-- 温度计-模式 -->
@ -258,11 +258,11 @@ defineExpose({ trigger })
min-width: 15px; min-width: 15px;
// height: 500px; // height: 500px;
&.like{ &.like{
background-image: linear-gradient(to top, #d2f0cb, #2f9e44); background-image: linear-gradient(to top, #fef0f0, #f56c6c);
// animation: striped-flow 5s linear infinite; // animation: striped-flow 5s linear infinite;
} }
&.doubt{ &.doubt{
background-image: linear-gradient(to top, #ebc6c6, #ff0000); background-image: linear-gradient(to top, #fdf6ec, #e6a23c);
} }
} }
} }