@steedos-widgets/amis-object 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.
@@ -11288,7 +11288,10 @@ function getObjectFooterToolbar(mainObject, formFactor, options) {
11288
11288
  // ]
11289
11289
  if(options.displayAs === 'split'){
11290
11290
  return [
11291
- "switch-per-page",
11291
+ {
11292
+ "type": "switch-per-page",
11293
+ "visibleOn": "${count >= 20}"
11294
+ },
11292
11295
  {
11293
11296
  "type": "pagination",
11294
11297
  "maxButtons": 5,
@@ -11332,7 +11335,10 @@ function getObjectFooterToolbar(mainObject, formFactor, options) {
11332
11335
  if (no_pagination && is_lookup) {
11333
11336
  return commonConfig;
11334
11337
  } else {
11335
- return ["switch-per-page", ...commonConfig];
11338
+ return [{
11339
+ "type": "switch-per-page",
11340
+ "visibleOn": "${count >= 20}"
11341
+ }, ...commonConfig];
11336
11342
  }
11337
11343
  }
11338
11344
  }
@@ -15916,7 +15922,7 @@ async function getFormBody(permissionFields, formFields, ctx){
15916
15922
  * @Author: 殷亮辉 yinlianghui@hotoa.com
15917
15923
  * @Date: 2023-11-15 09:50:22
15918
15924
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
15919
- * @LastEditTime: 2024-01-12 14:51:00
15925
+ * @LastEditTime: 2024-01-14 21:08:32
15920
15926
  */
15921
15927
 
15922
15928
  /**
@@ -16601,13 +16607,14 @@ async function getButtonActions(props, mode) {
16601
16607
  "global": "${global}",
16602
16608
  "uiSchema": "${uiSchema}",
16603
16609
  "index": "${index}",//amis组件自带行索引,在节点嵌套情况下,当前节点如果是children属性下的子节点时,这里的index是当前节点在children中的索引,而不是外层父节点的index
16604
- "parent": "${parent}",//amis组件自带父节点数据域数据,即节点嵌套情况下,当前节点为某个节点(比如A节点)的children属性下的子节点时,当前节点的父节点(即A节点)的数据域数据
16610
+ "parent": "${__super.parent}",//amis组件自带父节点数据域数据,即节点嵌套情况下,当前节点为某个节点(比如A节点)的children属性下的子节点时,当前节点的父节点(即A节点)的数据域数据
16605
16611
  // "__tableItems": `\${${props.name}}`
16606
16612
  // 为了解决"弹出的dialog窗口中子表组件会影响页面布局界面中父作用域字段值",比如设计字段布局微页面中的设置分组功能,弹出的就是子表dialog
16607
16613
  // 所以这里使用json|toJson转一次,断掉event.data.__tableItems与上层任用域中props.name的联系
16608
16614
  // "__tableItems": `\${${props.name}|json|toJson}`
16609
- "__tableItems": `\${(${props.name} || [])|json|toJson}`
16610
- },
16615
+ // 这里加__super.__super是因为要让映射到准确的作用域层,如果不加,在节点嵌套情况下,当前节点正好是带children属性的节点的话,这里弹出的dialog映射到的会是children数组
16616
+ "__tableItems": `\${((__super.parent ? __super.__super.${props.name} : __super.${props.name}) || [])|json|toJson}`
16617
+ },
16611
16618
  "actions": dialogButtons,
16612
16619
  "onEvent": {
16613
16620
  "confirm": {
@@ -16696,15 +16703,17 @@ async function getButtonActions(props, mode) {
16696
16703
  // 映射到中间变量__parentForm而不是直接用&展开映射是为了避免表单中字段名与作用域中变量重名
16697
16704
  // "__parentForm": "${__super.__super || {}}",
16698
16705
  "__parentForm": parentFormData,
16706
+ "_master": "${_master}",
16699
16707
  "global": "${global}",
16700
16708
  "uiSchema": "${uiSchema}",
16701
16709
  "index": "${index}",
16710
+ "parent": "${__super.parent}",//amis组件自带父节点数据域数据,即节点嵌套情况下,当前节点为某个节点(比如A节点)的children属性下的子节点时,当前节点的父节点(即A节点)的数据域数据
16702
16711
  // "__tableItems": `\${${props.name}}`
16703
16712
  // 为了解决"弹出的dialog窗口中子表组件会影响页面布局界面中父作用域字段值",比如设计字段布局微页面中的设置分组功能,弹出的就是子表dialog
16704
16713
  // 所以这里使用json|toJson转一次,断掉event.data.__tableItems与上层任用域中props.name的联系
16705
16714
  // "__tableItems": `\${${props.name}|json|toJson}`
16706
- "__tableItems": `\${(${props.name} || [])|json|toJson}`
16707
- },
16715
+ "__tableItems": `\${((__super.parent ? __super.__super.${props.name} : __super.${props.name}) || [])|json|toJson}`
16716
+ },
16708
16717
  }
16709
16718
  }
16710
16719
  ];