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: 'nick_name',
      label: '用户昵称',
      component: 'VbenInput',
      rules: 'required',
    },
    {
      fieldName: 'phone',
      label: '手机号码',
      component: 'VbenInput',
      rules: 'required',
    },
    {
      fieldName: 'email',
      label: '邮箱',
      component: 'VbenInput',
      rules: 'required',
    },
    {
      fieldName: 'level',
      label: '用户会员等级',
      component: 'InputNumber',
      rules: 'required',
    },
    {
      fieldName: 'balance',
      label: '用户余额',
      component: 'InputNumber',
      rules: 'required',
    },
    {
      fieldName: 'avatar',
      label: '用户头像',
      component: 'Avatar',
      rules: 'required',
    },
    {
      fieldName: 'integral',
      label: '积分',
      component: 'InputNumber',
      rules: 'required',
    },
  ],
  showDefaultActions: false,
};
