Thanks to visit codestin.com
Credit goes to github.com

Skip to content

inputTable组件在嵌套的场景下deleteItem动作删除逻辑有误 #10758

@dabanheiji

Description

@dabanheiji

描述问题:

inputTable组件在嵌套的场景下deleteItem动作删除逻辑有误

截图或视频:

image
图中点击按规则删除,第三行符合规则但是第三行却不会被删除

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

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

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

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

{
  "type": "page",
  "data": {
    "canDelete": true
  },
  "body": {
    "type": "form",
    "debug": true,
    "api": "/api/mock2/form/saveForm",
    "body": [
      {
        "type": "button",
        "label": "删除行(指定条件表达式)",
        "onEvent": {
          "click": {
            "actions": [
              {
                "componentId": "deleteItem-input-table",
                "groupType": "component",
                "actionType": "deleteItem",
                "args": {
                  "condition": "${(a === 'a3' || b === 'b4')}"
                }
              }
            ]
          }
        }
      },
      {
        "type": "input-table",
        "label": "表格表单",
        "id": "deleteItem-input-table",
        "name": "table",
        "columns": [
          {
            "name": "a",
            "label": "A"
          },
          {
            "name": "b",
            "label": "B"
          }
        ],
        "addable": true,
        "footerAddBtn": {
          "label": "新增",
          "icon": "fa fa-plus",
          "hidden": true
        },
        "strictMode": true,
        "minLength": 0,
        "needConfirm": false,
        "showTableAddBtn": false
      }
    ],
    "data": {
      "table": [
        {
          "a": "a1",
          "b": "b1",
          "id": 1,
          "children": [
            {
              "a": "a1-child1",
              "b": "b1-child1",
              "id": "1-1"
            },
            {
              "a": "a1-child2",
              "b": "b1-child2",
              "id": "1-2"
            }
          ]
        },
        {
          "a": "a2",
          "b": "b2",
          "id": 2,
          "children": [
            {
              "a": "a2-child1",
              "b": "b2-child1",
              "id": "2-1"
            },
            {
              "a": "a2-child2",
              "b": "b2-child2",
              "id": "2-2"
            }
          ]
        },
        {
          "a": "a3",
          "b": "b3",
          "id": 3,
          "children": [
            {
              "a": "a3-child1",
              "b": "b3-child1",
              "id": "3-1"
            },
            {
              "a": "a3-child2",
              "b": "b3-child2",
              "id": "3-2"
            }
          ]
        }
      ]
    }
  }
}
  1. 操作步骤
    复制上述schema到站点,点击删除按钮,第三行不会被删除

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions