import AutoTable from "@/components/AutoTable";
import PremButton from "@/components/PremButton";
import { doFetch } from "@/utils/doFetch";
import { Box, Container, Stack, Typography } from "@mui/material";
import { useRequest } from "ahooks";
import { Select, Statistic } from "antd";
import { useMemo, useRef, useState } from "react";
import CountUp from "react-countup";
import "./index.less";
const formatter = (value) => ;
function Record() {
const actionRef = useRef(),
formRef = useRef();
const [params, setparams] = useState({});
const { runAsync, data, loading } = useRequest(
async () => {
let res = await doFetch({
url: "/studentExperiment/scoreReport",
params,
});
return res?.data?.data;
},
{
debounceWait: 400,
refreshDeps: [params],
}
);
const columns = useMemo(() => {
let arr = [];
if (data?.listDynamicField) {
arr = data?.listDynamicField?.map((it, i) => {
return {
title: `${it?.experimentName}(${it?.weight}%)`,
dataIndex: it?.key,
key: it?.key,
search: false,
};
});
}
let res = [
{ title: "姓名", dataIndex: "name", key: "studentName" },
{ title: "账号", dataIndex: "userAccount", key: "studentAccount" },
{ title: "班级名称", dataIndex: "className", key: "className" },
...arr,
{ title: "实训总分", dataIndex: "score", key: "score", search: false },
{
title: "排名",
dataIndex: "sort",
key: "sort",
search: false,
sorter: {
compare: (a, b) => a.sort - b.sort,
},
},
];
return res;
}, [data]);
const options = useRequest(
async () => {
let res = await doFetch({
url: "/busTrain/loginTeacher/selection",
params: {},
});
return res?.data?.dataList;
},
{
debounceWait: 200,
}
);
return (
成绩单
{
e.stopPropagation();
let formval = formRef?.current.getFieldsValue();
const param = {
...formval,
...params,
};
await doFetch({
url: "/studentExperiment/scoreReportExport",
params: param,
});
},
}}
>
导出
{
setparams((s) => ({
...values,
trainId: s.trainId,
}));
}}
>
);
}
export default Record;