import { FormType } from "@/components/form/interface";
import { UserDataType } from "@/model/userModel";
import { CompanyConfig } from "@/service/user_config";
import { ColumnsType } from "antd/lib/table";
export const defaultConfig = [
  {
    type: FormType.input,
    label: "名称",
    name: "name",
    value: "",
    rules: [{ required: true, message: "请输入企业名称!" }],
  },
  {
    type: FormType.input,
    label: "描述",
    name: "desc",
    value: "",
    rules: [{ required: true, message: "请输入企业描述" }],
  },
  {
    type: FormType.input,
    label: "负责人",
    name: "head",
    value: "",
    rules: [{ required: true, message: "请输入负责人" }],
  },
  {
    type: FormType.input,
    label: "电话",
    name: "phone",
    value: "",
    rules: [{ required: true, message: "请输入企业电话" }],
  },

  {
    type: FormType.input,
    label: "邮箱",
    name: "email",
    value: "",
    rules: [{ required: true, message: "请输入邮箱" }],
  },
  {
    type: FormType.select,
    label: "上级企业",
    name: "p_id",
    value: 0,
    selectUrl: CompanyConfig.LIST,
    keys: "name",
    rules: [],
  },
];

export const columns: ColumnsType<UserDataType> = [
  {
    title: "企业名称",
    dataIndex: "name",
    width: 200,
    fixed: "left",
  },
  {
    title: "企业描述",
    dataIndex: "desc",
  },

  {
    title: "负责人",
    dataIndex: "head",
  },
  {
    title: "企业电话",
    width: 150,
    dataIndex: "phone",
  },
  {
    title: "企业邮箱",
    width: 150,
    dataIndex: "email",
  },
  {
    title: "上级企业名称",
    width: 150,
    dataIndex: "email",
  },
];
