mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 10:42:19 +08:00
fix: connected view does not apply field displayName settings
This commit is contained in:
parent
6afcbffdec
commit
f9d69e347f
@ -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) => (
|
||||
@ -227,7 +227,7 @@ const PreviewCom = (props) => {
|
||||
defaultValue={item?.uiSchema?.title || text}
|
||||
onChange={(e) =>
|
||||
handleFieldChange(
|
||||
{ ...item, uiSchema: { ...omit(item?.uiSchema, 'rawTitle'), title: e.target.value } },
|
||||
{ ...item, title1: e.target.value, uiSchema: { ...omit(item?.uiSchema, 'rawTitle'), title: e.target.value } },
|
||||
index,
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user