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'],
      },
    },
    // 生成的表单字段
    {
      fieldName: 'user_id',
      label: '用户',
      component: 'VbenInput',
      rules: 'required',
    },
    {
      fieldName: 'province',
      label: '省',
      component: 'InputNumber',
      rules: 'required',
    },
    {
      fieldName: 'city',
      label: '市',
      component: 'InputNumber',
      rules: 'required',
    },
    {
      fieldName: 'district',
      label: '区',
      component: 'InputNumber',
      rules: 'required',
    },
    {
      fieldName: 'detailed_address',
      label: '详细地址',
      component: 'Textarea',
      rules: 'required',
    },
    {
      fieldName: 'complete_address',
      label: '完整地址',
      component: 'VbenInput',
      rules: 'required',
    },
  ],
  showDefaultActions: false,
};
