import { FormConfig } from "/@/components/PageSearch";
import dayjs from "dayjs";

const current = dayjs(new Date());
const end = current.format("YYYY-MM-DD");
const start = current.subtract(29, "days").format("YYYY-MM-DD");

const searchFormConfig: FormConfig = {
  formItems: [
    {
      field: "date",
      type: "date_picker",
      trigger: "change",
      defaultValue: [start, end],
      otherOptions: {
        type: "daterange",
        startPlaceholder: "发起开始时间",
        endPlaceholder: "发起结束时间",
        valueFormat: "YYYY-MM-DD",
        startProp: "start_date",
        endProp: "end_date"
      }
    },
    {
      field: "supplierNo",
      placeholder: "供应商编码",
      trigger: "change",
      type: "input"
    },
    {
      field: "supplier_name",
      placeholder: "供应商名称",
      trigger: "change",
      type: "input"
    }
  ]
};

export default searchFormConfig;
