import type { ISearchConfig } from "@/components/CURD/types";
import consGroupApi from "@/api/product/cons-group";
import { statusOptions, payTypeOptions } from "./config";
const searchConfig: ISearchConfig = {
  pageName: "sys:user",
  inline: true,
  isExpandable: false,
  formItems: [
    {
      type: "select",
      label: "耗材分类",
      prop: "consGroupId",
      attrs: {
        placeholder: "请选择耗材分类",
        clearable: true,
        style: {
          width: "200px",
        },
      },
      initialValue: "",
      initFn(formItem) {
        console.log(formItem);
        consGroupApi.getAllList({}).then((res) => {
          formItem.options = res.map((item: { name: any; id: any }) => {
            return {
              label: item?.name,
              value: item?.id,
            };
          });
        });
      },
    },

    {
      type: "input",
      label: "耗材名称",
      prop: "conName",
      attrs: {
        placeholder: "请输入耗材名称",
        clearable: true,
        style: {
          width: "200px",
        },
      },
      initialValue: "",
    },
    // {
    //   type: "date-picker",
    //   label: "创建时间",
    //   prop: "createAt",
    //   attrs: {
    //     type: "daterange",
    //     "range-separator": "~",
    //     "start-placeholder": "开始时间",
    //     "end-placeholder": "截止时间",
    //     "value-format": "YYYY-MM-DD",
    //     style: {
    //       width: "240px",
    //     },
    //   },
    // },
  ],
};

export default searchConfig;
