import { FormType } from "@/components/form/interface";
import { UserDataType } from "@/model/userModel";
import { ColumnsType } from "antd/lib/table";
import dayjs from "dayjs";
export const columns: ColumnsType<UserDataType> = [
  {
    title: "分类名称",
    dataIndex: "name",
  },
];


export const leaveColumns: ColumnsType<UserDataType> = [
  {
    title: "请假人",
    dataIndex: "user_name",
  },
  {
    title: "请假开始时间",
    dataIndex: "leave_start_time",
    render(leave_start_time) {
      return dayjs(leave_start_time).format("YYYY-MM-DD");
    }
  },
  {
    title: "请假结束时间",
    dataIndex: "leave_end_time",
    render(leave_end_time) {
      return dayjs(leave_end_time).format("YYYY-MM-DD");
    }
  },
  {
    title: "请假备注",
    dataIndex: "leave_remark",
  },
  {
    title: "驳回原因",
    dataIndex: "reject_mark",
  },
  {
    title: "审批人",
    dataIndex: "audit_name",
  },
  {
    title: "假期类别",
    dataIndex: "name",
  },
  {
    title: "审核状态",
    dataIndex: "status",
    render(value, record, index) {
      return record.status === 1
        ? "已通过"
        : record.status === 2
        ? "已驳回"
        : "待审批";
    },
  },
];
 
export const defaultConfig = [
 
  {
    type: FormType.input,
    label: "驳回原因",
    name: "reject_mark",
    value: "",
    rules: [{ required: true, message: "请输入驳回原因!" }],
  },
];

 
export const defaultCatConfig = [
  {
    type: FormType.input,
    label: "分类名称",
    name: "name",
    value: "",
    rules: [{ required: true, message: "请输入分类名称!" }],
  },
];
