import classNames from "classnames";
import { useState } from "react";
import { Button, Form, Input, Table } from "antd";
import { DageTableActions } from "@dage/pc-components";
import { PageContainer } from "@/components";
import style from "../../Management/Form/index.module.scss";

const ManagementEvaluationPage = () => {
  const [list] = useState([
    {
      id: 1,
      name: "模板名称",
      a: "定级评估",
      description: "模板说明",
      b: "",
      c: "",
      d: "",
      e: "",
      f: "2024-09-24 16:50:30",
      g: "钱韵澄",
    },
  ]);

  return (
    <PageContainer title="考核评定">
      <div className={style.filter}>
        <Form layout="inline" className="inline-form">
          <Form.Item label="搜索">
            <Input placeholder="请输入报告标题" className="w160" />
          </Form.Item>
          <Form.Item>
            <Button type="primary">查询</Button>
          </Form.Item>
          <Form.Item>
            <Button type="primary" ghost>
              生成报告
            </Button>
          </Form.Item>
        </Form>
      </div>

      <div className={style.table}>
        <Table
          className={classNames("cus-table large")}
          dataSource={list}
          rowKey="id"
          scroll={{ x: "max-content" }}
          columns={[
            {
              title: "报告标题",
              dataIndex: "name",
              key: "name",
              align: "center",
              minWidth: 100,
            },
            {
              title: "编辑时间",
              dataIndex: "a",
              key: "a",
              align: "center",
              minWidth: 100,
            },
            {
              title: "编辑人",
              dataIndex: "description",
              key: "description",
              align: "center",
              minWidth: 100,
            },
            {
              title: "操作",
              key: "h",
              align: "center",
              fixed: "right",
              render: (item: (typeof list)[0]) => {
                return (
                  <DageTableActions
                    renderBefore={
                      <Button size="small" type="link">
                        导出
                      </Button>
                    }
                  />
                );
              },
            },
          ]}
        />
      </div>
    </PageContainer>
  );
};

export default ManagementEvaluationPage;
