Browse Source

Merge pull request #35 in FUI/fineui from ~GUY/fineui:master to master

* commit 'b9642b29e5c17db2ef634d93081bcd6f524591cb':
  add
  add
  add
  add
  全局样式
  长按button
  add
  add
  update
es6
guy 8 years ago
parent
commit
a0cbdac556
  1. 157
      bi/base.js
  2. 45
      bi/case.js
  3. 61
      bi/core.css
  4. 98
      bi/core.js
  5. 36
      bi/widget.js
  6. 157
      docs/base.js
  7. 45
      docs/case.js
  8. 61
      docs/core.css
  9. 98
      docs/core.js
  10. 12
      docs/resource.css
  11. 36
      docs/widget.js
  12. 2
      src/base/combination/group.combo.js
  13. 8
      src/base/pane.js
  14. 147
      src/base/single/button/button.basic.js
  15. 23
      src/case/table/table.dynamicsummarylayertree.js
  16. 22
      src/case/table/table.layertree.js
  17. 98
      src/core/proto/date.js
  18. 61
      src/css/core/utils/common.css
  19. 12
      src/css/resource/font.css
  20. 70
      src/less/core/utils/common.less
  21. 12
      src/less/lib/colors.less
  22. 5
      src/less/lib/constant.less
  23. 8
      src/less/resource/font.less
  24. 4
      src/widget/finetuningnumbereditor/finetuning.number.editor.js
  25. 16
      src/widget/sequencetable/listnumber.sequencetable.js
  26. 16
      src/widget/sequencetable/treenumber.sequencetable.js

157
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();
@ -685,72 +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) {
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;
ev(e);
});
break;
case "mousedown":
var mouseDown = false;
var selected = false;
hand.mousedown(function (e) {
// if (e.button === 0) {
if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) {
self.setSelected(!self.isSelected());
self._trigger();
$(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);
// }
});
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.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;
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);
@ -3453,7 +3480,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",

45
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);
}

61
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 {
@ -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;

98
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()) &&

36
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();
},
@ -7055,6 +7057,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 +7066,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 +7109,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 () {
@ -15722,6 +15726,8 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
headerRowSize: 25,
rowSize: 25,
sequenceHeaderCreator: null,
header: [],
items: [], //二维数组
@ -15740,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,
@ -15864,7 +15870,7 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
},
_populate: function () {
this.header.populate();
this.header.populate && this.header.populate();
this._layout();
this._calculateChildrenToRender();
},

157
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();
@ -685,72 +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) {
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;
ev(e);
});
break;
case "mousedown":
var mouseDown = false;
var selected = false;
hand.mousedown(function (e) {
// if (e.button === 0) {
if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) {
self.setSelected(!self.isSelected());
self._trigger();
$(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);
// }
});
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.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;
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);
@ -3453,7 +3480,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",

45
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);
}

61
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 {
@ -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;

98
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()) &&

12
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 {

36
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();
},
@ -7055,6 +7057,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 +7066,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 +7109,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 () {
@ -15722,6 +15726,8 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
headerRowSize: 25,
rowSize: 25,
sequenceHeaderCreator: null,
header: [],
items: [], //二维数组
@ -15740,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,
@ -15864,7 +15870,7 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
},
_populate: function () {
this.header.populate();
this.header.populate && this.header.populate();
this._layout();
this._calculateChildrenToRender();
},

2
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",

8
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();

147
src/base/single/button/button.basic.js

@ -102,72 +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) {
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;
ev(e);
});
break;
case "mousedown":
var mouseDown = false;
var selected = false;
hand.mousedown(function (e) {
// if (e.button === 0) {
if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) {
self.setSelected(!self.isSelected());
self._trigger();
$(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);
// }
});
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.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;
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);

23
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);
}

22
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);
}

98
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()) &&

61
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 {
@ -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;
}

12
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 {

70
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)";
}
//只有背景变化
@ -267,41 +266,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 +359,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 +378,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;
}
}
}
}
}

12
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;

5
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;

8
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);

4
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 () {

16
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();
},

16
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();
},

Loading…
Cancel
Save