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',
      defaultValue: '',
      dependencies: {
        show: false,
        triggerFields: ['id'],
      },
    },
    {
      component: 'VbenInput',
      componentProps: {
        placeholder: '请输入资质名称',
      },
      fieldName: 'name',
      label: '资质名称',
      rules: 'required',
      defaultValue: '',
    },
    {
      component: 'VbenSelect',
      componentProps: {
        placeholder: '请选择资质类型',
        options: [
          { label: '药品经营许可证', value: 1 },
          { label: '营业执照', value: 2 },
          { label: '医疗器械经营许可证', value: 3 },
          { label: '食品经营许可证', value: 4 },
          { label: '药师资格证', value: 5 },
        ],
      },
      fieldName: 'type',
      label: '资质类型',
      rules: 'required',
      defaultValue: undefined,
    },
    {
      component: 'Avatar',
      fieldName: 'image',
      label: '资质图片',
      defaultValue: '',
    },
    {
      component: 'InputNumber',
      componentProps: {
        placeholder: '请输入排序顺序',
        min: 0,
      },
      fieldName: 'sort_order',
      label: '排序顺序',
      formItemClass: 'col-span-6',
      defaultValue: 0,
    },
    {
      component: 'VbenSelect',
      componentProps: {
        placeholder: '请选择状态',
        options: [
          { label: '启用', value: 1 },
          { label: '禁用', value: 0 },
        ],
      },
      fieldName: 'status',
      label: '状态',
      formItemClass: 'col-span-6',
      defaultValue: 1,
    },
    {
      component: 'VbenInputNumber',
      componentProps: {
        placeholder: '门店ID（留空表示平台通用）',
        min: 0,
      },
      fieldName: 'store_id',
      label: '门店ID',
      formItemClass: 'col-span-6',
      defaultValue: 0,
    },
  ],
  showDefaultActions: false,
};
