|
|
|
@ -3,6 +3,13 @@ import { Table, Button } from 'antd'; |
|
|
|
|
import { withRouter, RouteComponentProps } from 'react-router-dom'; |
|
|
|
|
import { getDetail } from "api/exam-online/index"; |
|
|
|
|
import ESBreadcrumbComponent from "./ESBreadcrumbComponent"; |
|
|
|
|
import CustomerRetention from "../../statistical/customerRetention"; |
|
|
|
|
|
|
|
|
|
type ExamDetailProps = { |
|
|
|
|
examObj: any; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
type CombinedProps = ExamDetailProps & RouteComponentProps; |
|
|
|
|
|
|
|
|
|
// 定义考试参与情况数据类型,移除 serialNumber 字段
|
|
|
|
|
type ExamParticipationItem = { |
|
|
|
@ -100,15 +107,15 @@ const examAnswerColumns: Array<{ |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
const ExamStatisticsPage: React.FC<RouteComponentProps> = ({ history }) => { |
|
|
|
|
const ExamStatisticsPage: React.FC<CombinedProps> = ({ examObj, history }) => { |
|
|
|
|
// const ExamStatisticsPage: React.FC<RouteComponentProps> = ({ history }) => {
|
|
|
|
|
const [examParticipationData, setExamParticipationData] = useState<ExamParticipationItem[]>([]); |
|
|
|
|
const [examAnswerData, setExamAnswerData] = useState<ExamAnswerItem[]>([]); |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
const fetchData = async () => { |
|
|
|
|
try { |
|
|
|
|
const examId = sessionStorage.getItem('examId'); |
|
|
|
|
sessionStorage.removeItem('examId'); |
|
|
|
|
let examId = examObj.examId; |
|
|
|
|
// 调用 getDetail 方法进行初始化检索
|
|
|
|
|
const response = await getDetail(examId); |
|
|
|
|
// 从 AxiosResponse 中提取 data 部分
|
|
|
|
@ -155,4 +162,4 @@ const ExamStatisticsPage: React.FC<RouteComponentProps> = ({ history }) => { |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export default withRouter(ExamStatisticsPage); |
|
|
|
|
export default ExamStatisticsPage; |
|
|
|
|