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: 'order_id',
      label: '订单ID',
      component: 'VbenInput',
      rules: 'required',
    },
    {
      fieldName: 'product_id',
      label: '商品ID',
      component: 'VbenInput',
      rules: 'required',
    },
    {
      fieldName: 'quantity',
      label: '商品数量',
      component: 'VbenInputNumber',
      rules: 'required',
    },
    {
      fieldName: 'subtotal',
      label: '小计金额',
      component: 'VbenInputNumber',
      rules: '',
    },
    {
      fieldName: 'snapshot',
      label: '商品快照',
      component: 'VbenInput',
      rules: '',
    },
  ],
  showDefaultActions: false,
};
