Skip to content

Commit e3a5dc7

Browse files
committed
docs: update docs
1 parent 038358e commit e3a5dc7

File tree

7 files changed

+185
-16
lines changed

7 files changed

+185
-16
lines changed

docs/cores/packages/client.md

Lines changed: 179 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,29 @@ order: 6
77

88
## 介绍
99

10-
### 路由
10+
提供适配 Ant Design 组件的 NocoBase 客户端。
1111

12-
和众多框架类似,NocoBase 也提供了路由,可以根据 URL 找到对应的页面。为了适应无代码需求,NocoBase 提供了一套由服务端配置的 routes 表,routes 是一个大杂烩,如以下例子:
12+
<Alert title="注意">
13+
14+
@nocobase/client 可以用于任意 React 框架中,不过还存在许多难点和细节未解决。
15+
16+
</Alert>
17+
18+
## Loaders
19+
20+
### TemplateLoader <Badge>待完善</Badge>
21+
22+
- routes:路由表,大杂烩。类型包括:layout、page、redirect、url、menuGroup,**页面就是 type=page 的 route**
23+
- templates:模板
24+
- pathname:URL 路径
25+
26+
为了适应无代码需求,提供了一种 URL 和 Template 映射规则,如以下例子:
1327

1428
```ts
15-
[
29+
const routes = [
1630
{
1731
type: 'layout',
18-
name: 'auth', // 因为 /login、/register 没有统一的前缀,所以这里没有配置 path
32+
name: 'auth', // 因为 /login、/register 没有统一的前缀,所以这里没有配置 path
1933
template: 'AuthLayout', // 用于处理 login、register 等页面的布局
2034
children: [
2135
{
@@ -35,7 +49,7 @@ order: 6
3549
]
3650
},
3751
{
38-
type: 'layout',
52+
type: 'layout',
3953
name: 'admin',
4054
path: '/admin', // /admin 下的任意 uri 都转到这里
4155
template: 'AdminLoader',
@@ -44,15 +58,15 @@ order: 6
4458
// 通过解析 /admin/:name,找到对应子页面
4559
// 「菜单和页面配置」就是这部分的内容
4660
children: [
47-
{
61+
{
4862
type: 'page',
4963
name: 'welcome',
5064
template: 'BlockLoader',
5165
title: '欢迎',
5266
blocks: [],
5367
},
5468
{
55-
type: 'url',
69+
type: 'url',
5670
url: 'https://www.nocobase.com/',
5771
title: 'xxx',
5872
},
@@ -68,25 +82,175 @@ order: 6
6882
path: '/',
6983
redirect: '/admin',
7084
},
71-
]
85+
];
7286
```
7387

74-
route 类型包括:layout、page、redirect、url、menuGroup,页面就是 type=page 的 route
88+
<pre lang="tsx">
89+
<TemplateLoader
90+
pathname={pathname}
91+
routes={routes}
92+
templates={{
93+
AuthLayout,
94+
BlockLoader,
95+
AdminLoader,
96+
}}
97+
/>
98+
</pre>
7599

76-
NocoBase 会内置几种常用的 template 用于处理特定页面渲染,如果有特殊需求还可以自行扩展。
100+
### BlockLoader <Badge type="error">未实现</Badge>
77101

78-
### 页面和区块
102+
区块驱动器。
79103

80-
我们又进一步提炼了页面内部的各个块元素,抽象出 block(区块)的概念,就可以类似以下例子来配置页面和区块了。
104+
### AdminLoader <Badge>待完善</Badge>
105+
106+
一种 top/left 菜单结构的 Admin 布局。菜单由其对应的 children 组成,通过 `/admin/:name` 映射到对应子页面,「菜单和页面配置」就是这部分的内容。
107+
108+
### ShareLoader <Badge type="error">未实现</Badge>
109+
110+
分享模块,细节待补充
111+
112+
## Blocks
113+
114+
将页面内部的各个块元素进行提炼,抽象了 block(区块)的概念。
115+
116+
### Grid - 布局
81117

