From f8b5ff06deb57e9ae3897f5c7d3c3fc2bdfeb656 Mon Sep 17 00:00:00 2001 From: zjt Date: Thu, 14 Apr 2022 21:58:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=A1=86=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/formFields/treeSelect/index.tsx | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/components/formFields/treeSelect/index.tsx b/src/components/formFields/treeSelect/index.tsx index 2f73445..9796419 100644 --- a/src/components/formFields/treeSelect/index.tsx +++ b/src/components/formFields/treeSelect/index.tsx @@ -17,6 +17,7 @@ export default class TreeSelectFieldComponent extends TreeSelectField { return (
{ - console.log("onCheck", checked); - onChange(checked as string | (string | number)[]); + onCheck={(checked) => { + onChange(checked as Array); }} - checkedKeys={value} + checkedKeys={value as Array} treeData={treeData} /> } @@ -66,16 +66,10 @@ export default class TreeSelectFieldComponent extends TreeSelectField { }]} rowSelection={{ checkStrictly: false, - onChange: (selectedRowKeys, selectedRows) => { - console.log( - `selectedRowKeys: ${selectedRowKeys}`, - "selectedRows: ", - selectedRows - ); - console.log('typeof', typeof selectedRowKeys, selectedRowKeys) + onChange: (selectedRowKeys) => { onChange(selectedRowKeys) }, - selectedRowKeys: value || [] + selectedRowKeys: value as Array || [] }} dataSource={treeData} /> -- Gitee From a3a97a1613c2efcb633004e3395796e870b65002 Mon Sep 17 00:00:00 2001 From: zjt Date: Fri, 15 Apr 2022 16:25:16 +0800 Subject: [PATCH 2/2] =?UTF-8?q?perf:=20treeSelect=E8=A1=A5=E5=85=85multipl?= =?UTF-8?q?e=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/formFields/treeSelect/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/formFields/treeSelect/index.tsx b/src/components/formFields/treeSelect/index.tsx index 9796419..2dc263f 100644 --- a/src/components/formFields/treeSelect/index.tsx +++ b/src/components/formFields/treeSelect/index.tsx @@ -9,6 +9,7 @@ export default class TreeSelectFieldComponent extends TreeSelectField { //树选择treeselect renderComponent = (props: ITreeSelectField) => { const { + multiple, treeData, value, onChange @@ -17,7 +18,7 @@ export default class TreeSelectFieldComponent extends TreeSelectField { return (