From b93c68790f9782ffe27c672f178945b3be88d9f4 Mon Sep 17 00:00:00 2001 From: lhbxs <596850703@qq.com> Date: Fri, 5 Jan 2024 00:28:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A1=A5=E5=85=A8=20table-render=20onS?= =?UTF-8?q?earch=20=E6=96=B9=E6=B3=95=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/table-render/index.md | 5 ++++- packages/table-render/src/core/SearchView/index.tsx | 5 +++++ tools/schema-builder/package.json | 2 +- tools/schema-builder/src/createIframe.ts | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/table-render/index.md b/docs/table-render/index.md index 860b438be..80c224612 100644 --- a/docs/table-render/index.md +++ b/docs/table-render/index.md @@ -108,7 +108,10 @@ const Demo = () => { return ( alert(1), + }} request={api} columns={columns} title='最简表格' diff --git a/packages/table-render/src/core/SearchView/index.tsx b/packages/table-render/src/core/SearchView/index.tsx index 533e6466a..719d83249 100644 --- a/packages/table-render/src/core/SearchView/index.tsx +++ b/packages/table-render/src/core/SearchView/index.tsx @@ -11,6 +11,7 @@ const Search: ( refresh, getState, onMount, + onSearch, watch: _watch, mode, form, @@ -40,6 +41,10 @@ const Search: ( }; const handleSearch = (data: any) => { + if (typeof onSearch === 'function') { + onSearch(data); + } + refresh({ ...data, sorter }); }; diff --git a/tools/schema-builder/package.json b/tools/schema-builder/package.json index df52a0dca..793700025 100644 --- a/tools/schema-builder/package.json +++ b/tools/schema-builder/package.json @@ -1,6 +1,6 @@ { "name": "@xrenders/schema-builder", - "version": "1.0.0-alpha.15", + "version": "1.0.0-alpha.17", "description": "通过 JSON Schema 生成标准 Form,常用于自定义搭建配置界面生成", "keywords": [ "Form", diff --git a/tools/schema-builder/src/createIframe.ts b/tools/schema-builder/src/createIframe.ts index 5cc45f1ac..7d321a6d7 100644 --- a/tools/schema-builder/src/createIframe.ts +++ b/tools/schema-builder/src/createIframe.ts @@ -11,7 +11,7 @@ const createIframeContent = () => { - + + `;