amis icon indicating copy to clipboard operation
amis copied to clipboard

CRUD内操作列有多个button设置为ajax时,导致点击其中一个按钮其它都出现loading效果

Open qianxiaofendou opened this issue 2 years ago • 0 comments

描述问题:

在Crud的操作列表里面有多个button,当有一个actionType为ajax时,如下面的示例: 问题1:点击删除1按钮,当ajax请求的时候出现删除1、删除2两个按钮都有loading效果,会误导用户不知道是哪个按钮触发的 问题2: 点击删除2按钮,当ajax请求完成触发反馈弹窗的时候,反馈弹窗会闪一下(先出现一次再消失然后再出现,当然table也有loading,但是并没有触发table重新加载数据,只是个loading),然后这时候不管点击确定还是取消都会导致列表刷新,同时两个操作按钮也会有loading

上面两个问题在SDK1.9.0及一下版本里面是正常的,希望官方可以处理一下上面的问题。

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

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

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

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

{
  "type": "page",
  "body": {
    "type": "crud",
    "api": "/amis/api/mock2/sample?orderBy=id&orderDir=desc",
    "syncLocation": false,
    "columns": [
      {
        "name": "id",
        "label": "ID"
      },
      {
        "name": "engine",
        "label": "Rendering engine"
      },
      {
        "name": "browser",
        "label": "Browser"
      },
      {
        "type": "operation",
        "label": "操作",
        "buttons": [
          {
            "label": "删除1",
            "type": "button",
            "actionType": "ajax",
            "level": "danger",
            "confirmText": "确认要删除?",
            "api": "delete:/amis/api/mock2/sample/${id}"
          },
          {
            "label": "删除2",
            "type": "button",
            "actionType": "ajax",
            "level": "danger",
            "confirmText": "确认要删除?",
            "api": "delete:/amis/api/mock2/sample/${id}",
            "feedback": {
              "type": "dialog",
              "title": "弹框标题",
              "body": [
                {
                  "type": "tpl",
                  "tpl": "<p>内容</p>",
                  "inline": false
                }
              ]
            }
          }
        ]
      }
    ]
  }
}

qianxiaofendou avatar Aug 01 '22 05:08 qianxiaofendou