index.jsx 2.18 KB
Newer Older
maojiafeng's avatar
maojiafeng committed
1
import AutoTable from "@/components/AutoTable";
wuhao's avatar
wuhao committed
2
import PremButton from "@/components/PremButton";
maojiafeng's avatar
maojiafeng committed
3
import { Box, Container, Stack, Typography } from "@mui/material";
wuhao's avatar
wuhao committed
4
import { useParams } from "@umijs/max";
maojiafeng's avatar
maojiafeng committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
import { useMemo, useRef } from "react";
import "./index.less";

function Record() {
  const actionRef = useRef();
  const params = useParams();

  const columns = useMemo(() => {
    let res = [
      { title: "课程名称", dataIndex: "courseName", key: "courseName" },
      { title: "实训名称", dataIndex: "trainName", key: "trainName" },
      { title: "实验名称", dataIndex: "experimentName", key: "experimentName" },
      {
        title: "分数",
        dataIndex: "scoreWeight",
        key: "scoreWeight",
        hideInSearch: true,
      },
      {
        title: "提交时间",
        dataIndex: "finishTime",
        key: "finishTimeRange",
        valueType: "dateTimeRange",
      },
      {
        title: "批阅时间",
        dataIndex: "reviewTime",
        key: "reviewTimeRange",
        valueType: "dateTimeRange",
      },
      {
        title: "批阅状态",
        dataIndex: "reviewTypeName",
        key: "reviewType",
        valueType: "select",
        options: [
          { label: "待批阅", value: "1" },
          { label: "已批阅", value: "2" },
        ],
      },
    ];
    return res;
  }, []);

  return (
    <Container maxWidth={false}>
wuhao's avatar
wuhao committed
51 52 53 54 55 56
      <Stack
        direction={"row"}
        justifyContent={"space-between"}
        alignItems={"center"}
        mb={2}
      >
maojiafeng's avatar
maojiafeng committed
57
        <Typography variant="h5">成绩单</Typography>
wuhao's avatar
wuhao committed
58 59 60 61 62 63 64 65 66 67 68
        <PremButton
          btn={{
            variant: "outlined",
            onClick: (e) => {
              e.stopPropagation();
              history.back();
            },
          }}
        >
          返回
        </PremButton>
maojiafeng's avatar
maojiafeng committed
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
      </Stack>

      <Box boxShadow={"0 0 18px #f0f0f0"} borderRadius={2}>
        <AutoTable
          actionRef={actionRef}
          scroll={{ x: 1366 }}
          columns={[...columns]}
          path={"/studentTrain/experimentPage"}
          extraparams={{
            id: params?.id,
          }}
        ></AutoTable>
      </Box>
    </Container>
  );
}

export default Record;