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