baidu / amis

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

使用input-table组件根据行数据来标识是否可以被删除 #11203

Closed younglifestyle closed 1 week ago

younglifestyle commented 1 week ago

实现场景:

input-table里面"removable": true,但是是针对所有行都可以被删除,是否可以针对每行来控制是否可被删除

存在的问题:

请简单描述你现在遇到的不符合预期的问题...

当前方案:

{
  "type": "page",
  "body": {
    "type": "form",
    "data": {
      "table": [
        {
          "a": "a1",
          "b": "b1"
        },
        {
          "a": "a2",
          "b": "b2"
        },
        {
          "a": "a3",
          "b": "b3"
        }
      ]
    },
    "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/form/saveForm",
    "body": [
      {
        "type": "input-table",
        "name": "table",
        "label": "Table",
        "needConfirm": false,
        "addable": true,
        "removable": true,
        "columns": [
          {
            "label": "A",
            "name": "a",
            "quickEdit": false
          },
          {
            "label": "B",
            "name": "b"
          }
        ]
      }
    ]
  }
}