mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52:20 +08:00
fix: setting field displayName in connected view does not take effect (#7130)
This commit is contained in:
parent
88591454ec
commit
d1ff280d9f
@ -9,7 +9,7 @@
|
||||
|
||||
import { useField, useForm } from '@formily/react';
|
||||
import { Cascader, Input, Select, Spin, Table, Tag } from 'antd';
|
||||
import { last, omit } from 'lodash';
|
||||
import _, { last, omit } from 'lodash';
|
||||
import React, { useContext, useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { ResourceActionContext, useCompile } from '../../../';
|
||||
@ -120,9 +120,10 @@ const PreviewCom = (props) => {
|
||||
}, [databaseView]);
|
||||
|
||||
const handleFieldChange = (record, index) => {
|
||||
dataSource.splice(index, 1, record);
|
||||
setDataSource(dataSource);
|
||||
field.value = dataSource.map((v) => {
|
||||
const newDataSource = _.cloneDeep(dataSource);
|
||||
newDataSource[index] = record;
|
||||
setDataSource(newDataSource);
|
||||
field.value = newDataSource.map((v) => {
|
||||
const source = typeof v.source === 'string' ? v.source : v.source?.filter?.(Boolean)?.join('.');
|
||||
return {
|
||||
...v,
|
||||
@ -198,8 +199,7 @@ const PreviewCom = (props) => {
|
||||
style={{ width: '100%' }}
|
||||
popupMatchSelectWidth={false}
|
||||
onChange={(value) => {
|
||||
const interfaceConfig = getInterface(value);
|
||||
handleFieldChange({ ...item, interface: value, uiSchema: interfaceConfig?.default?.uiSchema }, index);
|
||||
handleFieldChange({ ...item, interface: value }, index);
|
||||
}}
|
||||
>
|
||||
{data.map((group) => (
|
||||
|
Loading…
x
Reference in New Issue
Block a user