baidu / amis

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

inputTable组件“获取父级数据”示例配置canAccessSuperData: true时,表格界面上能同步上层数据,但顶层form中没有数据 #10782

Closed thinkingc closed 1 month ago

thinkingc commented 2 months ago

描述问题:

inputTable组件“获取父级数据”示例配置canAccessSuperData: true时,表格界面上能同步上层数据,但顶层form中没有数据

截图或视频:

image

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

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

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

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

    {
    "type": "page",
    "body": {
    "type": "form",
    "debug": true,
    "mode": "horizontal",
    "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/form/saveForm",
    "body": [
      {
        "type": "input-text",
        "label": "父级文本框",
        "name": "super_text",
        "value": "123"
      },
      {
        "type": "switch",
        "label": "父级勾选框",
        "name": "super_switch",
        "value": false
      },
      {
        "type": "input-table",
        "name": "list",
        "label": "可获取父级数据",
        "addable": true,
        "needConfirm": false,
        "canAccessSuperData": true,
        "strictMode": false,
        "value": [
          {}
        ],
        "columns": [
          {
            "name": "super_text",
            "type": "text",
            "label": "表单项",
            "quickEdit": {
              "disabledOn": "this.super_switch"
            }
          },
          {
            "name": "super_switch",
            "type": "status",
            "quickEdit": false,
            "label": "非表单项"
          }
        ]
      }
    ]
    }
    }
  4. 操作步骤 开启canAccessSuperData,然后点击新增。可以看到第二条input中有“123”,但debug对应的数据是空的。

2betop commented 2 months ago

combo 好像可以

thinkingc commented 2 months ago

combo 好像可以

combo之前也有同样问题,这个issue #8773 修过

thinkingc commented 1 month ago

为什么没用combo的思路去修呢?