@steedos-widgets/amis-lib 6.3.3 → 6.3.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
@@ -7777,7 +7777,7 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
7777
7777
 
7778
7778
  // console.log('=======================max=========================', max)
7779
7779
 
7780
- if(objectSchema.compactLayouts){
7780
+ if(objectSchema.compactLayouts && objectSchema.compactLayouts.length > 0){
7781
7781
  const details = [];
7782
7782
  _.each(_.slice(_.difference(objectSchema.compactLayouts, [objectSchema.NAME_FIELD_KEY]), 0, max), (fieldName)=>{
7783
7783
  const field = objectSchema.fields[fieldName];
@@ -8973,18 +8973,19 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
8973
8973
  }
8974
8974
  let toolbarReloadButton;
8975
8975
  const onReloadScript = `
8976
- // const scope = event.context.scoped;
8977
- // var listView = scope.parent.getComponents().find(function(n){
8978
- // return n.props.type === "crud";
8979
- // });
8980
- // listView.handleChangePage(1);
8981
-
8982
-
8983
8976
  // 触发搜索,而不是reload,因为使用search-box可以在amissdk是3.6.3-patch.8+实现在非第一页的情况下,快速搜索输入框中过滤条件变更时再点刷新可以自动跳转翻页到第一页
8984
8977
  const scope = event.context.scoped;
8985
8978
  const sb = SteedosUI.getClosestAmisComponentByType(scope, "search-box");
8986
- const sbValue = sb.state.value;
8987
- sb.handleSearch(sbValue);
8979
+ if (sb) {
8980
+ const sbValue = sb.state.value;
8981
+ sb.handleSearch(sbValue);
8982
+ }else{
8983
+ var listView = scope.parent.getComponents().find(function(n){
8984
+ return n.props.type === "crud";
8985
+ });
8986
+ listView.handleChangePage(1);
8987
+ }
8988
+
8988
8989
  `;
8989
8990
  toolbarReloadButton = {
8990
8991
  // "type": "reload",//不可以直接使用reload,因为它不会设置页码到第一页,这在加载更多按钮的翻页模式下会有问题