|
@@ -1,11 +1,13 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="course-class" v-show="DataLoading">
|
|
<div class="course-class" v-show="DataLoading">
|
|
|
- <classHeader>{{Studentdata.stuName}}:{{ Studentdata.officialNumber }}</classHeader>
|
|
|
|
|
|
|
+ <classHeader>{{store.user.role === 'STUDENT'?Coursedata.courseName:Studentdata.stuName}}:{{store.user.role === 'STUDENT'?Classdata.className: Studentdata.officialNumber }}
|
|
|
|
|
+ <template #TeacherName v-if="store.user.role === 'STUDENT'">{{ Coursedata.teacherNames[0] }}</template>
|
|
|
|
|
+ </classHeader>
|
|
|
<div class="content">
|
|
<div class="content">
|
|
|
<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="输入作业序号或作业名称">
|
|
|
<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>
|
|
@@ -121,30 +123,30 @@ const TheSort = ref("无")
|
|
|
const ShowTheSort = ref("默认")
|
|
const ShowTheSort = ref("默认")
|
|
|
|
|
|
|
|
const StudentdataLoading = ref(false)
|
|
const StudentdataLoading = ref(false)
|
|
|
-// const CourseDataLoading = ref(false)
|
|
|
|
|
-// const ClassDataLoading = ref(false)
|
|
|
|
|
|
|
+const CourseDataLoading = ref(false)
|
|
|
|
|
+const ClassDataLoading = ref(false)
|
|
|
|
|
|
|
|
-// const Coursedata = reactive<CourseDetailVO>({
|
|
|
|
|
-// courseId: null,
|
|
|
|
|
-// courseName: '',
|
|
|
|
|
-// teacherIds: [],
|
|
|
|
|
-// teacherNames: [],
|
|
|
|
|
-// courseImages: [''],
|
|
|
|
|
-// targetGrade: '',
|
|
|
|
|
-// startTime: '',
|
|
|
|
|
-// endTime: '',
|
|
|
|
|
-// createTime: '',
|
|
|
|
|
-// description: '',
|
|
|
|
|
-// })
|
|
|
|
|
|
|
+const Coursedata = reactive<CourseDetailVO>({
|
|
|
|
|
+ courseId: null,
|
|
|
|
|
+ courseName: '',
|
|
|
|
|
+ teacherIds: [],
|
|
|
|
|
+ teacherNames: [],
|
|
|
|
|
+ courseImages: [''],
|
|
|
|
|
+ targetGrade: '',
|
|
|
|
|
+ startTime: '',
|
|
|
|
|
+ endTime: '',
|
|
|
|
|
+ createTime: '',
|
|
|
|
|
+ description: '',
|
|
|
|
|
+})
|
|
|
|
|
|
|
|
-// const Classdata = reactive<ClassVO>({
|
|
|
|
|
-// classId: null,
|
|
|
|
|
-// className: '',
|
|
|
|
|
-// courseId: null,
|
|
|
|
|
-// stuNumber: null,
|
|
|
|
|
-// classTime: '',
|
|
|
|
|
-// teacherId: null,
|
|
|
|
|
-// })
|
|
|
|
|
|
|
+const Classdata = reactive<ClassVO>({
|
|
|
|
|
+ classId: null,
|
|
|
|
|
+ className: '',
|
|
|
|
|
+ courseId: null,
|
|
|
|
|
+ stuNumber: null,
|
|
|
|
|
+ classTime: '',
|
|
|
|
|
+ teacherId: null,
|
|
|
|
|
+})
|
|
|
const sortMethods = ["默认","成绩从低到高","成绩从高到低","未批改优先","未提交优先"]
|
|
const sortMethods = ["默认","成绩从低到高","成绩从高到低","未批改优先","未提交优先"]
|
|
|
const Studentdata = ref({
|
|
const Studentdata = ref({
|
|
|
"officialNumber": 522025312092,
|
|
"officialNumber": 522025312092,
|
|
@@ -189,45 +191,50 @@ const Studentdata = ref({
|
|
|
]
|
|
]
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const identify = () => {
|
|
|
|
|
- if(store.user.role === "STUDENT"){
|
|
|
|
|
- router.push('/404')
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
|
|
+// const identify = () => {
|
|
|
|
|
+// if(store.user.role === "STUDENT"){
|
|
|
|
|
+// router.push('/404')
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
const getStudent = () => {
|
|
const getStudent = () => {
|
|
|
StudentdataLoading.value = false
|
|
StudentdataLoading.value = false
|
|
|
console.log(courseId)
|
|
console.log(courseId)
|
|
|
console.log(studentId)
|
|
console.log(studentId)
|
|
|
StudentdataLoading.value = true
|
|
StudentdataLoading.value = true
|
|
|
}
|
|
}
|
|
|
-// const getClass = () => {
|
|
|
|
|
-// console.log("classId:",classId)
|
|
|
|
|
-// Classdata.classId = classId
|
|
|
|
|
-// Classdata.courseId = courseId
|
|
|
|
|
-// Classdata.className = "读写1班"
|
|
|
|
|
-// Classdata.stuNumber = 30
|
|
|
|
|
-// Classdata.classTime = "Mon 10:10"
|
|
|
|
|
-// Classdata.teacherId = 4
|
|
|
|
|
|
|
+const getClass = () => {
|
|
|
|
|
+ console.log("classId:",classId)
|
|
|
|
|
+ Classdata.classId = classId
|
|
|
|
|
+ Classdata.courseId = courseId
|
|
|
|
|
+ Classdata.className = "读写1班"
|
|
|
|
|
+ Classdata.stuNumber = 30
|
|
|
|
|
+ Classdata.classTime = "Mon 10:10"
|
|
|
|
|
+ Classdata.teacherId = 4
|
|
|
|
|
|
|
|
-// ClassDataLoading.value = true
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ ClassDataLoading.value = true
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
-// const getCourse = () => {
|
|
|
|
|
-// // 获取课程信息
|
|
|
|
|
-// apis.getCourseByCourseId(courseId)
|
|
|
|
|
-// .then((res: any) => {
|
|
|
|
|
-// let data = res.data.data.records[0]
|
|
|
|
|
-// Object.assign(Coursedata, {...data})
|
|
|
|
|
-// CourseDataLoading.value = true
|
|
|
|
|
-// })
|
|
|
|
|
-// .catch((err: any) => {
|
|
|
|
|
-// console.error(err);
|
|
|
|
|
-// })
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+const getCourse = () => {
|
|
|
|
|
+ // 获取课程信息
|
|
|
|
|
+ apis.getCourseByCourseId(courseId)
|
|
|
|
|
+ .then((res: any) => {
|
|
|
|
|
+ let data = res.data.data.records[0]
|
|
|
|
|
+ Object.assign(Coursedata, {...data})
|
|
|
|
|
+ CourseDataLoading.value = true
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err: any) => {
|
|
|
|
|
+ console.error(err);
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const DataLoading = computed(() => {
|
|
const DataLoading = computed(() => {
|
|
|
// return CourseDataLoading.value && ClassDataLoading.value
|
|
// return CourseDataLoading.value && ClassDataLoading.value
|
|
|
- return StudentdataLoading
|
|
|
|
|
|
|
+ if(store.user.role === "STUDENT"){
|
|
|
|
|
+ return StudentdataLoading.value && CourseDataLoading.value && ClassDataLoading.value
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ return StudentdataLoading.value
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
const searchData = computed(()=>{
|
|
const searchData = computed(()=>{
|
|
|
if(searchInput.value===""){
|
|
if(searchInput.value===""){
|
|
@@ -290,10 +297,13 @@ watch(ShowTheSort,(newData) =>{
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- identify()
|
|
|
|
|
- // getClass()
|
|
|
|
|
- // getCourse()
|
|
|
|
|
|
|
+ // identify()
|
|
|
|
|
+ if(store.user.role === "STUDENT"){
|
|
|
|
|
+ getCourse()
|
|
|
|
|
+ getClass()
|
|
|
|
|
+ }
|
|
|
getStudent()
|
|
getStudent()
|
|
|
|
|
+
|
|
|
})
|
|
})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|