Skip to content

bug:crud2的table有隐藏列时,自定义显示列控制异常 #12258

@qppq54s

Description

@qppq54s

描述问题:

例如,如果有三列,id,name,age,隐藏id,显示列控制里展示的是name,age,但是点击age,隐藏的是name。age无法取消选中

截图或视频:

Image

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

  1. 你是如何使用 amis 的?
    amis-editor 官方示例

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

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

{
  "type": "page",
  "regions": [
    "body"
  ],
  "body": [
    {
      "id": "u:729a5d929711",
      "type": "crud2",
      "mode": "table2",
      "dsType": "api",
      "syncLocation": true,
      "primaryField": "id",
      "loadType": "pagination",
      "api": {
        "url": "",
        "method": "get"
      },
      "headerToolbar": [
        {
          "type": "flex",
          "direction": "row",
          "justify": "flex-start",
          "alignItems": "stretch",
          "style": {
            "position": "static"
          },
          "items": [
            {
              "type": "container",
              "align": "left",
              "behavior": [
                "Insert",
                "BulkEdit",
                "BulkDelete",
                "Export"
              ],
              "body": [],
              "wrapperBody": false,
              "style": {
                "flexGrow": 1,
                "flex": "1 1 auto",
                "position": "static",
                "display": "flex",
                "flexBasis": "auto",
                "flexDirection": "row",
                "flexWrap": "nowrap",
                "alignItems": "stretch",
                "justifyContent": "flex-start"
              },
              "id": "u:26c93eec6ba1"
            },
            {
              "type": "container",
              "align": "right",
              "behavior": [
                "FuzzyQuery"
              ],
              "body": [
                {
                  "type": "column-toggler",
                  "btnClassName": "m-l-xs",
                  "id": "u:94348446a5f4",
                  "align": "right"
                }
              ],
              "wrapperBody": false,
              "style": {
                "flexGrow": 1,
                "flex": "1 1 auto",
                "position": "static",
                "display": "flex",
                "flexBasis": "auto",
                "flexDirection": "row",
                "flexWrap": "nowrap",
                "alignItems": "stretch",
                "justifyContent": "flex-end"
              },
              "id": "u:876a66454247"
            }
          ],
          "id": "u:eb96bd5bab0a"
        }
      ],
      "footerToolbar": [
        {
          "type": "flex",
          "direction": "row",
          "justify": "flex-start",
          "alignItems": "stretch",
          "style": {
            "position": "static"
          },
          "items": [
            {
              "type": "container",
              "align": "left",
              "body": [],
              "wrapperBody": false,
              "style": {
                "flexGrow": 1,
                "flex": "1 1 auto",
                "position": "static",
                "display": "flex",
                "flexBasis": "auto",
                "flexDirection": "row",
                "flexWrap": "nowrap",
                "alignItems": "stretch",
                "justifyContent": "flex-start"
              },
              "id": "u:067870592a94"
            },
            {
              "type": "container",
              "align": "right",
              "body": [
                {
                  "type": "pagination",
                  "behavior": "Pagination",
                  "layout": [
                    "total",
                    "perPage",
                    "pager"
                  ],
                  "perPage": 10,
                  "perPageAvailable": [
                    10,
                    20,
                    50,
                    100
                  ],
                  "align": "right",
                  "id": "u:62e028cf74a6"
                }
              ],
              "wrapperBody": false,
              "style": {
                "flexGrow": 1,
                "flex": "1 1 auto",
                "position": "static",
                "display": "flex",
                "flexBasis": "auto",
                "flexDirection": "row",
                "flexWrap": "nowrap",
                "alignItems": "stretch",
                "justifyContent": "flex-end"
              },
              "id": "u:a81f288e2475"
            }
          ],
          "id": "u:04022b23493f"
        }
      ],
      "columns": [
        {
          "type": "tpl",
          "title": "id",
          "name": "id",
          "id": "u:63491951b7e9",
          "hidden": true
        },
        {
          "type": "tpl",
          "title": "name",
          "name": "name",
          "id": "u:68b113976f7c"
        },
        {
          "type": "tpl",
          "title": "age",
          "name": "age",
          "id": "u:aa0d9f00207e"
        }
      ],
      "showHeader": true,
      "columnsTogglable": true
    }
  ],
  "id": "u:548a100140f5",
  "pullRefresh": {
    "disabled": true
  },
  "asideResizor": false,
  "definitions": {}
}
  1. 操作步骤
    预览后,点击自定义显示列里的name,无反馈,无法取消选中。点击age,name被取消选中。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneed confirmstyleBug or PR related to component's style

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions