baidu / baidu/amis

CURD itemAction无法获取上层data数据

Open
#4,663 3 comments 0 reactions 0 assignees View on GitHub
Pending Discussion
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 描述问题:

CURD itemAction无法获取上层data数据

#### 截图或视频:

![image](https://user-images.githubusercontent.com/22347754/174550474-ac323ca0-47da-464f-a680-3dbf3642fada.png)
ItemAction:
![image](https://user-images.githubusercontent.com/22347754/174550554-c9f65c74-37c6-47ff-b7f1-2920b52ef71c.png)
单元格弹框:
![image](https://user-images.githubusercontent.com/22347754/174550995-0e4def3d-51c2-48b2-8080-077bb9d226d5.png)

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

1. 你是如何使用 amis 的?
`sdk`、`npm` 或`其他`...

2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
官网案例https://aisuda.bce.baidu.com/amis/zh-CN/components/table
3. 粘贴有问题的完整 `amis schema` 代码:
```
{
"type": "page",
"body": {
"type": "service",
"data": {
"data1": "测试数据"
},
"api": "/amis/api/mock2/sample?perPage=10",
"body": [
{
"type": "table",
"source": "$rows",
"itemAction": {
"type": "button",
"actionType": "dialog",
"dialog": {
"title": "详情",
"body": "当前行的数据 ${data1} browser: ${browser}, version: ${version}"
}
},
"columns": [
{
"name": "browser",
"label": "Browser"
},
{
"name": "version",
"label": "Version"
},
{
"type": "button",
"label": "一个弹框",
"actionType": "dialog",
"dialog": {
"title": "一个弹框",
"body": [
{
"type": "tpl",
"tpl": "当前行的数据 ${data1} browser: ${browser}, version: ${version}"
}
]
}
}
]
}
]
}
}
```

4. 操作步骤
请简单描述一下复现的操作步骤...

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the official table example and the supplied AMIS schema, then compare the itemAction dialog with the column button dialog to trace their available data scopes. The issue is resolved when itemAction can display both the parent data1 value and the current row's browser and version values consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.