From 0d8f1df26d7dad7755278fd480aebfb238bd549c Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 24 Apr 2017 11:48:17 +0800 Subject: [PATCH 1/9] update --- bi/core.js | 98 ++++++++++++++++++++++++++++++++++++++++++ docs/core.js | 98 ++++++++++++++++++++++++++++++++++++++++++ src/core/proto/date.js | 98 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 294 insertions(+) diff --git a/bi/core.js b/bi/core.js index 0c0d0099b..db3206894 100644 --- a/bi/core.js +++ b/bi/core.js @@ -6264,6 +6264,104 @@ Date.prototype.getOffsetDate = function (offset) { return new Date(this.getTime() + offset * 864e5); }; +Date.prototype.getAfterMulQuarter = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() + n * 3); + return dt; +}; +//获得n个季度前的日期 +Date.prototype.getBeforeMulQuarter = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() - n * 3); + return dt; +}; +//得到本季度的起始月份 +Date.prototype.getQuarterStartMonth = function () { + var quarterStartMonth = 0; + var nowMonth = this.getMonth(); + if (nowMonth < 3) { + quarterStartMonth = 0; + } + if (2 < nowMonth && nowMonth < 6) { + quarterStartMonth = 3; + } + if (5 < nowMonth && nowMonth < 9) { + quarterStartMonth = 6; + } + if (nowMonth > 8) { + quarterStartMonth = 9; + } + return quarterStartMonth; +}; +//获得本季度的起始日期 +Date.prototype.getQuarterStartDate = function () { + return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1); +}; +//得到本季度的结束日期 +Date.prototype.getQuarterEndDate = function () { + var quarterEndMonth = this.getQuarterStartMonth() + 2; + return new Date(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth)); +}; +Date.prototype.getAfterMultiMonth = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() + n | 0); + return dt; +}; +Date.prototype.getBeforeMultiMonth = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() - n | 0); + return dt; +}; + +Date.prototype.getAfterMulQuarter = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() + n * 3); + return dt; +}; +//获得n个季度前的日期 +Date.prototype.getBeforeMulQuarter = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() - n * 3); + return dt; +}; +//得到本季度的起始月份 +Date.prototype.getQuarterStartMonth = function () { + var quarterStartMonth = 0; + var nowMonth = this.getMonth(); + if (nowMonth < 3) { + quarterStartMonth = 0; + } + if (2 < nowMonth && nowMonth < 6) { + quarterStartMonth = 3; + } + if (5 < nowMonth && nowMonth < 9) { + quarterStartMonth = 6; + } + if (nowMonth > 8) { + quarterStartMonth = 9; + } + return quarterStartMonth; +}; +//获得本季度的起始日期 +Date.prototype.getQuarterStartDate = function () { + return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1); +}; +//得到本季度的结束日期 +Date.prototype.getQuarterEndDate = function () { + var quarterEndMonth = this.getQuarterStartMonth() + 2; + return new Date(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth)); +}; +Date.prototype.getAfterMultiMonth = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() + n | 0); + return dt; +}; +Date.prototype.getBeforeMultiMonth = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() - n | 0); + return dt; +}; + /** Checks date and time equality */ Date.prototype.equalsTo = function (date) { return ((this.getFullYear() == date.getFullYear()) && diff --git a/docs/core.js b/docs/core.js index 8a85d1efa..d8367ba60 100644 --- a/docs/core.js +++ b/docs/core.js @@ -23740,6 +23740,104 @@ Date.prototype.getOffsetDate = function (offset) { return new Date(this.getTime() + offset * 864e5); }; +Date.prototype.getAfterMulQuarter = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() + n * 3); + return dt; +}; +//获得n个季度前的日期 +Date.prototype.getBeforeMulQuarter = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() - n * 3); + return dt; +}; +//得到本季度的起始月份 +Date.prototype.getQuarterStartMonth = function () { + var quarterStartMonth = 0; + var nowMonth = this.getMonth(); + if (nowMonth < 3) { + quarterStartMonth = 0; + } + if (2 < nowMonth && nowMonth < 6) { + quarterStartMonth = 3; + } + if (5 < nowMonth && nowMonth < 9) { + quarterStartMonth = 6; + } + if (nowMonth > 8) { + quarterStartMonth = 9; + } + return quarterStartMonth; +}; +//获得本季度的起始日期 +Date.prototype.getQuarterStartDate = function () { + return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1); +}; +//得到本季度的结束日期 +Date.prototype.getQuarterEndDate = function () { + var quarterEndMonth = this.getQuarterStartMonth() + 2; + return new Date(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth)); +}; +Date.prototype.getAfterMultiMonth = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() + n | 0); + return dt; +}; +Date.prototype.getBeforeMultiMonth = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() - n | 0); + return dt; +}; + +Date.prototype.getAfterMulQuarter = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() + n * 3); + return dt; +}; +//获得n个季度前的日期 +Date.prototype.getBeforeMulQuarter = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() - n * 3); + return dt; +}; +//得到本季度的起始月份 +Date.prototype.getQuarterStartMonth = function () { + var quarterStartMonth = 0; + var nowMonth = this.getMonth(); + if (nowMonth < 3) { + quarterStartMonth = 0; + } + if (2 < nowMonth && nowMonth < 6) { + quarterStartMonth = 3; + } + if (5 < nowMonth && nowMonth < 9) { + quarterStartMonth = 6; + } + if (nowMonth > 8) { + quarterStartMonth = 9; + } + return quarterStartMonth; +}; +//获得本季度的起始日期 +Date.prototype.getQuarterStartDate = function () { + return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1); +}; +//得到本季度的结束日期 +Date.prototype.getQuarterEndDate = function () { + var quarterEndMonth = this.getQuarterStartMonth() + 2; + return new Date(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth)); +}; +Date.prototype.getAfterMultiMonth = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() + n | 0); + return dt; +}; +Date.prototype.getBeforeMultiMonth = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() - n | 0); + return dt; +}; + /** Checks date and time equality */ Date.prototype.equalsTo = function (date) { return ((this.getFullYear() == date.getFullYear()) && diff --git a/src/core/proto/date.js b/src/core/proto/date.js index d1c240377..755e488f0 100644 --- a/src/core/proto/date.js +++ b/src/core/proto/date.js @@ -104,6 +104,104 @@ Date.prototype.getOffsetDate = function (offset) { return new Date(this.getTime() + offset * 864e5); }; +Date.prototype.getAfterMulQuarter = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() + n * 3); + return dt; +}; +//获得n个季度前的日期 +Date.prototype.getBeforeMulQuarter = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() - n * 3); + return dt; +}; +//得到本季度的起始月份 +Date.prototype.getQuarterStartMonth = function () { + var quarterStartMonth = 0; + var nowMonth = this.getMonth(); + if (nowMonth < 3) { + quarterStartMonth = 0; + } + if (2 < nowMonth && nowMonth < 6) { + quarterStartMonth = 3; + } + if (5 < nowMonth && nowMonth < 9) { + quarterStartMonth = 6; + } + if (nowMonth > 8) { + quarterStartMonth = 9; + } + return quarterStartMonth; +}; +//获得本季度的起始日期 +Date.prototype.getQuarterStartDate = function () { + return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1); +}; +//得到本季度的结束日期 +Date.prototype.getQuarterEndDate = function () { + var quarterEndMonth = this.getQuarterStartMonth() + 2; + return new Date(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth)); +}; +Date.prototype.getAfterMultiMonth = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() + n | 0); + return dt; +}; +Date.prototype.getBeforeMultiMonth = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() - n | 0); + return dt; +}; + +Date.prototype.getAfterMulQuarter = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() + n * 3); + return dt; +}; +//获得n个季度前的日期 +Date.prototype.getBeforeMulQuarter = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() - n * 3); + return dt; +}; +//得到本季度的起始月份 +Date.prototype.getQuarterStartMonth = function () { + var quarterStartMonth = 0; + var nowMonth = this.getMonth(); + if (nowMonth < 3) { + quarterStartMonth = 0; + } + if (2 < nowMonth && nowMonth < 6) { + quarterStartMonth = 3; + } + if (5 < nowMonth && nowMonth < 9) { + quarterStartMonth = 6; + } + if (nowMonth > 8) { + quarterStartMonth = 9; + } + return quarterStartMonth; +}; +//获得本季度的起始日期 +Date.prototype.getQuarterStartDate = function () { + return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1); +}; +//得到本季度的结束日期 +Date.prototype.getQuarterEndDate = function () { + var quarterEndMonth = this.getQuarterStartMonth() + 2; + return new Date(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth)); +}; +Date.prototype.getAfterMultiMonth = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() + n | 0); + return dt; +}; +Date.prototype.getBeforeMultiMonth = function (n) { + var dt = new Date(this.getTime()); + dt.setMonth(dt.getMonth() - n | 0); + return dt; +}; + /** Checks date and time equality */ Date.prototype.equalsTo = function (date) { return ((this.getFullYear() == date.getFullYear()) && From aca09b754c3e83bb5cfabc33f9e60fb9cb025fde Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 25 Apr 2017 10:31:05 +0800 Subject: [PATCH 2/9] add --- bi/base.js | 8 +++- bi/core.css | 49 ++++++++--------------- docs/base.js | 8 +++- docs/core.css | 49 ++++++++--------------- src/base/combination/group.combo.js | 2 +- src/base/single/button/button.basic.js | 6 ++- src/css/core/utils/common.css | 49 ++++++++--------------- src/less/core/utils/common.less | 55 ++++++++++---------------- 8 files changed, 89 insertions(+), 137 deletions(-) diff --git a/bi/base.js b/bi/base.js index 0077aef3b..f6241ad7e 100644 --- a/bi/base.js +++ b/bi/base.js @@ -713,6 +713,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = false; $(document).unbind("mouseup." + self.getName()); + self.fireEvent(BI.BasicButton.EVENT_MOUSE_UP); // } }); if (mouseDown === true) { @@ -725,6 +726,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = true; ev(e); + self.fireEvent(BI.BasicButton.EVENT_MOUSE_DOWN); // } }); hand.mouseup(function (e) { @@ -870,7 +872,9 @@ BI.BasicButton = BI.inherit(BI.Single, { BI.BasicButton.superclass.destroy.apply(this, arguments); } }); -BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE";/** +BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE"; +BI.BasicButton.EVENT_MOUSE_DOWN = "BasicButton.EVENT_MOUSE_DOWN"; +BI.BasicButton.EVENT_MOUSE_UP = "BasicButton.EVENT_MOUSE_UP";/** * 表示一个可以展开的节点, 不仅有选中状态而且有展开状态 * * Created by GUY on 2015/9/9. @@ -3453,7 +3457,7 @@ BI.shortcut("bi.expander", BI.Expander);/** BI.ComboGroup = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.ComboGroup.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-combo-group", + baseCls: "bi-combo-group bi-list-item", //以下这些属性对每一个combo都是公用的 trigger: "click,hover", diff --git a/bi/core.css b/bi/core.css index 317fa4d81..5ae82a56d 100644 --- a/bi/core.css +++ b/bi/core.css @@ -3162,38 +3162,6 @@ i { .bi-theme-dark .bi-list-item-effect.disabled:active .bi-high-light { color: #666666 !important; } -.bi-list-item-hover:hover, -.bi-list-item-hover.hover { - color: #3f8ce8; - background-color: #eff1f4; -} -.bi-list-item-hover.disabled, -.bi-list-item-hover.disabled:hover, -.bi-list-item-hover.disabled:active { - color: #cccccc !important; - background-color: transparent !important; -} -.bi-list-item-hover.disabled .bi-high-light, -.bi-list-item-hover.disabled:hover .bi-high-light, -.bi-list-item-hover.disabled:active .bi-high-light { - color: #cccccc !important; -} -.bi-theme-dark .bi-list-item-hover:hover, -.bi-theme-dark .bi-list-item-hover.hover { - color: #3f8ce8; - background-color: #191b2b; -} -.bi-theme-dark .bi-list-item-hover.disabled, -.bi-theme-dark .bi-list-item-hover.disabled:hover, -.bi-theme-dark .bi-list-item-hover.disabled:active { - background-color: transparent !important; - color: #666666 !important; -} -.bi-theme-dark .bi-list-item-hover.disabled .bi-high-light, -.bi-theme-dark .bi-list-item-hover.disabled:hover .bi-high-light, -.bi-theme-dark .bi-list-item-hover.disabled:active .bi-high-light { - color: #666666 !important; -} .bi-list-item-active:hover, .bi-list-item-active.hover { color: #1a1a1a; @@ -3286,6 +3254,9 @@ i { .bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light { color: #666666 !important; } +.bi-list-item-choose:hover { + color: #1a1a1a; +} .bi-list-item-choose:active, .bi-list-item-choose.active { color: #ffffff; @@ -3306,6 +3277,20 @@ i { .bi-list-item-choose.disabled:active .bi-high-light { color: #cccccc !important; } +.bi-theme-dark .bi-list-item-choose:hover { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-choose.disabled, +.bi-theme-dark .bi-list-item-choose.disabled:hover, +.bi-theme-dark .bi-list-item-choose.disabled:active { + color: #666666 !important; + background-color: transparent !important; +} +.bi-theme-dark .bi-list-item-choose.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-choose.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-choose.disabled:active .bi-high-light { + color: #666666 !important; +} /*****************cursor*****************/ .cursor-pointer { cursor: pointer; diff --git a/docs/base.js b/docs/base.js index 0077aef3b..f6241ad7e 100644 --- a/docs/base.js +++ b/docs/base.js @@ -713,6 +713,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = false; $(document).unbind("mouseup." + self.getName()); + self.fireEvent(BI.BasicButton.EVENT_MOUSE_UP); // } }); if (mouseDown === true) { @@ -725,6 +726,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = true; ev(e); + self.fireEvent(BI.BasicButton.EVENT_MOUSE_DOWN); // } }); hand.mouseup(function (e) { @@ -870,7 +872,9 @@ BI.BasicButton = BI.inherit(BI.Single, { BI.BasicButton.superclass.destroy.apply(this, arguments); } }); -BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE";/** +BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE"; +BI.BasicButton.EVENT_MOUSE_DOWN = "BasicButton.EVENT_MOUSE_DOWN"; +BI.BasicButton.EVENT_MOUSE_UP = "BasicButton.EVENT_MOUSE_UP";/** * 表示一个可以展开的节点, 不仅有选中状态而且有展开状态 * * Created by GUY on 2015/9/9. @@ -3453,7 +3457,7 @@ BI.shortcut("bi.expander", BI.Expander);/** BI.ComboGroup = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.ComboGroup.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-combo-group", + baseCls: "bi-combo-group bi-list-item", //以下这些属性对每一个combo都是公用的 trigger: "click,hover", diff --git a/docs/core.css b/docs/core.css index 317fa4d81..5ae82a56d 100644 --- a/docs/core.css +++ b/docs/core.css @@ -3162,38 +3162,6 @@ i { .bi-theme-dark .bi-list-item-effect.disabled:active .bi-high-light { color: #666666 !important; } -.bi-list-item-hover:hover, -.bi-list-item-hover.hover { - color: #3f8ce8; - background-color: #eff1f4; -} -.bi-list-item-hover.disabled, -.bi-list-item-hover.disabled:hover, -.bi-list-item-hover.disabled:active { - color: #cccccc !important; - background-color: transparent !important; -} -.bi-list-item-hover.disabled .bi-high-light, -.bi-list-item-hover.disabled:hover .bi-high-light, -.bi-list-item-hover.disabled:active .bi-high-light { - color: #cccccc !important; -} -.bi-theme-dark .bi-list-item-hover:hover, -.bi-theme-dark .bi-list-item-hover.hover { - color: #3f8ce8; - background-color: #191b2b; -} -.bi-theme-dark .bi-list-item-hover.disabled, -.bi-theme-dark .bi-list-item-hover.disabled:hover, -.bi-theme-dark .bi-list-item-hover.disabled:active { - background-color: transparent !important; - color: #666666 !important; -} -.bi-theme-dark .bi-list-item-hover.disabled .bi-high-light, -.bi-theme-dark .bi-list-item-hover.disabled:hover .bi-high-light, -.bi-theme-dark .bi-list-item-hover.disabled:active .bi-high-light { - color: #666666 !important; -} .bi-list-item-active:hover, .bi-list-item-active.hover { color: #1a1a1a; @@ -3286,6 +3254,9 @@ i { .bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light { color: #666666 !important; } +.bi-list-item-choose:hover { + color: #1a1a1a; +} .bi-list-item-choose:active, .bi-list-item-choose.active { color: #ffffff; @@ -3306,6 +3277,20 @@ i { .bi-list-item-choose.disabled:active .bi-high-light { color: #cccccc !important; } +.bi-theme-dark .bi-list-item-choose:hover { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-choose.disabled, +.bi-theme-dark .bi-list-item-choose.disabled:hover, +.bi-theme-dark .bi-list-item-choose.disabled:active { + color: #666666 !important; + background-color: transparent !important; +} +.bi-theme-dark .bi-list-item-choose.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-choose.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-choose.disabled:active .bi-high-light { + color: #666666 !important; +} /*****************cursor*****************/ .cursor-pointer { cursor: pointer; diff --git a/src/base/combination/group.combo.js b/src/base/combination/group.combo.js index 89fce40c1..2d3314fd3 100644 --- a/src/base/combination/group.combo.js +++ b/src/base/combination/group.combo.js @@ -5,7 +5,7 @@ BI.ComboGroup = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.ComboGroup.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-combo-group", + baseCls: "bi-combo-group bi-list-item", //以下这些属性对每一个combo都是公用的 trigger: "click,hover", diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index 41f23794c..ce8b283dd 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -130,6 +130,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = false; $(document).unbind("mouseup." + self.getName()); + self.fireEvent(BI.BasicButton.EVENT_MOUSE_UP); // } }); if (mouseDown === true) { @@ -142,6 +143,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = true; ev(e); + self.fireEvent(BI.BasicButton.EVENT_MOUSE_DOWN); // } }); hand.mouseup(function (e) { @@ -287,4 +289,6 @@ BI.BasicButton = BI.inherit(BI.Single, { BI.BasicButton.superclass.destroy.apply(this, arguments); } }); -BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE"; \ No newline at end of file +BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE"; +BI.BasicButton.EVENT_MOUSE_DOWN = "BasicButton.EVENT_MOUSE_DOWN"; +BI.BasicButton.EVENT_MOUSE_UP = "BasicButton.EVENT_MOUSE_UP"; \ No newline at end of file diff --git a/src/css/core/utils/common.css b/src/css/core/utils/common.css index e6cf5e6ad..331bbec99 100644 --- a/src/css/core/utils/common.css +++ b/src/css/core/utils/common.css @@ -209,38 +209,6 @@ .bi-theme-dark .bi-list-item-effect.disabled:active .bi-high-light { color: #666666 !important; } -.bi-list-item-hover:hover, -.bi-list-item-hover.hover { - color: #3f8ce8; - background-color: #eff1f4; -} -.bi-list-item-hover.disabled, -.bi-list-item-hover.disabled:hover, -.bi-list-item-hover.disabled:active { - color: #cccccc !important; - background-color: transparent !important; -} -.bi-list-item-hover.disabled .bi-high-light, -.bi-list-item-hover.disabled:hover .bi-high-light, -.bi-list-item-hover.disabled:active .bi-high-light { - color: #cccccc !important; -} -.bi-theme-dark .bi-list-item-hover:hover, -.bi-theme-dark .bi-list-item-hover.hover { - color: #3f8ce8; - background-color: #191b2b; -} -.bi-theme-dark .bi-list-item-hover.disabled, -.bi-theme-dark .bi-list-item-hover.disabled:hover, -.bi-theme-dark .bi-list-item-hover.disabled:active { - background-color: transparent !important; - color: #666666 !important; -} -.bi-theme-dark .bi-list-item-hover.disabled .bi-high-light, -.bi-theme-dark .bi-list-item-hover.disabled:hover .bi-high-light, -.bi-theme-dark .bi-list-item-hover.disabled:active .bi-high-light { - color: #666666 !important; -} .bi-list-item-active:hover, .bi-list-item-active.hover { color: #1a1a1a; @@ -333,6 +301,9 @@ .bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light { color: #666666 !important; } +.bi-list-item-choose:hover { + color: #1a1a1a; +} .bi-list-item-choose:active, .bi-list-item-choose.active { color: #ffffff; @@ -353,3 +324,17 @@ .bi-list-item-choose.disabled:active .bi-high-light { color: #cccccc !important; } +.bi-theme-dark .bi-list-item-choose:hover { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-choose.disabled, +.bi-theme-dark .bi-list-item-choose.disabled:hover, +.bi-theme-dark .bi-list-item-choose.disabled:active { + color: #666666 !important; + background-color: transparent !important; +} +.bi-theme-dark .bi-list-item-choose.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-choose.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-choose.disabled:active .bi-high-light { + color: #666666 !important; +} diff --git a/src/less/core/utils/common.less b/src/less/core/utils/common.less index fbfe3a2b8..231eb9603 100644 --- a/src/less/core/utils/common.less +++ b/src/less/core/utils/common.less @@ -267,41 +267,6 @@ } } -//文字和背景hover时变化 -.bi-list-item-hover { - &:hover, &.hover { - color: @color-bi-text-highlight; - background-color: @color-bi-background-normal; - } - &.disabled { - &, &:hover, &:active { - color: @color-bi-text-disabled !important; - background-color: transparent !important; - & .bi-high-light { - color: @color-bi-text-disabled !important; - } - } - } -} - -.bi-theme-dark { - .bi-list-item-hover { - &:hover, &.hover { - color: @color-bi-text-highlight; - background-color: @color-bi-background-normal-theme-dark; - } - &.disabled { - &, &:hover, &:active { - background-color: transparent !important; - color: @color-bi-text-disabled-theme-dark !important; - & .bi-high-light { - color: @color-bi-text-disabled-theme-dark !important; - } - } - } - } -} - //文字和背景hover和active时变化 .bi-list-item-active { &:hover, &.hover { @@ -395,6 +360,9 @@ } .bi-list-item-choose { + &:hover { + color: @color-bi-text-black; + } &:active, &.active { color: @color-bi-text; background-color: @color-bi-background-highlight; @@ -411,4 +379,21 @@ } } } +} + +.bi-theme-dark { + .bi-list-item-choose { + &:hover { + color: @color-bi-text; + } + &.disabled { + &, &:hover, &:active { + color: @color-bi-text-disabled-theme-dark !important; + background-color: transparent !important; + & .bi-high-light { + color: @color-bi-text-disabled-theme-dark !important; + } + } + } + } } \ No newline at end of file From adf4dec3873a1af72a8ee921f5587006d10f9381 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 25 Apr 2017 10:38:36 +0800 Subject: [PATCH 3/9] add --- bi/base.js | 29 +++++++++++++++++++++----- docs/base.js | 29 +++++++++++++++++++++----- src/base/single/button/button.basic.js | 29 +++++++++++++++++++++----- 3 files changed, 72 insertions(+), 15 deletions(-) diff --git a/bi/base.js b/bi/base.js index f6241ad7e..82e71967e 100644 --- a/bi/base.js +++ b/bi/base.js @@ -713,7 +713,6 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = false; $(document).unbind("mouseup." + self.getName()); - self.fireEvent(BI.BasicButton.EVENT_MOUSE_UP); // } }); if (mouseDown === true) { @@ -726,7 +725,6 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = true; ev(e); - self.fireEvent(BI.BasicButton.EVENT_MOUSE_DOWN); // } }); hand.mouseup(function (e) { @@ -743,6 +741,29 @@ BI.BasicButton = BI.inherit(BI.Single, { case "dblclick": hand.dblclick(clk); break; + case "lclick": + var mouseDown = false; + var interval; + hand.mousedown(function (e) { + $(document).bind("mouseup." + self.getName(), function (e) { + interval && clearInterval(interval); + interval = null; + mouseDown = false; + $(document).unbind("mouseup." + self.getName()); + }); + if (mouseDown === true) { + return; + } + if (!self.isEnabled() || (self.isOnce() && self.isSelected())) { + return; + } + interval = setInterval(function () { + self.doClick(); + }, 100); + mouseDown = true; + ev(e); + }); + break; default: hand.mousedown(function (e) { ev(e); @@ -872,9 +893,7 @@ BI.BasicButton = BI.inherit(BI.Single, { BI.BasicButton.superclass.destroy.apply(this, arguments); } }); -BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE"; -BI.BasicButton.EVENT_MOUSE_DOWN = "BasicButton.EVENT_MOUSE_DOWN"; -BI.BasicButton.EVENT_MOUSE_UP = "BasicButton.EVENT_MOUSE_UP";/** +BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE";/** * 表示一个可以展开的节点, 不仅有选中状态而且有展开状态 * * Created by GUY on 2015/9/9. diff --git a/docs/base.js b/docs/base.js index f6241ad7e..82e71967e 100644 --- a/docs/base.js +++ b/docs/base.js @@ -713,7 +713,6 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = false; $(document).unbind("mouseup." + self.getName()); - self.fireEvent(BI.BasicButton.EVENT_MOUSE_UP); // } }); if (mouseDown === true) { @@ -726,7 +725,6 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = true; ev(e); - self.fireEvent(BI.BasicButton.EVENT_MOUSE_DOWN); // } }); hand.mouseup(function (e) { @@ -743,6 +741,29 @@ BI.BasicButton = BI.inherit(BI.Single, { case "dblclick": hand.dblclick(clk); break; + case "lclick": + var mouseDown = false; + var interval; + hand.mousedown(function (e) { + $(document).bind("mouseup." + self.getName(), function (e) { + interval && clearInterval(interval); + interval = null; + mouseDown = false; + $(document).unbind("mouseup." + self.getName()); + }); + if (mouseDown === true) { + return; + } + if (!self.isEnabled() || (self.isOnce() && self.isSelected())) { + return; + } + interval = setInterval(function () { + self.doClick(); + }, 100); + mouseDown = true; + ev(e); + }); + break; default: hand.mousedown(function (e) { ev(e); @@ -872,9 +893,7 @@ BI.BasicButton = BI.inherit(BI.Single, { BI.BasicButton.superclass.destroy.apply(this, arguments); } }); -BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE"; -BI.BasicButton.EVENT_MOUSE_DOWN = "BasicButton.EVENT_MOUSE_DOWN"; -BI.BasicButton.EVENT_MOUSE_UP = "BasicButton.EVENT_MOUSE_UP";/** +BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE";/** * 表示一个可以展开的节点, 不仅有选中状态而且有展开状态 * * Created by GUY on 2015/9/9. diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index ce8b283dd..1882bd2de 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -130,7 +130,6 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = false; $(document).unbind("mouseup." + self.getName()); - self.fireEvent(BI.BasicButton.EVENT_MOUSE_UP); // } }); if (mouseDown === true) { @@ -143,7 +142,6 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = true; ev(e); - self.fireEvent(BI.BasicButton.EVENT_MOUSE_DOWN); // } }); hand.mouseup(function (e) { @@ -160,6 +158,29 @@ BI.BasicButton = BI.inherit(BI.Single, { case "dblclick": hand.dblclick(clk); break; + case "lclick": + var mouseDown = false; + var interval; + hand.mousedown(function (e) { + $(document).bind("mouseup." + self.getName(), function (e) { + interval && clearInterval(interval); + interval = null; + mouseDown = false; + $(document).unbind("mouseup." + self.getName()); + }); + if (mouseDown === true) { + return; + } + if (!self.isEnabled() || (self.isOnce() && self.isSelected())) { + return; + } + interval = setInterval(function () { + self.doClick(); + }, 100); + mouseDown = true; + ev(e); + }); + break; default: hand.mousedown(function (e) { ev(e); @@ -289,6 +310,4 @@ BI.BasicButton = BI.inherit(BI.Single, { BI.BasicButton.superclass.destroy.apply(this, arguments); } }); -BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE"; -BI.BasicButton.EVENT_MOUSE_DOWN = "BasicButton.EVENT_MOUSE_DOWN"; -BI.BasicButton.EVENT_MOUSE_UP = "BasicButton.EVENT_MOUSE_UP"; \ No newline at end of file +BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE"; \ No newline at end of file From 9b446078cb656f62c09046b3106afc447e28eb4d Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Tue, 25 Apr 2017 16:34:47 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E9=95=BF=E6=8C=89button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bi/base.js | 168 +++++++++--------- bi/widget.js | 4 +- docs/base.js | 168 +++++++++--------- docs/widget.js | 4 +- src/base/single/button/button.basic.js | 168 +++++++++--------- .../finetuning.number.editor.js | 4 +- 6 files changed, 267 insertions(+), 249 deletions(-) diff --git a/bi/base.js b/bi/base.js index 82e71967e..ed5c38f49 100644 --- a/bi/base.js +++ b/bi/base.js @@ -685,95 +685,99 @@ BI.BasicButton = BI.inherit(BI.Single, { return; } hand = hand.element; - switch (o.trigger) { - case "mouseup": - var mouseDown = false; - hand.mousedown(function () { - mouseDown = true; - ev(e); - }); - hand.mouseup(function (e) { - if (mouseDown === true) { - clk(e); - } - mouseDown = false; - ev(e); - }); - break; - case "mousedown": - var mouseDown = false; - var selected = false; - hand.mousedown(function (e) { - // if (e.button === 0) { - $(document).bind("mouseup." + self.getName(), function (e) { - // if (e.button === 0) { - if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) { - self.setSelected(!self.isSelected()); - self._trigger(); + var triggerArr = (o.trigger || "").split(","); + BI.each(triggerArr, function (idx, trigger) { + switch (trigger) { + case "mouseup": + var mouseDown = false; + hand.mousedown(function () { + mouseDown = true; + ev(e); + }); + hand.mouseup(function (e) { + if (mouseDown === true) { + clk(e); } mouseDown = false; - $(document).unbind("mouseup." + self.getName()); + ev(e); + }); + break; + case "mousedown": + var mouseDown = false; + var selected = false; + hand.mousedown(function (e) { + // if (e.button === 0) { + $(document).bind("mouseup." + self.getName(), function (e) { + // if (e.button === 0) { + if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) { + self.setSelected(!self.isSelected()); + self._trigger(); + } + mouseDown = false; + $(document).unbind("mouseup." + self.getName()); + // } + }); + if (mouseDown === true) { + return; + } + if (self.isSelected()) { + selected = true; + } else { + clk(e); + } + mouseDown = true; + ev(e); // } }); - if (mouseDown === true) { - return; - } - if (self.isSelected()) { - selected = true; - } else { - clk(e); - } - mouseDown = true; - ev(e); - // } - }); - hand.mouseup(function (e) { - // if (e.button === 0) { - if (BI.DOM.isExist(self) && mouseDown === true && selected === true) { - clk(e); - } - mouseDown = false; - selected = false; - $(document).unbind("mouseup." + self.getName()); - // } - }); - break; - case "dblclick": - hand.dblclick(clk); - break; - case "lclick": - var mouseDown = false; - var interval; - hand.mousedown(function (e) { - $(document).bind("mouseup." + self.getName(), function (e) { - interval && clearInterval(interval); - interval = null; + hand.mouseup(function (e) { + // if (e.button === 0) { + if (BI.DOM.isExist(self) && mouseDown === true && selected === true) { + clk(e); + } mouseDown = false; + selected = false; $(document).unbind("mouseup." + self.getName()); + // } }); - if (mouseDown === true) { - return; - } - if (!self.isEnabled() || (self.isOnce() && self.isSelected())) { - return; - } - interval = setInterval(function () { - self.doClick(); - }, 100); - mouseDown = true; - ev(e); - }); - break; - default: - hand.mousedown(function (e) { - ev(e); - }); - hand.mouseup(function (e) { - ev(e); - }); - hand.click(clk); - break; - } + break; + case "dblclick": + hand.dblclick(clk); + break; + case "lclick": + var mouseDown = false; + var interval; + hand.mousedown(function (e) { + $(document).bind("mouseup." + self.getName(), function (e) { + interval && clearInterval(interval); + interval = null; + mouseDown = false; + $(document).unbind("mouseup." + self.getName()); + }); + if (mouseDown === true) { + return; + } + if (!self.isEnabled() || (self.isOnce() && self.isSelected())) { + return; + } + interval = setInterval(function () { + self.doClick(); + }, 100); + mouseDown = true; + ev(e); + }); + break; + default: + hand.mousedown(function (e) { + ev(e); + }); + hand.mouseup(function (e) { + ev(e); + }); + hand.click(clk); + break; + } + }); + //之后的300ms点击无效 var onClick = BI.debounce(this.doClick, BI.EVENT_RESPONSE_TIME, true); diff --git a/bi/widget.js b/bi/widget.js index 1a44714db..64a98ef1a 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -7055,6 +7055,7 @@ BI.FineTuningNumberEditor = BI.inherit(BI.Widget, { }); this.topBtn = BI.createWidget({ type: "bi.icon_button", + trigger: "lclick,", cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom" }); this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){ @@ -7063,6 +7064,7 @@ BI.FineTuningNumberEditor = BI.inherit(BI.Widget, { }); this.bottomBtn = BI.createWidget({ type: "bi.icon_button", + trigger: "lclick,", cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top" }); this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){ @@ -7105,7 +7107,7 @@ BI.FineTuningNumberEditor = BI.inherit(BI.Widget, { _finetuning: function(add){ var v = BI.parseInt(this._alertOutEditorValue(this.editor.getValue())); this.editor.setValue(this._alertInEditorValue(v + add)); - this.bottomBtn.setEnable((v + add) !== -1); + this.bottomBtn.setEnable((v + add) > -1); }, getValue: function () { diff --git a/docs/base.js b/docs/base.js index 82e71967e..ed5c38f49 100644 --- a/docs/base.js +++ b/docs/base.js @@ -685,95 +685,99 @@ BI.BasicButton = BI.inherit(BI.Single, { return; } hand = hand.element; - switch (o.trigger) { - case "mouseup": - var mouseDown = false; - hand.mousedown(function () { - mouseDown = true; - ev(e); - }); - hand.mouseup(function (e) { - if (mouseDown === true) { - clk(e); - } - mouseDown = false; - ev(e); - }); - break; - case "mousedown": - var mouseDown = false; - var selected = false; - hand.mousedown(function (e) { - // if (e.button === 0) { - $(document).bind("mouseup." + self.getName(), function (e) { - // if (e.button === 0) { - if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) { - self.setSelected(!self.isSelected()); - self._trigger(); + var triggerArr = (o.trigger || "").split(","); + BI.each(triggerArr, function (idx, trigger) { + switch (trigger) { + case "mouseup": + var mouseDown = false; + hand.mousedown(function () { + mouseDown = true; + ev(e); + }); + hand.mouseup(function (e) { + if (mouseDown === true) { + clk(e); } mouseDown = false; - $(document).unbind("mouseup." + self.getName()); + ev(e); + }); + break; + case "mousedown": + var mouseDown = false; + var selected = false; + hand.mousedown(function (e) { + // if (e.button === 0) { + $(document).bind("mouseup." + self.getName(), function (e) { + // if (e.button === 0) { + if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) { + self.setSelected(!self.isSelected()); + self._trigger(); + } + mouseDown = false; + $(document).unbind("mouseup." + self.getName()); + // } + }); + if (mouseDown === true) { + return; + } + if (self.isSelected()) { + selected = true; + } else { + clk(e); + } + mouseDown = true; + ev(e); // } }); - if (mouseDown === true) { - return; - } - if (self.isSelected()) { - selected = true; - } else { - clk(e); - } - mouseDown = true; - ev(e); - // } - }); - hand.mouseup(function (e) { - // if (e.button === 0) { - if (BI.DOM.isExist(self) && mouseDown === true && selected === true) { - clk(e); - } - mouseDown = false; - selected = false; - $(document).unbind("mouseup." + self.getName()); - // } - }); - break; - case "dblclick": - hand.dblclick(clk); - break; - case "lclick": - var mouseDown = false; - var interval; - hand.mousedown(function (e) { - $(document).bind("mouseup." + self.getName(), function (e) { - interval && clearInterval(interval); - interval = null; + hand.mouseup(function (e) { + // if (e.button === 0) { + if (BI.DOM.isExist(self) && mouseDown === true && selected === true) { + clk(e); + } mouseDown = false; + selected = false; $(document).unbind("mouseup." + self.getName()); + // } }); - if (mouseDown === true) { - return; - } - if (!self.isEnabled() || (self.isOnce() && self.isSelected())) { - return; - } - interval = setInterval(function () { - self.doClick(); - }, 100); - mouseDown = true; - ev(e); - }); - break; - default: - hand.mousedown(function (e) { - ev(e); - }); - hand.mouseup(function (e) { - ev(e); - }); - hand.click(clk); - break; - } + break; + case "dblclick": + hand.dblclick(clk); + break; + case "lclick": + var mouseDown = false; + var interval; + hand.mousedown(function (e) { + $(document).bind("mouseup." + self.getName(), function (e) { + interval && clearInterval(interval); + interval = null; + mouseDown = false; + $(document).unbind("mouseup." + self.getName()); + }); + if (mouseDown === true) { + return; + } + if (!self.isEnabled() || (self.isOnce() && self.isSelected())) { + return; + } + interval = setInterval(function () { + self.doClick(); + }, 100); + mouseDown = true; + ev(e); + }); + break; + default: + hand.mousedown(function (e) { + ev(e); + }); + hand.mouseup(function (e) { + ev(e); + }); + hand.click(clk); + break; + } + }); + //之后的300ms点击无效 var onClick = BI.debounce(this.doClick, BI.EVENT_RESPONSE_TIME, true); diff --git a/docs/widget.js b/docs/widget.js index 1a44714db..64a98ef1a 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -7055,6 +7055,7 @@ BI.FineTuningNumberEditor = BI.inherit(BI.Widget, { }); this.topBtn = BI.createWidget({ type: "bi.icon_button", + trigger: "lclick,", cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom" }); this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){ @@ -7063,6 +7064,7 @@ BI.FineTuningNumberEditor = BI.inherit(BI.Widget, { }); this.bottomBtn = BI.createWidget({ type: "bi.icon_button", + trigger: "lclick,", cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top" }); this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){ @@ -7105,7 +7107,7 @@ BI.FineTuningNumberEditor = BI.inherit(BI.Widget, { _finetuning: function(add){ var v = BI.parseInt(this._alertOutEditorValue(this.editor.getValue())); this.editor.setValue(this._alertInEditorValue(v + add)); - this.bottomBtn.setEnable((v + add) !== -1); + this.bottomBtn.setEnable((v + add) > -1); }, getValue: function () { diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index 1882bd2de..0b0a2055e 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -102,95 +102,99 @@ BI.BasicButton = BI.inherit(BI.Single, { return; } hand = hand.element; - switch (o.trigger) { - case "mouseup": - var mouseDown = false; - hand.mousedown(function () { - mouseDown = true; - ev(e); - }); - hand.mouseup(function (e) { - if (mouseDown === true) { - clk(e); - } - mouseDown = false; - ev(e); - }); - break; - case "mousedown": - var mouseDown = false; - var selected = false; - hand.mousedown(function (e) { - // if (e.button === 0) { - $(document).bind("mouseup." + self.getName(), function (e) { - // if (e.button === 0) { - if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) { - self.setSelected(!self.isSelected()); - self._trigger(); + var triggerArr = (o.trigger || "").split(","); + BI.each(triggerArr, function (idx, trigger) { + switch (trigger) { + case "mouseup": + var mouseDown = false; + hand.mousedown(function () { + mouseDown = true; + ev(e); + }); + hand.mouseup(function (e) { + if (mouseDown === true) { + clk(e); } mouseDown = false; - $(document).unbind("mouseup." + self.getName()); + ev(e); + }); + break; + case "mousedown": + var mouseDown = false; + var selected = false; + hand.mousedown(function (e) { + // if (e.button === 0) { + $(document).bind("mouseup." + self.getName(), function (e) { + // if (e.button === 0) { + if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) { + self.setSelected(!self.isSelected()); + self._trigger(); + } + mouseDown = false; + $(document).unbind("mouseup." + self.getName()); + // } + }); + if (mouseDown === true) { + return; + } + if (self.isSelected()) { + selected = true; + } else { + clk(e); + } + mouseDown = true; + ev(e); // } }); - if (mouseDown === true) { - return; - } - if (self.isSelected()) { - selected = true; - } else { - clk(e); - } - mouseDown = true; - ev(e); - // } - }); - hand.mouseup(function (e) { - // if (e.button === 0) { - if (BI.DOM.isExist(self) && mouseDown === true && selected === true) { - clk(e); - } - mouseDown = false; - selected = false; - $(document).unbind("mouseup." + self.getName()); - // } - }); - break; - case "dblclick": - hand.dblclick(clk); - break; - case "lclick": - var mouseDown = false; - var interval; - hand.mousedown(function (e) { - $(document).bind("mouseup." + self.getName(), function (e) { - interval && clearInterval(interval); - interval = null; + hand.mouseup(function (e) { + // if (e.button === 0) { + if (BI.DOM.isExist(self) && mouseDown === true && selected === true) { + clk(e); + } mouseDown = false; + selected = false; $(document).unbind("mouseup." + self.getName()); + // } }); - if (mouseDown === true) { - return; - } - if (!self.isEnabled() || (self.isOnce() && self.isSelected())) { - return; - } - interval = setInterval(function () { - self.doClick(); - }, 100); - mouseDown = true; - ev(e); - }); - break; - default: - hand.mousedown(function (e) { - ev(e); - }); - hand.mouseup(function (e) { - ev(e); - }); - hand.click(clk); - break; - } + break; + case "dblclick": + hand.dblclick(clk); + break; + case "lclick": + var mouseDown = false; + var interval; + hand.mousedown(function (e) { + $(document).bind("mouseup." + self.getName(), function (e) { + interval && clearInterval(interval); + interval = null; + mouseDown = false; + $(document).unbind("mouseup." + self.getName()); + }); + if (mouseDown === true) { + return; + } + if (!self.isEnabled() || (self.isOnce() && self.isSelected())) { + return; + } + interval = setInterval(function () { + self.doClick(); + }, 100); + mouseDown = true; + ev(e); + }); + break; + default: + hand.mousedown(function (e) { + ev(e); + }); + hand.mouseup(function (e) { + ev(e); + }); + hand.click(clk); + break; + } + }); + //之后的300ms点击无效 var onClick = BI.debounce(this.doClick, BI.EVENT_RESPONSE_TIME, true); diff --git a/src/widget/finetuningnumbereditor/finetuning.number.editor.js b/src/widget/finetuningnumbereditor/finetuning.number.editor.js index 4331684ad..f1832685d 100644 --- a/src/widget/finetuningnumbereditor/finetuning.number.editor.js +++ b/src/widget/finetuningnumbereditor/finetuning.number.editor.js @@ -27,6 +27,7 @@ BI.FineTuningNumberEditor = BI.inherit(BI.Widget, { }); this.topBtn = BI.createWidget({ type: "bi.icon_button", + trigger: "lclick,", cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom" }); this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){ @@ -35,6 +36,7 @@ BI.FineTuningNumberEditor = BI.inherit(BI.Widget, { }); this.bottomBtn = BI.createWidget({ type: "bi.icon_button", + trigger: "lclick,", cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top" }); this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){ @@ -77,7 +79,7 @@ BI.FineTuningNumberEditor = BI.inherit(BI.Widget, { _finetuning: function(add){ var v = BI.parseInt(this._alertOutEditorValue(this.editor.getValue())); this.editor.setValue(this._alertInEditorValue(v + add)); - this.bottomBtn.setEnable((v + add) !== -1); + this.bottomBtn.setEnable((v + add) > -1); }, getValue: function () { From e29a50a71d2d03ec65f6de8658cb80fb08d488de Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 25 Apr 2017 16:35:20 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bi/base.js | 8 ++++---- docs/base.js | 8 ++++---- src/base/pane.js | 8 ++++---- src/css/resource/font.css | 12 ++++++------ src/less/lib/colors.less | 12 +----------- src/less/lib/constant.less | 5 +---- src/less/resource/font.less | 8 ++++---- 7 files changed, 24 insertions(+), 37 deletions(-) diff --git a/bi/base.js b/bi/base.js index 82e71967e..5728fef8d 100644 --- a/bi/base.js +++ b/bi/base.js @@ -243,7 +243,7 @@ BI.Pane = BI.inherit(BI.Widget, { loading: function () { var self = this, o = this.options; if (o.overlap === true) { - if (!BI.Maskers.has(this.getName())) { + if (!BI.Layers.has(this.getName())) { BI.createWidget({ type: 'bi.vtape', items: [{ @@ -253,10 +253,10 @@ BI.Pane = BI.inherit(BI.Widget, { }, height: 30 }], - element: BI.Maskers.make(this.getName(), this) + element: BI.Layers.make(this.getName(), this) }); } - BI.Maskers.show(self.getName()); + BI.Layers.show(self.getName()); } else if (BI.isNull(this._loading)) { this._loading = BI.createWidget({ type: "bi.layout", @@ -279,7 +279,7 @@ BI.Pane = BI.inherit(BI.Widget, { loaded: function () { var self = this, o = this.options; - BI.Maskers.remove(self.getName()); + BI.Layers.remove(self.getName()); this._loading && this._loading.destroy(); this._loading && (this._loading = null); o.onLoaded(); diff --git a/docs/base.js b/docs/base.js index 82e71967e..5728fef8d 100644 --- a/docs/base.js +++ b/docs/base.js @@ -243,7 +243,7 @@ BI.Pane = BI.inherit(BI.Widget, { loading: function () { var self = this, o = this.options; if (o.overlap === true) { - if (!BI.Maskers.has(this.getName())) { + if (!BI.Layers.has(this.getName())) { BI.createWidget({ type: 'bi.vtape', items: [{ @@ -253,10 +253,10 @@ BI.Pane = BI.inherit(BI.Widget, { }, height: 30 }], - element: BI.Maskers.make(this.getName(), this) + element: BI.Layers.make(this.getName(), this) }); } - BI.Maskers.show(self.getName()); + BI.Layers.show(self.getName()); } else if (BI.isNull(this._loading)) { this._loading = BI.createWidget({ type: "bi.layout", @@ -279,7 +279,7 @@ BI.Pane = BI.inherit(BI.Widget, { loaded: function () { var self = this, o = this.options; - BI.Maskers.remove(self.getName()); + BI.Layers.remove(self.getName()); this._loading && this._loading.destroy(); this._loading && (this._loading = null); o.onLoaded(); diff --git a/src/base/pane.js b/src/base/pane.js index ca5677592..1ef5b7f29 100644 --- a/src/base/pane.js +++ b/src/base/pane.js @@ -42,7 +42,7 @@ BI.Pane = BI.inherit(BI.Widget, { loading: function () { var self = this, o = this.options; if (o.overlap === true) { - if (!BI.Maskers.has(this.getName())) { + if (!BI.Layers.has(this.getName())) { BI.createWidget({ type: 'bi.vtape', items: [{ @@ -52,10 +52,10 @@ BI.Pane = BI.inherit(BI.Widget, { }, height: 30 }], - element: BI.Maskers.make(this.getName(), this) + element: BI.Layers.make(this.getName(), this) }); } - BI.Maskers.show(self.getName()); + BI.Layers.show(self.getName()); } else if (BI.isNull(this._loading)) { this._loading = BI.createWidget({ type: "bi.layout", @@ -78,7 +78,7 @@ BI.Pane = BI.inherit(BI.Widget, { loaded: function () { var self = this, o = this.options; - BI.Maskers.remove(self.getName()); + BI.Layers.remove(self.getName()); this._loading && this._loading.destroy(); this._loading && (this._loading = null); o.onLoaded(); diff --git a/src/css/resource/font.css b/src/css/resource/font.css index b7944bb8d..ac9eeba8c 100644 --- a/src/css/resource/font.css +++ b/src/css/resource/font.css @@ -411,7 +411,7 @@ .dot-ha-font:focus .b-font:before, .dot-ha-font.hover .b-font:before { content: "\e606"; - color: #f4f4f4; + color: #999999; } .dot-ha-font:active .b-font:before, .dot-ha-font.active .b-font:before { @@ -431,7 +431,7 @@ .dot-e-font:focus .b-font:before, .dot-e-font.hover .b-font:before { content: "\e606"; - color: #f4f4f4; + color: #999999; } .dot-e-font.active .b-font:before { content: "\e606"; @@ -2242,12 +2242,12 @@ } .group-add-font .b-font:before { content: "\e649"; - color: #808080; + color: #999999; } .group-add-font.native .b-font:before, .group-add-font.disabled .b-font:before { content: "\e649"; - color: #808080; + color: #999999; } .sortable-font .b-font:before { content: "\e63b"; @@ -2642,7 +2642,7 @@ .data-link-check-font:focus .b-font:before, .data-link-check-font.hover .b-font:before { content: "\e611"; - color: #f4f4f4; + color: #999999; } .data-link-check-font:active .b-font:before, .data-link-check-font.active .b-font:before { @@ -2747,7 +2747,7 @@ .item-check-font:focus .b-font:before, .item-check-font.hover .b-font:before { content: "\e611"; - color: #f4f4f4; + color: #999999; } .item-check-font:active .b-font:before, .item-check-font.active .b-font:before { diff --git a/src/less/lib/colors.less b/src/less/lib/colors.less index f89590aec..578f333d3 100644 --- a/src/less/lib/colors.less +++ b/src/less/lib/colors.less @@ -41,10 +41,6 @@ @color-bi-background-black: @background-color-black; //深灰色背景 @color-bi-background-dark: @background-color-dark; -//浅灰色背景 -@color-bi-background-gray: @background-color-active; -//浅色背景 -@color-bi-background-light: @background-color-light; //灰化背景 @color-bi-background-disabled: @background-color-disabled; //成功背景色 @@ -71,10 +67,8 @@ //灰化分割线 @color-bi-split-disabled: @split-color-disabled; -//基本边框色 +//黑色边框色 @color-bi-border-black: @border-color-black; -//基本边框色 -@color-bi-border-normal: @border-color-normal; //默认边框色 @color-bi-border-default: @border-color-default; //outline颜色 @@ -115,10 +109,6 @@ //失败边框 @color-bi-tooltip-warning-border: @border-color-error; -//dashboard -@color-dashboard-toolbar-border: @border-color-main; -@color-dashboard-toolbar-font: @font-color-light-gray; - //dimension @color-dimension-background: @background-color-light-blue; @color-target-background: @background-color-light-green; diff --git a/src/less/lib/constant.less b/src/less/lib/constant.less index 50ae11399..9e9341b59 100644 --- a/src/less/lib/constant.less +++ b/src/less/lib/constant.less @@ -32,17 +32,15 @@ @font-color-orange: #fcc550; //font-icon color -@icon-color-normal: #808080; +@icon-color-normal: #999999; @icon-color-active: #3f8ce8; //background color @background-color-black: #1a1a1a;// -@background-color-light: #eaeaea; @background-color-default: #ffffff;// @background-color-default-theme-dark: #242640;// @background-color-normal: #eff1f4;// @background-color-normal-theme-dark: #191B2B;// -@background-color-active: #f4f4f4; @background-color-highlight: #3f8ce8; @background-color-dark: #d4dadd; @background-color-disabled: #c4c6c6; @@ -71,7 +69,6 @@ @border-color-normal: #d4dadd; @border-color-line: #d4dadd; @border-color-line-theme-dark: #525466; -@border-color-main: #d3d9dc; @border-color-outline: #3f8ce8; @border-color-highlight: #178cdf; @border-color-resize: #e85050; diff --git a/src/less/resource/font.less b/src/less/resource/font.less index 7f4580ef3..ad9bf4215 100644 --- a/src/less/resource/font.less +++ b/src/less/resource/font.less @@ -39,8 +39,8 @@ //子菜单选中 .font(dot-font, @font-dot, @color-bi-text-black); .font-hover(dot-h-font, @font-dot, @color-bi-text-black); -.font-hover-active(dot-ha-font, @font-dot, @color-bi-text, @color-bi-background-gray, @color-bi-text-black); -.font-effect(dot-e-font, @font-dot, @color-bi-text, @color-bi-background-gray, @color-bi-text-highlight, @color-bi-text-black); +.font-hover-active(dot-ha-font, @font-dot, @color-bi-text, @color-bi-text-gray, @color-bi-text-black); +.font-effect(dot-e-font, @font-dot, @color-bi-text, @color-bi-text-gray, @color-bi-text-highlight, @color-bi-text-black); //向右展开子菜单 .font(pull-right-font, @font-right-triangle); @@ -251,7 +251,7 @@ .font(add-new-table-pull-down-font, @font-down, @color-bi-text); -.font-hover-active(data-link-check-font, @font-check-mark, @color-bi-text, @color-bi-background-gray, @color-bi-text-highlight); +.font-hover-active(data-link-check-font, @font-check-mark, @color-bi-text, @color-bi-text-gray, @color-bi-text-highlight); //点击编辑 .font-hover(edit-set-font, @font-detail-set); @@ -264,7 +264,7 @@ .font-hover-active(folder-list-view, @font-classify, inherit, inherit, @color-bi-text); .font-hover-active(folder-card-view, @font-tile-view, inherit, inherit, @color-bi-text); -.font-hover-active(item-check-font, @font-check-mark, @color-bi-text, @color-bi-background-gray, @color-bi-font-active); +.font-hover-active(item-check-font, @font-check-mark, @color-bi-text, @color-bi-text-gray, @color-bi-font-active); //表格上面的相关操作——升序、降序、不排序、过滤 .font-hover(table-no-sort-no-filter-font, @font-no-sort-no-filter); From ad99d4e22a57950be48f6fac536b294bd0424385 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 25 Apr 2017 19:37:32 +0800 Subject: [PATCH 6/9] add --- bi/core.css | 12 ++++++------ docs/core.css | 12 ++++++------ docs/resource.css | 12 ++++++------ src/css/core/utils/common.css | 12 ++++++------ src/less/core/utils/common.less | 15 +++++++-------- 5 files changed, 31 insertions(+), 32 deletions(-) diff --git a/bi/core.css b/bi/core.css index 5ae82a56d..9d2ea4701 100644 --- a/bi/core.css +++ b/bi/core.css @@ -3043,6 +3043,10 @@ i { .bi-high-light { color: #3f8ce8; } +.bi-high-light-background { + background-color: #3f8ce8; + color: #ffffff; +} .bi-water-mark { color: #cccccc; cursor: text; @@ -3060,12 +3064,8 @@ i { background: #ffffff; } .bi-z-index-mask { - background-color: #1a1a1a; - opacity: 0.5; - filter: alpha(opacity=50); -} -.bi-theme-dark .bi-z-index-mask { - background-color: #ffffff; + background-color: rgba(26, 26, 26, 0.5); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7f1a1a1a,endColorstr=#7f1a1a1a); } .bi-list-item:hover, .bi-list-item.hover { diff --git a/docs/core.css b/docs/core.css index 5ae82a56d..9d2ea4701 100644 --- a/docs/core.css +++ b/docs/core.css @@ -3043,6 +3043,10 @@ i { .bi-high-light { color: #3f8ce8; } +.bi-high-light-background { + background-color: #3f8ce8; + color: #ffffff; +} .bi-water-mark { color: #cccccc; cursor: text; @@ -3060,12 +3064,8 @@ i { background: #ffffff; } .bi-z-index-mask { - background-color: #1a1a1a; - opacity: 0.5; - filter: alpha(opacity=50); -} -.bi-theme-dark .bi-z-index-mask { - background-color: #ffffff; + background-color: rgba(26, 26, 26, 0.5); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7f1a1a1a,endColorstr=#7f1a1a1a); } .bi-list-item:hover, .bi-list-item.hover { diff --git a/docs/resource.css b/docs/resource.css index f3b24fcc8..f147b4cd5 100644 --- a/docs/resource.css +++ b/docs/resource.css @@ -1025,7 +1025,7 @@ textarea::-webkit-scrollbar-thumb { .dot-ha-font:focus .b-font:before, .dot-ha-font.hover .b-font:before { content: "\e606"; - color: #f4f4f4; + color: #999999; } .dot-ha-font:active .b-font:before, .dot-ha-font.active .b-font:before { @@ -1045,7 +1045,7 @@ textarea::-webkit-scrollbar-thumb { .dot-e-font:focus .b-font:before, .dot-e-font.hover .b-font:before { content: "\e606"; - color: #f4f4f4; + color: #999999; } .dot-e-font.active .b-font:before { content: "\e606"; @@ -2856,12 +2856,12 @@ textarea::-webkit-scrollbar-thumb { } .group-add-font .b-font:before { content: "\e649"; - color: #808080; + color: #999999; } .group-add-font.native .b-font:before, .group-add-font.disabled .b-font:before { content: "\e649"; - color: #808080; + color: #999999; } .sortable-font .b-font:before { content: "\e63b"; @@ -3256,7 +3256,7 @@ textarea::-webkit-scrollbar-thumb { .data-link-check-font:focus .b-font:before, .data-link-check-font.hover .b-font:before { content: "\e611"; - color: #f4f4f4; + color: #999999; } .data-link-check-font:active .b-font:before, .data-link-check-font.active .b-font:before { @@ -3361,7 +3361,7 @@ textarea::-webkit-scrollbar-thumb { .item-check-font:focus .b-font:before, .item-check-font.hover .b-font:before { content: "\e611"; - color: #f4f4f4; + color: #999999; } .item-check-font:active .b-font:before, .item-check-font.active .b-font:before { diff --git a/src/css/core/utils/common.css b/src/css/core/utils/common.css index 331bbec99..028c37ac3 100644 --- a/src/css/core/utils/common.css +++ b/src/css/core/utils/common.css @@ -90,6 +90,10 @@ .bi-high-light { color: #3f8ce8; } +.bi-high-light-background { + background-color: #3f8ce8; + color: #ffffff; +} .bi-water-mark { color: #cccccc; cursor: text; @@ -107,12 +111,8 @@ background: #ffffff; } .bi-z-index-mask { - background-color: #1a1a1a; - opacity: 0.5; - filter: alpha(opacity=50); -} -.bi-theme-dark .bi-z-index-mask { - background-color: #ffffff; + background-color: rgba(26, 26, 26, 0.5); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7f1a1a1a,endColorstr=#7f1a1a1a); } .bi-list-item:hover, .bi-list-item.hover { diff --git a/src/less/core/utils/common.less b/src/less/core/utils/common.less index 231eb9603..4f9c766a9 100644 --- a/src/less/core/utils/common.less +++ b/src/less/core/utils/common.less @@ -127,6 +127,11 @@ color: @color-bi-text-highlight; } +.bi-high-light-background { + background-color: @color-bi-background-highlight; + color: @color-bi-text; +} + //水印 .bi-water-mark { color: @water-mark-color; @@ -153,14 +158,8 @@ } .bi-z-index-mask { - background-color: @color-bi-background-black; - .opacity(0.5); -} - -.bi-theme-dark { - .bi-z-index-mask { - background-color: @color-bi-background-default; - } + background-color: rgba(26, 26, 26, .5); + filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr=#7f1a1a1a,endColorstr=#7f1a1a1a)"; } //只有背景变化 From 314111141d8399f39eb562384a7422c7f72e8044 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 26 Apr 2017 09:49:42 +0800 Subject: [PATCH 7/9] add --- bi/core.css | 3 +++ docs/core.css | 3 +++ src/css/core/utils/common.css | 3 +++ src/less/core/utils/common.less | 4 ++++ 4 files changed, 13 insertions(+) diff --git a/bi/core.css b/bi/core.css index 9d2ea4701..88b55286d 100644 --- a/bi/core.css +++ b/bi/core.css @@ -3040,6 +3040,9 @@ i { .bi-keyword-red-mark { color: #f07d0a; } +.bi-white { + color: #ffffff; +} .bi-high-light { color: #3f8ce8; } diff --git a/docs/core.css b/docs/core.css index 9d2ea4701..88b55286d 100644 --- a/docs/core.css +++ b/docs/core.css @@ -3040,6 +3040,9 @@ i { .bi-keyword-red-mark { color: #f07d0a; } +.bi-white { + color: #ffffff; +} .bi-high-light { color: #3f8ce8; } diff --git a/src/css/core/utils/common.css b/src/css/core/utils/common.css index 028c37ac3..130827b72 100644 --- a/src/css/core/utils/common.css +++ b/src/css/core/utils/common.css @@ -87,6 +87,9 @@ .bi-keyword-red-mark { color: #f07d0a; } +.bi-white { + color: #ffffff; +} .bi-high-light { color: #3f8ce8; } diff --git a/src/less/core/utils/common.less b/src/less/core/utils/common.less index 4f9c766a9..90fd903d6 100644 --- a/src/less/core/utils/common.less +++ b/src/less/core/utils/common.less @@ -122,6 +122,10 @@ color: @color-bi-text-redmark; } +.bi-white { + color: @color-bi-text; +} + //高亮 .bi-high-light { color: @color-bi-text-highlight; From 561bdc38983c1ace9a06583683731c289ac92ded Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 26 Apr 2017 09:53:42 +0800 Subject: [PATCH 8/9] add --- src/css/core/utils/common.css | 3 --- src/less/core/utils/common.less | 4 ---- 2 files changed, 7 deletions(-) diff --git a/src/css/core/utils/common.css b/src/css/core/utils/common.css index 130827b72..028c37ac3 100644 --- a/src/css/core/utils/common.css +++ b/src/css/core/utils/common.css @@ -87,9 +87,6 @@ .bi-keyword-red-mark { color: #f07d0a; } -.bi-white { - color: #ffffff; -} .bi-high-light { color: #3f8ce8; } diff --git a/src/less/core/utils/common.less b/src/less/core/utils/common.less index 90fd903d6..4f9c766a9 100644 --- a/src/less/core/utils/common.less +++ b/src/less/core/utils/common.less @@ -122,10 +122,6 @@ color: @color-bi-text-redmark; } -.bi-white { - color: @color-bi-text; -} - //高亮 .bi-high-light { color: @color-bi-text-highlight; From b9642b29e5c17db2ef634d93081bcd6f524591cb Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 26 Apr 2017 14:01:30 +0800 Subject: [PATCH 9/9] add --- bi/case.js | 45 ++++++++++--------- bi/core.css | 3 -- bi/widget.js | 32 +++++++------ docs/case.js | 45 ++++++++++--------- docs/core.css | 3 -- docs/widget.js | 32 +++++++------ .../table/table.dynamicsummarylayertree.js | 23 +++++----- src/case/table/table.layertree.js | 22 ++++----- .../sequencetable/listnumber.sequencetable.js | 16 ++++--- .../sequencetable/treenumber.sequencetable.js | 16 ++++--- 10 files changed, 129 insertions(+), 108 deletions(-) diff --git a/bi/case.js b/bi/case.js index 12dde9b59..41a27538c 100644 --- a/bi/case.js +++ b/bi/case.js @@ -9106,6 +9106,9 @@ BI.DynamicSummaryLayerTreeTable = BI.inherit(BI.Widget, { regionColumnSize: [], + //行表头 + rowHeaderCreator: null, + headerCellStyleGetter: BI.emptyFn, summaryCellStyleGetter: BI.emptyFn, sequenceCellStyleGetter: BI.emptyFn, @@ -9142,17 +9145,17 @@ BI.DynamicSummaryLayerTreeTable = BI.inherit(BI.Widget, { var newHeader = this._formatColumns(header); var deep = this._getHDeep(); if (deep <= 0) { - newHeader.unshift({ - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }); + newHeader.unshift(o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }); } else { - newHeader[0] = { - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }; + newHeader[0] = o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }; } result.push(newHeader); } @@ -9796,6 +9799,8 @@ BI.LayerTreeTable = BI.inherit(BI.Widget, { regionColumnSize: [], + rowHeaderCreator: null, + headerCellStyleGetter: BI.emptyFn, summaryCellStyleGetter: BI.emptyFn, sequenceCellStyleGetter: BI.emptyFn, @@ -9831,17 +9836,17 @@ BI.LayerTreeTable = BI.inherit(BI.Widget, { var newHeader = this._formatColumns(header); var deep = this._getHDeep(); if (deep <= 0) { - newHeader.unshift({ - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }); + newHeader.unshift(o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }); } else { - newHeader[0] = { - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }; + newHeader[0] = o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }; } result.push(newHeader); } diff --git a/bi/core.css b/bi/core.css index 88b55286d..9d2ea4701 100644 --- a/bi/core.css +++ b/bi/core.css @@ -3040,9 +3040,6 @@ i { .bi-keyword-red-mark { color: #f07d0a; } -.bi-white { - color: #ffffff; -} .bi-high-light { color: #3f8ce8; } diff --git a/bi/widget.js b/bi/widget.js index 64a98ef1a..0bcb9fec0 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -15,6 +15,8 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { headerRowSize: 25, rowSize: 25, + sequenceHeaderCreator: null, + header: [], items: [], //二维数组 @@ -33,12 +35,12 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget({ - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); + this.header = BI.createWidget(o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell bi-border", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -320,7 +322,7 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { task.apply(self); }); this.tasks = []; - this.header.populate(); + this.header.populate && this.header.populate(); this._layout(); this._calculateChildrenToRender(); }, @@ -15724,6 +15726,8 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { headerRowSize: 25, rowSize: 25, + sequenceHeaderCreator: null, + header: [], items: [], //二维数组 @@ -15742,12 +15746,12 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget({ - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); + this.header = BI.createWidget(o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell bi-border", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -15866,7 +15870,7 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { }, _populate: function () { - this.header.populate(); + this.header.populate && this.header.populate(); this._layout(); this._calculateChildrenToRender(); }, diff --git a/docs/case.js b/docs/case.js index 12dde9b59..41a27538c 100644 --- a/docs/case.js +++ b/docs/case.js @@ -9106,6 +9106,9 @@ BI.DynamicSummaryLayerTreeTable = BI.inherit(BI.Widget, { regionColumnSize: [], + //行表头 + rowHeaderCreator: null, + headerCellStyleGetter: BI.emptyFn, summaryCellStyleGetter: BI.emptyFn, sequenceCellStyleGetter: BI.emptyFn, @@ -9142,17 +9145,17 @@ BI.DynamicSummaryLayerTreeTable = BI.inherit(BI.Widget, { var newHeader = this._formatColumns(header); var deep = this._getHDeep(); if (deep <= 0) { - newHeader.unshift({ - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }); + newHeader.unshift(o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }); } else { - newHeader[0] = { - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }; + newHeader[0] = o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }; } result.push(newHeader); } @@ -9796,6 +9799,8 @@ BI.LayerTreeTable = BI.inherit(BI.Widget, { regionColumnSize: [], + rowHeaderCreator: null, + headerCellStyleGetter: BI.emptyFn, summaryCellStyleGetter: BI.emptyFn, sequenceCellStyleGetter: BI.emptyFn, @@ -9831,17 +9836,17 @@ BI.LayerTreeTable = BI.inherit(BI.Widget, { var newHeader = this._formatColumns(header); var deep = this._getHDeep(); if (deep <= 0) { - newHeader.unshift({ - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }); + newHeader.unshift(o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }); } else { - newHeader[0] = { - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }; + newHeader[0] = o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }; } result.push(newHeader); } diff --git a/docs/core.css b/docs/core.css index 88b55286d..9d2ea4701 100644 --- a/docs/core.css +++ b/docs/core.css @@ -3040,9 +3040,6 @@ i { .bi-keyword-red-mark { color: #f07d0a; } -.bi-white { - color: #ffffff; -} .bi-high-light { color: #3f8ce8; } diff --git a/docs/widget.js b/docs/widget.js index 64a98ef1a..0bcb9fec0 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -15,6 +15,8 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { headerRowSize: 25, rowSize: 25, + sequenceHeaderCreator: null, + header: [], items: [], //二维数组 @@ -33,12 +35,12 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget({ - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); + this.header = BI.createWidget(o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell bi-border", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -320,7 +322,7 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { task.apply(self); }); this.tasks = []; - this.header.populate(); + this.header.populate && this.header.populate(); this._layout(); this._calculateChildrenToRender(); }, @@ -15724,6 +15726,8 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { headerRowSize: 25, rowSize: 25, + sequenceHeaderCreator: null, + header: [], items: [], //二维数组 @@ -15742,12 +15746,12 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget({ - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); + this.header = BI.createWidget(o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell bi-border", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -15866,7 +15870,7 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { }, _populate: function () { - this.header.populate(); + this.header.populate && this.header.populate(); this._layout(); this._calculateChildrenToRender(); }, diff --git a/src/case/table/table.dynamicsummarylayertree.js b/src/case/table/table.dynamicsummarylayertree.js index 79794c80a..15e708349 100644 --- a/src/case/table/table.dynamicsummarylayertree.js +++ b/src/case/table/table.dynamicsummarylayertree.js @@ -33,6 +33,9 @@ BI.DynamicSummaryLayerTreeTable = BI.inherit(BI.Widget, { regionColumnSize: [], + //行表头 + rowHeaderCreator: null, + headerCellStyleGetter: BI.emptyFn, summaryCellStyleGetter: BI.emptyFn, sequenceCellStyleGetter: BI.emptyFn, @@ -69,17 +72,17 @@ BI.DynamicSummaryLayerTreeTable = BI.inherit(BI.Widget, { var newHeader = this._formatColumns(header); var deep = this._getHDeep(); if (deep <= 0) { - newHeader.unshift({ - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }); + newHeader.unshift(o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }); } else { - newHeader[0] = { - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }; + newHeader[0] = o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }; } result.push(newHeader); } diff --git a/src/case/table/table.layertree.js b/src/case/table/table.layertree.js index 565969c5a..568f83240 100644 --- a/src/case/table/table.layertree.js +++ b/src/case/table/table.layertree.js @@ -33,6 +33,8 @@ BI.LayerTreeTable = BI.inherit(BI.Widget, { regionColumnSize: [], + rowHeaderCreator: null, + headerCellStyleGetter: BI.emptyFn, summaryCellStyleGetter: BI.emptyFn, sequenceCellStyleGetter: BI.emptyFn, @@ -68,17 +70,17 @@ BI.LayerTreeTable = BI.inherit(BI.Widget, { var newHeader = this._formatColumns(header); var deep = this._getHDeep(); if (deep <= 0) { - newHeader.unshift({ - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }); + newHeader.unshift(o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }); } else { - newHeader[0] = { - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }; + newHeader[0] = o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }; } result.push(newHeader); } diff --git a/src/widget/sequencetable/listnumber.sequencetable.js b/src/widget/sequencetable/listnumber.sequencetable.js index ea4e53547..fb8c57eb4 100644 --- a/src/widget/sequencetable/listnumber.sequencetable.js +++ b/src/widget/sequencetable/listnumber.sequencetable.js @@ -15,6 +15,8 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { headerRowSize: 25, rowSize: 25, + sequenceHeaderCreator: null, + header: [], items: [], //二维数组 @@ -33,12 +35,12 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget({ - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); + this.header = BI.createWidget(o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell bi-border", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -157,7 +159,7 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { }, _populate: function () { - this.header.populate(); + this.header.populate && this.header.populate(); this._layout(); this._calculateChildrenToRender(); }, diff --git a/src/widget/sequencetable/treenumber.sequencetable.js b/src/widget/sequencetable/treenumber.sequencetable.js index a5800f847..9de53c08c 100644 --- a/src/widget/sequencetable/treenumber.sequencetable.js +++ b/src/widget/sequencetable/treenumber.sequencetable.js @@ -15,6 +15,8 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { headerRowSize: 25, rowSize: 25, + sequenceHeaderCreator: null, + header: [], items: [], //二维数组 @@ -33,12 +35,12 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget({ - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); + this.header = BI.createWidget(o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell bi-border", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -320,7 +322,7 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { task.apply(self); }); this.tasks = []; - this.header.populate(); + this.header.populate && this.header.populate(); this._layout(); this._calculateChildrenToRender(); },