@steedos-widgets/amis-lib 3.6.11-beta.6 → 3.6.11-beta.7

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
@@ -8276,7 +8276,6 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
8276
8276
  // 等升级到amis 3.4+,blur事件换成change事件执行onChangeScript,就可以不用在onSearchScript中执行onChangeScript了
8277
8277
  // 基于amis3.6,已经不再用blur事件触发onChangeScript,所以这里把之前加上的onChangeScript去掉了,如果以后还要换blur来触发onChangeScript脚本的话,这里又要加回onChangeScript脚本
8278
8278
  const onSearchScript = `
8279
- // console.log("==search=onSearchScript===");
8280
8279
  // 下面的脚本只为解决点击搜索表单取消按钮,再重新在其中输入过滤条件但是不点击搜索按钮或回车按键触发搜索,此时在快速搜索框输入过滤条件按回车按键会把搜索表单中的过滤条件清空的问题
8281
8280
  const scope = event.context.scoped;
8282
8281
  // 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
@@ -8297,13 +8296,15 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
8297
8296
  }, 500);
8298
8297
  `;
8299
8298
 
8300
- const onBlurScript = `
8301
- // console.log("==search=onBlurScript===");
8302
- // 失去焦点事件触发搜索
8303
- const scope = event.context.scoped;
8304
- const sb = SteedosUI.getClosestAmisComponentByType(scope, "search-box");
8305
- sb.handleSearch();
8306
- `;
8299
+ // const onBlurScript = `
8300
+ // // 失去焦点事件触发搜索,先去掉,因为会有bug,见:[Bug]: 列表上快速搜索输入框输入内容后点击放大镜界面上列表未显示过滤后的内容 #6742
8301
+ // const value = event.data.value;
8302
+ // setTimeout(function(){
8303
+ // const scope = event.context.scoped;
8304
+ // const sb = SteedosUI.getClosestAmisComponentByType(scope, "search-box");
8305
+ // sb.handleSearch(value);
8306
+ // }, 500);
8307
+ // `;
8307
8308
 
8308
8309
  return {
8309
8310
  "type": "tooltip-wrapper",
@@ -8342,14 +8343,14 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
8342
8343
  },
8343
8344
  ]
8344
8345
  },
8345
- "blur": {
8346
- "actions": [
8347
- {
8348
- "actionType": "custom",
8349
- "script": onBlurScript
8350
- },
8351
- ]
8352
- }
8346
+ // "blur": {
8347
+ // "actions": [
8348
+ // {
8349
+ // "actionType": "custom",
8350
+ // "script": onBlurScript
8351
+ // },
8352
+ // ]
8353
+ // }
8353
8354
  }
8354
8355
  }
8355
8356
  ]
@@ -8382,13 +8383,10 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
8382
8383
  // listView.handleChangePage(1);
8383
8384
 
8384
8385
 
8385
- // 触发搜索,而不是reload,因为快速搜索输入框失去焦点已经会触发搜索了,这里用reload的话,会有bug
8386
- // 不加setTimeout的话,快速搜索输入框失去焦点再触发此脚本还是有问题
8387
- setTimeout(function(){
8388
- const scope = event.context.scoped;
8389
- const sb = SteedosUI.getClosestAmisComponentByType(scope, "search-box");
8390
- sb.handleSearch();
8391
- }, 500);
8386
+ // 触发搜索,而不是reload,因为使用search-box可以在amissdk是3.6.3-patch.8+实现快速搜索输入框中过滤条件变更时再点刷新可以自动跳转到第一页面
8387
+ const scope = event.context.scoped;
8388
+ const sb = SteedosUI.getClosestAmisComponentByType(scope, "search-box");
8389
+ sb.handleSearch();
8392
8390
  `;
8393
8391
  toolbarReloadButton = {
8394
8392
  // "type": "reload",//不可以直接使用reload,因为它不会设置页码到第一页,这在加载更多按钮的翻页模式下会有问题