import type { ISearchConfig } from "@/components/CURD/types";
import { paramTypeOptions } from './config'
import UserAPI from "@/api/product/productclassification";
import ShopApi from "@/api/account/shop";


const searchConfig: ISearchConfig = {
  pageName: "sys:user",
  formItems: [
    {
      type: "select",
      label: "分店选择",
      prop: "shopId",
      attrs: {
        placeholder: "请选择分店",
        clearable: true,
        style: {
          width: "200px",
        },
      },
      options: [],
      async initFn(formItem) {
        // formItem.options = await UserAPI.getList();
        let res = await ShopApi.getBranchList();
        let options = [];
        res.map(v=>{
          options.push({
            label: v.shopName,
            value: v.shopId,
          })
        })  
        formItem.options = options

      },
    },
    {
      type: "input",
      label: "账号名",
      prop: "name",
      attrs: {
        placeholder: "请输入账号名",
        clearable: true,
        style: {
          width: "200px",
        },
      },
    },
    {
      type: "input",
      label: "员工编号",
      prop: "code",
      attrs: {
        placeholder: "请输入员工编号",
        clearable: true,
        style: {
          width: "200px",
        },
      },
    },
  ],
};

export default searchConfig;
