guy
7 years ago
11 changed files with 601 additions and 150 deletions
@ -0,0 +1,47 @@
|
||||
/** |
||||
* Created by roy on 16/5/23. |
||||
*/ |
||||
BI.DetailTableCell = BI.inherit(BI.Widget, { |
||||
|
||||
_defaultConfig: function () { |
||||
return BI.extend(BI.DetailTableCell.superclass._defaultConfig.apply(this, arguments), { |
||||
baseCls: "bi-detail-table-cell", |
||||
dId: "", |
||||
text: "" |
||||
}) |
||||
}, |
||||
|
||||
_init: function () { |
||||
BI.DetailTableCell.superclass._init.apply(this, arguments); |
||||
this._createItem(); |
||||
}, |
||||
|
||||
_createItem: function () { |
||||
var self = this, o = this.options; |
||||
var type = this.options.dimensionType; |
||||
var item = BI.createWidget({ |
||||
type: "bi.label", |
||||
height: o.height, |
||||
text: o.text, |
||||
title: o.text, |
||||
lgap: 5, |
||||
rgap: 5 |
||||
}); |
||||
|
||||
if (BI.isNotEmptyString(o.color)) { |
||||
this.element.css("color", o.color); |
||||
} |
||||
|
||||
BI.createWidget({ |
||||
type: "bi.vertical", |
||||
element: this, |
||||
items: [item] |
||||
}) |
||||
|
||||
//表格样式
|
||||
if (BI.isNotNull(o.styles) && BI.isObject(o.styles)) { |
||||
this.element.css(o.styles); |
||||
} |
||||
}, |
||||
}); |
||||
BI.shortcut("bi.detail_table_cell", BI.DetailTableCell); |
@ -0,0 +1,98 @@
|
||||
Demo.Face = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "demo-face" |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this; |
||||
return { |
||||
type: "bi.absolute", |
||||
items: [{ |
||||
el: { |
||||
type: "bi.sequence_table", |
||||
ref: function () { |
||||
self.table = this; |
||||
}, |
||||
isNeedFreeze: null, |
||||
isNeedMerge: false, |
||||
summaryCellStyleGetter: function (isLast) { |
||||
return { |
||||
background: "rgb(4, 177, 194)", |
||||
color: "#ffffff", |
||||
fontWeight: "bold" |
||||
}; |
||||
}, |
||||
sequenceCellStyleGetter: function (index) { |
||||
return { |
||||
background: "rgb(4, 177, 194)", |
||||
color: "#ffffff", |
||||
fontWeight: "bold" |
||||
}; |
||||
}, |
||||
headerCellStyleGetter: function () { |
||||
return { |
||||
background: "rgb(4, 177, 194)", |
||||
color: "#ffffff", |
||||
fontWeight: "bold" |
||||
}; |
||||
}, |
||||
el: { |
||||
type: "bi.adaptive_table", |
||||
el: { |
||||
type: "bi.resizable_table", |
||||
el: { |
||||
type: "bi.grid_table" |
||||
} |
||||
} |
||||
}, |
||||
sequence: { |
||||
type: "bi.sequence_table_list_number", |
||||
pageSize: 100, |
||||
sequenceHeaderCreator: { |
||||
type: "bi.normal_sequence_header_cell", |
||||
styleGetter: function () { |
||||
return { |
||||
background: "rgb(4, 177, 194)", |
||||
color: "#ffffff", |
||||
fontWeight: "bold" |
||||
}; |
||||
} |
||||
} |
||||
}, |
||||
itemsCreator: function (op, populate) { |
||||
} |
||||
}, |
||||
left: 0, |
||||
right: 0, |
||||
top: 0, |
||||
bottom: 0 |
||||
}] |
||||
} |
||||
}, |
||||
|
||||
mounted: function () { |
||||
var self = this; |
||||
this._resizeHandler = BI.debounce(function () { |
||||
var width = self.element.width(), height = self.element.height(); |
||||
if (self.table.getWidth() !== width || self.table.getHeight() !== height) { |
||||
self.table.setWidth(width); |
||||
self.table.setHeight(height); |
||||
self.table.populate(); |
||||
} |
||||
}, 0); |
||||
BI.ResizeDetector.addResizeListener(this, function () { |
||||
self._resizeHandler(); |
||||
}); |
||||
this.table.setWidth(this.element.width()); |
||||
this.table.setHeight(this.element.height()); |
||||
this.table.attr("columnSize", BI.makeArray(26, "")); |
||||
this.table.attr("minColumnSize", BI.makeArray(26, 80)); |
||||
this.table.attr("isNeedFreeze", true); |
||||
this.table.attr("freezeCols", []); |
||||
this.table.attr("showSequence", true); |
||||
this.table.attr("headerRowSize", 25); |
||||
this.table.attr("rowSize", 25); |
||||
this.table.populate(TABLE_ITEMS, TABLE_HEADER); |
||||
} |
||||
}); |
||||
BI.shortcut("demo.large_table", Demo.Face); |
@ -0,0 +1,38 @@
|
||||
/** |
||||
* Created by Young's on 2016/4/15. |
||||
*/ |
||||
BI.DetailTableHeader = BI.inherit(BI.Widget, { |
||||
_defaultConfig: function () { |
||||
return BI.extend(BI.DetailTableHeader.superclass._defaultConfig.apply(this, arguments), { |
||||
baseCls: "bi-detail-table-header" |
||||
}) |
||||
}, |
||||
|
||||
_init: function () { |
||||
BI.DetailTableHeader.superclass._init.apply(this, arguments); |
||||
var self = this, o = this.options; |
||||
var dId = o.dId; |
||||
var name = o.text; |
||||
BI.createWidget({ |
||||
type: "bi.htape", |
||||
element: this, |
||||
items: [{ |
||||
el: { |
||||
type: "bi.label", |
||||
text: name, |
||||
title: name, |
||||
whiteSpace: "nowrap", |
||||
textAlign: "center", |
||||
lgap: 5, |
||||
height: o.height |
||||
} |
||||
}] |
||||
}); |
||||
|
||||
//表格样式
|
||||
if (BI.isNotNull(o.styles) && BI.isObject(o.styles)) { |
||||
this.element.css(o.styles); |
||||
} |
||||
}, |
||||
}); |
||||
BI.shortcut("bi.detail_table_header", BI.DetailTableHeader); |
@ -0,0 +1,39 @@
|
||||
/** |
||||
* created by young |
||||
* 默认风格表格——表头 |
||||
*/ |
||||
BI.NormalSequenceHeaderCell = BI.inherit(BI.Widget, { |
||||
_defaultConfig: function () { |
||||
return BI.extend(BI.NormalSequenceHeaderCell.superclass._defaultConfig.apply(this, arguments), { |
||||
baseCls: "bi-normal-sequence-header-cell", |
||||
}) |
||||
}, |
||||
|
||||
_init: function () { |
||||
BI.NormalSequenceHeaderCell.superclass._init.apply(this, arguments); |
||||
var self = this, o = this.options; |
||||
this.text = BI.createWidget({ |
||||
type: "bi.label", |
||||
element: this, |
||||
textAlign: "left", |
||||
forceCenter: true, |
||||
hgap: 5, |
||||
text: BI.i18nText("BI-Number_Index") |
||||
}); |
||||
this._digestStyle(); |
||||
}, |
||||
|
||||
_digestStyle: function () { |
||||
var o = this.options; |
||||
var style = o.styleGetter(); |
||||
if (style) { |
||||
this.element.css(style); |
||||
} |
||||
}, |
||||
|
||||
populate: function () { |
||||
this._digestStyle(); |
||||
} |
||||
}); |
||||
BI.NormalSequenceHeaderCell.EVENT_CHANGE = "EVENT_CHANGE"; |
||||
BI.shortcut("bi.normal_sequence_header_cell", BI.NormalSequenceHeaderCell); |
File diff suppressed because one or more lines are too long
@ -0,0 +1,12 @@
|
||||
Demo.CATEGORY_CONFIG = [{ |
||||
id: 100000, |
||||
text: "专题" |
||||
}, { |
||||
pId: 100000, |
||||
text: "自定义一棵树", |
||||
value: "demo.platform_level_tree" |
||||
}, { |
||||
pId: 100000, |
||||
text: "大表格", |
||||
value: "demo.large_table" |
||||
}]; |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue