Files
DjangoAdmin_Django_EleVue/public/templates/ui/querySchemas.ts.tpl
T
2026-09-11 11:39:07 +08:00

29 lines
816 B
Smarty

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