Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.4.0版本crud2里操作列的dialog弹不出来 #10177

Closed
swieer opened this issue May 8, 2024 · 4 comments
Closed

6.4.0版本crud2里操作列的dialog弹不出来 #10177

swieer opened this issue May 8, 2024 · 4 comments
Labels
feat fix need confirm style Bug or PR related to component's style

Comments

@swieer
Copy link

swieer commented May 8, 2024

6.4.0版本crud2里操作列的dialog弹不出来,6.3.0没有这个问题

可以的话,尽可能提供截图或视频来补充描述你的问题...
点击查看编辑不能弹出dialog,

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

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

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

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

{
  "type": "page",
  "title": "aaa",
  "body": [
    {
      "type": "crud2",
      "id": "u:8b4c950a826c",
      "mode": "table2",
      "dsType": "api",
      "syncLocation": true,
      "primaryField": "bmsCustomerId",
      "loadType": "pagination",
      "columns": [
        {
          "type": "tpl",
          "title": "客户代码",
          "name": "customerCode",
          "id": "u:e471efe470f2",
          "placeholder": "-"
        },

        {
          "type": "operation",
          "title": "操作",
          "id": "u:18d57f43c8e6",
          "buttons": [
            {
              "type": "button",
              "label": "查看",
              "level": "link",
              "behavior": "View",
              "onEvent": {
                "click": {
                  "actions": [
                    {
                      "actionType": "dialog",
                      "dialog": {
                        "body": {
                          "id": "u:daf3e2ba81cc",
                          "type": "form",
                          "title": "查看数据",
                          "mode": "horizontal",
                          "dsType": "api",
                          "feat": "View",
                          "body": [
                            {
                              "name": "customerCode",
                              "label": "客户代码",
                              "type": "input-text"
                            }
                          ],
                          "static": true,
                          "actions": [
                            {
                              "type": "button",
                              "actionType": "cancel",
                              "label": "关闭"
                            }
                          ],
                          "onEvent": {
                            "submitSucc": {
                              "actions": [
                                {
                                  "actionType": "search",
                                  "groupType": "component",
                                  "componentId": "u:8b4c950a826c"
                                }
                              ]
                            }
                          }
                        },
                        "title": "查看数据",
                        "size": "md",
                        "actions": [
                          {
                            "type": "button",
                            "actionType": "cancel",
                            "label": "关闭"
                          }
                        ]
                      }
                    }
                  ]
                }
              },
              "id": "u:c1939c07abb3"
            },
            {
              "type": "button",
              "label": "编辑",
              "level": "link",
              "behavior": "Edit",
              "onEvent": {
                "click": {
                  "actions": [
                    {
                      "actionType": "dialog",
                      "dialog": {
                        "body": [
                          {
                            "id": "u:8a399a1a19db",
                            "type": "form",
                            "title": "编辑数据",
                            "mode": "horizontal",
                            "dsType": "api",
                            "feat": "Edit",
                            "body": [
                              {
                                "name": "customerCode",
                                "label": "客户代码",
                                "type": "input-text",
                                "id": "u:342a4ce02ac5"
                              }
                            ],
                            "api": {
                              "url": "/prod-api/engine/dataset/update/bmsCustomer",
                              "method": "post"
                            },
                            "resetAfterSubmit": true,
                            "actions": [
                              {
                                "type": "button",
                                "actionType": "cancel",
                                "label": "取消"
                              },
                              {
                                "type": "button",
                                "actionType": "submit",
                                "label": "提交",
                                "level": "primary"
                              }
                            ],
                            "onEvent": {
                              "submitSucc": {
                                "actions": [
                                  {
                                    "actionType": "search",
                                    "groupType": "component",
                                    "componentId": "u:8b4c950a826c"
                                  }
                                ]
                              }
                            },
                            "data": {
                              "bmsCustomerId": "${bmsCustomerId}"
                            }
                          }
                        ],
                        "title": "编辑数据",
                        "size": "md",
                        "actions": [
                          {
                            "type": "button",
                            "actionType": "cancel",
                            "label": "取消",
                            "id": "u:a731f2e48219"
                          },
                          {
                            "type": "button",
                            "actionType": "submit",
                            "label": "提交",
                            "level": "primary",
                            "id": "u:c69d1c778992"
                          }
                        ],
                        "id": "u:86f1836a3409"
                      }
                    }
                  ]
                }
              },
              "id": "u:cf32c281324b"
            },
            {
              "type": "button",
              "label": "删除",
              "behavior": "Delete",
              "className": "m-r-xs text-danger",
              "level": "link",
              "confirmText": "确认要删除数据",
              "id": "u:311c762be4db",
              "actionType": "ajsx",
              "onEvent": {
                "click": {
                  "weight": 0,
                  "actions": [
                    {
                      "ignoreError": false,
                      "outputVar": "responseResult",
                      "actionType": "ajax",
                      "options": {},
                      "api": {
                        "url": "/prod-api/engine/dataset/delete/bmsCustomer",
                        "method": "delete",
                        "requestAdaptor": "",
                        "adaptor": "",
                        "messages": {},
                        "dataType": "",
                        "data": {
                          "id": "${bmsCustomerId}"
                        }
                      }
                    },
                    {
                      "componentId": "u:8b4c950a826c",
                      "ignoreError": false,
                      "actionType": "reload"
                    }
                  ]
                }
              }
            }
          ],
          "fixed": "right",
          "width": 140
        }
      ],
      "editorSetting": {
        "mock": {
          "enable": true,
          "maxDisplayRows": 5
        }
      },
      "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:9f0677e0a701",
                                "type": "form",
                                "title": "新增数据",
                                "mode": "horizontal",
                                "dsType": "api",
                                "feat": "Insert",
                                "body": [
                                  {
                                    "name": "customerCode",
                                    "label": "客户代码",
                                    "type": "input-text",
                                    "id": "u:58bd09dfa785"
                                  }
                                ],
                                "resetAfterSubmit": true,
                                "actions": [
                                  {
                                    "type": "button",
                                    "actionType": "cancel",
                                    "label": "取消"
                                  },
                                  {
                                    "type": "button",
                                    "actionType": "submit",
                                    "label": "提交",
                                    "level": "primary"
                                  }
                                ],
                                "onEvent": {
                                  "submitSucc": {
                                    "actions": [
                                      {
                                        "actionType": "search",
                                        "groupType": "component",
                                        "componentId": "u:8b4c950a826c"
                                      }
                                    ]
                                  }
                                },
                                "api": "/prod-api/engine/dataset/save/bmsCustomer"
                              }
                            ],
                            "title": "新增数据",
                            "size": "md",
                            "actions": [
                              {
                                "type": "button",
                                "actionType": "cancel",
                                "label": "取消",
                                "id": "u:3d5acc108c25"
                              },
                              {
                                "type": "button",
                                "actionType": "submit",
                                "label": "提交",
                                "level": "primary",
                                "id": "u:a9e1bb2801dd"
                              }
                            ],
                            "id": "u:e60cf77c8525"
                          }
                        }
                      ]
                    }
                  },
                  "id": "u:c48cc0bc7466"
                }
              ],
              "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:a4535c141c97"
            },
            {
              "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:aa6dd5c95d07"
            }
          ],
          "id": "u:06ed010b606f"
        }
      ],
      "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:37dcb1aaed4d"
            },
            {
              "type": "container",
              "align": "right",
              "body": [
                {
                  "type": "pagination",
                  "behavior": "Pagination",
                  "layout": ["total", "perPage", "pager"],
                  "perPage": 10,
                  "perPageAvailable": [10, 20, 50, 100],
                  "align": "right",
                  "id": "u:86252b02d227"
                }
              ],
              "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:16fbdb2ac2f8"
            }
          ],
          "id": "u:666baec6c6a0"
        }
      ],
      "filter": {
        "type": "form",
        "title": "条件查询",
        "mode": "inline",
        "columnCount": 3,
        "clearValueOnHidden": true,
        "behavior": ["SimpleQuery"],
        "body": [
          {
            "name": "customerCode",
            "label": "客户代码",
            "type": "input-text",
            "size": "full",
            "required": false,
            "behavior": "SimpleQuery",
            "id": "u:bde5b1b8fd7f"
          }
        ],
        "actions": [
          {
            "type": "reset",
            "label": "重置",
            "id": "u:606e432db0d7"
          },
          {
            "type": "submit",
            "label": "查询",
            "level": "primary",
            "id": "u:47d1ee566d0d"
          }
        ],
        "id": "u:5e31cd958ce6",
        "feat": "Insert"
      },
      "quickSaveItemApi": {
        "url": "/prod-api/engine/dataset/save/bmsCustomer",
        "method": "get"
      },
      "data": [
        {
          "customerCode": "code01"
        },
        {
          "customerCode": "code02"
        }
      ]
    }
  ],
  "id": "u:c995def8c16e"
}

  1. 操作步骤
    请简单描述一下复现的操作步骤...
@github-actions github-actions bot added feat fix style Bug or PR related to component's style labels May 8, 2024
Copy link

github-actions bot commented May 8, 2024

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

Please review the labels and make any necessary changes.

@yuhonyon
Copy link

6.4.1也存在 现在只能回退6.3.0了

@2betop
Copy link
Collaborator

2betop commented May 14, 2024

问题修复还没发版本,也可以考虑把 crud2 换成 crud

@2betop
Copy link
Collaborator

2betop commented May 14, 2024

#10189

@2betop 2betop closed this as completed May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat fix need confirm style Bug or PR related to component's style
Projects
None yet
Development

No branches or pull requests

3 participants