baidu / amis

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

表格和表格好像不能联动 #2079

Closed SheenaghF closed 1 year ago

SheenaghF commented 3 years ago

描述问题:

当我点击了左边表格时,刷新右边表格

截图或视频:

image

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

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

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

    {
    "type": "page",
    "body": [
    {
      "type": "grid",
      "columns": [
        {
          "type": "crud",
          "api": "/blade-system/dict/parent-list",
          "columns": [
            {
              "name": "code",
              "label": "字典编号",
              "type": "text"
            },
            {
              "name": "dictValue",
              "label": "字典名称",
              "type": "text"
            },
            {
              "type": "text",
              "label": "封存",
              "name": "isSealed"
            },
            {
              "type": "operation",
              "label": "操作",
              "buttons": [
                {
                  "label": "编辑",
                  "type": "button",
                  "actionType": "dialog",
                  "level": "link",
                  "dialog": {
                    "title": "新增表单",
                    "body": {
                      "type": "form",
                      "api": "xxx/update",
                      "controls": [
                        {
                          "name": "id",
                          "label": "ID",
                          "type": "text"
                        },
                        {
                          "name": "engine",
                          "label": "渲染引擎",
                          "type": "text"
                        }
                      ]
                    }
                  }
                },
                {
                  "label": "删除",
                  "type": "button",
                  "level": "link",
                  "actionType": "ajax",
                  "confirmText": "确定要删除?",
                  "api": "/blade-system/dict/remove?ids=${ids}"
                }
              ]
            }
          ],
          "bulkActions": [
            {
              "type": "button",
              "level": "danger",
              "label": "批量删除",
              "actionType": "ajax",
              "confirmText": "确定要删除?",
              "api": "/blade-system/dict/remove?ids=${ids}"
            }
          ],
          "itemActions": [],
          "filter": {
            "title": "字典列表",
            "controls": [
              {
                "type": "group",
                "controls": [
                  {
                    "type": "text",
                    "label": "字典编码",
                    "name": "code"
                  },
                  {
                    "type": "text",
                    "label": "字典名称",
                    "name": "dictValue"
                  }
                ],
                "label": false
              }
            ],
            "wrapWithPanel": true,
            "actions": [
              {
                "type": "submit",
                "label": "查询",
                "level": "primary"
              },
              {
                "type": "reset",
                "label": "重置"
              }
            ]
          },
          "perPageAvailable": [
            10
          ],
          "syncLocation": false,
          "source": "${records}",
          "pageField": "current",
          "perPageField": "size",
          "messages": {},
          "footerToolbar": [
            {
              "type": "pagination"
            }
          ],
          "headerToolbar": [
            {
              "type": "button",
              "label": "新增",
              "actionType": "dialog",
              "dialog": {
                "title": "新增表单",
                "body": {
                  "type": "form",
                  "api": "xxx/update",
                  "controls": [
                    {
                      "name": "id",
                      "label": "ID",
                      "type": "text"
                    },
                    {
                      "name": "engine",
                      "label": "渲染引擎",
                      "type": "text"
                    }
                  ]
                }
              },
              "level": "primary"
            },
            {
              "type": "bulk-actions"
            }
          ],
          "checkOnItemClick": false
        },
        {
          "type": "crud",
          "api": "/blade-system/dict/child-list",
          "columns": [
            {
              "name": "code",
              "label": "字典编号",
              "type": "text"
            },
            {
              "name": "dictValue",
              "label": "字典名称",
              "type": "text"
            },
            {
              "type": "text",
              "name": "isSealed",
              "label": "封存"
            },
            {
              "type": "operation",
              "label": "操作",
              "buttons": [
                {
                  "label": "编辑",
                  "type": "button",
                  "actionType": "dialog",
                  "level": "link",
                  "dialog": {
                    "title": "新增表单",
                    "body": {
                      "type": "form",
                      "api": "xxx/update",
                      "controls": [
                        {
                          "name": "id",
                          "label": "ID",
                          "type": "text"
                        },
                        {
                          "name": "engine",
                          "label": "渲染引擎",
                          "type": "text"
                        }
                      ]
                    }
                  }
                },
                {
                  "label": "删除",
                  "type": "button",
                  "level": "link",
                  "actionType": "ajax",
                  "confirmText": "确定要删除?",
                  "api": "/blade-system/dict/remove?ids=${ids}"
                }
              ]
            }
          ],
          "bulkActions": [
            {
              "type": "button",
              "level": "danger",
              "label": "批量删除",
              "actionType": "ajax",
              "confirmText": "确定要删除?",
              "api": "/blade-system/dict/remove?ids=${ids}"
            }
          ],
          "itemActions": [],
          "filter": {
            "title": "字典子集列表",
            "controls": [
              {
                "type": "text",
                "name": "code",
                "label": "字典编码"
              },
              {
                "type": "text",
                "label": "字典名称",
                "name": "dictValue"
              }
            ],
            "wrapWithPanel": true,
            "actions": [
              {
                "type": "submit",
                "label": "查询",
                "level": "primary"
              },
              {
                "type": "reset",
                "label": "重置"
              }
            ]
          },
          "perPageAvailable": [],
          "syncLocation": false,
          "source": "${data}",
          "pageField": "",
          "perPageField": "",
          "messages": {},
          "headerToolbar": [
            {
              "type": "button",
              "label": "新增",
              "actionType": "dialog",
              "level": "primary",
              "dialog": {
                "title": "新增表单",
                "body": {
                  "type": "form",
                  "api": "xxx/update",
                  "controls": [
                    {
                      "name": "id",
                      "label": "ID",
                      "type": "text"
                    },
                    {
                      "name": "engine",
                      "label": "渲染引擎",
                      "type": "text"
                    }
                  ]
                }
              }
            },
            {
              "type": "bulk-actions"
            }
          ],
          "footerToolbar": []
        }
      ]
    }
    ],
    "className": "bg-white"
    }
  3. 操作步骤 请简单描述一下复现的操作步骤...

xtefluo commented 2 years ago

现在问题解决了吗?

nwind commented 1 year ago

现在可以用事件动作