Skip to content

Commit

Permalink
Merge pull request #1460 from alibaba/table-render
Browse files Browse the repository at this point in the history
feat: 补全 table-render onSearch 方法配置
  • Loading branch information
lhbxs authored Jan 4, 2024
2 parents c437192 + 2e68d2b commit 5ecdbf5
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 9 deletions.
15 changes: 15 additions & 0 deletions docs/form-render/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,18 @@ toc: false

form-render 有生命周期的概念,请在 onMount 这个钩子里 set。

##### 3. type 为 object 类型自定义组件没有接收到 value 与 onChange 属性

例如下面这种 Schema 结构的自定义组件,2.x 会判定它是容器组件并非表单控件,那如何解决这种误判呢?增加一个 widgetType: 'field'
```js
{
type: "object",
widget: "WidgetObj",
properties: {
name: {
title: "name",
type: "string",
}
}
}
```
2 changes: 2 additions & 0 deletions packages/form-render/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 更新日志

### 2.3.8
- [!] 修复 schema 多层嵌套下,getSchemaByPath 获取异常

### 2.3.7
- [+] 增加 antdVersion 配置字段,对应值 'v4' | 'v5',用于处理 ant v4 与 v5 API 不兼容性警告提示,例如 visible & open,默认是 v5 版本。
Expand Down
2 changes: 1 addition & 1 deletion packages/form-render/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "form-render",
"version": "2.3.7",
"version": "2.3.8",
"description": "通过 JSON Schema 生成标准 Form,常用于自定义搭建配置界面生成",
"keywords": [
"Form",
Expand Down
6 changes: 3 additions & 3 deletions packages/form-render/src/models/formCoreUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ export const getSchemaFullPath = (path: string, schema: any) => {

// 补全 object 类型 path 路径
let result = 'properties';
(path.split('.')).forEach(item => {
const pathList = path.split('.');
pathList.forEach((item, index) => {
const key = result + '.' + item;
const itemSchema = _get(schema, key, {});

if (isObjType(itemSchema)) {
if (isObjType(itemSchema) && index !== pathList.length-1) {
result = key + '.properties';
return ;
}
Expand Down
5 changes: 4 additions & 1 deletion packages/table-render/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# 更新日志

### 2.1.4
-[!] 修复 onSearch 方法缺失

### 2.0.18
-[!] 修复 table-render 切换 pageSize 无效
### 2.0.17
Expand All @@ -23,4 +26,4 @@
-[+] table-render 新版发布上线,props 调整
### 2.0.0

- [+] form-render 2.0 正式发版
- [+] table-render 2.0 正式发版
2 changes: 1 addition & 1 deletion packages/table-render/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "table-render",
"version": "2.1.3",
"version": "2.1.4",
"description": "中后台表格解决方案",
"keywords": [
"TableRender",
Expand Down
4 changes: 4 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,9 @@ 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 5ecdbf5

Please sign in to comment.