Browse Source

update

master
guy 7 years ago
parent
commit
54c48a5fb9
  1. 2
      demo/config.js
  2. 0
      demo/js/category/customATree/demo.multilayerselecttree.leveltree.js
  3. 47
      demo/js/category/largeTable/cell.js
  4. 98
      demo/js/category/largeTable/face.js
  5. 38
      demo/js/category/largeTable/header.js
  6. 39
      demo/js/category/largeTable/sequenceheadercell.normal.js
  7. 2
      demo/js/category/largeTable/table.js
  8. 8
      demo/js/config/addons.js
  9. 12
      demo/js/config/category.js
  10. 70
      dist/bundle.min.js
  11. 435
      dist/demo.js

2
demo/config.js

@ -1,4 +1,4 @@
Demo.CONFIG = Demo.CORE_CONFIG.concat(Demo.BASE_CONFIG).concat(Demo.CASE_CONFIG).concat(Demo.WIDGET_CONFIG).concat(Demo.COMPONENT_CONFIG).concat(Demo.ADDONS_CONFIG); Demo.CONFIG = Demo.CORE_CONFIG.concat(Demo.BASE_CONFIG).concat(Demo.CASE_CONFIG).concat(Demo.WIDGET_CONFIG).concat(Demo.COMPONENT_CONFIG).concat(Demo.ADDONS_CONFIG).concat(Demo.CATEGORY_CONFIG);
Demo.CONSTANTS = { Demo.CONSTANTS = {
SIMPLE_ITEMS: BI.map("柳州市城贸金属材料有限责任公司 柳州市建福房屋租赁有限公司 柳州市迅昌数码办公设备有限责任公司 柳州市河海贸易有限责任公司 柳州市花篮制衣厂 柳州市兴溪物资有限公司 柳州市针织总厂 柳州市衡管物资有限公司 柳州市琪成机电设备有限公司 柳州市松林工程机械修理厂".match(/[^\s]+/g), function (i, v) { SIMPLE_ITEMS: BI.map("柳州市城贸金属材料有限责任公司 柳州市建福房屋租赁有限公司 柳州市迅昌数码办公设备有限责任公司 柳州市河海贸易有限责任公司 柳州市花篮制衣厂 柳州市兴溪物资有限公司 柳州市针织总厂 柳州市衡管物资有限公司 柳州市琪成机电设备有限公司 柳州市松林工程机械修理厂".match(/[^\s]+/g), function (i, v) {

0
demo/js/component/demo.multilayerselecttree.leveltree.js → demo/js/category/customATree/demo.multilayerselecttree.leveltree.js

47
demo/js/category/largeTable/cell.js

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

98
demo/js/category/largeTable/face.js

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

38
demo/js/category/largeTable/header.js

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

39
demo/js/category/largeTable/sequenceheadercell.normal.js

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

2
demo/js/category/largeTable/table.js

File diff suppressed because one or more lines are too long

8
demo/js/config/addons.js

@ -14,12 +14,4 @@ Demo.ADDONS_CONFIG = [{
id: 602, id: 602,
text: "滚动sliders", text: "滚动sliders",
value: "demo.slider" value: "demo.slider"
}, {
id: 100000,
text: "小demo",
value: "demo.platform_level_tree"
}, {
pId: 100000,
text: "平台用",
value: "demo.platform_level_tree"
}]; }];

12
demo/js/config/category.js

@ -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"
}];

70
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

435
dist/demo.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save