|
@@ -3,16 +3,16 @@
|
|
|
<div class="search">
|
|
<div class="search">
|
|
|
<img src="@/assets/search.svg" width="20px" height="20px"></img>
|
|
<img src="@/assets/search.svg" width="20px" height="20px"></img>
|
|
|
<div class="searchInput">
|
|
<div class="searchInput">
|
|
|
- <input type="text" v-model.trim="searchInput" placeholder="输入姓名或学号">
|
|
|
|
|
|
|
+ <input type="text" v-model.trim="searchInput" placeholder="输入姓名或学号" :disabled="!isTable">
|
|
|
<div class="fix">
|
|
<div class="fix">
|
|
|
<span>搜索</span>
|
|
<span>搜索</span>
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#b8b8b8" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18l6-6-6-6"/></svg>
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#b8b8b8" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18l6-6-6-6"/></svg>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="Myselect">
|
|
<div class="Myselect">
|
|
|
- <select id="selectHomework" v-model="TheHomework" @change="changeHomework">
|
|
|
|
|
- <option value="无">选择作业</option>
|
|
|
|
|
- <option v-for="item in Homeworksdata" :value="item">{{item}}</option>
|
|
|
|
|
|
|
+ <select id="selectHomework" v-model="TheHomework" @change="changeHomework" :disabled="!isTable">
|
|
|
|
|
+ <option value=-1>选择作业</option>
|
|
|
|
|
+ <option v-for="item in Homeworksdata" :value="item.assignmentId">{{item.assignmentName}}</option>
|
|
|
</select>
|
|
</select>
|
|
|
<div class="show">
|
|
<div class="show">
|
|
|
{{ ShowTheHomework }}
|
|
{{ ShowTheHomework }}
|
|
@@ -27,16 +27,14 @@
|
|
|
{{ ShowTheSort }}
|
|
{{ ShowTheSort }}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="toggle">
|
|
|
|
|
- <button class="left"
|
|
|
|
|
- :class="{'active':isTable,'unactive':!isTable}"
|
|
|
|
|
- @click="isTable=true"
|
|
|
|
|
- >table</button>
|
|
|
|
|
- <button class="right"
|
|
|
|
|
- :class="{'active':!isTable,'unactive':isTable}"
|
|
|
|
|
- @click="isTable=false"
|
|
|
|
|
- >统计图</button>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <classToggle v-model:isLeft="isTable">
|
|
|
|
|
+ <template #left>
|
|
|
|
|
+ table
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #right>
|
|
|
|
|
+ chart
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </classToggle>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="content">
|
|
<div class="content">
|
|
|
<div class="Loading" v-show="!DataLoading">Loading...</div>
|
|
<div class="Loading" v-show="!DataLoading">Loading...</div>
|
|
@@ -61,12 +59,12 @@
|
|
|
:class="{Gethover:hoverStuId===item.studentId,Blue:true}"
|
|
:class="{Gethover:hoverStuId===item.studentId,Blue:true}"
|
|
|
>{{ item.stuName }}</td>
|
|
>{{ item.stuName }}</td>
|
|
|
<td>{{ item.officialNumber }}</td>
|
|
<td>{{ item.officialNumber }}</td>
|
|
|
- <td>
|
|
|
|
|
|
|
+ <td @click="$router.push(`/home/assignment/${ShowTheHomeworkId}/correct?studentId=${item.studentId}`)">
|
|
|
<div class="highScore" v-if="item.score>=80"> {{ item.score }}</div>
|
|
<div class="highScore" v-if="item.score>=80"> {{ item.score }}</div>
|
|
|
<div class="midScore" v-else-if="item.score>=60"> {{ item.score }}</div>
|
|
<div class="midScore" v-else-if="item.score>=60"> {{ item.score }}</div>
|
|
|
<div class="lowScore" v-else-if="item.score>0"> {{ item.score }}</div>
|
|
<div class="lowScore" v-else-if="item.score>0"> {{ item.score }}</div>
|
|
|
- <div class="uncorrected" v-else-if="item.state==='未批改'"> 未批改</div>
|
|
|
|
|
- <div class="unsubmitted" v-else-if="item.state==='未提交'"> 未提交</div>
|
|
|
|
|
|
|
+ <div class="uncorrected" v-else-if="item.status==='SUBMITTED'"> 未批改</div>
|
|
|
|
|
+ <div class="unsubmitted" v-else-if="item.status==='NOT_SUBMITTED'"> 未提交</div>
|
|
|
</td>
|
|
</td>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else>
|
|
<template v-else>
|
|
@@ -101,12 +99,12 @@
|
|
|
:class="{Gethover:hoverStuId===item.studentId,Blue:true}"
|
|
:class="{Gethover:hoverStuId===item.studentId,Blue:true}"
|
|
|
>{{ item.stuName }}</td>
|
|
>{{ item.stuName }}</td>
|
|
|
<td>{{ item.officialNumber }}</td>
|
|
<td>{{ item.officialNumber }}</td>
|
|
|
- <td>
|
|
|
|
|
|
|
+ <td @click="$router.push(`/home/assignment/${ShowTheHomeworkId}/correct?studentId=${item.studentId}`)">
|
|
|
<div class="highScore" v-if="item.score>=80"> {{ item.score }}</div>
|
|
<div class="highScore" v-if="item.score>=80"> {{ item.score }}</div>
|
|
|
<div class="midScore" v-else-if="item.score>=60"> {{ item.score }}</div>
|
|
<div class="midScore" v-else-if="item.score>=60"> {{ item.score }}</div>
|
|
|
<div class="lowScore" v-else-if="item.score>0"> {{ item.score }}</div>
|
|
<div class="lowScore" v-else-if="item.score>0"> {{ item.score }}</div>
|
|
|
- <div class="uncorrected" v-else-if="item.state==='未批改'"> 未批改</div>
|
|
|
|
|
- <div class="unsubmitted" v-else-if="item.state==='未提交'"> 未提交</div>
|
|
|
|
|
|
|
+ <div class="uncorrected" v-else-if="item.status==='SUBMITTED'"> 未批改</div>
|
|
|
|
|
+ <div class="unsubmitted" v-else-if="item.status==='NOT_SUBMITTED'"> 未提交</div>
|
|
|
</td>
|
|
</td>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else>
|
|
<template v-else>
|
|
@@ -135,12 +133,14 @@
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import classTable from './components/classTable.vue';
|
|
import classTable from './components/classTable.vue';
|
|
|
|
|
+import classToggle from './components/classToggle.vue'
|
|
|
import {onMounted, ref, computed, watch, nextTick } from 'vue';
|
|
import {onMounted, ref, computed, watch, nextTick } from 'vue';
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
import { useStore } from "@/store"
|
|
import { useStore } from "@/store"
|
|
|
import * as echarts from 'echarts'
|
|
import * as echarts from 'echarts'
|
|
|
import useApis from "@/apis";
|
|
import useApis from "@/apis";
|
|
|
|
|
|
|
|
|
|
+const apis = useApis()
|
|
|
const store = useStore()
|
|
const store = useStore()
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
@@ -149,8 +149,9 @@ const courseId = +route.query.courseId;
|
|
|
|
|
|
|
|
const currentPage = ref(1)
|
|
const currentPage = ref(1)
|
|
|
const searchInput = ref("")
|
|
const searchInput = ref("")
|
|
|
-const TheHomework = ref("无")
|
|
|
|
|
-const ShowTheHomework = ref("第一次作业")
|
|
|
|
|
|
|
+const TheHomework = ref(-1)
|
|
|
|
|
+const ShowTheHomework = ref("")
|
|
|
|
|
+const ShowTheHomeworkId = ref(-1)
|
|
|
const TheSort = ref("无")
|
|
const TheSort = ref("无")
|
|
|
const ShowTheSort = ref("默认")
|
|
const ShowTheSort = ref("默认")
|
|
|
const hoverStuId = ref(-1)
|
|
const hoverStuId = ref(-1)
|
|
@@ -174,10 +175,10 @@ const setChart = () => {
|
|
|
const chartInstance2 = echarts.init(chartRef2.value)
|
|
const chartInstance2 = echarts.init(chartRef2.value)
|
|
|
let excellentnum=0, goodnum=0 , failnum=0 , uncorrectednum=0 , unsubmittednum=0
|
|
let excellentnum=0, goodnum=0 , failnum=0 , uncorrectednum=0 , unsubmittednum=0
|
|
|
Studentsdata.value.forEach((item)=>{
|
|
Studentsdata.value.forEach((item)=>{
|
|
|
- if(item.state === "未提交"){
|
|
|
|
|
|
|
+ if(item.status === "NOT_SUBMITTED"){
|
|
|
unsubmittednum++
|
|
unsubmittednum++
|
|
|
}
|
|
}
|
|
|
- else if(item.state === "未批改"){
|
|
|
|
|
|
|
+ else if(item.status === "SUBMITTED"){
|
|
|
uncorrectednum++
|
|
uncorrectednum++
|
|
|
}
|
|
}
|
|
|
else if(item.score<60){
|
|
else if(item.score<60){
|
|
@@ -282,100 +283,35 @@ const identify = () => {
|
|
|
router.push('/404')
|
|
router.push('/404')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+const getHomeworks = async () => {
|
|
|
|
|
+ // console.log(courseId,classId);
|
|
|
|
|
+ console.log(ShowTheHomeworkId.value);
|
|
|
|
|
+ await apis.getAssignmentByCourseId(courseId)
|
|
|
|
|
+ .then((res:any)=>{
|
|
|
|
|
+ // console.log('----------------------');
|
|
|
|
|
+ // console.log(res.data.data.records);
|
|
|
|
|
+ res.data.data.records.forEach(item => Homeworksdata.value.push(item))
|
|
|
|
|
+ ShowTheHomework.value = res.data.data.records[0].assignmentName
|
|
|
|
|
+ ShowTheHomeworkId.value = res.data.data.records[0].assignmentId
|
|
|
|
|
+ })
|
|
|
|
|
+ // t.forEach(item => Homeworksdata.value.push(item))
|
|
|
|
|
+ HomeworkDataLoading.value = true
|
|
|
|
|
+ console.log(ShowTheHomeworkId.value);
|
|
|
|
|
+}
|
|
|
const getStudents = () => {
|
|
const getStudents = () => {
|
|
|
StudentsDataLoading.value=false
|
|
StudentsDataLoading.value=false
|
|
|
- setTimeout(()=>{
|
|
|
|
|
- console.log("classID:",classId);
|
|
|
|
|
- console.log("作业:",ShowTheHomework);
|
|
|
|
|
- const newData = [
|
|
|
|
|
- {
|
|
|
|
|
- "officialNumber": 522025320092,
|
|
|
|
|
- "stuName": "关谷神奇",
|
|
|
|
|
- "state": "已提交",
|
|
|
|
|
- "score": 88,
|
|
|
|
|
- "studentId": 1
|
|
|
|
|
-
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "officialNumber": 522025312092,
|
|
|
|
|
- "stuName": "唐悠悠",
|
|
|
|
|
- "state": "已提交",
|
|
|
|
|
- "score": 92,
|
|
|
|
|
- "studentId": 2
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "officialNumber": 1231232,
|
|
|
|
|
- "stuName": "曾小贤",
|
|
|
|
|
- "state": "未提交",
|
|
|
|
|
- "score": 0,
|
|
|
|
|
- "studentId": 3
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "officialNumber": 123123123123,
|
|
|
|
|
- "stuName": "陈美嘉",
|
|
|
|
|
- "state": "已提交",
|
|
|
|
|
- "score": 59,
|
|
|
|
|
- "studentId": 4
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "officialNumber": 123132435132,
|
|
|
|
|
- "stuName": "胡一菲",
|
|
|
|
|
- "state": "已提交",
|
|
|
|
|
- "score": 100,
|
|
|
|
|
- "studentId": 5
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "officialNumber": 123442,
|
|
|
|
|
- "stuName": "张伟",
|
|
|
|
|
- "state": "未批改",
|
|
|
|
|
- "score": 0,
|
|
|
|
|
- "studentId": 6
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "officialNumber": 1231231662,
|
|
|
|
|
- "stuName": "吕子乔",
|
|
|
|
|
- "state": "已提交",
|
|
|
|
|
- "score": 57,
|
|
|
|
|
- "studentId": 7
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "officialNumber": 12399312312,
|
|
|
|
|
- "stuName": "展播",
|
|
|
|
|
- "state": "已提交",
|
|
|
|
|
- "score": 93,
|
|
|
|
|
- "studentId": 8
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "officialNumber": 123993112,
|
|
|
|
|
- "stuName": "婉瑜",
|
|
|
|
|
- "state": "已提交",
|
|
|
|
|
- "score": 79,
|
|
|
|
|
- "studentId": 9
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "officialNumber": 22321452,
|
|
|
|
|
- "stuName": "秦羽墨",
|
|
|
|
|
- "state": "已提交",
|
|
|
|
|
- "score": 64,
|
|
|
|
|
- "studentId": 10
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "officialNumber": 223214522,
|
|
|
|
|
- "stuName": "吕小布",
|
|
|
|
|
- "state": "已提交",
|
|
|
|
|
- "score": 58,
|
|
|
|
|
- "studentId": 11
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
- Studentsdata.value = newData
|
|
|
|
|
- StudentsDataLoading.value = true
|
|
|
|
|
-},1000)
|
|
|
|
|
-}
|
|
|
|
|
-const getHomeworks = () => {
|
|
|
|
|
- console.log(courseId,classId);
|
|
|
|
|
- const t = ["第一次作业","第二次作业","第三次作业","期中作业","第五次作业","第六次作业","期末考试"]
|
|
|
|
|
- t.forEach(item => Homeworksdata.value.push(item))
|
|
|
|
|
- HomeworkDataLoading.value = true
|
|
|
|
|
|
|
+ console.log('+++++++++++++++++++++++');
|
|
|
|
|
+ console.log(classId,ShowTheHomeworkId.value);
|
|
|
|
|
+ apis.getClassStatesOfCourse(classId,ShowTheHomeworkId.value)
|
|
|
|
|
+ .then((res:any)=>{
|
|
|
|
|
+ console.log(res.data.data);
|
|
|
|
|
+ Studentsdata.value = res.data.data
|
|
|
|
|
+ StudentsDataLoading.value = true
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err:any)=>{
|
|
|
|
|
+ console.log('-------------------------');
|
|
|
|
|
+ console.log(err);
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
const changeHomework = () => {
|
|
const changeHomework = () => {
|
|
|
console.log(ShowTheHomework.value)
|
|
console.log(ShowTheHomework.value)
|
|
@@ -403,8 +339,8 @@ const showData = computed(() => {
|
|
|
showdata.push( {
|
|
showdata.push( {
|
|
|
"officialNumber": 0,
|
|
"officialNumber": 0,
|
|
|
"stuName": "",
|
|
"stuName": "",
|
|
|
- "stateCode": -1,
|
|
|
|
|
- "stateDesc": "",
|
|
|
|
|
|
|
+ "status": "",
|
|
|
|
|
+ "score": 0,
|
|
|
"studentId": -1
|
|
"studentId": -1
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -418,9 +354,11 @@ const DataLoading = computed(() => {
|
|
|
watch(TheHomework, () => {
|
|
watch(TheHomework, () => {
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
|
// console.log(ShowTheHomework.value,TheHomework.value);
|
|
// console.log(ShowTheHomework.value,TheHomework.value);
|
|
|
- if(TheHomework.value != "无"){
|
|
|
|
|
- ShowTheHomework.value = TheHomework.value
|
|
|
|
|
- TheHomework.value = "无"
|
|
|
|
|
|
|
+ if(TheHomework.value != -1){
|
|
|
|
|
+ let t = Homeworksdata.value.find(item=>item.assignmentId==TheHomework.value)
|
|
|
|
|
+ ShowTheHomework.value = t.assignmentName
|
|
|
|
|
+ ShowTheHomeworkId.value = t.assignmentId
|
|
|
|
|
+ TheHomework.value = -1
|
|
|
}
|
|
}
|
|
|
// console.log(ShowTheHomework.value,TheHomework.value);
|
|
// console.log(ShowTheHomework.value,TheHomework.value);
|
|
|
});
|
|
});
|
|
@@ -436,30 +374,30 @@ watch(TheSort, () => {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
watch(ShowTheSort,(newData) =>{
|
|
watch(ShowTheSort,(newData) =>{
|
|
|
- if(newData==="未批改优先"){
|
|
|
|
|
|
|
+ if(newData==="未提交优先"){
|
|
|
Studentsdata.value = Studentsdata.value.sort((a,b)=>{
|
|
Studentsdata.value = Studentsdata.value.sort((a,b)=>{
|
|
|
- return a.state === "未批改" ? -1 : b.state === "未批改" ? 1 : 0;
|
|
|
|
|
|
|
+ return a.status === "NOT_SUBMITTED" ? -1 : b.status === "NOT_SUBMITTED" ? 1 : 0;
|
|
|
})
|
|
})
|
|
|
console.log("未批改已排序");
|
|
console.log("未批改已排序");
|
|
|
console.log(Studentsdata.value);
|
|
console.log(Studentsdata.value);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- else if(newData==="未提交优先"){
|
|
|
|
|
|
|
+ else if(newData==="未批改优先"){
|
|
|
Studentsdata.value = Studentsdata.value.sort((a,b)=>{
|
|
Studentsdata.value = Studentsdata.value.sort((a,b)=>{
|
|
|
- return a.state === "未提交" ? -1 : b.state === "未提交" ? 1 : 0;
|
|
|
|
|
|
|
+ return a.status === "SUBMITTED" ? -1 : b.status === "SUBMITTED" ? 1 : 0;
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
else if(newData==="成绩从低到高"){
|
|
else if(newData==="成绩从低到高"){
|
|
|
Studentsdata.value = Studentsdata.value.sort((a,b)=>{
|
|
Studentsdata.value = Studentsdata.value.sort((a,b)=>{
|
|
|
- if (a.state === "已提交" && b.state !== "已提交") return -1;
|
|
|
|
|
- if (a.state !== "已提交" && b.state === "已提交") return 1;
|
|
|
|
|
|
|
+ if (a.status === "CORRECTED" && b.status !== "CORRECTED") return -1;
|
|
|
|
|
+ if (a.status !== "CORRECTED" && b.status === "CORRECTED") return 1;
|
|
|
return a.score - b.score;
|
|
return a.score - b.score;
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
else if(newData==="成绩从高到低"){
|
|
else if(newData==="成绩从高到低"){
|
|
|
Studentsdata.value = Studentsdata.value.sort((a,b)=>{
|
|
Studentsdata.value = Studentsdata.value.sort((a,b)=>{
|
|
|
- if (a.state === "已提交" && b.state !== "已提交") return -1;
|
|
|
|
|
- if (a.state !== "已提交" && b.state === "已提交") return 1;
|
|
|
|
|
|
|
+ if (a.status === "CORRECTED" && b.status !== "CORRECTED") return -1;
|
|
|
|
|
+ if (a.status !== "CORRECTED" && b.status === "CORRECTED") return 1;
|
|
|
return b.score - a.score;
|
|
return b.score - a.score;
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -472,13 +410,14 @@ watch(isTable, (newVal) => {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
-onMounted(() => {
|
|
|
|
|
- console.log(store.user.role)
|
|
|
|
|
- // console.log('chartRef dom:', chartRef.value)
|
|
|
|
|
- getStudents()
|
|
|
|
|
- getHomeworks()
|
|
|
|
|
- // setChart()
|
|
|
|
|
-})
|
|
|
|
|
|
|
+onMounted(async () => {
|
|
|
|
|
+ await getHomeworks();
|
|
|
|
|
+ if (ShowTheHomeworkId.value) {
|
|
|
|
|
+ await getStudents();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.warn('未获取到作业 ID,无法加载学生数据');
|
|
|
|
|
+ }
|
|
|
|
|
+});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
@@ -555,32 +494,6 @@ onMounted(() => {
|
|
|
border-radius: 0 5px 5px 0;
|
|
border-radius: 0 5px 5px 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- .toggle{
|
|
|
|
|
- margin-left: 20px;
|
|
|
|
|
- .left{
|
|
|
|
|
- border: 3px solid #4A90C4;
|
|
|
|
|
- border-radius: 20px 0 0 20px;
|
|
|
|
|
- border-right: 0;
|
|
|
|
|
- padding: 2px 7px;
|
|
|
|
|
- font-weight: 700;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- }
|
|
|
|
|
- .right{
|
|
|
|
|
- border: 3px solid #4A90C4;
|
|
|
|
|
- border-radius: 0 20px 20px 0;
|
|
|
|
|
- padding: 2px 7px;
|
|
|
|
|
- font-weight: 700;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- }
|
|
|
|
|
- .unactive{
|
|
|
|
|
- color: #70BBDB;
|
|
|
|
|
- background-color: #fff;
|
|
|
|
|
- }
|
|
|
|
|
- .active{
|
|
|
|
|
- color: #fff;
|
|
|
|
|
- background-color:#4A90C4;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
.content{
|
|
.content{
|
|
|
width: 100%;
|
|
width: 100%;
|