fix: view collection should omit rawTitle when sync form database (#3326)

This commit is contained in:
katherinehhh 2024-01-05 09:57:23 +08:00 committed by GitHub
parent dfcd21f34f
commit c26edf6282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
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 } 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 '../../../';
@ -207,7 +207,7 @@ const PreviewCom = (props) => {
defaultValue={item?.uiSchema?.title || text} defaultValue={item?.uiSchema?.title || text}
onChange={(e) => onChange={(e) =>
handleFieldChange( handleFieldChange(
{ ...item, uiSchema: { ...item?.uiSchema, title: e.target.value, rawTitle: e.target.value } }, { ...item, uiSchema: { ...omit(item?.uiSchema, 'rawTitle'), title: e.target.value } },
index, index,
) )
} }