amis icon indicating copy to clipboard operation
amis copied to clipboard

crud组件defaultChecked属性无效

Open lucasrui opened this issue 4 years ago • 2 comments

描述问题:

  1. crud组件defaultChecked属性无效。启用了批量操作功能,即存在bulkActions,并将defaultChecked属性设置为true,但渲染的时候,并没有全选。
  2. 看了下代码"CRUD.tsx",其中"export interface CRUDCommonSchema extends BaseSchema"并没有存在defaultChecked属性。

截图或视频:

可以的话,尽可能提供截图或视频来补充描述你的问题... image

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

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

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

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

{
  "type": "page",
  "body": {
    "type": "crud",
    "syncLocation": false,
    "defaultChecked": true,
    "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/sample",
    "headerToolbar": [
      "bulkActions"
    ],
    "bulkActions": [
      {
        "label": "批量删除",
        "actionType": "ajax",
        "api": "delete:https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/sample/${ids|raw}",
        "confirmText": "确定要批量删除?"
      },
      {
        "label": "批量修改",
        "actionType": "dialog",
        "dialog": {
          "title": "批量编辑",
          "body": {
            "type": "form",
            "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/sample/bulkUpdate2",
            "body": [
              {
                "type": "hidden",
                "name": "ids"
              },
              {
                "type": "input-text",
                "name": "engine",
                "label": "Engine"
              }
            ]
          }
        }
      }
    ],
    "columns": [
      {
        "name": "id",
        "label": "ID"
      },
      {
        "name": "engine",
        "label": "Rendering engine"
      },
      {
        "name": "browser",
        "label": "Browser"
      },
      {
        "name": "platform",
        "label": "Platform(s)"
      },
      {
        "name": "version",
        "label": "Engine version"
      },
      {
        "name": "grade",
        "label": "CSS grade"
      }
    ]
  }
}
  1. 操作步骤 无需操作,直接渲染。

lucasrui avatar Dec 16 '21 07:12 lucasrui

检查了下没有这个属性和功能,应该是文档写错了

RickCole21 avatar Jan 05 '22 08:01 RickCole21

如果我想要使用默认全选的功能,除了自己封装组件,是否还有其他更优雅的方式? 强烈建议支持此功能💡。在很多业务场景下需要使用到。

lucasrui avatar Jan 19 '22 09:01 lucasrui