import { FormConfig } from "/@/components/PageSearch";
import dayjs from "dayjs";
import { useUserStore } from "/@/store/modules/user";

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

const searchFormConfig: FormConfig = {
  formItems: [
    {
      field: "date",
      type: "date_picker",
      // defaultValue: [start, end],
      trigger: "change",
      otherOptions: {
        type: "daterange",
        startPlaceholder: "竞价开始时间",
        endPlaceholder: "竞价结束时间",
        valueFormat: "YYYY-MM-DD",
        startProp: "start",
        endProp: "end"
      }
    },
    {
      field: "depart_id",
      type: "depart-query",
      trigger: "change"
    },
    // {
    //   field: "supplierNo",
    //   type: 'supplier-query',
    //   placeholder: '供应商',
    //   trigger: 'change'
    // },
    {
      field: "person_id",
      type: 'user-query',
      trigger: 'change',
      placeholder: '供应商负责人'
    }
  ]
};

export default searchFormConfig;
