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

数据域更新后下层组件展示异常 #10211

Open
thinkingc opened this issue May 10, 2024 · 3 comments
Open

数据域更新后下层组件展示异常 #10211

thinkingc opened this issue May 10, 2024 · 3 comments
Assignees
Labels
bug Something isn't working need confirm

Comments

@thinkingc
Copy link

描述问题:

在更新数据链描述中,数据域在更新时,只追踪上面2层,如果没有更新,该层数据拿不到最新值。

截图或视频:

点击”更改下拉选项内容,增加C选项“按钮增加c数据,input-table中的下拉会更新,但crud的filter下拉不会更新。但我理解page层的数据对于他们2个都超过2层,下面的数据都不会更新才对。但input-table的下拉框数据会更新,filter数据不更新。

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

  1. 你是如何使用 amis 的?
    npm

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

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

{
  "type": "page",
  "id": "u:0f734d5df702",
  "data": {
    "myList": [
      {
        "label": "A",
        "value": "a"
      },
      {
        "label": "B",
        "value": "b"
      }
    ],
    "tableList": [
      {}
    ]
  },
  "body": {  
      "type": "service",
        "api": "https://aliyunfc-amis-mock-gmecwxibod.cn-beijing.fcapp.run/api/amis-mock/mock2/crud/table?perPage=5",
        "body": [
          {
            "type": "service",
            "api": "https://aliyunfc-amis-mock-gmecwxibod.cn-beijing.fcapp.run/api/amis-mock/mock2/crud/table?perPage=5",
            "body": [
              {
                "type": "form",
                "title": "表单",
                "id": "u:07f35d0c0180",
                "body": [
                  {
                    "level": "primary",
                    "onEvent": {
                      "click": {
                        "actions": [
                          {
                            "componentId": "u:0f734d5df702",
                            "ignoreError": false,
                            "actionType": "setValue",
                            "args": {
                              "value": {
                                "myList": [
                                  {
                                    "label": "A",
                                    "value": "a"
                                  },
                                  {
                                    "label": "B",
                                    "value": "b"
                                  },
                                  {
                                    "label": "C",
                                    "value": "c"
                                  }
                                ]
                              }
                            }
                          }
                        ]
                      }
                    },
                    "id": "u:1aaf3c7b154f",
                    "label": "更改下拉选项内容,增加C选项",
                    "type": "button"
                  },
                  {
                    "name": "select",
                    "multiple": false,
                    "id": "u:c5802ebb178e",
                    "label": "点击按钮后此下拉选项会变化:",
                    "source": "${myList}",
                    "type": "select",
                    "horizontal": {
                      "left": 3,
                      "right": 9
                    }
                  },
                  {
                    "addable": true,
                    "footerAddBtn": {
                      "icon": "fa fa-plus",
                      "id": "u:4fcccd2a3b96",
                      "label": "新增"
                    },
                    "columns": [
                      {
                        "quickEdit": false,
                        "name": "name",
                        "id": "u:d398946f9ad5",
                        "label": "按理此下拉选项应该也变(用的同一source),但是没有变,有bug",
                        "source": "${myList}",
                        "type": "select"
                      }
                    ],
                    "minLength": 0,
                    "strictMode": false,
                    "needConfirm": false,
                    "name": "tableList",
                    "id": "u:b5fb3e0c8ffe",
                    "label": "表格表单",
                    "type": "input-table",
                    "canAccessSuperData": true
                  }
                ]
              },
              {
                "type": "crud",
                "filter": {
                  "debug": true,
                  // "trackExpression": "${myList|json}",
                  "body": [
                    {
                      "type": "select",
                      "name": "a",
                      "source": "${myList}"
                    }
                  ]
                }
              }
            ]
          }
        ]
  }
}
  1. 操作步骤
    先点击crud、和input-table的下拉,观察数据只有a/b,在点击”更改下拉选项内容,增加C选项“更新myList数据。此时input-table的下拉数据增加c,但crud没有c。
@github-actions github-actions bot added the bug Something isn't working label May 10, 2024
Copy link

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

@2betop
Copy link
Collaborator

2betop commented May 20, 2024

最新的 master 分支没有复现,应该是已经修复了
image

@2betop 2betop self-assigned this May 20, 2024
@thinkingc
Copy link
Author

最新的 master 分支没有复现,应该是已经修复了 image

filter配置trackExpression是可以取到的。不太理解官网这段描述,上面例子点击”新增c“后,input-table的select值更新了,和二层更新描述不符。
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need confirm
Projects
None yet
Development

No branches or pull requests

2 participants