import { FormSchema } from '@/components/Form/index'; /** * 查询表单配置 * 定义搜索区域的表单项 */ export const schemas: FormSchema[] = [ {% for field in filter_fields %} { field: '{{ field.name }}', component: '{% if field.type == 'CharField' %}NInput{% elif field.choices %}NSelect{% elif field.type == 'IntegerField' and not field.choices %}NInputNumber{% elif field.type == 'DateField' %}NDatePicker{% else %}NInput{% endif %}', label: '{{ field.label }}', componentProps: { placeholder: '请输入{{ field.label }}', clearable: true, filterable: {% if field.choices %}true{% else %}false{% endif %}, {% if field.choices %} options: [ {% for choice in field.choices %} { label: '{{ choice.label }}', value: {{ choice.value }}, }, {% endfor %} ], {% endif %} }, }, {% endfor %} ];