From 79d1ad02f14b0af649db30a8d08856453bcb1cda Mon Sep 17 00:00:00 2001 From: yxh01132861 Date: Fri, 26 Jan 2024 16:14:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E8=A1=A8=E6=A0=BC=E3=80=81=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8tab=E5=88=87=E6=8D=A2=E6=B8=B2=E6=9F=93=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widgets/WidgetsPanel/WidgetAttribute/WidgetForm/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/li-editor/src/widgets/WidgetsPanel/WidgetAttribute/WidgetForm/index.tsx b/packages/li-editor/src/widgets/WidgetsPanel/WidgetAttribute/WidgetForm/index.tsx index bb187484..f00d1827 100644 --- a/packages/li-editor/src/widgets/WidgetsPanel/WidgetAttribute/WidgetForm/index.tsx +++ b/packages/li-editor/src/widgets/WidgetsPanel/WidgetAttribute/WidgetForm/index.tsx @@ -59,7 +59,7 @@ const WidgetForm: React.FC = (props) => { }); return form; - }, [schema]); + }, [registerFormData.toValues]); return (
Date: Wed, 31 Jan 2024 10:29:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WidgetAttribute/WidgetForm/index.tsx | 2 +- .../WidgetsPanel/WidgetAttribute/index.tsx | 36 ++++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/packages/li-editor/src/widgets/WidgetsPanel/WidgetAttribute/WidgetForm/index.tsx b/packages/li-editor/src/widgets/WidgetsPanel/WidgetAttribute/WidgetForm/index.tsx index f00d1827..bb187484 100644 --- a/packages/li-editor/src/widgets/WidgetsPanel/WidgetAttribute/WidgetForm/index.tsx +++ b/packages/li-editor/src/widgets/WidgetsPanel/WidgetAttribute/WidgetForm/index.tsx @@ -59,7 +59,7 @@ const WidgetForm: React.FC = (props) => { }); return form; - }, [registerFormData.toValues]); + }, [schema]); return ( = (props) => { // 数据集列表 const { editorDatasets } = useEditorDatasets(); - const datasets: Dataset[] = editorDatasets.map((item) => { - const columns = item.columns.map((cloumn) => { - // TODO: 从 editorDataset 获取 domain 数据 - let domain: string[] | [number, number] = []; - if (cloumn.type === 'string') { - const itemValue = item.data.map((_item: any) => _item[cloumn.name]); - domain = cloumn.type === 'string' ? [...new Set(itemValue)] : []; - } + const datasets: Dataset[] = useMemo(() => { + return editorDatasets.map((item) => { + const columns = item.columns.map((cloumn) => { + // TODO: 从 editorDataset 获取 domain 数据 + let domain: string[] | [number, number] = []; + if (cloumn.type === 'string') { + const itemValue = item.data.map((_item: any) => _item[cloumn.name]); + domain = cloumn.type === 'string' ? [...new Set(itemValue)] : []; + } - return { ...cloumn, domain }; - }); + return { ...cloumn, domain }; + }); - return { - ...item.schema, - columns: columns, - data: [], - }; - }); + return { + ...item.schema, + columns: columns, + data: [], + }; + }); + }, [editorDatasets]); // 服务资产列表 const services = useMemo(() => appService.getImplementServices(), [appService]);