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

inputTable取消编辑时会导致数据错误 #11506

Open
pptttiger opened this issue Jan 15, 2025 · 2 comments
Open

inputTable取消编辑时会导致数据错误 #11506

pptttiger opened this issue Jan 15, 2025 · 2 comments
Assignees

Comments

@pptttiger
Copy link

pptttiger commented Jan 15, 2025

描述问题:

inputTable取消编辑时会导致数据错误,inputTable中有3条数据,当对第3条数据进行修改,将B字段值改为【b3333333】,点击保存,再对第2条数据进行修改,不做任何字段的变更,直接点击取消按钮,第2条数据变成了第3条的历史数据【a3】【b3】。

截图或视频:

image

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

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

  2. amis 版本是什么?
    V6.7.0 ~6.10.0

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

{
  "type": "page",
  "body": {
    "type": "form",
    "api": "/amis/api/mock2/form/saveForm",
    "debug": true,
    "body": [
      {
        "type": "input-table",
        "name": "table",
        "addable": true,
        "copyable": true,
        "copyData": {
          "&": "$$",
          "id": "${'__undefined'}",
          "copyFrom": "${id}"
        },
        "editable": true,
        "value": [
          {
            "a": "a1",
            "b": "b1",
            "id": 1
          },
          {
            "a": "a2",
            "b": "b2",
            "id": 2
          },
          {
            "a": "a3",
            "b": "b3",
            "id": 3
          },
          {
            "a": "a4",
            "b": "b4",
            "id": 4
          }
        ],
        "columns": [
          {
            "name": "a",
            "label": "A"
          },
          {
            "name": "b",
            "label": "B"
          }
        ]
      }
    ]
  }
}```

5. 操作步骤
inputTable中有3条数据,当对第3条数据进行修改,将B字段值改为【b3333333】,点击保存,再对第2条数据进行修改,不做任何字段的变更,直接点击取消按钮,第2条数据变成了第3条的历史数据【a3】【b3】。
@boxui
Copy link

boxui commented Jan 16, 2025

刚试了确实是个bug,取消编辑状态的时候拿到上一次编辑行的数据了。

@lhtuling
Copy link

真神奇。。还真是 哈哈哈哈 我经常用这个玩意儿都没发现

欢迎大佬来交流

Amis低代码前端框架交流群【QQ 1群】:717791727
Amis低代码前端框架交流群【QQ 2群】:721182449

@2betop 2betop self-assigned this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants