This commit is contained in:
commit
217197318a
|
@ -3,6 +3,8 @@ import { Link } from 'react-router-dom';
|
||||||
// import axios from 'axios';
|
// import axios from 'axios';
|
||||||
import './Marking.css';
|
import './Marking.css';
|
||||||
import Test from '../../pages/Home/img/test.jpg'
|
import Test from '../../pages/Home/img/test.jpg'
|
||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
// 批改
|
// 批改
|
||||||
function Marking(){
|
function Marking(){
|
||||||
|
@ -12,33 +14,80 @@ function Marking(){
|
||||||
window.location.href='http://36.138.114.105:30294/'
|
window.location.href='http://36.138.114.105:30294/'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const [istrue,setistrue]=useState(false)
|
||||||
|
|
||||||
|
//获取班级
|
||||||
|
const [ClassID,setClassID]=useState()
|
||||||
|
const [selectClass,SetClassData]=useState()
|
||||||
|
const SeleactClass= async()=>{
|
||||||
|
try {
|
||||||
|
const select_class_src = await axios.post('/api/teacher/select_class', {
|
||||||
|
teacher_ID
|
||||||
|
});
|
||||||
|
SetClassData(select_class_src.data['Class']);
|
||||||
|
setClassID(Object.keys(select_class_src.data['Class'])[0])
|
||||||
|
setistrue(true)
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
useEffect(()=>{
|
||||||
|
SeleactClass()
|
||||||
|
},[])
|
||||||
|
|
||||||
|
//获取默认的未批改的实训
|
||||||
|
const [MarkData,setMarkData]=useState()
|
||||||
|
const MarkTrainFunc=async()=>{
|
||||||
|
try{
|
||||||
|
const MarkTrainSrc=await axios.post('/api/teacher/marktrain',{
|
||||||
|
ClassID,
|
||||||
|
teacher_ID
|
||||||
|
})
|
||||||
|
setMarkData(MarkTrainSrc.data['MarkClass'])
|
||||||
|
}catch{
|
||||||
|
alert('MarkTrain出错')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
useEffect(()=>{
|
||||||
|
if(istrue){
|
||||||
|
MarkTrainFunc()
|
||||||
|
}
|
||||||
|
},[ClassID])
|
||||||
|
|
||||||
|
|
||||||
|
const ClassChange=(event)=>{
|
||||||
|
setClassID(event.target.value)
|
||||||
|
}
|
||||||
|
const click=()=>{
|
||||||
|
console.log(ClassID);
|
||||||
|
console.log(MarkData);
|
||||||
|
}
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div className='body-right-mark'>
|
<div className='body-right-mark'>
|
||||||
<select className='mark-list'>
|
{selectClass&&<select className='mark-list' onChange={ClassChange}>
|
||||||
<option value="2024级一班">2024级一班</option>
|
{Object.keys(selectClass).map((key)=>(
|
||||||
<option value="2024级二班">2024级二班</option>
|
<option value={key} key={key} >{key}</option>
|
||||||
<option value="2024级三班">2024级三班</option>
|
))}
|
||||||
</select>
|
</select>}
|
||||||
<div className='test-mark'>
|
{MarkData&&<div className='test-mark'>
|
||||||
{/* 内容 */}
|
{/* 内容 */}
|
||||||
<ul>
|
<ul>
|
||||||
{[{class:'课程1:达梦数据库的安装',time:"关闭时间:2024-4-16 11.46",ImgSrc:Test},
|
{Object.keys(MarkData).map((key)=>(
|
||||||
{class:'课程2:web前端开发与数据库的结合',time:"关闭时间:2024-4-16 11.46",ImgSrc:Test},
|
<Link style={{color:'#000',textDecoration:'none'}} to={`studentlink/Mark/${key}`}>
|
||||||
{class:'课程2:web前端开发与数据库的结合',time:"关闭时间:2024-4-16 11.46",ImgSrc:Test},
|
<li key={key}>
|
||||||
].map((item) =>
|
<img src={Test} alt="" width='35px' height='35px'/>
|
||||||
<Link style={{color:'#000',textDecoration:'none'}} to={'studentlink'}>
|
|
||||||
<li key={item.class}>
|
|
||||||
<img src={item.ImgSrc} alt="" width='35px' height='35px'/>
|
|
||||||
<p>
|
<p>
|
||||||
<p className='p-mark'>{item.class}</p>
|
<p className='p-mark'>{eval(MarkData[key][0][11])}</p>
|
||||||
<span>{item.time}</span>
|
<span>{}</span><span></span>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
<button onClick={click}>asda</button>
|
||||||
</div>
|
</div>}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ function SendTest(){
|
||||||
</div>
|
</div>
|
||||||
<div className='SendTest_body_right'>
|
<div className='SendTest_body_right'>
|
||||||
<p>题目选择</p>
|
<p>题目选择</p>
|
||||||
{<table>
|
{question&&<table>
|
||||||
<span className='title'>选择题</span>
|
<span className='title'>选择题</span>
|
||||||
{Object.keys(question['choice']).map((key)=>(
|
{Object.keys(question['choice']).map((key)=>(
|
||||||
<tr key={key}>
|
<tr key={key}>
|
||||||
|
@ -207,11 +207,6 @@ function SendTest(){
|
||||||
</table>}
|
</table>}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<button onClick={SendTrainBtn} id='SendTrainBtn'>发布按钮</button>
|
<button onClick={SendTrainBtn} id='SendTrainBtn'>发布按钮</button>
|
||||||
</div>
|
</div>
|
||||||
{/* 右边的内容 */}
|
{/* 右边的内容 */}
|
||||||
|
|
|
@ -134,9 +134,6 @@ function SendTrain(){
|
||||||
}
|
}
|
||||||
//获取截止时间
|
//获取截止时间
|
||||||
const [StopTime,SetStopTime]=useState('')
|
const [StopTime,SetStopTime]=useState('')
|
||||||
const getstoptime=(event)=>{
|
|
||||||
SetStopTime(event.target.value)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 日历
|
// 日历
|
||||||
const [startDate, setStartDate] = useState(new Date());
|
const [startDate, setStartDate] = useState(new Date());
|
||||||
|
@ -323,10 +320,10 @@ function SendTrain(){
|
||||||
<option value={num} key={num}>{num}</option>
|
<option value={num} key={num}>{num}</option>
|
||||||
))}
|
))}
|
||||||
</select>小时
|
</select>小时
|
||||||
{/* <button onClick={()=>{
|
<button onClick={()=>{
|
||||||
console.log(selectedItems);
|
console.log(startDate);
|
||||||
console.log(Train);
|
console.log(endDate);
|
||||||
}}>asd</button> */}
|
}}>asd</button>
|
||||||
<select name="" id="" value={MinValue} onChange={getminvalue}>
|
<select name="" id="" value={MinValue} onChange={getminvalue}>
|
||||||
{min_list.map((num)=>(
|
{min_list.map((num)=>(
|
||||||
<option value={num} key={num}>{num}</option>
|
<option value={num} key={num}>{num}</option>
|
||||||
|
|
|
@ -43,10 +43,6 @@ const WarningModal = ({ isOpen, onClose }) => {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const list4=[
|
|
||||||
{'train':'实训3:待定',id:'3'},
|
|
||||||
{'train':'实训4:待定',id:'4'}
|
|
||||||
]
|
|
||||||
// 首页 学习分析
|
// 首页 学习分析
|
||||||
function SubjectPage(){
|
function SubjectPage(){
|
||||||
|
|
||||||
|
@ -94,6 +90,7 @@ function SubjectPage(){
|
||||||
{Object.keys(title).map((key)=>(
|
{Object.keys(title).map((key)=>(
|
||||||
<div className='test-box-training' key={key}>
|
<div className='test-box-training' key={key}>
|
||||||
<p>实训:{eval(title[key][0][11])}</p>
|
<p>实训:{eval(title[key][0][11])}</p>
|
||||||
|
<span>实训ID:{(title[key][0][10])}</span>
|
||||||
<span>发布者:陈老师</span>
|
<span>发布者:陈老师</span>
|
||||||
<div>发布时间:{title[key][0][5]}</div>
|
<div>发布时间:{title[key][0][5]}</div>
|
||||||
<div>截至时间:{title[key][0][6]}</div>
|
<div>截至时间:{title[key][0][6]}</div>
|
||||||
|
|
|
@ -26,9 +26,8 @@ import Marking from '../TeacherPages/MarkingPages/Marking';
|
||||||
import StudentLink from '../TeacherPages/MarkingPages/StudentLink';
|
import StudentLink from '../TeacherPages/MarkingPages/StudentLink';
|
||||||
|
|
||||||
|
|
||||||
import SendTrain from '../TeacherPages/TrainManage/SendTrain';
|
import SendTrain from '../TeacherPages/Trainmanage/SendTrain';
|
||||||
import TrainManage from '../TeacherPages/TrainManage/Trainmanage';
|
import TrainManage from '../TeacherPages/Trainmanage/Trainmanage';
|
||||||
import Test from "../TeacherPages/teacherManagetest/Test.tsx"
|
|
||||||
// 定义一个组件来包裹除了特定页面(exam)外的所有页面使其有导航
|
// 定义一个组件来包裹除了特定页面(exam)外的所有页面使其有导航
|
||||||
const MainLayout = ({ headerNav:HeaderNav }) => {
|
const MainLayout = ({ headerNav:HeaderNav }) => {
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue