@steedos-widgets/amis-lib 3.6.2-beta.3 → 3.6.2-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -8107,7 +8107,10 @@ function getObjectFooterToolbar(mainObject, formFactor, options) {
8107
8107
  // ]
8108
8108
  if(options.displayAs === 'split'){
8109
8109
  return [
8110
- "switch-per-page",
8110
+ {
8111
+ "type": "switch-per-page",
8112
+ "visibleOn": "${count >= 20}"
8113
+ },
8111
8114
  {
8112
8115
  "type": "pagination",
8113
8116
  "maxButtons": 5,
@@ -8151,7 +8154,10 @@ function getObjectFooterToolbar(mainObject, formFactor, options) {
8151
8154
  if (no_pagination && is_lookup) {
8152
8155
  return commonConfig;
8153
8156
  } else {
8154
- return ["switch-per-page", ...commonConfig];
8157
+ return [{
8158
+ "type": "switch-per-page",
8159
+ "visibleOn": "${count >= 20}"
8160
+ }, ...commonConfig];
8155
8161
  }
8156
8162
  }
8157
8163
  }
@@ -12735,7 +12741,7 @@ async function getFormBody(permissionFields, formFields, ctx){
12735
12741
  * @Author: 殷亮辉 yinlianghui@hotoa.com
12736
12742
  * @Date: 2023-11-15 09:50:22
12737
12743
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
12738
- * @LastEditTime: 2024-01-12 14:51:00
12744
+ * @LastEditTime: 2024-01-14 21:08:32
12739
12745
  */
12740
12746
 
12741
12747
  /**
@@ -13420,13 +13426,14 @@ async function getButtonActions(props, mode) {
13420
13426
  "global": "${global}",
13421
13427
  "uiSchema": "${uiSchema}",
13422
13428
  "index": "${index}",//amis组件自带行索引,在节点嵌套情况下,当前节点如果是children属性下的子节点时,这里的index是当前节点在children中的索引,而不是外层父节点的index
13423
- "parent": "${parent}",//amis组件自带父节点数据域数据,即节点嵌套情况下,当前节点为某个节点(比如A节点)的children属性下的子节点时,当前节点的父节点(即A节点)的数据域数据
13429
+ "parent": "${__super.parent}",//amis组件自带父节点数据域数据,即节点嵌套情况下,当前节点为某个节点(比如A节点)的children属性下的子节点时,当前节点的父节点(即A节点)的数据域数据
13424
13430
  // "__tableItems": `\${${props.name}}`
13425
13431
  // 为了解决"弹出的dialog窗口中子表组件会影响页面布局界面中父作用域字段值",比如设计字段布局微页面中的设置分组功能,弹出的就是子表dialog
13426
13432
  // 所以这里使用json|toJson转一次,断掉event.data.__tableItems与上层任用域中props.name的联系
13427
13433
  // "__tableItems": `\${${props.name}|json|toJson}`
13428
- "__tableItems": `\${(${props.name} || [])|json|toJson}`
13429
- },
13434
+ // 这里加__super.__super是因为要让映射到准确的作用域层,如果不加,在节点嵌套情况下,当前节点正好是带children属性的节点的话,这里弹出的dialog映射到的会是children数组
13435
+ "__tableItems": `\${((__super.parent ? __super.__super.${props.name} : __super.${props.name}) || [])|json|toJson}`
13436
+ },
13430
13437
  "actions": dialogButtons,
13431
13438
  "onEvent": {
13432
13439
  "confirm": {
@@ -13515,15 +13522,17 @@ async function getButtonActions(props, mode) {
13515
13522
  // 映射到中间变量__parentForm而不是直接用&展开映射是为了避免表单中字段名与作用域中变量重名
13516
13523
  // "__parentForm": "${__super.__super || {}}",
13517
13524
  "__parentForm": parentFormData,
13525
+ "_master": "${_master}",
13518
13526
  "global": "${global}",
13519
13527
  "uiSchema": "${uiSchema}",
13520
13528
  "index": "${index}",
13529
+ "parent": "${__super.parent}",//amis组件自带父节点数据域数据,即节点嵌套情况下,当前节点为某个节点(比如A节点)的children属性下的子节点时,当前节点的父节点(即A节点)的数据域数据
13521
13530
  // "__tableItems": `\${${props.name}}`
13522
13531
  // 为了解决"弹出的dialog窗口中子表组件会影响页面布局界面中父作用域字段值",比如设计字段布局微页面中的设置分组功能,弹出的就是子表dialog
13523
13532
  // 所以这里使用json|toJson转一次,断掉event.data.__tableItems与上层任用域中props.name的联系
13524
13533
  // "__tableItems": `\${${props.name}|json|toJson}`
13525
- "__tableItems": `\${(${props.name} || [])|json|toJson}`
13526
- },
13534
+ "__tableItems": `\${((__super.parent ? __super.__super.${props.name} : __super.${props.name}) || [])|json|toJson}`
13535
+ },
13527
13536
  }
13528
13537
  }
13529
13538
  ];