From 0909ccd45ee01768f6c60ca7a75317f959ed9915 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Tue, 22 May 2018 11:32:12 +0800 Subject: [PATCH] BI-20686 --- demo/version.js | 6 ++-- dist/bundle.css | 11 +++++++ dist/bundle.js | 66 +++++++++++++++++++++---------------- dist/config.js | 6 ++-- dist/fineui.css | 11 +++++++ dist/fineui.js | 66 +++++++++++++++++++++---------------- dist/resource.css | 11 +++++++ dist/widget.js | 61 +++++++++++++++++++--------------- public/css/font.css | 11 +++++++ public/js/index.js | 5 +-- src/css/resource/font.css | 11 +++++++ src/less/lib/font.less | 2 ++ src/less/resource/font.less | 4 ++- ui/css/font.css | 11 +++++++ ui/js/index.js | 5 +-- 15 files changed, 196 insertions(+), 91 deletions(-) diff --git a/demo/version.js b/demo/version.js index ec5b32565..9fa0a9852 100644 --- a/demo/version.js +++ b/demo/version.js @@ -59,7 +59,7 @@ BI.i18n = { "BI-Basic_April": "四月", "BI-Multi_Date_Quarter_Begin": "季度初", "BI-Multi_Date_Week": "周", - "BI-Click_Blank_To_Select": "点击\"空格键\"选中匹配项", + "BI-Click_Blank_To_Select": "点击\"空格键\"选中完全匹配项", "BI-Basic_August": "八月", "BI-Word_Align_Left": "文字居左", "BI-Basic_November": "十一月", @@ -163,5 +163,7 @@ BI.i18n = { "BI-Basic_Please_Enter_Number_Between": "请输入{R1}-{R2}的值", "BI-Word_Align_Center": "文字居中", "BI-More_Than": "大于", - "BI-More_And_Equal": "大于等于" + "BI-More_And_Equal": "大于等于", + "BI-Please_Enter_SQL": "请输入SQL", + "BI-Basic_Click_To_Add_Text": "点击新增\"{R1}\"" }; \ No newline at end of file diff --git a/dist/bundle.css b/dist/bundle.css index 5d506b44e..821953560 100644 --- a/dist/bundle.css +++ b/dist/bundle.css @@ -6390,6 +6390,17 @@ textarea::-webkit-scrollbar-thumb:hover { content: "\e74b"; color: inherit; } +.text-add-tip-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-add-tip-font .b-font:before { + content: "\e6dd"; + color: #5cb75d; +} +.text-add-tip-font.disabled .b-font:before { + content: "\e6dd"; + color: #5cb75d; +} .tree-collapse-icon-type1 .x-icon { display: block; background: url('https://fanruan.coding.me/fineui/dist/images/2x/icon/tree_collapse_1.png') no-repeat center center; diff --git a/dist/bundle.js b/dist/bundle.js index 69cd64c5a..3e2257caa 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -97841,23 +97841,23 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { self._setStartValue(""); }); this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () { - // if (this.getSearcher().hasMatched()) { - var keyword = this.getSearcher().getKeyword(); - self._join({ - type: BI.Selection.Multi, - value: [keyword] - }, function () { - // 如果在不选的状态下直接把该值添加进来 - if (self.storeValue.type === BI.Selection.Multi) { - self.storeValue.value.pushDistinct(keyword); - } - self.combo.setValue(self.storeValue); - self._setStartValue(keyword); - assertShowValue(); - self.populate(); - self._setStartValue(""); - }); - // } + if (this.getSearcher().hasMatched()) { + var keyword = this.getSearcher().getKeyword(); + self._join({ + type: BI.Selection.Multi, + value: [keyword] + }, function () { + // 如果在不选的状态下直接把该值添加进来 + if (self.storeValue.type === BI.Selection.Multi) { + self.storeValue.value.pushDistinct(keyword); + } + self.combo.setValue(self.storeValue); + self._setStartValue(keyword); + assertShowValue(); + self.populate(); + self._setStartValue(""); + }); + } }); this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) { var last = BI.last(keywords); @@ -99374,6 +99374,17 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, { height: this.constants.height }); + this.addNotMatchTip = BI.createWidget({ + type: "bi.icon_text_item", + invisible: true, + text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""), + cls: "text-add-tip-font", + height: this.constants.height, + handler: function () { + self.fireEvent(BI.MultiSelectSearchPane.EVENT_ADD_ITEM, o.keywordGetter()); + } + }); + this.loader = BI.createWidget({ type: "bi.multi_select_search_loader", keywordGetter: o.keywordGetter, @@ -99394,23 +99405,20 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, { type: "bi.vtape", element: this, items: [{ - el: this.tooltipClick, - height: 0 + type: "bi.center_adapt", + items: [this.tooltipClick, this.addNotMatchTip], + height: this.constants.height }, { el: this.loader }] }); - this.tooltipClick.setVisible(false); }, setKeyword: function (keyword) { var btn; - var isVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === btn.getValue()); - if (isVisible !== this.tooltipClick.isVisible()) { - this.tooltipClick.setVisible(isVisible); - this.resizer.attr("items")[0].height = (isVisible ? this.constants.height : 0); - this.resizer.resize(); - } + var isMatchTipVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === btn.getValue()); + this.tooltipClick.setVisible(isMatchTipVisible); + this.addNotMatchTip.setVisible(!isMatchTipVisible); }, isAllSelected: function () { @@ -99439,6 +99447,7 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, { }); BI.MultiSelectSearchPane.EVENT_CHANGE = "EVENT_CHANGE"; +BI.MultiSelectSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM"; BI.shortcut("bi.multi_select_search_pane", BI.MultiSelectSearchPane);/** * 查看已选按钮 @@ -112961,7 +112970,7 @@ BI.i18n = { "BI-Basic_April": "四月", "BI-Multi_Date_Quarter_Begin": "季度初", "BI-Multi_Date_Week": "周", - "BI-Click_Blank_To_Select": "点击\"空格键\"选中匹配项", + "BI-Click_Blank_To_Select": "点击\"空格键\"选中完全匹配项", "BI-Basic_August": "八月", "BI-Word_Align_Left": "文字居左", "BI-Basic_November": "十一月", @@ -113066,5 +113075,6 @@ BI.i18n = { "BI-Basic_Please_Enter_Number_Between": "请输入{R1}-{R2}的值", "BI-More_Than": "大于", "BI-More_And_Equal": "大于等于", - "BI-Please_Enter_SQL": "请输入SQL" + "BI-Please_Enter_SQL": "请输入SQL", + "BI-Basic_Click_To_Add_Text": "点击新增\"{R1}\"" }; \ No newline at end of file diff --git a/dist/config.js b/dist/config.js index ec5b32565..9fa0a9852 100644 --- a/dist/config.js +++ b/dist/config.js @@ -59,7 +59,7 @@ BI.i18n = { "BI-Basic_April": "四月", "BI-Multi_Date_Quarter_Begin": "季度初", "BI-Multi_Date_Week": "周", - "BI-Click_Blank_To_Select": "点击\"空格键\"选中匹配项", + "BI-Click_Blank_To_Select": "点击\"空格键\"选中完全匹配项", "BI-Basic_August": "八月", "BI-Word_Align_Left": "文字居左", "BI-Basic_November": "十一月", @@ -163,5 +163,7 @@ BI.i18n = { "BI-Basic_Please_Enter_Number_Between": "请输入{R1}-{R2}的值", "BI-Word_Align_Center": "文字居中", "BI-More_Than": "大于", - "BI-More_And_Equal": "大于等于" + "BI-More_And_Equal": "大于等于", + "BI-Please_Enter_SQL": "请输入SQL", + "BI-Basic_Click_To_Add_Text": "点击新增\"{R1}\"" }; \ No newline at end of file diff --git a/dist/fineui.css b/dist/fineui.css index 53a7d6b00..775fb6fd7 100644 --- a/dist/fineui.css +++ b/dist/fineui.css @@ -6390,6 +6390,17 @@ textarea::-webkit-scrollbar-thumb:hover { content: "\e74b"; color: inherit; } +.text-add-tip-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-add-tip-font .b-font:before { + content: "\e6dd"; + color: #5cb75d; +} +.text-add-tip-font.disabled .b-font:before { + content: "\e6dd"; + color: #5cb75d; +} .tree-collapse-icon-type1 .x-icon { display: block; background: url('resources?path=/com/fr/web/ui/images/2x/icon/tree_collapse_1.png') no-repeat center center; diff --git a/dist/fineui.js b/dist/fineui.js index bc0ca9ab0..42aac0827 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -98084,23 +98084,23 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { self._setStartValue(""); }); this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () { - // if (this.getSearcher().hasMatched()) { - var keyword = this.getSearcher().getKeyword(); - self._join({ - type: BI.Selection.Multi, - value: [keyword] - }, function () { - // 如果在不选的状态下直接把该值添加进来 - if (self.storeValue.type === BI.Selection.Multi) { - self.storeValue.value.pushDistinct(keyword); - } - self.combo.setValue(self.storeValue); - self._setStartValue(keyword); - assertShowValue(); - self.populate(); - self._setStartValue(""); - }); - // } + if (this.getSearcher().hasMatched()) { + var keyword = this.getSearcher().getKeyword(); + self._join({ + type: BI.Selection.Multi, + value: [keyword] + }, function () { + // 如果在不选的状态下直接把该值添加进来 + if (self.storeValue.type === BI.Selection.Multi) { + self.storeValue.value.pushDistinct(keyword); + } + self.combo.setValue(self.storeValue); + self._setStartValue(keyword); + assertShowValue(); + self.populate(); + self._setStartValue(""); + }); + } }); this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) { var last = BI.last(keywords); @@ -99617,6 +99617,17 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, { height: this.constants.height }); + this.addNotMatchTip = BI.createWidget({ + type: "bi.icon_text_item", + invisible: true, + text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""), + cls: "text-add-tip-font", + height: this.constants.height, + handler: function () { + self.fireEvent(BI.MultiSelectSearchPane.EVENT_ADD_ITEM, o.keywordGetter()); + } + }); + this.loader = BI.createWidget({ type: "bi.multi_select_search_loader", keywordGetter: o.keywordGetter, @@ -99637,23 +99648,20 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, { type: "bi.vtape", element: this, items: [{ - el: this.tooltipClick, - height: 0 + type: "bi.center_adapt", + items: [this.tooltipClick, this.addNotMatchTip], + height: this.constants.height }, { el: this.loader }] }); - this.tooltipClick.setVisible(false); }, setKeyword: function (keyword) { var btn; - var isVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === btn.getValue()); - if (isVisible !== this.tooltipClick.isVisible()) { - this.tooltipClick.setVisible(isVisible); - this.resizer.attr("items")[0].height = (isVisible ? this.constants.height : 0); - this.resizer.resize(); - } + var isMatchTipVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === btn.getValue()); + this.tooltipClick.setVisible(isMatchTipVisible); + this.addNotMatchTip.setVisible(!isMatchTipVisible); }, isAllSelected: function () { @@ -99682,6 +99690,7 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, { }); BI.MultiSelectSearchPane.EVENT_CHANGE = "EVENT_CHANGE"; +BI.MultiSelectSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM"; BI.shortcut("bi.multi_select_search_pane", BI.MultiSelectSearchPane);/** * 查看已选按钮 @@ -113204,7 +113213,7 @@ BI.i18n = { "BI-Basic_April": "四月", "BI-Multi_Date_Quarter_Begin": "季度初", "BI-Multi_Date_Week": "周", - "BI-Click_Blank_To_Select": "点击\"空格键\"选中匹配项", + "BI-Click_Blank_To_Select": "点击\"空格键\"选中完全匹配项", "BI-Basic_August": "八月", "BI-Word_Align_Left": "文字居左", "BI-Basic_November": "十一月", @@ -113309,5 +113318,6 @@ BI.i18n = { "BI-Basic_Please_Enter_Number_Between": "请输入{R1}-{R2}的值", "BI-More_Than": "大于", "BI-More_And_Equal": "大于等于", - "BI-Please_Enter_SQL": "请输入SQL" + "BI-Please_Enter_SQL": "请输入SQL", + "BI-Basic_Click_To_Add_Text": "点击新增\"{R1}\"" }; \ No newline at end of file diff --git a/dist/resource.css b/dist/resource.css index 8b7b9a615..307e005a0 100644 --- a/dist/resource.css +++ b/dist/resource.css @@ -1175,6 +1175,17 @@ textarea::-webkit-scrollbar-thumb:hover { content: "\e74b"; color: inherit; } +.text-add-tip-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-add-tip-font .b-font:before { + content: "\e6dd"; + color: #5cb75d; +} +.text-add-tip-font.disabled .b-font:before { + content: "\e6dd"; + color: #5cb75d; +} .tree-collapse-icon-type1 .x-icon { display: block; background: url('images/2x/icon/tree_collapse_1.png') no-repeat center center; diff --git a/dist/widget.js b/dist/widget.js index 83270dc5f..e2e626107 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -10274,23 +10274,23 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { self._setStartValue(""); }); this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () { - // if (this.getSearcher().hasMatched()) { - var keyword = this.getSearcher().getKeyword(); - self._join({ - type: BI.Selection.Multi, - value: [keyword] - }, function () { - // 如果在不选的状态下直接把该值添加进来 - if (self.storeValue.type === BI.Selection.Multi) { - self.storeValue.value.pushDistinct(keyword); - } - self.combo.setValue(self.storeValue); - self._setStartValue(keyword); - assertShowValue(); - self.populate(); - self._setStartValue(""); - }); - // } + if (this.getSearcher().hasMatched()) { + var keyword = this.getSearcher().getKeyword(); + self._join({ + type: BI.Selection.Multi, + value: [keyword] + }, function () { + // 如果在不选的状态下直接把该值添加进来 + if (self.storeValue.type === BI.Selection.Multi) { + self.storeValue.value.pushDistinct(keyword); + } + self.combo.setValue(self.storeValue); + self._setStartValue(keyword); + assertShowValue(); + self.populate(); + self._setStartValue(""); + }); + } }); this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) { var last = BI.last(keywords); @@ -11807,6 +11807,17 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, { height: this.constants.height }); + this.addNotMatchTip = BI.createWidget({ + type: "bi.icon_text_item", + invisible: true, + text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""), + cls: "text-add-tip-font", + height: this.constants.height, + handler: function () { + self.fireEvent(BI.MultiSelectSearchPane.EVENT_ADD_ITEM, o.keywordGetter()); + } + }); + this.loader = BI.createWidget({ type: "bi.multi_select_search_loader", keywordGetter: o.keywordGetter, @@ -11827,23 +11838,20 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, { type: "bi.vtape", element: this, items: [{ - el: this.tooltipClick, - height: 0 + type: "bi.center_adapt", + items: [this.tooltipClick, this.addNotMatchTip], + height: this.constants.height }, { el: this.loader }] }); - this.tooltipClick.setVisible(false); }, setKeyword: function (keyword) { var btn; - var isVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === btn.getValue()); - if (isVisible !== this.tooltipClick.isVisible()) { - this.tooltipClick.setVisible(isVisible); - this.resizer.attr("items")[0].height = (isVisible ? this.constants.height : 0); - this.resizer.resize(); - } + var isMatchTipVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === btn.getValue()); + this.tooltipClick.setVisible(isMatchTipVisible); + this.addNotMatchTip.setVisible(!isMatchTipVisible); }, isAllSelected: function () { @@ -11872,6 +11880,7 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, { }); BI.MultiSelectSearchPane.EVENT_CHANGE = "EVENT_CHANGE"; +BI.MultiSelectSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM"; BI.shortcut("bi.multi_select_search_pane", BI.MultiSelectSearchPane);/** * 查看已选按钮 diff --git a/public/css/font.css b/public/css/font.css index e8bb63c67..da31d2e3d 100644 --- a/public/css/font.css +++ b/public/css/font.css @@ -854,3 +854,14 @@ content: "\e74b"; color: inherit; } +.text-add-tip-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-add-tip-font .b-font:before { + content: "\e6dd"; + color: #5cb75d; +} +.text-add-tip-font.disabled .b-font:before { + content: "\e6dd"; + color: #5cb75d; +} diff --git a/public/js/index.js b/public/js/index.js index d01a0df64..d5780e549 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -59,7 +59,7 @@ BI.i18n = { "BI-Basic_April": "四月", "BI-Multi_Date_Quarter_Begin": "季度初", "BI-Multi_Date_Week": "周", - "BI-Click_Blank_To_Select": "点击\"空格键\"选中匹配项", + "BI-Click_Blank_To_Select": "点击\"空格键\"选中完全匹配项", "BI-Basic_August": "八月", "BI-Word_Align_Left": "文字居左", "BI-Basic_November": "十一月", @@ -164,5 +164,6 @@ BI.i18n = { "BI-Basic_Please_Enter_Number_Between": "请输入{R1}-{R2}的值", "BI-More_Than": "大于", "BI-More_And_Equal": "大于等于", - "BI-Please_Enter_SQL": "请输入SQL" + "BI-Please_Enter_SQL": "请输入SQL", + "BI-Basic_Click_To_Add_Text": "点击新增\"{R1}\"" }; \ No newline at end of file diff --git a/src/css/resource/font.css b/src/css/resource/font.css index c80de0892..a638f9da5 100644 --- a/src/css/resource/font.css +++ b/src/css/resource/font.css @@ -854,3 +854,14 @@ content: "\e74b"; color: inherit; } +.text-add-tip-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-add-tip-font .b-font:before { + content: "\e6dd"; + color: #5cb75d; +} +.text-add-tip-font.disabled .b-font:before { + content: "\e6dd"; + color: #5cb75d; +} diff --git a/src/less/lib/font.less b/src/less/lib/font.less index f586bf464..db71d5659 100644 --- a/src/less/lib/font.less +++ b/src/less/lib/font.less @@ -37,4 +37,6 @@ @font-tip-success: "e756"; @font-tip-warning: "e755"; @font-tip-message: "e74b"; +@font-add: "e6dd"; + diff --git a/src/less/resource/font.less b/src/less/resource/font.less index dfba73d76..1ca94e429 100644 --- a/src/less/resource/font.less +++ b/src/less/resource/font.less @@ -106,4 +106,6 @@ .font(toast-error-font, @font-tip-error); .font(toast-success-font, @font-tip-success); .font(toast-warning-font, @font-tip-warning); -.font(toast-message-font, @font-tip-message); \ No newline at end of file +.font(toast-message-font, @font-tip-message); + +.font(text-add-tip-font, @font-add, @color-bi-text-success); \ No newline at end of file diff --git a/ui/css/font.css b/ui/css/font.css index 2706cb858..062cc62f7 100644 --- a/ui/css/font.css +++ b/ui/css/font.css @@ -854,3 +854,14 @@ content: "\e74b"; color: inherit; } +.text-add-tip-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-add-tip-font .b-font:before { + content: "\e6dd"; + color: #5cb75d; +} +.text-add-tip-font.disabled .b-font:before { + content: "\e6dd"; + color: #5cb75d; +} diff --git a/ui/js/index.js b/ui/js/index.js index abd7c40e1..53412044e 100644 --- a/ui/js/index.js +++ b/ui/js/index.js @@ -59,7 +59,7 @@ BI.i18n = { "BI-Basic_April": "四月", "BI-Multi_Date_Quarter_Begin": "季度初", "BI-Multi_Date_Week": "周", - "BI-Click_Blank_To_Select": "点击\"空格键\"选中匹配项", + "BI-Click_Blank_To_Select": "点击\"空格键\"选中完全匹配项", "BI-Basic_August": "八月", "BI-Word_Align_Left": "文字居左", "BI-Basic_November": "十一月", @@ -164,5 +164,6 @@ BI.i18n = { "BI-Basic_Please_Enter_Number_Between": "请输入{R1}-{R2}的值", "BI-More_Than": "大于", "BI-More_And_Equal": "大于等于", - "BI-Please_Enter_SQL": "请输入SQL" + "BI-Please_Enter_SQL": "请输入SQL", + "BI-Basic_Click_To_Add_Text": "点击新增\"{R1}\"" }; \ No newline at end of file