From f4d5f462543c81e69c889ec2ca07028d352b7e8e Mon Sep 17 00:00:00 2001 From: zhoubichuan Date: Sun, 12 Nov 2023 20:10:46 +0800 Subject: [PATCH] update --- src/pages/list/list/index.tsx | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/pages/list/list/index.tsx b/src/pages/list/list/index.tsx index 97b8fbf..a332344 100644 --- a/src/pages/list/list/index.tsx +++ b/src/pages/list/list/index.tsx @@ -169,16 +169,7 @@ const TableList: React.FC = () => { }; const handleOnSearch = async () => { const { data } = await requestList({ current: 1, pageSize: 1000 }); - const targetArr = [], - obj = {}; - for (let i = 0; i < data.length; i++) { - const { typeName = '' } = data[i]; - if (!obj[typeName]) { - obj[typeName] = true; - targetArr.push({ label: typeName, value: typeName }); - } - } - setOptions(targetArr); + setOptions(data); }; useEffect(() => { getTemplateData(params.id); @@ -224,11 +215,17 @@ const TableList: React.FC = () => { ...item.table, renderFormItem: () => { if (item.search && item.search.type === 'select') { - // if(item.search.data){ - // return ; - // }else{ - return ; - // } + return ( + o[item.dataIndex]))].map( + (name: string) => ({ + label: name, + value: name, + }), + )} + /> + ); } else { return ; }