baidu / baidu/amis

1.5.0版本 mapping 组件 在crud中使用,数据映射显示数据有问题

Open
#3,121 6 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

1.5.0版本 mapping 组件 在crud中使用,数据映射显示数据有问题

数据中心 的ID 是一样的

```
{
"type": "mapping",
"label": "数据中心ID",
"name": "DataCenterID",
"map": {},
"source": {
"method": "get",
"cache": 1,
"url": "/ram/datacenter/select/options",
"adaptor": "var data = {};\n payload.data.options.forEach(e=>{data[e.value] = e.label}); \n payload.data = data; \n return payload;\n"
}
},
```

![image](https://user-images.githubusercontent.com/88780174/144252315-7c763a04-5cb1-47b5-ba0e-f990d1a5e995.png)

去掉 "map": {}, 显示 通配符:

```
{
"type": "mapping",
"label": "数据中心ID",
"name": "DataCenterID",
"source": {
"method": "get",
"cache": 1,
"url": "/ram/datacenter/select/options",
"adaptor": "var data = {};\n payload.data.options.forEach(e=>{data[e.value] = e.label}); \n payload.data = data; \n return payload;\n"
}
},
```

![image](https://user-images.githubusercontent.com/88780174/144251978-cc634093-715a-4f8c-8ef5-ec6cde78543c.png)

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the reported mapping configuration inside a CRUD view, comparing behavior with "map": {} present and omitted. Start by locating the mapping component and its handling of the source adaptor response; done means the DataCenterID value displays the returned label rather than a wildcard in both relevant configurations.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.