From f553733f90aee03832415bbd583d50e7dd68f5d7 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 24 Apr 2020 15:36:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?BI-64186=20refactor:=20searcher=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E5=8F=AF=E9=85=8D=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + src/base/combination/searcher.js | 3 ++- src/css/widget/singleselect/search/multiselect.css | 3 +++ src/css/widget/singleselect/search/singleselect.css | 3 +++ .../singleselect/search/singleselect.search.pane.less | 8 ++++++++ .../search/singleselect.search.pane.insert.js | 2 +- .../singleselect/search/singleselect.search.pane.js | 2 +- 7 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 src/css/widget/singleselect/search/multiselect.css create mode 100644 src/css/widget/singleselect/search/singleselect.css create mode 100644 src/less/widget/singleselect/search/singleselect.search.pane.less diff --git a/changelog.md b/changelog.md index 9c11c0888..5da0b0a52 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-04) +- searcher提供可配是否支持搜索空格的allSearchBlank - 修复了复选下拉全选状态下使用空格添加值trigger显示更新不对的问题 - 复选下拉树展开节点提供分页加载和滚动加载两种方式 - 修复了复选下拉列表初始化的时候发送执行两次itemsCreator的问题 diff --git a/src/base/combination/searcher.js b/src/base/combination/searcher.js index 7d99209b4..a3153db8e 100644 --- a/src/base/combination/searcher.js +++ b/src/base/combination/searcher.js @@ -21,6 +21,7 @@ BI.Searcher = BI.inherit(BI.Widget, { isAutoSearch: true, // 是否自动搜索 isAutoSync: true, // 是否自动同步数据, 即是否保持搜索面板和adapter面板状态值的统一 chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, + allowSearchBlank: false, // isAutoSearch为false时启用 onSearch: function (op, callback) { @@ -164,7 +165,7 @@ BI.Searcher = BI.inherit(BI.Widget, { }, _search: function () { - var self = this, o = this.options, keyword = this._getLastSearchKeyword(); + var self = this, o = this.options, keyword = o.allowSearchBlank ? this.editor.getValue() : this._getLastSearchKeyword(); if (keyword === "" || this._stop) { return; } diff --git a/src/css/widget/singleselect/search/multiselect.css b/src/css/widget/singleselect/search/multiselect.css new file mode 100644 index 000000000..3d881ba36 --- /dev/null +++ b/src/css/widget/singleselect/search/multiselect.css @@ -0,0 +1,3 @@ +.bi-multi-select-search-pane .multi-select-toolbar { + color: #faaa39; +} diff --git a/src/css/widget/singleselect/search/singleselect.css b/src/css/widget/singleselect/search/singleselect.css new file mode 100644 index 000000000..d0f4778a4 --- /dev/null +++ b/src/css/widget/singleselect/search/singleselect.css @@ -0,0 +1,3 @@ +.bi-single-select-search-pane .single-select-toolbar { + color: #faaa39; +} diff --git a/src/less/widget/singleselect/search/singleselect.search.pane.less b/src/less/widget/singleselect/search/singleselect.search.pane.less new file mode 100644 index 000000000..6674b663a --- /dev/null +++ b/src/less/widget/singleselect/search/singleselect.search.pane.less @@ -0,0 +1,8 @@ +@import "../../../index"; + + +.bi-single-select-search-pane{ + & .single-select-toolbar{ + color: @color-bi-text-redmark; + } +} \ No newline at end of file diff --git a/src/widget/singleselect/search/singleselect.search.pane.insert.js b/src/widget/singleselect/search/singleselect.search.pane.insert.js index 6583a4c98..69d037dc3 100644 --- a/src/widget/singleselect/search/singleselect.search.pane.insert.js +++ b/src/widget/singleselect/search/singleselect.search.pane.insert.js @@ -31,7 +31,7 @@ BI.SingleSelectSearchInsertPane = BI.inherit(BI.Widget, { type: "bi.label", invisible: true, text: BI.i18nText("BI-Click_Blank_To_Select"), - cls: "multi-select-toolbar", + cls: "single-select-toolbar", height: this.constants.height }); diff --git a/src/widget/singleselect/search/singleselect.search.pane.js b/src/widget/singleselect/search/singleselect.search.pane.js index 93cdb9140..3c98ab03e 100644 --- a/src/widget/singleselect/search/singleselect.search.pane.js +++ b/src/widget/singleselect/search/singleselect.search.pane.js @@ -31,7 +31,7 @@ BI.SingleSelectSearchPane = BI.inherit(BI.Widget, { type: "bi.label", invisible: true, text: BI.i18nText("BI-Click_Blank_To_Select"), - cls: "multi-select-toolbar", + cls: "single-select-toolbar", height: this.constants.height }); From 0c60008c3fb0f511c125ebbfd50278a048129164 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 24 Apr 2020 15:37:35 +0800 Subject: [PATCH 2/2] update --- src/base/combination/searcher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/combination/searcher.js b/src/base/combination/searcher.js index a3153db8e..f3d3962cc 100644 --- a/src/base/combination/searcher.js +++ b/src/base/combination/searcher.js @@ -21,7 +21,7 @@ BI.Searcher = BI.inherit(BI.Widget, { isAutoSearch: true, // 是否自动搜索 isAutoSync: true, // 是否自动同步数据, 即是否保持搜索面板和adapter面板状态值的统一 chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, - allowSearchBlank: false, + allowSearchBlank: false, // 是否能够搜索包含空格的字符串 // isAutoSearch为false时启用 onSearch: function (op, callback) {