import type { VbenFormProps } from '#/adapter/form';

export const modalFormProps: VbenFormProps = {
  wrapperClass: 'grid-cols-12', // 24栅格,
  commonConfig: {
    formItemClass: 'col-span-12',
    // 所有表单项
    componentProps: {
      class: 'w-full',
    },
  },
  // handleSubmit: onSubmit,
  layout: 'horizontal',
  schema: [
    {
      component: 'VbenInput',
      fieldName: 'id',
      label: 'ID',
      formItemClass: 'col-span-6',
      dependencies: {
        show: false,
        triggerFields: ['id'],
      },
    },
    {
      component: 'WarehouseAdminDrugSearch',
      fieldName: 'drug_id',
      label: '选择加入的药品',
      formItemClass: 'col-span-12',
      rules: 'required',
      componentProps: {
        productType: 1,
      },
      dependencies: {
        show(formValues: any) {
          return !formValues.id;
        },
        triggerFields: ['id'],
      },
    },
    {
      component: 'VbenInput',
      componentProps: {
        placeholder: '请输入供货价格',
      },
      fieldName: 'market_price',
      formItemClass: 'col-span-12',
      label: '供货价格',
      rules: 'required',
    },
    {
      component: 'VbenInput',
      componentProps: {
        placeholder: '请输入价格',
      },
      fieldName: 'price',
      formItemClass: 'col-span-12',
      label: '价格',
      rules: 'required',
    },
  ],
  showDefaultActions: false,
};
export const uploadExcelProps: VbenFormProps = {
  wrapperClass: 'grid-cols-12', // 24栅格,
  commonConfig: {
    formItemClass: 'col-span-12',
    // 所有表单项
    componentProps: {
      class: 'w-full',
    },
  },
  // handleSubmit: onSubmit,
  layout: 'horizontal',
  schema: [
    {
      component: 'Upload',
      componentProps: {
        placeholder: '请选择',
        multiple: true,
      },
      fieldName: 'frequency_id',
      formItemClass: 'col-span-12',
      label: '导入excel',
      rules: 'file',
    },
  ],
  showDefaultActions: false,
};
