This commit is contained in:
nopy 2024-06-19 20:23:48 +08:00
commit 0d108ffea0
3 changed files with 59 additions and 12 deletions

View File

@ -1,9 +1,32 @@
.body-TrainManage{ .body-TrainManage{
width: 1420px; width: 1420px;
height: 1330px; height: 830px;
position: absolute; position: absolute;
top: 72px; top: 72px;
left: 220px; left: 220px;
border-radius: 10px; border-radius: 10px;
background-color: #f7f8fa; background-color: #f7f8fa;
} }
.body-right-Train h3{
margin-left: 60px;
font-size: 20px;
margin-bottom: -5px;
}
.test-Train{
display:flex;
flex-wrap: wrap;
flex-direction: row;
margin-left: 40px;
margin-bottom: 60px;
}
.Train-box{
flex-basis: calc(30.00% - 10PX);
box-sizing: border-box;
margin: 20px;
height: 210px;
background-image: linear-gradient(190deg,rgba(157, 246, 252, 0.7),rgba(198, 212, 255, 0.7));
border-radius: 15px;
line-height: 35px;
}

View File

@ -1,11 +1,36 @@
import './Trainmanage.css' import './Trainmanage.css'
import axios from 'axios';
import React,{ useState,useEffect } from 'react';
function TeacherTrainManage(){ function TeacherTrainManage(){
const click=()=>{
console.log('a');
}
return( return(
<div className="body-TrainManage"> <div className="body-TrainManage">
asd <div className="body-right-Train">
<h3>正在进行的考试与练习</h3>
<div className='test-Train'>
<div className='Train-box'>
<p>试卷ID:</p>
<span>发布者:</span>
<div>发布时间:</div>
<div>截至时间:</div>
</div>
</div>
<button onClick={click}>测试按钮</button>
<h3>已结束或完成的试卷与练习</h3>
<div className='test-subject'>
<div className='test-box'>
<p>试卷ID:</p>
<span>发布者:</span>
<div>发布时间:</div>
<div>截至时间:</div>
</div>
</div>
</div>
</div> </div>
) )
} }

View File

@ -9,28 +9,27 @@ import './classid.css'
function TeacherPage() { function TeacherPage() {
const { key } = useParams(); const { key } = useParams();
const [isclick,setisclick]=useState(false)
// //
const [classdata,setClassData]=useState([]) const [classdata,setClassData]=useState([])
const class_succeed = async () => { const class_succeed = async () => {
try{ try{
const class_scr=await axios.post('http://127.0.0.1:5000/teacher/find_student',{key}) const class_scr=await axios.post('http://127.0.0.1:5000/teacher/find_student',{key})
const class_data=class_scr.data const class_data=class_scr.data
console.log(class_data[1]);
setClassData(class_data[1]) setClassData(class_data[1])
setisclick(true)
}catch(error){ }catch(error){
alert(error) alert(error)
} }
} }
useState(()=>{ useState(()=>{
class_succeed(); class_succeed();
},[classdata]) },[])
// //
const student_fig_btn=(Class)=>{ const student_fig_btn=()=>{
const student_fig=document.getElementById('body-right-bottom-right')
student_fig.innerHTML=''
student_fig.innerHTML='学生'+Class+'画像'
} }
// //
@ -44,7 +43,7 @@ function TeacherPage() {
})); }));
setStudentScores(scores); setStudentScores(scores);
}); });
}, [classdata]); }, [isclick]);
return( return(
<div className='body-right-classId'> <div className='body-right-classId'>
@ -73,7 +72,7 @@ function TeacherPage() {
<td className='box-content'>{classdata[item][3]}</td> <td className='box-content'>{classdata[item][3]}</td>
<td className='box-content'>{classdata[item][5]}</td> <td className='box-content'>{classdata[item][5]}</td>
<td className='box-content'>出生日期</td> <td className='box-content'>出生日期</td>
<td className='box-content'><button onClick={() => student_fig_btn(classdata[item][0])}>查看详情</button></td> <td className='box-content'><button onClick={student_fig_btn}>查看详情</button></td>
</tr> </tr>
))} ))}
</tbody> </tbody>