import { FormType } from "@/components/form/interface";
import { UserDataType } from "@/model/userModel";
import SourceConfig from "@/service/source_config";
import { EventTypeConfig } from "@/service/user_config";
import { ColumnsType } from "antd/es/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.textarea,
    label: "事件内容",
    name: "content",
    value: "",
    rules: [{ required: true, message: "请输入事件内容!" }],
  },
  {
    type: FormType.input,
    label: "事件地点",
    name: "address",
    value: "",
    rules: [{ required: true, message: "请输入事件地点!" }],
  },
   {
    type: FormType.select,
    label: "事件类型",
    name: "type_identity",
    value: "",
    keys:"type_name",
    selectUrl: EventTypeConfig.LIST,
    rules: [{ required: true, message: "请输入事件地点!" }],
  },
  {
    type: FormType.input,
    label: "事件开始时间",
    name: "start_time",
    value: "",
    rules: [{ required: true, message: "请输入事件开始时间!" }],
  },
  {
    type: FormType.input,
    label: "事件结束时间",
    name: "end_time",
    value: "",
    rules: [{ required: true, message: "请输入事件开始时间!" }],
  },
  {
    type: FormType.input,
    label: "造成的影响",
    name: "effect",
    value: "",
    rules: [{ required: true, message: "请输入影响!" }],
  },
  {
    type: FormType.select,
    label: "负责人选择",
    name: "director",
    value: "",
    mode: "",
    selectUrl: SourceConfig.Searchs,
    keys:"content",
    rules: [{ required: false, message: "请选择负责人!" }],
  },
  {
    type: FormType.input,
    label: "负责人电话",
    name: "tel",
    value: "",
    rules: [{ required: true, message: "请输入负责人电话!" }],
  },
  
  {
    type: FormType.fetchList,
    label: "参与人员选择",
    name: "part_idCard",
    mode: "multiple",
    value: [],
    selectUrl: SourceConfig.Searchs,
    rules: [{ required: false, message: "请选择参与人员!" }],
  },
  {
    type: FormType.select,
    label: "事件等级",
    name: "level",
    value: 1,
    selectList: [
      {
        name: "普通",
        id: 1,
      }, {
        name: "紧急",
        id: 2,
      }, {
        name: "特级",
        id: 3,
      }
    ],
    rules: [{ required: true, message: "请输入事件等级!" }],
  },
  {
    type: FormType.upload,
    label: "现场拍摄",
    name: "images",
    value: [],
    rules: [],
  },
]


export const columns: ColumnsType<UserDataType> = [
  {
    title: "事件名称",
    dataIndex: "name",
    fixed: "left",
  },
  {
    title: "事件描述",
    dataIndex: "desc",
  },
  {
    title: "事件内容",
    dataIndex: "content",
  },
  {
    title: "事件地点",
    dataIndex: "address",
  },
  {
    title: "事件开始时间",
    dataIndex: "start_time",
  },
  {
    title: "事件结束时间",
    dataIndex: "end_time",
  },
  {
    title: "影响",
    dataIndex: "effect",
  },
  {
    title: "负责人名称",
    dataIndex: "director",
  },
  {
    title: "电话",
    dataIndex: "tel",
  },

];
