index.jsx 1.87 KB
Newer Older
wuhao's avatar
wuhao committed
1
import AutoTable from "@/components/AutoTable";
wuhao's avatar
wuhao committed
2
import { Box, Container, Typography } from "@mui/material";
wuhao's avatar
wuhao committed
3 4 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 51 52 53
import * as Antd from "antd";
import { useMemo, useRef } from "react";
import "./index.less";

const { message } = Antd;
const { Paragraph } = Antd.Typography;

function Class() {
  const actionRef = useRef();

  const columns = useMemo(
    () => [
      {
        title: "操作时间",
        dataIndex: "operateTime",
        key: "operateTimeRange",
        valueType: "dateTimeRange",
      },
      { title: "操作人", dataIndex: "operateUserName", key: "operateUserName" },
      {
        title: "操作类型",
        dataIndex: "operateTypeName",
        key: "operateType",
        valueType: "select",
        options: [
          { label: "登录", value: "1" },
          { label: "退出", value: "2" },
          { label: "新增", value: "3" },
          { label: "修改", value: "4" },
          { label: "删除", value: "5" },
          { label: "查看", value: "6" },
          { label: "导入", value: "7" },
          { label: "导出", value: "8" },
        ],
      },
      { title: "操作内容", dataIndex: "operateContent", key: "operateContent" },
      { title: "MAC地址", dataIndex: "mac", key: "mac" },
      { title: "ip地址", dataIndex: "ip", key: "ip" },
    ],
    []
  );

  return (
    <Container maxWidth={false}>
      <Box
        display={"flex"}
        justifyContent={"space-between"}
        alignItems={"center"}
        sx={{ mb: 2.5 }}
        mt={0}
      >
wuhao's avatar
wuhao committed
54
        <Typography variant="h5">平台日志</Typography>
wuhao's avatar
wuhao committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
      </Box>

      <Box boxShadow={"0 0 18px #f0f0f0"} borderRadius={2}>
        <AutoTable
          actionRef={actionRef}
          scroll={{ x: 1366 }}
          columns={[...columns]}
          path="/log/page"
          rerendered={false}
        ></AutoTable>
      </Box>
    </Container>
  );
}

export default Class;