baidu / amis

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

【bug】操作并下一个 功能把官方示例dialog改成drawer抽屉弹窗后失效 获取不到hasNext hasPrev #8895

Open newClassCode opened 9 months ago

newClassCode commented 9 months ago

描述问题:

【操作并下一个】功能把官方示例dialog改成drawer抽屉弹窗后失效 drawer抽屉弹窗获取不到hasNext hasPrev,改回dialog弹窗之后就能获取到hasNext hasPrev

截图或视频:

20231127042829

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

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

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

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

    {
    "type": "page",
    "body": [
    {
      "type": "crud",
      "title": "",
      "api": "https://aisuda.bce.baidu.com/amis/api/sample/list",
      "columnsTogglable": false,
      "columns": [
        {
          "name": "id",
          "label": "ID",
          "width": 30,
          "type": "text",
          "toggled": true,
          "id": "u:812c00b3d80e"
        },
        {
          "name": "engine",
          "label": "Rendering engine",
          "type": "text",
          "toggled": true,
          "id": "u:a100ea55bf08"
        },
        {
          "name": "browser",
          "label": "Browser",
          "type": "text",
          "toggled": true,
          "id": "u:e6ca30d25c8c"
        },
        {
          "type": "operation",
          "label": "操作",
          "width": 130,
          "buttons": [
            {
              "type": "button",
              "icon": "fa fa-pencil",
              "actionType": "drawer",
              "nextCondition": "true",
              "_nextCondition": "可以设置条件比如: data.grade == \"B\"",
              "id": "u:dea400344e74",
              "drawer": {
                "title": "编辑",
                "actions": [
                  {
                    "type": "button",
                    "actionType": "prev",
                    "level": "info",
                    "visibleOn": "data.hasPrev",
                    "label": "上一个"
                  },
                  {
                    "type": "button",
                    "actionType": "cancel",
                    "label": "关闭"
                  },
                  {
                    "type": "submit",
                    "actionType": "next",
                    "visibleOn": "data.hasNext",
                    "label": "保存并下一个",
                    "level": "primary"
                  },
                  {
                    "type": "submit",
                    "visibleOn": "!data.hasNext",
                    "label": "保存",
                    "level": "primary"
                  },
                  {
                    "type": "button",
                    "actionType": "next",
                    "level": "info",
                    "visibleOn": "data.hasNext",
                    "label": "下一个"
                  }
                ],
                "body": {
                  "type": "form",
                  "name": "sample-edit-form",
                  "api": "/amis/api/sample/$id",
                  "body": [
                    {
                      "type": "input-text",
                      "name": "engine",
                      "label": "Engine",
                      "required": true
                    },
                    {
                      "type": "divider"
                    },
                    {
                      "type": "input-text",
                      "name": "browser",
                      "label": "Browser",
                      "required": true
                    },
                    {
                      "type": "divider"
                    },
                    {
                      "type": "input-text",
                      "name": "platform",
                      "label": "Platform(s)",
                      "required": true
                    },
                    {
                      "type": "divider"
                    },
                    {
                      "type": "input-text",
                      "name": "version",
                      "label": "Engine version"
                    },
                    {
                      "type": "divider"
                    },
                    {
                      "type": "input-text",
                      "name": "grade",
                      "label": "CSS grade"
                    }
                  ]
                }
              }
            }
          ],
          "toggled": true,
          "id": "u:00c14b0874a3"
        }
      ],
      "id": "u:ba4f7f753314"
    }
    ],
    "title": "操作并下一个",
    "remark": "当存在下一条时,支持直接打开下一条操作。",
    "id": "u:5b719db12a46"
    }
  4. 操作步骤 把dialog改成drawer抽屉弹窗之后失效

github-actions[bot] commented 9 months ago

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

Please review the labels and make any necessary changes.