amisadmin / fastapi-amis-admin

FastAPI-Amis-Admin is a high-performance, efficient and easily extensible FastAPI admin framework. Inspired by django-admin, and has as many powerful functions as django-admin.
http://docs.amis.work
Apache License 2.0
1.09k stars 161 forks source link

enum类型字段显示、筛选异常 #189

Open zeroChen00 opened 1 month ago

zeroChen00 commented 1 month ago

1、显示异常 使用enum类型时,可以通过设置kwargs["quickEdit"] = True进行填写框下拉,功能正常 image

但是字段下拉框用的是mapping类型的kwargs["filterable"],会超出文本框。后改成无类型的kwargs["filterable"],还是超出文本框,导致显示异常。 image

2、筛选异常 enum类型还会导致搜索异常,筛选无法生效 image

enum类型我是在数据模型中设置的,如:

class SystemType(Enum):
    Option1 = "xx系统"
    Option2 = "xx系统"
    Option3 = "xx系统"

搜索异常怀疑是name和lable的中英文导致的。全使用中文时,带括号的话会变量异常;全使用英文,就无法看到中文了。如果再用映射去处理,又太冗杂了。

求教 @amisadmin

prostospirit commented 3 weeks ago

@zeroChen00 Please write your text in English so that other users can assist you more easily.