Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crud的filter表单下拉框中如果使用了上层service中的数据,默认获取不到数据 #10217

Closed
dabanheiji opened this issue May 11, 2024 · 1 comment · Fixed by #10253

Comments

@dabanheiji
Copy link
Contributor

描述问题:

crud的filter表单下拉框中如果使用了上层service中的数据,默认获取不到数据,进行一次查询操作后才能获取到

截图或视频:

image

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的?
    使用方式见下方schema

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
    目前站点上问题依然存在

  3. 粘贴有问题的完整 amis schema 代码:

{
  "type": "page",
  "body": {
    "type": "service",
    "api": {
      "url": "https://aliyunfc-amis-mock-gmecwxibod.cn-beijing.fcapp.run/api/amis-mock/mock2/options/autoComplete3?term=$term",
      "adaptor": "return { data: { options: payload } }"
    },
    "body": [
      {
        "type": "tpl",
        "tpl": "${options.data|json}"
      },
      {
        "type": "crud",
        "api": "/amis/api/mock2/sample",
        "syncLocation": false,
        "autoGenerateFilter": {
          "defaultExpanded": true,
          "showBtnToolbar": false
        },
        "filter": {
          "body": [
            {
              "type": "select",
              "name": "browser",
              "label": "浏览器",
              "labelField": "lab",
              "valueField": "val",
              "placeholder": "选择浏览器",
              "source": "${options.data}"
            }
          ]
        },
        "headerToolbar": [
          {
            "type": "columns-toggler",
            "align": "right",
            "draggable": true,
            "icon": "fas fa-cog",
            "overlay": true,
            "footerBtnSize": "sm"
          }
        ],
        "columns": [
          {
            "name": "id",
            "label": "ID"
          },
          {
            "name": "engine",
            "label": "Rendering engine"
          },
          {
            "name": "browser",
            "label": "Browser"
          },
          {
            "name": "platform",
            "label": "Platform(s)",
            "headSearchable": true
          },
          {
            "name": "version",
            "label": "Engine version"
          },
          {
            "name": "grade",
            "label": "CSS grade",
            "headSearchable": {
              "type": "input-text",
              "name": "grade",
              "label": "CSS grade",
              "mode": "horizontal"
            }
          }
        ]
      }
    ]
  }
}
  1. 操作步骤
    请简单描述一下复现的操作步骤...
@2betop
Copy link
Collaborator

2betop commented May 17, 2024

#10253 合入可修复此问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants