Skip to content

Commit a75bc1c

Browse files
authored
Merge pull request #1995 from hqwcxy/master
[FIX] <pro>Lov: Fixed an issue where the data displayed by Lov was in…
2 parents 2a10de9 + 6740e2c commit a75bc1c

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

components-pro/lov/Lov.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,13 @@ export default class Lov extends Select<LovProps> {
738738
handleLovViewSelect(records: Record | Record[]) {
739739
const { viewMode, textField = '' } = this;
740740
if (isArrayLike(records)) {
741-
this.setValue(getRecords(records, textField).map(record => this.processRecordToObject(record)));
741+
// 全选的情况下,所有记录 selectedTimestamp 都相同
742+
const isSameSelectedTimestamp = new Set(records.map(record => (record.selectedTimestamp || -1))).size === 1;
743+
if (isSameSelectedTimestamp) {
744+
this.setValue(records.map(record => this.processRecordToObject(record)));
745+
} else {
746+
this.setValue(getRecords(records, textField).map(record => this.processRecordToObject(record)));
747+
}
742748
} else {
743749
this.setValue(records && this.processRecordToObject(records) || this.emptyValue);
744750
}

components/configure/index.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const prefixCls = getConfig('prefixCls');
4444
| lovQueryCachedSelected | lov 查询缓存已勾选记录 | (code: string, cachedSelected: Map<string, Record>) => Promise<object[]> | |
4545
| lookupBatchAxiosConfig | hook for batch lookup query, more info:[AxiosRequestConfig](#AxiosRequestConfig)| (codes: string[]) => AxiosRequestConfig | - |
4646
| useLookupBatch | 是否使用批量查询快码 | (code: string, field: Field) => boolean | noop |
47+
| batchParaKey | lookup 批量查询参数的键,如果查询参数的键全部在 batchParaKey 数组中,那么依然执行批量查询 | string\[\] | - |
4748
| selectReverse | Whether to enable the pull-down multi-select reverse function. | boolean | true |
4849
| selectOptionsFilter | 选项过滤。 | (record: Record) => boolean | |
4950
| selectSearchable | 是否开启下拉搜索功能。 | boolean | false |

components/configure/index.zh-CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const prefixCls = getConfig('prefixCls');
4747
| lovQueryCachedSelected | lov 查询缓存已勾选记录 | (code: string, cachedSelected: Map<string, Record>) => Promise<object[]> | |
4848
| lookupBatchAxiosConfig | 返回 lookup 批量查询配置的钩子,详见[AxiosRequestConfig](#AxiosRequestConfig)| (codes: string[]) => AxiosRequestConfig | - |
4949
| useLookupBatch | 是否使用批量查询快码 | (code: string, field: Field) => boolean | noop |
50+
| batchParaKey | lookup 批量查询参数的键,如果查询参数的键全部在 batchParaKey 数组中,那么依然执行批量查询 | string\[\] | - |
5051
| selectReverse | 是否开启下拉多选反向功能。 | boolean | true |
5152
| selectOptionsFilter | 选项过滤。 | (record: Record) => boolean | |
5253
| selectSearchable | 是否开启下拉搜索功能。 | boolean | false |

0 commit comments

Comments
 (0)