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

export const modalFormProps: VbenFormProps = {
  wrapperClass: 'grid-cols-12', // 24栅格,
  commonConfig: {
    formItemClass: 'col-span-12',
    // 所有表单项
    componentProps: {
      class: 'w-full',
    },
  },
  layout: 'horizontal',
  showDefaultActions: false,
  schema: [
    {
      component: 'VbenInput',
      fieldName: 'id',
      label: 'ID',
      dependencies: {
        show: false,
        triggerFields: ['id'],
      },
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入问题内容',
        rows: 3,
      },
      fieldName: 'question',
      label: '问题内容',
      rules: 'required',
    },
    {
      component: 'Select',
      componentProps: {
        placeholder: '请选择问题类型',
        options: [
          {
            label: '转接方问题',
            value: 1,
          },
          {
            label: '在线复诊问题',
            value: 2,
          },
          {
            label: '购药在线复诊问题',
            value: 3,
          },
        ],
      },
      defaultValue: 1,
      fieldName: 'type',
      label: '问题类型',
      rules: 'required',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入答案选项，每行一个（默认：是、否）',
        rows: 4,
      },
      fieldName: 'answers',
      label: '答案选项',
      defaultValue: '否\n是',
    },
    {
      component: 'InputNumber',
      componentProps: {
        placeholder: '请输入排序（数字越小越靠前）',
        min: 0,
      },
      defaultValue: 0,
      fieldName: 'sort',
      label: '排序',
      rules: 'required',
    },
    {
      component: 'RadioGroup',
      componentProps: {
        options: [
          {
            label: '启用',
            value: 1,
          },
          {
            label: '禁用',
            value: 0,
          },
        ],
      },
      defaultValue: 1,
      fieldName: 'status',
      label: '状态',
      rules: 'required',
    },
  ],
};
