Browse Source

Merge pull request #149332 in DEC/fineui from release/11.0 to bugfix/11.0

* commit 'f930b9a6f9d98bc6e587da0983f4526a42103375':
  REPORT-78579 fix: 调整bi.time_combo组件结构,保持结构统一
  REPORT-78514 revert: REPORT-7696组件是否异步获取数据,和组件是否支持搜索分离开
research/test
superman 2 years ago
parent
commit
cf8d6fb22c
  1. 6
      src/widget/multilayerselecttree/multilayerselecttree.combo.js
  2. 33
      src/widget/multilayersingletree/multilayersingletree.combo.js
  3. 54
      src/widget/time/time.combo.js

6
src/widget/multilayerselecttree/multilayerselecttree.combo.js

@ -132,11 +132,6 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_STOP,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_STOP);
}
}, { }, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM, eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () { action: function () {
@ -248,7 +243,6 @@ BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeCombo.EVENT_BLUR = "EVENT_BLUR"; BI.MultiLayerSelectTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSelectTreeCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSelectTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; BI.MultiLayerSelectTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.MultiLayerSelectTreeCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; BI.MultiLayerSelectTreeCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo); BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);

33
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -36,6 +36,11 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig(); return (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig();
}, },
_shouldWrapper: function () {
var o = this.options;
return !o.allowEdit && o.itemsCreator === BI.emptyFn;
},
_getBaseConfig: function () { _getBaseConfig: function () {
var self = this, o = this.options; var self = this, o = this.options;
return { return {
@ -94,6 +99,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
container: o.container, container: o.container,
allowInsertValue: o.allowInsertValue, allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit,
cls: "multilayer-single-tree-trigger", cls: "multilayer-single-tree-trigger",
ref: function (_ref) { ref: function (_ref) {
self.trigger = _ref; self.trigger = _ref;
@ -130,11 +136,6 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_STOP,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_STOP);
}
}, { }, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM, eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () { action: function () {
@ -183,28 +184,13 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
tipType: o.tipType, tipType: o.tipType,
warningTitle: o.warningTitle, warningTitle: o.warningTitle,
valueFormatter: o.valueFormatter, valueFormatter: o.valueFormatter,
}, }
}); });
}, },
_getAsyncConfig: function () { _getAsyncConfig: function () {
var o = this.options, self = this; var config = this._getBaseConfig();
var baseConfig = this._getBaseConfig(); return BI.extend(config, this._getSearchConfig());
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
ref: function (_ref) {
self.textTrigger = _ref;
},
text: o.text,
height: o.height,
items: o.items,
value: o.value,
tipType: o.tipType,
warningTitle: o.warningTitle,
valueFormatter: o.valueFormatter,
},
});
}, },
getSearcher: function () { getSearcher: function () {
@ -257,6 +243,5 @@ BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeCombo.EVENT_BLUR = "EVENT_BLUR"; BI.MultiLayerSingleTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSingleTreeCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSingleTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; BI.MultiLayerSingleTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo); BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);

54
src/widget/time/time.combo.js

@ -60,19 +60,20 @@
} }
}; };
return { return {
type: "bi.horizontal_fill", type: "bi.absolute",
cls: "bi-border bi-border-radius",
columnSize: ["fill", this.constants.iconWidth],
height: opts.height - 2,
width: opts.width - 2,
items: [{ items: [{
el: { el: {
type: "bi.combo", type: "bi.combo",
cls: "bi-border bi-border-radius",
container: opts.container, container: opts.container,
toggle: false, toggle: false,
isNeedAdjustHeight: opts.isNeedAdjustHeight, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: opts.isNeedAdjustWidth, isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: { el: {
type: "bi.horizontal_fill",
columnSize: ["fill", this.constants.iconWidth],
height: opts.height - 2,
items: [{
type: "bi.time_trigger", type: "bi.time_trigger",
height: opts.height - 2, height: opts.height - 2,
allowEdit: opts.allowEdit, allowEdit: opts.allowEdit,
@ -150,6 +151,26 @@
self.fireEvent("EVENT_CONFIRM"); self.fireEvent("EVENT_CONFIRM");
} }
}] }]
}, {
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button time-font",
width: this.constants.iconWidth,
listeners: [{
eventName: BI.IconButton.EVENT_CHANGE,
action: function () {
if (self.combo.isViewVisible()) {
// self.combo.hideView();
} else {
self.combo.showView();
}
}
}],
ref: function (_ref) {
self.triggerBtn = _ref;
}
},
}],
}, },
adjustLength: this.constants.comboAdjustHeight, adjustLength: this.constants.comboAdjustHeight,
popup: { popup: {
@ -171,25 +192,10 @@
self.combo = _ref; self.combo = _ref;
} }
}, },
}, { top: 0,
el: { left: 0,
type: "bi.icon_button", right: 0,
cls: "bi-trigger-icon-button time-font", bottom: 0
width: this.constants.iconWidth,
listeners: [{
eventName: BI.IconButton.EVENT_CHANGE,
action: function () {
if (self.combo.isViewVisible()) {
// self.combo.hideView();
} else {
self.combo.showView();
}
}
}],
ref: function (_ref) {
self.triggerBtn = _ref;
}
},
}] }]
}; };
}, },

Loading…
Cancel
Save