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

当 select 组件使用表格模式展示时,change 事件无 selectedItems 数据 #11431

Open
Bitzo opened this issue Dec 26, 2024 · 0 comments

Comments

@Bitzo
Copy link

Bitzo commented Dec 26, 2024

描述问题:

当 select 组件使用表格模式展示时,change 事件无 selectedItems 数据

截图或视频:

以表格模式展示时
image
以非表格模式展示时
image

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

  1. 你是如何使用 amis 的?
    sdk
  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
    6.10.0
  3. 粘贴有问题的完整 amis schema 代码:
{
                  type: "select",
                  selectMode: "table",
                  searchable: true,
                  multiple: false,
                  checkAll: true,
                  clearable: true,
                  with: 200,
                  size: "md",
                  joinValues: false,
                  extractValue: true,
                  columns: [
                    {
                      name: "identity_title",
                      label: "身份",
                    },
                    {
                      name: "identity_id",
                      label: "标识",
                    },
                  ],
                  name: "identity_id",
                  label: "会员身份",
                  source: api.identities(),
                  onEvent: {
                    change: {
                      actions: [
                        {
                          actionType: "setValue",
                          componentId: "certification",
                          args: {
                            value: "${event.data.selectedItems}"
                          }
                        },
                        {
                          actionType: "toast",
                          args: {
                            "msg": "${event.data.selectedItems|json}"
                          }
                        }
                      ]
                    }
                  },
                }

开启表格模式展示时 change 事件返回的 event.data

{
  "value": "698856511374311424",
  "options": [
    {
      "identity_id": "digitalMem",
      "identity_title": "数字会员",
      "identity_icon": "",
      "certification": {
        "img": "http://www.test.com/19310.png",
        "name": "数字会员证书",
        "prod_name": "数字会员证 9",
        "creator": "数字会员证书 28",
        "issuer": "数字会员证书 37",
        "issuer_org": "数字会员证书 46"
      },
      "label": "数字会员",
      "value": "digitalMem"
    },
    {
      "identity_id": "698856511462391808",
      "identity_title": "普通会员",
      "identity_icon": "",
      "label": "普通会员",
      "value": "698856511462391808"
    }
  ],
  "items": [
    {
      "identity_id": "digitalMem",
      "identity_title": "数字会员",
      "identity_icon": "",
      "certification": {
        "img": "http://www.test.com/19310.png",
        "name": "数字会员证书",
        "prod_name": "数字会员证 9",
        "creator": "数字会员证书 28",
        "issuer": "数字会员证书 37",
        "issuer_org": "数字会员证书 46"
      },
      "label": "数字会员",
      "value": "digitalMem"
    },
    {
      "identity_id": "698856511462391808",
      "identity_title": "普通会员",
      "identity_icon": "",
      "label": "普通会员",
      "value": "698856511462391808"
    }
  ],
  "identity_id": "698856511374311424",
  "__rendererData": {
    "certification": {},
    "identity_id": "698856511374311424"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant