ant-design / ant-design/pro-components

👑 [需求] convertValue不建议直接只根据dataIndex给数据 建议多给函数整个表格的数据

Open
#9,120 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

### 🔩 所属模块或组件
proForm Schema Form - JSON 表单

### 🥰 需求描述

比如我有一个日期周期组件 我传递给后端的是startData 和endData 前端使用的是dateTimeRange组件 这个时候
```
transform: (value) => {
return {
startDate: value[0],
endDate: value[1],
};
},

convertValue: (v,f,entity) => {
// editForm.getFieldsValue 现在还拿不到数据 建议通过entity传递下来 添加一个entity参数 我能通过其他方式得到 但是没有这个方式更为直接
const { startData, endData } = editForm.getFieldsValue();
if (startData && endData) return [startData, endData];
return undefined;
},
```

Image

Contributor guide

Open the contributing guide

Research direction

Start from the ProForm Schema Form convertValue callback and compare its current arguments with the transform callback and editForm.getFieldsValue usage shown in the issue. Trace how form data is passed through the component, then verify that the callback can access the complete form entity and that the date-range example works without relying on unavailable form values.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.