baidu / baidu/amis

crud字段filterable中的source无法获取父级变量

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

Description

#### 描述问题:

crud中filterable使用source方式设置options,参数无法调用父级的变量

#### 截图或视频:

```
{
type: "text",
label: "存放地点",
name: "project_name",
filterable: {
source: {
method: "get",
url: "/api/project/getselectoptions?with_all=0",
data: {
ignore_project_id: "${target_project_id}"
},
cache: 10000
}
}
},
```
data的ignore_project_id无法获取target_project_id变量值
![image](https://user-images.githubusercontent.com/22230193/178750639-181a8704-afcf-4314-b15e-eacf1e57e31b.png)

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

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

2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
2.0.0,2.0.1,2.0.2均试过,都不可以

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

```

4. 操作步骤

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue in the CRUD configuration shown, using the filterable source and its data.ignore_project_id expression. Test the reported SDK versions 2.0.0, 2.0.1, and 2.0.2, and verify whether the parent target_project_id value reaches the request. Done means the parent variable is resolved correctly in the source request.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.