From 5e0ef1ee16c30311429f6a7ec03190ebc19cb488 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 20 Jan 2022 11:38:30 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E6=B0=94=E6=B3=A1=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=93=81=E7=89=8C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/layer/layer.popup.js | 4 +++- src/case/combo/bubblecombo/combo.bubble.js | 6 ++++-- src/case/combo/bubblecombo/popup.bubble.js | 17 +++++++++-------- src/less/base/combo/combo.bubble.less | 3 +++ src/less/core/utils/common.less | 4 ++++ src/less/lib/constant.less | 2 ++ 6 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index 66db79ec7..53c8e17d1 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -7,6 +7,8 @@ BI.PopupView = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this, arguments), { _baseCls: "bi-popup-view", + // 品牌色 + primary: false, maxWidth: "auto", minWidth: 100, // maxHeight: 200, @@ -84,7 +86,7 @@ BI.PopupView = BI.inherit(BI.Widget, { hgap: o.hgap, items: BI.LogicFactory.createLogicItemsByDirection(o.direction, BI.extend({ - cls: "list-view-outer bi-card list-view-shadow" + cls: "list-view-outer bi-card list-view-shadow" + (o.primary ? " bi-primary" : "") }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, { items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.tool, this.tab, this.view, this.toolbar) }))) diff --git a/src/case/combo/bubblecombo/combo.bubble.js b/src/case/combo/bubblecombo/combo.bubble.js index 3e9e4c750..dbd42e84d 100644 --- a/src/case/combo/bubblecombo/combo.bubble.js +++ b/src/case/combo/bubblecombo/combo.bubble.js @@ -13,6 +13,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { baseCls: "bi-bubble-combo", trigger: "click", toggle: true, + primary: false, direction: "bottom,left", // top||bottom||left||right||top,left||top,right||bottom,left||bottom,right isDefaultInit: false, destroyWhenHide: false, @@ -57,6 +58,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { type: "bi.bubble_popup_view", animation: "bi-zoom-big", animationDuring: 200, + primary: o.primary }, o.popup) }); this.combo.on(BI.Combo.EVENT_TRIGGER_CHANGE, function () { @@ -95,7 +97,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { }, _createTriangle: function (direction) { - var pos = {}, op = {}; + var o = this.options, pos = {}, op = {}; var adjustLength = this.options.adjustLength; var offset = this.element.offset(); var left = offset.left, right = offset.left + this.element.outerWidth(); @@ -143,7 +145,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { cls: "button-combo-triangle-wrapper", items: [{ type: "bi.layout", - cls: "bubble-combo-triangle-" + direction + cls: "bubble-combo-triangle-" + direction + (o.primary ? " bi-primary": "") }] }); pos.el = this.triangle; diff --git a/src/case/combo/bubblecombo/popup.bubble.js b/src/case/combo/bubblecombo/popup.bubble.js index f2da50fbb..cbb15070a 100644 --- a/src/case/combo/bubblecombo/popup.bubble.js +++ b/src/case/combo/bubblecombo/popup.bubble.js @@ -9,9 +9,9 @@ BI.BubblePopupView = BI.inherit(BI.PopupView, { var config = BI.BubblePopupView.superclass._defaultConfig.apply(this, arguments); return BI.extend(config, { baseCls: config.baseCls + " bi-bubble-popup-view", - minWidth: 220, + minWidth: 70, maxWidth: 300, - minHeight: 90 + minHeight: 50 }); }, }); @@ -60,11 +60,11 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, { }); return BI.createWidget({ type: "bi.center", - height: 48, - rgap: 15, + height: 54, + rgap: 20, items: [{ type: "bi.right_vertical_adapt", - lgap: 10, + lgap: 15, items: items }] }); @@ -79,12 +79,12 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, { layouts: [{ type: "bi.vertical", cls: "bar-popup-container", - hgap: 15, - tgap: 10 + hgap: 20, + tgap: 15 }] }); - button.element.css("min-height", o.minHeight - 48); + button.element.css("min-height", o.minHeight - 54); return button; } @@ -134,6 +134,7 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, { }); return { type: "bi.bubble_bar_popup_view", + primary: o.primary, minWidth: o.minWidth, maxWidth: o.maxWidth, minHeight: o.minHeight, diff --git a/src/less/base/combo/combo.bubble.less b/src/less/base/combo/combo.bubble.less index 54223bd5c..16f9f6e9f 100644 --- a/src/less/base/combo/combo.bubble.less +++ b/src/less/base/combo/combo.bubble.less @@ -29,6 +29,9 @@ &:before { background-color: @color-bi-background-bubble-combo-triangle; } + &.bi-primary:before { + background-color: @background-color-primary; + } } } diff --git a/src/less/core/utils/common.less b/src/less/core/utils/common.less index 21caf1b3a..0dfefd2af 100644 --- a/src/less/core/utils/common.less +++ b/src/less/core/utils/common.less @@ -122,6 +122,10 @@ & .bi-textarea { color: @color-bi-text-card; } + &.bi-primary { + background-color: @background-color-primary; + color: @color-card-primary; + } } .bi-theme-dark { diff --git a/src/less/lib/constant.less b/src/less/lib/constant.less index ffdb6bfad..6029c7ef9 100644 --- a/src/less/lib/constant.less +++ b/src/less/lib/constant.less @@ -23,6 +23,8 @@ // 色板 // 品牌 @color-primary: #3685f2; +@color-card-primary: @color-white; +@background-color-primary: #1e4092; //green @color-green-100: #13cd66;