Skip to content

Commit

Permalink
feat: 补全 table-render onSearch 方法配置
Browse files Browse the repository at this point in the history
  • Loading branch information
lhbxs committed Jan 4, 2024
1 parent c437192 commit b93c687
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion docs/table-render/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ const Demo = () => {

return (
<TableRender
search={{ schema }}
search={{
schema,
onSearch: () => alert(1),
}}
request={api}
columns={columns}
title='最简表格'
Expand Down
5 changes: 5 additions & 0 deletions packages/table-render/src/core/SearchView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const Search: <RecordType extends object = any>(
refresh,
getState,
onMount,
onSearch,
watch: _watch,
mode,
form,
Expand Down Expand Up @@ -40,6 +41,10 @@ const Search: <RecordType extends object = any>(
};

const handleSearch = (data: any) => {
if (typeof onSearch === 'function') {
onSearch(data);
}

refresh({ ...data, sorter });
};

Expand Down
2 changes: 1 addition & 1 deletion tools/schema-builder/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions tools/schema-builder/src/createIframe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const createIframeContent = () => {
<link href="https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/dist/next.var.min.css" rel="stylesheet" />
<link rel="stylesheet" href="https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/css/engine-core.css" />
<link rel="stylesheet" href="https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/css/engine-ext.css" />
<link rel="stylesheet" href="https://g.alicdn.com/fone-lowcode/fr-generator/1.0.13/css/index.css" />
<link rel="stylesheet" href="https://g.alicdn.com/fone-lowcode/fr-generator/1.0.14/css/index.css" />
<script>
window.React = window.parent.React;
Expand All @@ -30,7 +30,7 @@ const createIframeContent = () => {
<body>
<div id="lce-container"></div>
<script type="text/javascript" src="https://g.alicdn.com/fone-lowcode/fr-generator/1.0.13/js/index.js"></script>
<script type="text/javascript" src="https://g.alicdn.com/fone-lowcode/fr-generator/1.0.14/js/index.js"></script>
</body>
</html>
`;
Expand Down

0 comments on commit b93c687

Please sign in to comment.