fix(plugin-formula): fix read-pretty component when used in association field #1957
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description (Bug 描述)
公式字段在表格中展示时间格式有误,未按照 DatePicker 组件的格式展示。
Steps to reproduce (复现步骤)
Datetime
,格式为“年-月-日”。Expected behavior (预期行为)
按照选择的时间格式展示。
Actual behavior (实际行为)
未按照 DatePicker 组件的格式展示。
Related issues (相关 issue)
#1911 #1805
Reason (原因)
#1911 中修改了
Formula.Result
组件的 read-pretty 格式引入。Solution (解决方案)
恢复到 #1911 之前,但为解决 #1805,重新处理关系字段的配置读取问题。
其他影响
由于当前表格的关系字段展示选择标题列未对任意组件适配,所以暂时不支持从关系字段展示关系数据标题列为公式的结果组件渲染优化,会造成以此种方式展示日期类型公式结果时显示为 ISOString。但可以通过直接引用关系字段的字段绕过,可正常显示。
相关代码未来需要改进:
nocobase/packages/core/client/src/schema-component/antd/association-field/util.ts
Line 44 in 3f4cd86