82118
```ts
83119
{
84-
type: 'page',
120+
type: 'grid',
121+
span: 12,
85122
blocks: [
86123
{
87-
type: 'table',
88-
}
124+
col: 1,
125+
order: 1,
126+
},
127+
{
128+
col: 2,
129+
order: 1,
130+
},
131+
{
132+
col: 1,
133+
order: 2,
134+
},
89135
],
90136
}
91137
```
92138

139+
### Descriptions - 详情
140+
141+
```ts
142+
{
143+
type: 'descriptions',
144+
fields: [],
145+
actions: [],
146+
}
147+
```
148+
149+
### Form - 表单
150+
151+
```ts
152+
{
153+
type: 'form',
154+
fields: [],
155+
// 表单提交反馈信息,细节待定
156+
returnType,
157+
redirect,
158+
message,
159+
}
160+
```
161+
162+
### Table - 表单
163+
164+
```ts
165+
{
166+
type: 'table',
167+
defaultPerPage: 20,
168+
draggable: false,
169+
filter: {},
170+
sort: [],
171+
detailsOpenMode: 'drawer',
172+
actions: [],
173+
fields: [],
174+
details: [],
175+
labelField,
176+
}
177+
```
178+
179+
### Calendar - 日历
180+
181+
```ts
182+
{
183+
type: 'calendar',
184+
filter: {},
185+
detailsOpenMode: 'drawer',
186+
actions: [],
187+
details: [],
188+
labelField,
189+
}
190+
```
191+
192+
### Kanban - 看板
193+
194+
```ts
195+
{
196+
type: 'kanban',
197+
groupField,
198+
labelField,
199+
fields,
200+
filter,
201+
actions,
202+
detailsOpenMode,
203+
details,
204+
}
205+
```
206+
207+
### Markdown
208+
209+
```ts
210+
{
211+
type: 'markdown',
212+
content: '',
213+
}
214+
```
215+
216+
## Actions
217+
218+
操作按钮
219+
220+
### create - 新增
221+
222+
### update - 编辑
223+
224+
### destroy - 删除
225+
226+
### filter - 筛选
227+
228+
### print - 打印
229+
230+
### export - 导出
231+
232+
## Fields
233+
234+
字段控件
235+
236+
### boolean
237+
### cascader
238+
### checkbox
239+
### checkboxes
240+
### colorSelect
241+
### date
242+
### drawerSelect
243+
### filter
244+
### icon
245+
### markdown
246+
### number
247+
### password
248+
### percent
249+
### radio
250+
### remoteSelect
251+
### string
252+
### select
253+
### subTable
254+
### textarea
255+
### time
256+
### upload

docs/cores/packages/migrator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ order: 8
44
# toc: menu
55
---
66

7-
# @nocobase/migrate <Badge>未实现</Badge>
7+
# @nocobase/migrator <Badge>未实现</Badge>
88

99
NocoBase 的 Database 是基于 Sequelize,Sequelize 虽然提供了 sequelize-cli,包括 migrations 和 seeders 但是并不适用于 NocoBase。
1010

docs/plugins/packages/action-logs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: '@nocobase/plugin-action-logs'
3+
order: 5
34
group:
45
order: 3
56
title: 官方插件

docs/plugins/packages/automations.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: '@nocobase/plugin-automations'
3+
order: 4
34
---
45

56
# @nocobase/plugin-automations

docs/plugins/packages/collections.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: '@nocobase/plugin-collections'
3+
order: 1
34
---
45

56
# @nocobase/plugin-collections

docs/plugins/packages/pages.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: '@nocobase/plugin-pages'
3+
order: 1
34
---
45

56
# @nocobase/plugin-pages

docs/plugins/packages/permissions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: '@nocobase/plugin-permissions'
3+
order: 1
34
---
45

56
# @nocobase/plugin-permissions

0 commit comments

Comments
 (0)