mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 03:02:19 +08:00
fix: details block to render map field as map (#6010)
This commit is contained in:
parent
cd2418f3fa
commit
5eb8f751da
@ -7,8 +7,8 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { useField, useFieldSchema, useForm } from '@formily/react';
|
import { useFieldSchema } from '@formily/react';
|
||||||
import { EllipsisWithTooltip, useCollection, useFieldTitle } from '@nocobase/client';
|
import { EllipsisWithTooltip, useCollection, useFieldTitle, useFlag } from '@nocobase/client';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { MapComponent } from './MapComponent';
|
import { MapComponent } from './MapComponent';
|
||||||
|
|
||||||
@ -18,10 +18,10 @@ const ReadPretty = (props) => {
|
|||||||
const collection = useCollection();
|
const collection = useCollection();
|
||||||
const collectionField = collection.getField(fieldSchema.name);
|
const collectionField = collection.getField(fieldSchema.name);
|
||||||
const mapType = props.mapType || collectionField?.uiSchema['x-component-props']?.mapType;
|
const mapType = props.mapType || collectionField?.uiSchema['x-component-props']?.mapType;
|
||||||
const form = useForm();
|
const { isInSubTable } = useFlag();
|
||||||
const field = useField();
|
const displayText = fieldSchema?.parent?.['x-component'] === 'TableV2.Column' || isInSubTable;
|
||||||
useFieldTitle();
|
useFieldTitle();
|
||||||
if (!form.readPretty || field.readPretty) {
|
if (displayText) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<EllipsisWithTooltip ellipsis={true}>
|
<EllipsisWithTooltip ellipsis={true}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user