diff --git a/docs/cores/index.md b/docs/cores/index.md index 2924f8fa6..204557f11 100644 --- a/docs/cores/index.md +++ b/docs/cores/index.md @@ -8,95 +8,3 @@ nav: --- # 介绍 - -NocoBase 核心主要围绕三点: - -- 数据的结构 -- 数据的行为 -- 数据的形态 - -由此抽象了三类配置协议 - -- Collection:用于描述数据的结构和关系 -- Resourcer:用于描述数据资源和操作方法 -- UI Schema:用于描述用户界面(组件树结构) - -## Collection - -基于 Sequelize ModelOptions - -```ts -{ - name: 'posts', - fields: [ - {type: 'string', name: 'title'}, - {type: 'text', name: 'content'}, - ], -} -``` - -## Resourcer - -基于资源(resource)和操作方法(action)设计,将 REST 和 RPC 思想融合起来 - -```ts -{ - name: 'posts', - actions: { - list: { - filter: {}, // 过滤 - fields: [], // 输出哪些字段 - sort: '-created_at', // 排序 - page: 1, - perPage: 20, - // ... - }, - get: { - filter: {}, - fields: [], - // ... - }, - create: { - fields: [], - values: {}, - // ... - }, - update: { - fields: [], - values: {}, - // ... - }, - destroy: { - filter: {}, - // ... - }, - }, -} -``` - -## UI Schema - -基于 Formily Schema 2.0 - -```ts -{ - type: 'object', - // 'x-component': 'Form', - properties: { - title: { - type: 'string', - title: '标题', - 'x-component': 'Input', - }, - content: { - type: 'string', - title: '标题', - 'x-component': 'Input.TextArea', - }, - }, -} -``` - -更进一步,构建了整个 NocoBase 架构: - - \ No newline at end of file diff --git a/docs/cores/nocobase-core.png b/docs/cores/nocobase-core.png deleted file mode 100644 index 0b3f4db1b..000000000 Binary files a/docs/cores/nocobase-core.png and /dev/null differ diff --git a/docs/cores/packages/sdk.md b/docs/cores/packages/sdk.md index f9c7e8911..d3898e1e4 100644 --- a/docs/cores/packages/sdk.md +++ b/docs/cores/packages/sdk.md @@ -1,6 +1,6 @@ --- title: '@nocobase/sdk' -order: 3 +order: 5 # toc: menu --- diff --git a/docs/cores/packages/ui-schema.md b/docs/cores/packages/ui-schema.md new file mode 100644 index 000000000..8ac54ea3b --- /dev/null +++ b/docs/cores/packages/ui-schema.md @@ -0,0 +1,13 @@ +--- +title: '@nocobase/ui-schema' +order: 4 +--- + +# @nocobase/ui-schema 未实现 + +v0.5 前端完全重构了,减少了对 umijs 的直接依赖,前端后续会拆分成四部分 + +- ui-schema 核心组件库 +- ui-router 前端路由 +- sdk 供客户端使用 +- create-nocobase-app 项目脚手架,基于 umijs diff --git a/docs/guide/index.md b/docs/guide/index.md index 5c37d8d24..1ecd9a9cd 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -7,36 +7,42 @@ nav: order: 1 --- -## NocoBase 是什么? +## Nocude 是什么? -NocoBase 是一个开源免费的无代码、低代码开发平台。 无论是不懂编程的业务主管,还是精通编程的开发人员,都可以快速搭建各类定制化、私有部署的协作平台、管理系统。 +Nocude 是一个开源免费的无代码、低代码开发平台。 无论是不懂编程的业务主管,还是精通编程的开发人员,都可以快速搭建各类定制化、私有部署的协作平台、管理系统。 ## 架构 - + ### 微内核 -NocoBase 采用微内核架构,框架只保留核心的概念,具体各类功能都以插件的形式扩展。各个包可以拆出来单独或组合使用,可用于现有项目中,这也是渐进式框架的意义所在。除此之外,我们也非常注重与现有技术框架融合,做连接现有生态的桥梁,而不是闭门造车。 +Nocude 采用微内核架构,框架只保留核心的概念,具体各类功能都以插件的形式扩展。各个包可以拆出来单独或组合使用,也可用于现有项目中。 ### 插件化 所有的功能需求都通过插件形式扩展,除了现有的几个核心插件以外,开发者还可以自由的扩展,包括但不局限于: -- Collection - 数据 -- Relationship - 相关数据 -- Field - 字段 -- Model - 模型 -- Hook - 触发事件 -- Resource - 资源 -- Action - 操作方法 -- Middleware - 中间件 -- Block - 区块 -- Page - 页面 +- Collection - 数据表 + - CollectionField - 字段 + - DataType - 存储类型 + - UI Schema/Component - 组件 + - Template - 模板 + - Model/Repository - 模型 + - Schema Builder - 构造器 +- Resource/Service - 资源/服务 + - Action - 方法 + - Hook/Event - 事件 + - Middleware - 中间件 + - Resource Middleware + - Action Middleware +- UI + - UI Schema/Component - 前端组件 + - Router - 前端路由 -### 配置化驱动 +### 配置化 -配置化是常见的无代码/低代码技术方案,NocoBase 也是基于配置驱动的,为了方便各类配置需求,配置有三类写法: +配置化驱动,为了方便各场景配置需求,配置有三种写法: - 直接写在代码里,多用于处理动态配置 - 保存在文件里,多用于系统表配置或纯开发配置 diff --git a/docs/guide/nocobase.png b/docs/guide/nocobase.png deleted file mode 100644 index c5001529b..000000000 Binary files a/docs/guide/nocobase.png and /dev/null differ diff --git a/docs/nocude.png b/docs/nocude.png new file mode 100644 index 000000000..118b34dce Binary files /dev/null and b/docs/nocude.png differ diff --git a/docs/plugins/concepts/blocks.md b/docs/plugins/concepts/blocks.md deleted file mode 100644 index 18d1f0b07..000000000 --- a/docs/plugins/concepts/blocks.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: Blocks - 区块 ---- - -# Blocks - 区块 - -## 字段区块 - -```ts -export default { - name: 'examples', - fields: [ - { - name: 'content', - interface: 'string', - type: 'string', - block: { - type: 'textarea', - }, - } - ], -}; -``` - -## 数据表区块 - -```ts -export default { - name: 'examples', - blocks: [ - { - type: 'form', - name: 'form', - title: '表单', - fields: ['col1', 'col2'], - }, - ], -}; -``` - -## 后台可配置 - -```ts -export const form = { - title: '表单', - options: { - // form blocks 配置项默认值 - }, - properties: { - // 需要开放配置的字段 - }, - linkages: { - // 字段联动 - }, -}; -``` diff --git a/docs/plugins/concepts/collection-fields.md b/docs/plugins/concepts/collection-fields.md new file mode 100644 index 000000000..e0b966562 --- /dev/null +++ b/docs/plugins/concepts/collection-fields.md @@ -0,0 +1,5 @@ +--- +title: Collection Fields - 数据表字段 +--- + +# Collection Fields - 数据表字段 diff --git a/docs/plugins/concepts/fields.md b/docs/plugins/concepts/fields.md deleted file mode 100644 index 0aa16af72..000000000 --- a/docs/plugins/concepts/fields.md +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: Fields - 字段 ---- - -# Fields - -一个完整的字段由「数据类型」和「区块类型」两部分参数组合而成。同一个数据类型可能对应多种区块类型,同一个区块类型的数据值也可能是多种数据类型。因此提炼了字段的接口(Interface)作为唯一标识。 - -字段的 Types 和 Blocks 就不赘述了,请查阅核心章节介绍 - -- [Field Types](/cores/packages/database#field-types) -- [Field Blocks](/cores/packages/blocks#fields---字段) - - -在 NocoBase 里,普通用户概念上的字段类型指的是 interface;field type 只表示数据类型 - data type;field block 是 ui 组件,同一个组件也可能表示多种字段类型(interface)。 - - -## Interfaces - 接口类型 - -```ts -{ - // 多行文本框 - interface: 'textarea', - // 长文本类型 - type: 'text', // 也可以是 string - // 使用 多行文本框 区块渲染 UI - block: { - type: 'textarea', - }, -} - -{ - // 电子邮箱 - interface: 'email', - // 字符串 - type: 'string', - format: 'email', - // 使用 String 区块渲染 - block: { - type: 'string', - }, -} - -{ - // 手机号 - interface: 'phone', - // 字符串 - type: 'string', - format: 'phone', - // 使用 String 区块渲染 - block: { - type: 'string', - }, -} -``` - -分类有: - -- basic -- media -- choices -- datetime -- relation -- systemInfo -- developerMode -- others - -### basic -#### string -#### textarea -#### phone -#### email -#### number -#### percent - -### media -#### markdown -#### wysiwyg -#### attachment - -### choices -#### select -#### multipleSelect -#### radio -#### checkboxes -#### boolean -#### chinaRegion - -### datetime -#### datetime -#### time - -### relation -#### subTable -#### linkTo - -### systemInfo -#### createdAt -#### createdBy -#### updatedAt -#### updatedBy - -### developerMode - -#### primaryKey -#### sort -#### password -#### icon -#### json - -### Others - -以下字段可能会被遗弃 - -#### description -#### group -#### status \ No newline at end of file diff --git a/docs/plugins/concepts/locales.md b/docs/plugins/concepts/locales.md index 86f914873..1f8100f3e 100644 --- a/docs/plugins/concepts/locales.md +++ b/docs/plugins/concepts/locales.md @@ -3,32 +3,3 @@ title: Locales - 国际化 --- # Locales - 国际化 未实现 - -NocoBase 采用 [formatjs](https://formatjs.io/docs/getting-started/installation) 来处理国际化问题。 - -直接写在代码里,详情参考 formatjs 用例,NocoBase 会封装一个更易用的 `__` 函数来处理国际化,如: - -```ts -__('Hello, {name}'); -``` - -在配置里有两种写法: - -模板字符串: - -```ts -{ - name: `{{ __('Hello, {name}') }}` -} -``` - -json 格式: - -```ts -{ - name: { - 'zh-CN': '{name},您好', - 'en-US': 'Hello, {name}', - }, -} -``` diff --git a/docs/plugins/concepts/ui-schema.md b/docs/plugins/concepts/ui-schema.md new file mode 100644 index 000000000..f851ed9c1 --- /dev/null +++ b/docs/plugins/concepts/ui-schema.md @@ -0,0 +1,5 @@ +--- +title: UI Schema - 组件 +--- + +# UI Schema - 组件 diff --git a/docs/plugins/packages/china-region.md b/docs/plugins/packages/china-region.md new file mode 100644 index 000000000..a5989910b --- /dev/null +++ b/docs/plugins/packages/china-region.md @@ -0,0 +1,5 @@ +--- +title: '@nocobase/plugin-china-region' +--- + +# @nocobase/plugin-china-region diff --git a/docs/plugins/packages/system-settings.md b/docs/plugins/packages/system-settings.md new file mode 100644 index 000000000..6effec075 --- /dev/null +++ b/docs/plugins/packages/system-settings.md @@ -0,0 +1,5 @@ +--- +title: '@nocobase/plugin-system-settings' +--- + +# @nocobase/plugin-system-settings diff --git a/docs/plugins/packages/ui-router.md b/docs/plugins/packages/ui-router.md new file mode 100644 index 000000000..4b5a5b98c --- /dev/null +++ b/docs/plugins/packages/ui-router.md @@ -0,0 +1,5 @@ +--- +title: '@nocobase/plugin-ui-router' +--- + +# @nocobase/plugin-ui-router diff --git a/docs/plugins/packages/ui-schema.md b/docs/plugins/packages/ui-schema.md new file mode 100644 index 000000000..a7eb47d95 --- /dev/null +++ b/docs/plugins/packages/ui-schema.md @@ -0,0 +1,5 @@ +--- +title: '@nocobase/plugin-ui-schema' +--- + +# @nocobase/plugin-ui-schema