Skip to content

Commit

Permalink
fix 作用域中没有主表变量formData/record时会报错
Browse files Browse the repository at this point in the history
  • Loading branch information
yinlianghui committed Dec 12, 2023
1 parent 1cf9d0c commit b528a9a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/@steedos-widgets/amis-lib/src/lib/input_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: 殷亮辉 [email protected]
* @Date: 2023-11-15 09:50:22
* @LastEditors: 殷亮辉 [email protected]
* @LastEditTime: 2023-12-12 17:08:33
* @LastEditTime: 2023-12-12 17:13:37
*/

import { getFormBody } from './converter/amis/form';
Expand Down Expand Up @@ -497,7 +497,7 @@ async function getButtonEdit(props, showAsInlineEditMode) {
// 这里必须加data数据映射,否则翻页功能中取changedItems值时会乱,比如翻页编辑后会把上一页中没改过的字段值带过去
// 额外把华炎魔方主表记录ObjectForm中的字段值从record变量中映射到子表form中,因为子表lookup字段filtersFunction中可能依赖了主表记录中的字段值,比如“工作流规则”对象“时间触发器”字段中的“日期字段”字段
// 额外把global、uiSchema也映射过去,有可能要用,后续需要用到其他变更可以这里加映射
"&": "${record}",
"&": "${record || {}}",
"global": "${global}",
"uiSchema": "${uiSchema}",
"grid": "${grid}",
Expand Down Expand Up @@ -551,7 +551,7 @@ async function getButtonView(props) {
// 这里必须加data数据映射,否则翻页功能中取changedItems值时会乱,比如翻页编辑后会把上一页中没改过的字段值带过去
// 额外把华炎魔方主表记录ObjectForm中的字段值从formData变量中映射到子表form中,因为子表lookup字段filtersFunction中可能依赖了主表记录中的字段值,比如“工作流规则”对象“时间触发器”字段中的“日期字段”字段
// global、uiSchema等常用变量本来就在formData变量已经存在了,无需另外映射
"&": "${formData}",
"&": "${formData || {}}",
"grid": "${grid}",
"index": "${index}",
"changedItems": "${changedItems}",
Expand Down

0 comments on commit b528a9a

Please sign in to comment.