From e73ad1b98ba6ba6b10d04897f1677bb757f41bf4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=A2=AB=E9=9B=A8=E6=B0=B4=E8=BF=87=E6=BB=A4=E7=9A=84?=
=?UTF-8?q?=E7=A9=BA=E6=B0=94-Rain?= <958414905@qq.com>
Date: Thu, 9 Nov 2023 12:55:06 +0800
Subject: [PATCH] fix: detail block has no data (#3003)
* chore: add comments
* fix: detail block has no data
---
packages/core/client/src/block-provider/BlockProvider.tsx | 3 ---
.../schema-component/antd/form-item/SchemaSettingOptions.tsx | 1 +
packages/core/client/src/schema-items/GeneralSchemaItems.tsx | 1 +
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/packages/core/client/src/block-provider/BlockProvider.tsx b/packages/core/client/src/block-provider/BlockProvider.tsx
index e3a92671d2..f1ed19a2e0 100644
--- a/packages/core/client/src/block-provider/BlockProvider.tsx
+++ b/packages/core/client/src/block-provider/BlockProvider.tsx
@@ -93,9 +93,6 @@ const useResource = (props: UseResourceProps) => {
if (sourceId) {
return api.resource(resource, sourceId);
}
- if (record[association?.sourceKey || 'id']) {
- return api.resource(resource, record[association?.sourceKey || 'id']);
- }
if (record?.__parent?.[association?.sourceKey || 'id']) {
return api.resource(resource, record.__parent[association?.sourceKey || 'id']);
}
diff --git a/packages/core/client/src/schema-component/antd/form-item/SchemaSettingOptions.tsx b/packages/core/client/src/schema-component/antd/form-item/SchemaSettingOptions.tsx
index a86aaca615..fa5b1e5270 100644
--- a/packages/core/client/src/schema-component/antd/form-item/SchemaSettingOptions.tsx
+++ b/packages/core/client/src/schema-component/antd/form-item/SchemaSettingOptions.tsx
@@ -167,6 +167,7 @@ export const EditRequired = () => {
const { t } = useTranslation();
const { dn, refresh } = useDesignable();
+ // TODO: FormField 好像被弃用了,应该删除掉
return !field.readPretty && fieldSchema['x-component'] !== 'FormField' ? (
)}
+ {/* TODO: FormField 好像被弃用了,应该删除掉 */}
{!field.readPretty && fieldSchema['x-component'] !== 'FormField' && required && (