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",
  },
  {
    title: "物资描述",
    dataIndex: "desc",
  },
  {
    title: "过期时间",
    dataIndex: "expiry_date",
    render: (expiry_date) => <>{ <span>{dayjs(expiry_date).format("YYYY-MM-DD")}</span>}</>,
  },
  {
    title: "货架名称",
    dataIndex: "storage_name",
  },
  {
    title: "货架位置",
    dataIndex: "storage_cloumn",
  },
  {
    title: "所属仓库",
    dataIndex: "stash_name",
  },
  {
    title: "数量",
    dataIndex: "num",
  },
];

export const defaultConfig = [
 
  {
    type: FormType.input,
    label: "货架位置",
    name: "storage_cloumn",
    value: "",
    rules: [{ required: true, message: "请选择货架位置!" }],
  },
 
  {
    type: FormType.input,
    label: "物资名称",
    name: "name",
    value: "",
    rules: [{ required: true, message: "请输入物资名称!" }],
  },
  {
    type: FormType.input,
    label: "物资描述",
    name: "desc",
    value: "",
    rules: [{ required: true, message: "请输入物资描述!" }],
  },
  {
    type: FormType.inputNumber,
    label: "物资数量",
    name: "num",
    value: "",
    rules: [{ required: true, message: "请输入物资数量!" }],
  },
  {
    type: FormType.date,
    label: "过期时间",
    name: "expiry_date",
    value: "",
    rules: [{ required: true, message: "请选择过期时间!" }],
  },
  {
    type: FormType.upload,
    label: "物资图片",
    name: "supplie_piker",
    value: [],
  },
];
