Browse Source

REPORT-76823 fix: FR11样式-控件-下拉树控件,点击按钮展开后,无法再次点击收起

es6
zsmj 2 years ago
parent
commit
53dd4ddd65
  1. 2
      src/less/base/trigger/trigger.less
  2. 10
      src/less/widget/multilayersingletree/multilayersingletree.combo.less
  3. 3
      src/widget/multilayerselecttree/multilayerselecttree.combo.js
  4. 97
      src/widget/multilayersingletree/multilayersingletree.combo.js
  5. 11
      src/widget/multilayersingletree/multilayersingletree.trigger.js

2
src/less/base/trigger/trigger.less

@ -1,7 +1,7 @@
@import "../../index.less"; @import "../../index.less";
.bi-trigger{ .bi-trigger{
& .bi-trigger-icon-button{ & .bi-trigger-icon-button, &.bi-trigger-icon-button {
font-size: @font-size-16; font-size: @font-size-16;
} }
} }

10
src/less/widget/multilayersingletree/multilayersingletree.combo.less

@ -1,6 +1,16 @@
@import "../../index.less"; @import "../../index.less";
@val: transform .3s ease;
.bi-multilayer-single-tree-combo { .bi-multilayer-single-tree-combo {
// 此combo的trigger_button是absolute上去的,与bi-combo在同一层级,独立写一下
& .bi-combo.bi-combo-popup + .bi-trigger-icon-button {
& .x-icon {
.rotate(180deg);
.transition(@val);
}
}
&.status-error { &.status-error {
&.bi-border, &.bi-border-bottom { &.bi-border, &.bi-border-bottom {
border-color: @border-color-negative; border-color: @border-color-negative;

3
src/widget/multilayerselecttree/multilayerselecttree.combo.js

@ -35,7 +35,6 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
var baseConfig = this._getBaseConfig(); var baseConfig = this._getBaseConfig();
if (o.allowEdit) { if (o.allowEdit) {
return { return {
type: "bi.absolute", type: "bi.absolute",
@ -210,7 +209,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options; var self = this, o = this.options;
return { return {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
cls: "trigger-icon-button", cls: "bi-trigger trigger-icon-button",
ref: function (_ref) { ref: function (_ref) {
self.triggerBtn = _ref; self.triggerBtn = _ref;
}, },

97
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -33,14 +33,48 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
return (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig(); var cls = (o.simple ? "bi-border-bottom " : "bi-border bi-border-radius ") + (BI.isKey(o.status) ? ("status-" + o.status) : "");
var baseConfig = this._getBaseConfig();
if (o.allowEdit) {
return {
type: "bi.absolute",
cls,
items: [
{
el: BI.extend(baseConfig, this._getSearchConfig()),
top: 0, bottom: 0, right: 0, left: 0
}, {
el: self._getTriggerIconButton(),
top: 0, bottom: 0, right: 0,
},
]
};
}
return BI.extend(baseConfig, {
el: {
type: "bi.single_tree_trigger",
ref: function (_ref) {
self.textTrigger = _ref;
},
text: o.text,
defaultText: o.defaultText,
height: o.height,
items: o.items,
value: o.value,
tipType: o.tipType,
warningTitle: o.warningTitle,
valueFormatter: o.valueFormatter,
},
}, { cls });
}, },
_getBaseConfig: function () { _getBaseConfig: function () {
var self = this, o = this.options; var self = this, o = this.options;
return { return {
type: "bi.combo", type: "bi.combo",
cls: (o.simple ? "bi-border-bottom" : "bi-border bi-border-radius ") + (BI.isKey(o.status) ? ("status-" + o.status) : ""),
container: o.container, container: o.container,
destroyWhenHide: o.destroyWhenHide, destroyWhenHide: o.destroyWhenHide,
adjustLength: 2, adjustLength: 2,
@ -152,7 +186,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
// IE11下,popover(position: fixed)下放置下拉控件(position: fixed), 滚动的时候会异常卡顿 // IE11下,popover(position: fixed)下放置下拉控件(position: fixed), 滚动的时候会异常卡顿
// 通过container参数将popup放置于popover之外解决此问题, 其他下拉控件由于元素少或者有分页,所以 // 通过container参数将popup放置于popover之外解决此问题, 其他下拉控件由于元素少或者有分页,所以
// 卡顿不明显, 先在此做尝试, 并在FineUI特殊处理待解决文档中标记跟踪 // 卡顿不明显, 先在此做尝试, 并在FineUI特殊处理待解决文档中标记跟踪
return !(o.container && self.trigger.getSearcher().isSearching() && self.trigger.getSearcher().getView().element.find(e.target).length > 0); return (o.container && self.trigger.getSearcher().isSearching() && self.trigger.getSearcher().getView().element.find(e.target).length > 0) ? false : self.triggerBtn?.element.find(e.target).length === 0;
}, },
listeners: [{ listeners: [{
eventName: BI.Combo.EVENT_AFTER_HIDEVIEW, eventName: BI.Combo.EVENT_AFTER_HIDEVIEW,
@ -168,46 +202,29 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
}; };
}, },
_getSyncConfig: function () { _getTriggerIconButton: function () {
var o = this.options, self = this; var self = this, o = this.options;
var baseConfig = this._getBaseConfig(); return {
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : { type: "bi.trigger_icon_button",
el: { cls: "bi-trigger trigger-icon-button",
type: "bi.single_tree_trigger",
ref: function (_ref) {
self.textTrigger = _ref;
},
text: o.text,
defaultText: o.defaultText,
height: o.height,
items: o.items,
value: o.value,
tipType: o.tipType,
warningTitle: o.warningTitle,
valueFormatter: o.valueFormatter,
},
});
},
_getAsyncConfig: function () {
var o = this.options, self = this;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
ref: function (_ref) { ref: function (_ref) {
self.textTrigger = _ref; self.triggerBtn = _ref;
}, },
text: o.text, width: o.height,
defaultText: o.defaultText,
height: o.height, height: o.height,
items: o.items, listeners: [
value: o.value, {
tipType: o.tipType, eventName: BI.TriggerIconButton.EVENT_CHANGE,
warningTitle: o.warningTitle, action: function () {
valueFormatter: o.valueFormatter, if (self.combo.isViewVisible()) {
}, self.combo.hideView();
}); } else {
self.combo.showView();
}
}
}
]
};
}, },
getSearcher: function () { getSearcher: function () {

11
src/widget/multilayersingletree/multilayersingletree.trigger.js

@ -102,17 +102,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
width: "fill", width: "fill",
}, { rgap: 24,
el: {
type: "bi.trigger_icon_button",
cls: "trigger-icon-button",
ref: function (_ref) {
self.triggerBtn = _ref;
}, },
width: 24,
},
width: 24
}
] ]
}; };
}, },

Loading…
Cancel
Save