From 95c815db0221909cec1ae41c6e74844dc34820f5 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 10 Dec 2020 14:58:12 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-6440=20refactor:=20loadingPane=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=8A=A8=E7=94=BB=E6=8F=90=E4=BE=9Bsmall=E5=92=8Cbig?= =?UTF-8?q?=E4=B8=A4=E7=A7=8D=E5=B0=BA=E5=AF=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + src/base/pane.js | 26 ++++++++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/changelog.md b/changelog.md index ec029ccac..5f8e085be 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-12) +- Pane系列提供small和big两种大小的加载动画 - 同步树列表系列支持不显示节点连接线和展开收起图标 - 规范了下拉树trigger中显示值的显示顺序 - bi.editor支持传入autocomplete diff --git a/src/base/pane.js b/src/base/pane.js index a77976f61..cc7e9b61b 100644 --- a/src/base/pane.js +++ b/src/base/pane.js @@ -13,6 +13,7 @@ BI.Pane = BI.inherit(BI.Widget, { _baseCls: "bi-pane", tipText: BI.i18nText("BI-No_Selected_Item"), loadingText: "", + loadingSize: "small", overlap: true, onLoaded: BI.emptyFn }); @@ -41,25 +42,25 @@ BI.Pane = BI.inherit(BI.Widget, { var loadingAnimation = BI.createWidget({ type: "bi.horizontal", cls: "bi-loading-widget" + (isIE ? " wave-loading hack" : ""), - height: 30, - width: 30, - hgap: 5, + height: this._getSize(60), + width: this._getSize(60), + hgap: this._getSize(10), vgap: 2.5, items: isIE ? [] : [{ type: "bi.layout", cls: "animate-rect rect1", - height: 25, - width: 3 + height: this._getSize(50), + width: this._getSize(5), }, { type: "bi.layout", cls: "animate-rect rect2", - height: 25, - width: 3 + height: this._getSize(50), + width: this._getSize(5), }, { type: "bi.layout", cls: "animate-rect rect3", - height: 25, - width: 3 + height: this._getSize(50), + width: this._getSize(5), }] }); // pane在同步方式下由items决定tipText的显示与否 @@ -88,6 +89,10 @@ BI.Pane = BI.inherit(BI.Widget, { this.element.addClass("loading-status"); }, + _getSize: function(v) { + return Math.ceil(v / (this.options.loadingSize === 'small' ? 2 : 1)); + }, + _getLoadingTipItems: function (loadingTip) { var o = this.options; var loadingTipItems = [{ @@ -96,7 +101,8 @@ BI.Pane = BI.inherit(BI.Widget, { }]; BI.isNotEmptyString(o.loadingText) && loadingTipItems.push({ type: "bi.text", - text: o.loadingText + text: o.loadingText, + tgap: this._getSize(10), }); return [{