diff --git a/docs/zh-CN/welcome/release/v08-1-collection-templates.md b/docs/en-US/welcome/release/collection-templates.md similarity index 98% rename from docs/zh-CN/welcome/release/v08-1-collection-templates.md rename to docs/en-US/welcome/release/collection-templates.md index 2fea83326..1b93bf9a0 100644 --- a/docs/zh-CN/welcome/release/v08-1-collection-templates.md +++ b/docs/en-US/welcome/release/collection-templates.md @@ -1,4 +1,4 @@ -# v0.8.1: Collection 模板 +# v0.9.0: Collection 模板 diff --git a/docs/en-US/welcome/release/formulas.md b/docs/en-US/welcome/release/formulas.md new file mode 100644 index 000000000..3cd461b0b --- /dev/null +++ b/docs/en-US/welcome/release/formulas.md @@ -0,0 +1,33 @@ +# v0.9.0:字段的计算公式插件 + +NocoBase 目前提供了两种计算公式插件: + +- `@nocobase/plugin-math-formula-field` Math 公式 +- `@nocobase/plugin-excel-formula-field` Excel 公式(感谢 [azriel46d](https://github.com/nocobase/nocobase/pull/906) 贡献) + +## Math Formula + +基于 [Math.js](https://mathjs.org/) 实现,它具有支持符号计算的灵活表达式解析器,大量内置函数和常量,并提供了集成的解决方案来处理不同的数据类型,例如数字,大数,复数,分数,单位和矩阵。 + +```ts +import { evaluate } from 'mathjs'; +// expressions +evaluate('1.2 * (2 + 4.5)') // 7.8 +evaluate('12.7 cm to inch') // 5 inch +evaluate('sin(45 deg) ^ 2') // 0.5 +evaluate('9 / 3 + 2i') // 3 + 2i +evaluate('det([-1, 2; 3, 1])') // -7 +``` + + + +## Excel Formula + +基于 [Formula.js](https://formulajs.info/) 实现,详细用法参考 [Formula.js functions](https://formulajs.info/functions/)。 + +```ts +SUM(-5, 15, 32) // 42 +IF(true, 'Hello!', 'Goodbye!') // Hello! +``` + + diff --git a/docs/en-US/welcome/release/formulas/excel-form.jpg b/docs/en-US/welcome/release/formulas/excel-form.jpg new file mode 100644 index 000000000..41413a0c4 Binary files /dev/null and b/docs/en-US/welcome/release/formulas/excel-form.jpg differ diff --git a/docs/en-US/welcome/release/formulas/math-form.jpg b/docs/en-US/welcome/release/formulas/math-form.jpg new file mode 100644 index 000000000..ecf54c476 Binary files /dev/null and b/docs/en-US/welcome/release/formulas/math-form.jpg differ diff --git a/docs/en-US/welcome/release/index.md b/docs/en-US/welcome/release/index.md index c69887d51..4d4891226 100644 --- a/docs/en-US/welcome/release/index.md +++ b/docs/en-US/welcome/release/index.md @@ -1,5 +1,65 @@ # Release Notes +## 2022/01/11 ~v0.9.0-alpha.1 + +### 协议变更 + +- [内核](https://github.com/nocobase/nocobase/tree/main/packages/core) 继续采用 [Apache 2.0 协议](https://github.com/nocobase/nocobase/blob/main/LICENSE-APACHE-2.0) +- [插件](https://github.com/nocobase/nocobase/tree/main/packages/plugins) 变更为 [AGPL 3.0 协议](https://github.com/nocobase/nocobase/blob/main/LICENSE-AGPL) + +### 内核改进 + +- [NocoBase 的 Logging 系统](/welcome/release/logger) +- [数据表继承](/welcome/release/inherits) +- [数据表模板](/welcome/release/collection-templates) +- 数据表主键默认为 BigInt 类型 +- 提供更健全的 ACL 模块 +- 关系字段组件支持切换为简单的 Select 组件 +- 支持页面标签页 +- 表格、看板支持固定区块 +- 提供更为友好的关系筛选 +- 日历区块支持显示农历 +- 日历区块支持配置、删除重复日程 +- 表格区块横向滚动条优化,支持调整列宽 +- 弹窗可配置尺寸大小 + +### 新增插件 + +- Excel 数据导入插件 +- 图形化数据表配置插件 +- SSO 插件:OIDC、SAML +- 地图插件 +- iframe 区块插件 +- 数据快照插件 +- 应用复制、备份、迁移插件 +- [字段的计算公式插件:Math Formula 和 Excel Formula](/welcome/release/formulas) + +### 其他插件优化 + +- 数据表配置: + - 数据表支持筛选 + - 数据表支持设置标题字段 + - 数据表支持分类 +- 工作流: + - 修复触发器取值功能 + - 前端代码重构,插件独立化 + - 修复执行历史加载问题 + - 数据表触发后执行不再使用相同事务,优化执行流程 + - 新增调度器和触发缓存,以队列执行方式解决并发问题 + - 修复定时任务结束时间组件问题 + - 修复定时任务跳秒问题 + - 支持工作流级别复制 + - 重构上下文及节点变量数据结构 +- 验证码: + - 新增验证码配置面板 +- 文件管理器: + - 修复本地存储静态文件服务中间件 + - 本地存储空 baseUrl 配置容错处理 +- 自动编号: + - 重构为由数据表记录序列 + - 增加可输入和匹配规则的配置 + - 修复生成数字不小于配置的起始值 + ## 2022/10/31 ~ v0.8.0-alpha.1 - Starting with v0.8, NocoBase begins to provide an available plugin manager and development documentation. diff --git a/docs/en-US/welcome/release/inherits.md b/docs/en-US/welcome/release/inherits.md new file mode 100644 index 000000000..aee2c72e7 --- /dev/null +++ b/docs/en-US/welcome/release/inherits.md @@ -0,0 +1,74 @@ +# v0.9.0: 数据表继承 + +数据表继承基于 [PostgreSQL 的 INHERITS 语法](https://www.postgresql.org/docs/current/tutorial-inheritance.html) 实现,仅限于 PostgreSQL 数据库安装的 NocoBase 时才会提供。 + +## 示例 + +我们从一个例子开始,假设要做一个教学系统,有三类用户:学生、家长和老师。 + +如果没有继承,要分别为三类用户建表: + +- 学生:姓名、年龄、性别、身份证 +- 家长:姓名、年龄、性别、职业、学历 +- 老师:姓名、年龄、性别、教龄、已婚 + +有了数据表继承之后,共同的信息就可以提炼出来: + +- 用户:姓名、年龄、性别 +- 学生:身份证 +- 家长:职业、学历 +- 老师:教龄、已婚 + +ER 图如下: + + + +注:子表 ID 和父表 ID 共享序列 + +## 配置数据表继承 + +Inherits 字段选择需要继承的数据表 + + + +通过代码配置如下: + +```ts +db.collection({ + name: 'users', +}); + +db.collection({ + name: 'students', + inherits: 'users', +}); +``` + +注意: + +- 继承的表并不能随意选择,主键必须是唯一序列,比如 uuid 或者所有继承线路上的表的 id 自增序列都用同一个 +- Inherits 参数不能被编辑 +- 如果有继承关系,被继承的父表不能被删除 + +## 数据表字段列表 + +字段列表里同步显示继承的父表字段,父表字段不可以修改,但可以重写(Override) + + + +重写父表字段的注意事项: +- 子表字段标识与父表字段一样时为重写 +- 重写字段的类型必须保持一致 +- 关系字段除了 target collection 以外的其他参数需要保持一致 + +## 父表的子表区块 + +在父表区块里可以配置子表的区块 + + + +## 新增继承的父表字段的配置 + +当有继承的父表时,配置字段时,会提供从父表继承的字段的配置 + + diff --git a/docs/en-US/welcome/release/inherits/configure-fields.jpg b/docs/en-US/welcome/release/inherits/configure-fields.jpg new file mode 100644 index 000000000..adf256da3 Binary files /dev/null and b/docs/en-US/welcome/release/inherits/configure-fields.jpg differ diff --git a/docs/en-US/welcome/release/inherits/er.svg b/docs/en-US/welcome/release/inherits/er.svg new file mode 100644 index 000000000..f1ba5c251 --- /dev/null +++ b/docs/en-US/welcome/release/inherits/er.svg @@ -0,0 +1,4 @@ + + + +UsersPKidnameagegenderStudentsPKididentityNumberParentsPKidoccupationTeachersPKidmarried \ No newline at end of file diff --git a/docs/en-US/welcome/release/inherits/form.jpg b/docs/en-US/welcome/release/inherits/form.jpg new file mode 100644 index 000000000..2de047cd5 Binary files /dev/null and b/docs/en-US/welcome/release/inherits/form.jpg differ diff --git a/docs/en-US/welcome/release/inherits/inherit-fields.jpg b/docs/en-US/welcome/release/inherits/inherit-fields.jpg new file mode 100644 index 000000000..acdaddda9 Binary files /dev/null and b/docs/en-US/welcome/release/inherits/inherit-fields.jpg differ diff --git a/docs/en-US/welcome/release/inherits/inherit.jpg b/docs/en-US/welcome/release/inherits/inherit.jpg new file mode 100644 index 000000000..ecc419daa Binary files /dev/null and b/docs/en-US/welcome/release/inherits/inherit.jpg differ diff --git a/docs/en-US/welcome/release/inherits/inherited-blocks.jpg b/docs/en-US/welcome/release/inherits/inherited-blocks.jpg new file mode 100644 index 000000000..e95928c20 Binary files /dev/null and b/docs/en-US/welcome/release/inherits/inherited-blocks.jpg differ diff --git a/docs/en-US/welcome/release/logger.md b/docs/en-US/welcome/release/logger.md index 9a92db953..af8f0a74a 100644 --- a/docs/en-US/welcome/release/logger.md +++ b/docs/en-US/welcome/release/logger.md @@ -1,4 +1,4 @@ -# v0.8.1:NocoBase 的 Logging 系统 +# v0.9.0:NocoBase 的 Logging 系统 ## `@nocobase/logger` diff --git a/docs/en-US/welcome/release/v08-1-collection-templates/v08-1-collection-templates.jpg b/docs/en-US/welcome/release/v08-1-collection-templates/v08-1-collection-templates.jpg new file mode 100644 index 000000000..dd0a99af8 Binary files /dev/null and b/docs/en-US/welcome/release/v08-1-collection-templates/v08-1-collection-templates.jpg differ diff --git a/docs/zh-CN/welcome/release/collection-templates.md b/docs/zh-CN/welcome/release/collection-templates.md new file mode 100644 index 000000000..1b93bf9a0 --- /dev/null +++ b/docs/zh-CN/welcome/release/collection-templates.md @@ -0,0 +1,79 @@ +# v0.9.0: Collection 模板 + + + +## 为什么需要 Collection 模板? + +待补充 + +## 配置参数说明 + +```ts +interface ICollectionTemplate { + name: string; + title?: string; + /** 排序 */ + order?: number; + /** 默认配置 */ + default?: CollectionOptions; + /** UI 可配置的 CollectionOptions 参数(添加或编辑的 Collection 表单的字段) */ + configurableProperties?: Record; + /** 当前模板可用的字段类型 */ + availableFieldInterfaces?: AvailableFieldInterfacesInclude | AvailableFieldInterfacesExclude; +} + +interface AvailableFieldInterfacesInclude { + include?: any[]; +} + +interface AvailableFieldInterfacesExclude { + exclude?: any[]; +} + +interface CollectionOptions { + /** + * 自动生成 id + * @default true + * */ + autoGenId?: boolean; + /** 创建人 */ + createdBy?: boolean; + /** 最后更新人 */ + updatedBy?: boolean; + /** 创建日期 */ + createdAt?: boolean; + /** 更新日期 */ + updatedAt?: boolean; + /** 可排序 */ + sortable?: boolean; + /* 树结构 */ + tree?: string; + /* 日志 */ + logging?: boolean; + /** 继承 */ + inherits: string | string[]; + /* 字段列表 */ + fields?: FieldOptions[]; +} +``` + +## 示例 + +创建时都不需要 autoGenId,并且只提供 title 和 name 配置项 + +```ts +import { collectionConfigurableProperties } from '@nocobase/client'; + +{ + default: { + autoGenId: false, + fields: [], + }, + configurableProperties: { + ...collectionConfigurableProperties('name', 'title'), + }, +} +``` + +完整插件示例参考:[samples/custom-collection-template](https://github.com/nocobase/nocobase/tree/feat/collection-templates/packages/samples/custom-collection-template) + diff --git a/docs/zh-CN/welcome/release/formulas.md b/docs/zh-CN/welcome/release/formulas.md index 40255c6d6..3cd461b0b 100644 --- a/docs/zh-CN/welcome/release/formulas.md +++ b/docs/zh-CN/welcome/release/formulas.md @@ -1,4 +1,4 @@ -# v0.8.1:字段的计算公式插件 +# v0.9.0:字段的计算公式插件 NocoBase 目前提供了两种计算公式插件: diff --git a/docs/zh-CN/welcome/release/index.md b/docs/zh-CN/welcome/release/index.md index 1b5c698f2..4795553df 100644 --- a/docs/zh-CN/welcome/release/index.md +++ b/docs/zh-CN/welcome/release/index.md @@ -1,5 +1,65 @@ # 更新日志 +## 2022/01/11 ~v0.9.0-alpha.1 + +### 协议变更 + +- [内核](https://github.com/nocobase/nocobase/tree/main/packages/core) 继续采用 [Apache 2.0 协议](https://github.com/nocobase/nocobase/blob/main/LICENSE-APACHE-2.0) +- [插件](https://github.com/nocobase/nocobase/tree/main/packages/plugins) 变更为 [AGPL 3.0 协议](https://github.com/nocobase/nocobase/blob/main/LICENSE-AGPL) + +### 内核改进 + +- [NocoBase 的 Logging 系统](/welcome/release/logger) +- [数据表继承](/welcome/release/inherits) +- [数据表模板](/welcome/release/collection-templates) +- 数据表主键默认为 BigInt 类型 +- 提供更健全的 ACL 模块 +- 关系字段组件支持切换为简单的 Select 组件 +- 支持页面标签页 +- 表格、看板支持固定区块 +- 提供更为友好的关系筛选 +- 日历区块支持显示农历 +- 日历区块支持配置、删除重复日程 +- 表格区块横向滚动条优化,支持调整列宽 +- 弹窗可配置尺寸大小 + +### 新增插件 + +- Excel 数据导入插件 +- 图形化数据表配置插件 +- SSO 插件:OIDC、SAML +- 地图插件 +- iframe 区块插件 +- 数据快照插件 +- 应用复制、备份、迁移插件 +- [字段的计算公式插件:Math Formula 和 Excel Formula](/welcome/release/formulas) + +### 其他插件优化 + +- 数据表配置: + - 数据表支持筛选 + - 数据表支持设置标题字段 + - 数据表支持分类 +- 工作流: + - 修复触发器取值功能 + - 前端代码重构,插件独立化 + - 修复执行历史加载问题 + - 数据表触发后执行不再使用相同事务,优化执行流程 + - 新增调度器和触发缓存,以队列执行方式解决并发问题 + - 修复定时任务结束时间组件问题 + - 修复定时任务跳秒问题 + - 支持工作流级别复制 + - 重构上下文及节点变量数据结构 +- 验证码: + - 新增验证码配置面板 +- 文件管理器: + - 修复本地存储静态文件服务中间件 + - 本地存储空 baseUrl 配置容错处理 +- 自动编号: + - 重构为由数据表记录序列 + - 增加可输入和匹配规则的配置 + - 修复生成数字不小于配置的起始值 + ## 2022/10/31 ~ v0.8.0-alpha.1 - 从 v0.8 开始,NocoBase 开始提供可用的插件管理器和开发文档。[查看 v0.8 的主要变化](/welcome/release/v08-changelog) diff --git a/docs/zh-CN/welcome/release/inherits.md b/docs/zh-CN/welcome/release/inherits.md index a4a5278ec..aee2c72e7 100644 --- a/docs/zh-CN/welcome/release/inherits.md +++ b/docs/zh-CN/welcome/release/inherits.md @@ -1,4 +1,4 @@ -# v0.8.1: 数据表继承 +# v0.9.0: 数据表继承 数据表继承基于 [PostgreSQL 的 INHERITS 语法](https://www.postgresql.org/docs/current/tutorial-inheritance.html) 实现,仅限于 PostgreSQL 数据库安装的 NocoBase 时才会提供。 diff --git a/docs/zh-CN/welcome/release/logger.md b/docs/zh-CN/welcome/release/logger.md index 9a92db953..af8f0a74a 100644 --- a/docs/zh-CN/welcome/release/logger.md +++ b/docs/zh-CN/welcome/release/logger.md @@ -1,4 +1,4 @@ -# v0.8.1:NocoBase 的 Logging 系统 +# v0.9.0:NocoBase 的 Logging 系统 ## `@nocobase/logger`