import { AddRoleModal, PageContainer } from "@/components";
import { FC, useState } from "react";
import { Pane } from "./components/Pane";
import { Table } from "antd";
import { DageTableActions } from "@dage/pc-components";

const SettingRole: FC = () => {
  const [addRoleVisible, setAddRoleVisible] = useState(false);

  return (
    <PageContainer title="设置角色">
      <Pane
        title="自评组"
        required
        tips="负责填报指标或上传资料的部门或组织"
        onAdd={() => setAddRoleVisible(true)}
      >
        <Table
          className="cus-table gray"
          columns={[
            {
              title: "自评组名称",
              align: "center",
              dataIndex: "name",
            },
            {
              title: "博物馆级别",
              align: "center",
              dataIndex: "level",
            },
            {
              title: "组别说明",
              align: "center",
              dataIndex: "description",
            },
            {
              title: "自评组成员",
              align: "center",
              dataIndex: "group",
            },
            {
              title: "操作",
              align: "center",
              render: (item: any, record, index) => {
                return <DageTableActions />;
              },
            },
          ]}
        />
      </Pane>

      <Pane
        title="评定组"
        tips="负责评定责任部门填报结果的人员"
        style={{ marginTop: 40 }}
      >
        <Table
          className="cus-table gray"
          columns={[
            {
              title: "评定组名称",
              align: "center",
              dataIndex: "name",
            },
            {
              title: "组别说明",
              align: "center",
              dataIndex: "description",
            },
            {
              title: "评定组成员",
              align: "center",
              dataIndex: "group",
            },
            {
              title: "操作",
              align: "center",
              render: (item: any, record, index) => {
                return <DageTableActions />;
              },
            },
          ]}
        />
      </Pane>

      <AddRoleModal
        open={addRoleVisible}
        onCancel={() => setAddRoleVisible(false)}
      />
    </PageContainer>
  );
};

export default SettingRole;
