baidu/amis

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

Opened this issue · 3 comments

描述问题:

在更新数据链描述中,数据域在更新时,只追踪上面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。

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

Please review the labels and make any necessary changes.

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

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

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