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

import { getZoneOptions } from '../api';

export const formOptions: VbenFormProps = {
  collapsed: false,
  commonConfig: {
    componentProps: {
      class: 'w-full',
    },
  },
  schema: [
    {
      component: 'ApiSelect',
      componentProps: {
        api: getZoneOptions,
        labelField: 'title',
        valueField: 'id',
        placeholder: '请选择专区',
        allowClear: true,
      },
      fieldName: 'zone_id',
      label: '所属专区',
    },
    {
      component: 'VbenInput',
      componentProps: {
        placeholder: '请输入分类名称',
      },
      fieldName: 'category_name',
      label: '分类名称',
    },
    {
      component: 'VbenSelect',
      componentProps: {
        allowClear: true,
        options: [
          { label: '一级分类', value: 1 },
          { label: '二级分类', value: 2 },
          { label: '三级分类', value: 3 },
        ],
        placeholder: '请选择层级',
      },
      fieldName: 'level',
      label: '分类层级',
    },
  ],
  showCollapseButton: true,
  submitButtonOptions: {
    content: '查询',
  },
  wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3',
};

