ant-design / ant-design/pro-components

🐛[BUG]ProDescriptions 当valueType为Select且字段值为number时,select组件默认选中值显示数字,未显示对应text值

Open
#8,517 2 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

### 🐛 bug 描述

ProDescriptions 当valueType为Select且字段值为number时,进入编辑模式时,select组件默认选中值显示数字,未显示对应字典值。
![image](https://github.com/ant-design/pro-components/assets/12812852/55524cb7-2754-4f9f-b3e3-037a6cbb28ae)

![image](https://github.com/ant-design/pro-components/assets/12812852/0ee5be10-e097-43b3-bde6-632399b1d8b7)

### 📷 复现步骤
1.声明一个column的valuType为select, dataIndex为status,valueEnum数据如图
![image](https://github.com/ant-design/pro-components/assets/12812852/79c014a8-058c-43f8-8ad3-eaa3817e3878)

2.声明dataSource为{status: 2}(text对应为“已完成”)
打开ProDescriptions的editable
点击字段进入编辑,结果显示值未被映射成text
![image](https://github.com/ant-design/pro-components/assets/12812852/987537d3-c9c0-4544-ab52-4fb37d10e3fb)

### 🏞 期望结果

当字段值类型是number时,编辑时可以正常显示默认选中值的text。

### © 版本信息

- ProComponents 版本: [2.7.10]
- @umijs/max 版本: [4.1.1]
- 浏览器环境 chrome 版本: [126.0.6478.114]
- 开发环境 [web]

### 🚑 其他信息
之前有开发者提类似的问题,连接如下:
https://github.com/ant-design/pro-components/issues/2088
但是未解决此次问题。

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the ProDescriptions editable Select case described here: a numeric status value with a valueEnum mapping. Trace the relevant TypeScript entry point for ProDescriptions and its editable Select field, then verify that entering edit mode displays the mapped text for the numeric value while preserving the selected value.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.