amis crud2不支持列显示开关,导致没有办法关掉

pbgvytdp  于 3个月前  发布在  其他
关注(0)|答案(1)|浏览(73)
描述问题:

使用crud2组件,超过6列会自动显示列显示开关,无法配置关闭。并且和headertool不在同一个容器

截图或视频:

如何复现(请务必完整填写下面内容):
  1. 你是如何使用 amis 的?
    react
  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
    最新版本 6.0.0
  3. 粘贴有问题的完整 amis schema 代码:
{
  "type": "page",
  "id": "u:b9557a932a72",
  "asideResizor": false,
  "pullRefresh": {
    "disabled": true
  },
  "regions": [
    "body",
    "header"
  ],
  "body": [
    {
      "id": "u:60c4db9a9ce2",
      "type": "crud2",
      "mode": "table2",
      "dsType": "api",
      "syncLocation": true,
      "primaryField": "objectKey",
      "loadType": "pagination",
      "api": {
        "url": "/api/system/menu/page?fields=items{objectKey,objectId,comment,path,menuType,status,screen{objectKey,objectId},parent[objectKey,objectId]}",
        "method": "post",
        "requestAdaptor": "",
        "adaptor": "",
        "messages": {},
        "data": {
          "&": "$$",
          "sort": "path"
        }
      },
      "filter": {
        "type": "form",
        "title": "条件查询",
        "mode": "inline",
        "columnCount": 3,
        "clearValueOnHidden": true,
        "behavior": [
          "SimpleQuery"
        ],
        "body": [
          {
            "type": "tree-select",
            "label": "父菜单",
            "name": "parent.objectKey",
            "id": "u:333fe64e35be",
            "multiple": false,
            "enableNodePath": false,
            "hideRoot": true,
            "showIcon": false,
            "initiallyOpen": true,
            "onEvent": {},
            "hideNodePathLabel": false,
            "mode": "inline",
            "size": "full",
            "source": {
              "url": "/api/system/menu/dir/tree",
              "method": "get",
              "requestAdaptor": "",
              "adaptor": "",
              "messages": {}
            },
            "labelField": "label",
            "valueField": "rrn",
            "clearable": false
          },
          {
            "name": "objectId",
            "label": "菜单",
            "type": "input-text",
            "size": "full",
            "required": false,
            "behavior": "SimpleQuery",
            "id": "u:02d662adf3d7"
          },
          {
            "name": "path",
            "label": "路径",
            "type": "input-text",
            "size": "full",
            "required": false,
            "behavior": "SimpleQuery",
            "id": "u:a72ef8f44676"
          }
        ],
        "actions": [
          {
            "type": "reset",
            "label": "重置",
            "id": "u:158c758935d6"
          },
          {
            "type": "submit",
            "label": "查询",
            "level": "primary",
            "id": "u:9a43039416c9"
          }
        ],
        "id": "u:822ea4245cbf",
        "feat": "Insert",
        "affixFooter": false
      },
      "headerToolbar": [
        {
          "type": "flex",
          "direction": "row",
          "justify": "flex-start",
          "alignItems": "stretch",
          "style": {
            "position": "static"
          },
          "items": [
            {
              "type": "container",
              "align": "left",
              "behavior": [
                "Insert",
                "BulkEdit",
                "BulkDelete"
              ],
              "body": [
                {
                  "type": "button",
                  "label": "新增",
                  "level": "primary",
                  "className": "m-r-xs",
                  "behavior": "Insert",
                  "onEvent": {
                    "click": {
                      "actions": [
                        {
                          "actionType": "dialog",
                          "dialog": {
                            "body": [
                              {
                                "id": "u:0f0441ca8f1b",
                                "type": "form",
                                "title": "新增数据",
                                "mode": "normal",
                                "dsType": "api",
                                "feat": "Insert",
                                "body": [
                                  {
                                    "type": "group",
                                    "body": [
                                      {
                                        "name": "menuId",
                                        "label": "菜单名",
                                        "type": "input-text",
                                        "id": "u:2b5a98d981bd",
                                        "required": true,
                                        "size": "lg"
                                      },
                                      {
                                        "type": "input-text",
                                        "label": "备注",
                                        "name": "comment",
                                        "id": "u:9b21089497df"
                                      },
                                      {
                                        "type": "switch",
                                        "label": "隐藏",
                                        "name": "hideInMenu",
                                        "id": "u:30501003c0f5",
                                        "option": "",
                                        "falseValue": false,
                                        "trueValue": true,
                                        "value": false,
                                        "description": ""
                                      }
                                    ],
                                    "id": "u:8a7a193a63e2"
                                  },
                                  {
                                    "type": "group",
                                    "body": [
                                      {
                                        "type": "select",
                                        "label": "菜单类型",
                                        "name": "menuType",
                                        "id": "u:bdde5d12e9cc",
                                        "multiple": false,
                                        "source": {
                                          "url": "/api/system/menu/types",
                                          "method": "get"
                                        },
                                        "required": true
                                      },
                                      {
                                        "type": "tree-select",
                                        "label": "父菜单",
                                        "name": "parentKey",
                                        "id": "u:859b5aeab560",
                                        "multiple": false,
                                        "enableNodePath": false,
                                        "hideRoot": true,
                                        "showIcon": false,
                                        "initiallyOpen": true,
                                        "onEvent": {},
                                        "hideNodePathLabel": false,
                                        "size": "full",
                                        "source": {
                                          "url": "/api/system/menu/dir/tree",
                                          "method": "get",
                                          "requestAdaptor": "",
                                          "adaptor": "",
                                          "messages": {}
                                        },
                                        "labelField": "label",
                                        "valueField": "rrn",
                                        "clearable": false
                                      },
                                      {
                                        "name": "icon",
                                        "label": "图标",
                                        "type": "input-text",
                                        "id": "u:a0d62801b23a"
                                      }
                                    ],
                                    "id": "u:fb457850cfb8"
                                  },
                                  {
                                    "type": "group",
                                    "body": [
                                      {
                                        "name": "path",
                                        "label": "路径",
                                        "type": "input-text",
                                        "id": "u:e2218ebe8f08",
                                        "required": true
                                      },
                                      {
                                        "name": "screen",
                                        "label": "页面",
                                        "type": "picker",
                                        "id": "u:197ea5945cf1",
                                        "overflowConfig": {
                                          "maxTagCount": -1
                                        },
                                        "modalClassName": "app-popover :AMISCSSWrapper",
                                        "multiple": false,
                                        "embed": false,
                                        "modalMode": "drawer",
                                        "placeholder": "",
                                        "labelField": "objectId",
                                        "valueField": "objectKey",
                                        "pickerSchema": {
                                          "mode": "list",
                                          "labelField": "objectId",
                                          "valueField": "objectKey",
                                          "id": "u:cb0aee2fb7b9",
                                          "perPageAvailable": [
                                            10
                                          ],
                                          "listItem": {
                                            "title": "${objectId}",
                                            "id": "u:e4057a4e1e93",
                                            "subTitle": "",
                                            "desc": "${comment}",
                                            "actions": []
                                          },
                                          "filter": {
                                            "title": "查询",
                                            "body": [
                                              {
                                                "type": "input-text",
                                                "name": "screenId",
                                                "label": "菜单名",
                                                "id": "u:40edcd4521e6"
                                              }
                                            ],
                                            "id": "u:5165644b2c62",
                                            "actions": [
                                              {
                                                "type": "submit",
                                                "label": "搜索",
                                                "primary": true,
                                                "id": "u:c7c0aa83485b"
                                              }
                                            ],
                                            "feat": "View",
                                            "dsType": "api",
                                            "initApi": "",
                                            "canAccessSuperData": false
                                          },
                                          "primaryField": "objectKey",
                                          "filterTogglable": false,
                                          "autoFillHeight": true,
                                          "alwaysShowPagination": false,
                                          "syncLocation": false,
                                          "body": [
                                            {
                                              "type": "service",
                                              "body": []
                                            },
                                            {
                                              "type": "service",
                                              "body": []
                                            }
                                          ]
                                        },
                                        "value": "",
                                        "labelTpl": "",
                                        "static": false,
                                        "source": {
                                          "method": "post",
                                          "url": "/api/system/screen/page?fields=items{objectKey,objectId,comment,activeSchemaVersion}",
                                          "requestAdaptor": "",
                                          "adaptor": "",
                                          "messages": {},
                                          "data": {
                                            "objectId": "${screenId}",
                                            "objectKey": "${op === 'loadOptions' ? ${screen.objectKey} : null}"
                                          }
                                        },
                                        "disabled": false,
                                        "hiddenOn": "${menuType !== 'MENU'}",
                                        "clearValueOnHidden": true
                                      }
                                    ],
                                    "id": "u:5299b59117d5"
                                  }
                                ],
                                "resetAfterSubmit": true,
                                "actions": [
                                  {
                                    "type": "button",
                                    "actionType": "cancel",
                                    "label": "取消",
                                    "id": "u:023495f05414"
                                  },
                                  {
                                    "type": "button",
                                    "actionType": "submit",
                                    "label": "提交",
                                    "level": "primary",
                                    "id": "u:ca62ec8cf135"
                                  }
                                ],
                                "onEvent": {
                                  "submitSucc": {
                                    "actions": [
                                      {
                                        "actionType": "search",
                                        "groupType": "component",
                                        "componentId": "u:60c4db9a9ce2"
                                      }
                                    ]
                                  }
                                },
                                "api": {
                                  "url": "/api/system/menu",
                                  "method": "put",
                                  "requestAdaptor": "",
                                  "adaptor": "",
                                  "messages": {}
                                },
                                "canAccessSuperData": false,
                                "rules": [],
                                "submitOnChange": false,
                                "columnCount": 0,
                                "wrapWithPanel": false,
                                "affixFooter": false,
                                "className": ""
                              }
                            ],
                            "title": "新增菜单",
                            "actions": [
                              {
                                "type": "button",
                                "actionType": "cancel",
                                "label": "取消",
                                "id": "u:cd15cedff6df"
                              },
                              {
                                "type": "button",
                                "actionType": "submit",
                                "label": "提交",
                                "level": "primary",
                                "id": "u:399fb507f321"
                              }
                            ],
                            "id": "u:f1c71cb3e7cd",
                            "showCloseButton": true,
                            "closeOnOutside": false,
                            "closeOnEsc": false,
                            "showErrorMsg": true,
                            "showLoading": true,
                            "draggable": false,
                            "themeCss": {
                              "dialogBodyClassName": {
                                "padding-and-margin": {}
                              }
                            },
                            "size": "lg"
                          }
                        }
                      ]
                    }
                  },
                  "id": "u:9b2ff28a99a8"
                }
              ],
              "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:6e42da39cb3b"
            },
            {
              "type": "container",
              "align": "right",
              "behavior": [
                "FuzzyQuery"
              ],
              "body": [],
              "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:d2c5f0aedddc"
            }
          ],
          "id": "u:3f8ae080c6a5"
        }
      ],
      "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:e92c3ad294ec"
            },
            {
              "type": "container",
              "align": "right",
              "body": [
                {
                  "type": "pagination",
                  "behavior": "Pagination",
                  "layout": [
                    "total",
                    "perPage",
                    "pager"
                  ],
                  "perPage": 10,
                  "perPageAvailable": [
                    10,
                    20,
                    50,
                    100
                  ],
                  "align": "right",
                  "id": "u:0682a3c1a445"
                }
              ],
              "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:996f1b73b4b0"
            }
          ],
          "id": "u:da31a95c7bc6"
        }
      ],
      "columns": [
        {
          "type": "tpl",
          "title": "菜单",
          "name": "objectId",
          "id": "u:b91f34d68771",
          "placeholder": "-"
        },
        {
          "type": "tpl",
          "title": "备注",
          "name": "comment",
          "id": "u:078208e08f58",
          "placeholder": "-"
        },
        {
          "type": "tpl",
          "title": "父菜单",
          "name": "parent.objectId",
          "id": "u:1dca9540efb3"
        },
        {
          "type": "tpl",
          "title": "菜单类型",
          "name": "menuType",
          "id": "u:342367209687",
          "placeholder": "-"
        },
        {
          "type": "tpl",
          "title": "页面",
          "name": "screen.objectId",
          "id": "u:0f58598fbe31",
          "placeholder": "-"
        },
        {
          "type": "tpl",
          "title": "路径",
          "name": "path",
          "id": "u:76647faaeb11",
          "placeholder": "-"
        },
        {
          "type": "operation",
          "title": "操作",
          "buttons": [
            {
              "type": "button",
              "label": "编辑",
              "level": "link",
              "behavior": "Edit",
              "onEvent": {
                "click": {
                  "actions": [
                    {
                      "actionType": "dialog",
                      "dialog": {
                        "body": [
                          {
                            "id": "u:e7d28f580ae2",
                            "type": "form",
                            "title": "编辑数据",
                            "mode": "normal",
                            "dsType": "api",
                            "feat": "Edit",
                            "body": [
                              {
                                "type": "group",
                                "body": [
                                  {
                                    "name": "objectId",
                                    "label": "菜单名",
                                    "type": "input-text",
                                    "id": "u:2b5a98d981bd",
                                    "required": true,
                                    "size": "lg"
                                  },
                                  {
                                    "type": "input-text",
                                    "label": "备注",
                                    "name": "comment",
                                    "id": "u:9b21089497df"
                                  },
                                  {
                                    "type": "switch",
                                    "label": "隐藏",
                                    "name": "hideInMenu",
                                    "id": "u:30501003c0f5",
                                    "option": "",
                                    "falseValue": false,
                                    "trueValue": true,
                                    "value": false,
                                    "description": ""
                                  }
                                ],
                                "id": "u:8a7a193a63e2"
                              },
                              {
                                "type": "group",
                                "body": [
                                  {
                                    "type": "select",
                                    "label": "菜单类型",
                                    "name": "menuType",
                                    "id": "u:bdde5d12e9cc",
                                    "multiple": false,
                                    "source": {
                                      "url": "/api/system/menu/types",
                                      "method": "get"
                                    },
                                    "required": true
                                  },
                                  {
                                    "type": "tree-select",
                                    "label": "父菜单",
                                    "name": "parentKey",
                                    "id": "u:859b5aeab560",
                                    "multiple": false,
                                    "enableNodePath": false,
                                    "hideRoot": true,
                                    "showIcon": false,
                                    "initiallyOpen": true,
                                    "onEvent": {},
                                    "hideNodePathLabel": false,
                                    "size": "full",
                                    "source": {
                                      "url": "/api/system/menu/dir/tree",
                                      "method": "get",
                                      "requestAdaptor": "",
                                      "adaptor": "",
                                      "messages": {}
                                    },
                                    "labelField": "label",
                                    "valueField": "rrn",
                                    "clearable": false
                                  },
                                  {
                                    "name": "icon",
                                    "label": "图标",
                                    "type": "input-text",
                                    "id": "u:a0d62801b23a"
                                  }
                                ],
                                "id": "u:fb457850cfb8"
                              },
                              {
                                "type": "group",
                                "body": [
                                  {
                                    "name": "path",
                                    "label": "路径",
                                    "type": "input-text",
                                    "id": "u:e2218ebe8f08",
                                    "required": true
                                  },
                                  {
                                    "name": "screenKey",
                                    "label": "页面",
                                    "type": "picker",
                                    "id": "u:197ea5945cf1",
                                    "overflowConfig": {
                                      "maxTagCount": -1
                                    },
                                    "modalClassName": "app-popover :AMISCSSWrapper",
                                    "multiple": false,
                                    "embed": false,
                                    "modalMode": "drawer",
                                    "placeholder": "",
                                    "labelField": "objectId",
                                    "valueField": "objectKey",
                                    "pickerSchema": {
                                      "mode": "list",
                                      "labelField": "objectId",
                                      "valueField": "objectKey",
                                      "id": "u:cb0aee2fb7b9",
                                      "perPageAvailable": [
                                        10
                                      ],
                                      "listItem": {
                                        "title": "${objectId}",
                                        "id": "u:e4057a4e1e93",
                                        "subTitle": "",
                                        "desc": "${comment}",
                                        "actions": []
                                      },
                                      "filter": {
                                        "title": "查询",
                                        "body": [
                                          {
                                            "type": "input-text",
                                            "name": "screenId",
                                            "label": "菜单名",
                                            "id": "u:40edcd4521e6"
                                          }
                                        ],
                                        "id": "u:5165644b2c62",
                                        "actions": [
                                          {
                                            "type": "submit",
                                            "label": "搜索",
                                            "primary": true,
                                            "id": "u:c7c0aa83485b"
                                          }
                                        ],
                                        "feat": "View",
                                        "dsType": "api",
                                        "initApi": "",
                                        "canAccessSuperData": false
                                      },
                                      "primaryField": "objectKey",
                                      "filterTogglable": false,
                                      "autoFillHeight": true,
                                      "alwaysShowPagination": false,
                                      "syncLocation": false,
                                      "body": [
                                        {
                                          "type": "service",
                                          "body": []
                                        },
                                        {
                                          "type": "service",
                                          "body": []
                                        }
                                      ]
                                    },
                                    "value": "",
                                    "labelTpl": "",
                                    "static": false,
                                    "source": {
                                      "method": "post",
                                      "url": "/api/system/screen/page?fields=items{objectKey,objectId,comment,activeSchemaVersion}",
                                      "requestAdaptor": "",
                                      "adaptor": "",
                                      "messages": {},
                                      "data": {
                                        "objectId": "${screenId}",
                                        "objectKey": "${op === 'loadOptions' ? ${screen.objectKey} : null}"
                                      }
                                    },
                                    "hiddenOn": "${menuType !== 'MENU'}",
                                    "clearValueOnHidden": true
                                  }
                                ],
                                "id": "u:5299b59117d5"
                              }
                            ],
                            "resetAfterSubmit": true,
                            "actions": [
                              {
                                "type": "button",
                                "actionType": "cancel",
                                "label": "取消",
                                "id": "u:13114548b4bc"
                              },
                              {
                                "type": "button",
                                "actionType": "submit",
                                "label": "提交",
                                "level": "primary",
                                "id": "u:404d3c1089b9"
                              }
                            ],
                            "onEvent": {
                              "submitSucc": {
                                "actions": [
                                  {
                                    "actionType": "search",
                                    "groupType": "component",
                                    "componentId": "u:60c4db9a9ce2"
                                  }
                                ]
                              }
                            },
                            "wrapWithPanel": false,
                            "columnCount": 0,
                            "affixFooter": false,
                            "preventEnterSubmit": true,
                            "api": {
                              "url": "/api/system/menu",
                              "method": "post",
                              "requestAdaptor": "",
                              "adaptor": "",
                              "messages": {},
                              "data": {
                                "&": "$$",
                                "menuKey": "${objectKey}"
                              }
                            },
                            "canAccessSuperData": true
                          }
                        ],
                        "title": "编辑数据",
                        "actions": [
                          {
                            "type": "button",
                            "actionType": "cancel",
                            "label": "取消",
                            "id": "u:ef07d9fc6593"
                          },
                          {
                            "type": "button",
                            "actionType": "submit",
                            "label": "提交",
                            "level": "primary",
                            "id": "u:903d6f6aaddc"
                          }
                        ],
                        "id": "u:2a4c0195c4be",
                        "showCloseButton": true,
                        "closeOnOutside": true,
                        "closeOnEsc": false,
                        "showErrorMsg": true,
                        "showLoading": true,
                        "draggable": false,
                        "withDefaultData": true,
                        "dataMapSwitch": true,
                        "size": "md",
                        "data": {
                          "parentKey": "${parent.objectKey}",
                          "&": "$$",
                          "screenKey": "${screen.objectKey}"
                        },
                        "dataMap": {
                          "parentKey": "${parent.objectKey}",
                          "screenKey": "${screen.objectKey}"
                        }
                      }
                    }
                  ]
                }
              },
              "id": "u:4fac86fbe1b6"
            },
            {
              "type": "button",
              "label": "删除",
              "behavior": "Delete",
              "className": "m-r-xs text-danger",
              "level": "link",
              "confirmText": "确认要删除数据",
              "onEvent": {
                "click": {
                  "actions": [
                    {
                      "actionType": "ajax",
                      "data": {
                        "&": "$$"
                      }
                    },
                    {
                      "actionType": "search",
                      "groupType": "component",
                      "componentId": "u:60c4db9a9ce2"
                    }
                  ]
                }
              },
              "id": "u:03d5f27b15ad"
            }
          ],
          "id": "u:f07d20aa8655"
        }
      ],
      "placeholder": "暂无数据",
      "showHeader": true,
      "lineHeight": "",
      "title": null,
      "itemDraggableOn": "",
      "draggable": false,
      "showBadge": false,
      "editorSetting": {
        "mock": {
          "enable": true,
          "maxDisplayRows": 5
        }
      },
      "autoFillHeight": true,
      "rowSelection": false,
      "hidden": false,
      "selectable": false,
      "resizable": false,
      "bordered": false
    }
  ],
  "title": "菜单定义"
}
  1. 操作步骤
    请简单描述一下复现的操作步骤...
6tr1vspr

6tr1vspr1#

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

相关问题