baidu / amis

前端低代码框架,通过 JSON 配置就能生成各种页面。
https://baidu.github.io/amis/
Apache License 2.0
17.33k stars 2.51k forks source link

crud 分页参数和查询参数 没有自动附加到请求中 #10230

Closed woxiangbo closed 5 months ago

woxiangbo commented 5 months ago

实现场景:

在使用crud进行翻页,或者按照action_status 进行查询, 参数没有自动附加到请求中,如图,

image

下面是我的json代码,我使用的是 amis-admin 请问是因为缺少什么配置 还是哪里配错了? 感谢回答!!

{
    "type": "page",
    "body":
    [

        {
            "type": "crud",
             "keepItemSelectionOnPageChange": true,
            "api": "${API_HOST}/weekly/demo",
            "initFetch": true,
            "name": "laterAction_cds",
            "columns":
            [
                {
                    "name": "data_entered",
                    "label": "测试日期"
                },
                {
                    "name": "fail_reason",
                    "label": "失败原因"
                },
                {
                    "name": "error_category",
                    "label": "错误分类"
                },
                {
                    "name": "later_action",
                    "label": "后续action"
                },
                {
                    "name": "action_status",
                    "label": "措施状态",
                    "searchable":
                    {
                        "type": "select",
                        "name": "action_status",
                        "label": "措施状态",
                        "clearable": false,
                        "multiple": false,
                        "options":
                        [
                            "进行中",
                            "已完成"
                        ]
                    }
                },
                {
                    "name": "action_owner",
                    "label": "措施责任人"
                },
                {
                    "name": "total",
                    "label": "预计完成时间"
                }
            ]
        }
    ]
}
woxiangbo commented 5 months ago

是因为 "api": "${API_HOST}/weekly/demo", 用了 变量的原因么?
如果直接写完整的url是可以的

2betop commented 5 months ago

是的,一旦用了变量,就是配啥发啥了

2betop commented 5 months ago

这里有说明 https://aisuda.bce.baidu.com/amis/zh-CN/components/crud#query-%E5%8F%82%E6%95%B0