fix: tagcolor value error

This commit is contained in:
katherinehhh 2023-08-20 11:00:25 +08:00
parent be6b949f55
commit 5773f879bf

View File

@ -41,11 +41,10 @@ export const ReadPrettyInternalTag: React.FC = observer(
const labelUiSchema = useLabelUiSchema(collectionField, fieldNames?.label || 'label'); const labelUiSchema = useLabelUiSchema(collectionField, fieldNames?.label || 'label');
const { snapshot } = useActionContext(); const { snapshot } = useActionContext();
const ellipsisWithTooltipRef = useRef<IEllipsisWithTooltipRef>(); const ellipsisWithTooltipRef = useRef<IEllipsisWithTooltipRef>();
const tagColor = flat(recordCtx)[`${fieldSchema.name}.${tagColorField}`];
const renderRecords = () => const renderRecords = () =>
toArr(props.value).map((record, index, arr) => { toArr(props.value).map((record, index, arr) => {
const val = toValue(compile(record?.[fieldNames?.label || 'label']), 'N/A'); const val = toValue(compile(record?.[fieldNames?.label || 'label']), 'N/A');
const text = getTabFormatValue(compile(labelUiSchema), val, tagColor); const text = getTabFormatValue(compile(labelUiSchema), val, record[tagColorField]);
return ( return (
<Fragment key={`${record.id}_${index}`}> <Fragment key={`${record.id}_${index}`}>
<span> <span>