forked from fanruan/fineui
Browse Source
* commit '851412078441c8fd1faa70aa0916d2764430a881': add add add add add init 整理 FineUI 2.0 init addes6
guy
8 years ago
193 changed files with 1053 additions and 86453 deletions
@ -1,2 +1,5 @@
|
||||
node_modules/ |
||||
/.idea/ |
||||
/.idea/ |
||||
dist |
||||
demo.js |
||||
demo.css |
@ -0,0 +1,12 @@
|
||||
$(function () { |
||||
var ref; |
||||
BI.createWidget({ |
||||
type: "demo.main", |
||||
ref: function (_ref) { |
||||
console.log(_ref); |
||||
ref = _ref; |
||||
}, |
||||
element: '#wrapper' |
||||
}); |
||||
// ref.destroy();
|
||||
}); |
@ -0,0 +1,3 @@
|
||||
.demo-main .bg1 { |
||||
background-color: #178cdf; |
||||
} |
@ -0,0 +1,61 @@
|
||||
Demo.Center = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "demo-center" |
||||
}, |
||||
beforeCreate: function () { |
||||
console.log("beforeCreate"); |
||||
}, |
||||
render: function () { |
||||
return { |
||||
type: "bi.vertical", |
||||
hgap: 50, |
||||
vgap: 20, |
||||
items: [{ |
||||
type: "bi.label", |
||||
text: "栅格布局", |
||||
height: 50 |
||||
}, { |
||||
type: "bi.lattice", |
||||
columnSize: [0.1, 0.1, 0.3, 0.4, 0.1], |
||||
items: [{ |
||||
type: "bi.label", |
||||
height: 30, |
||||
text: "Left-1", |
||||
cls: "layout-bg1 lattice-item", |
||||
hgap: 20 |
||||
}, { |
||||
type: "bi.label", |
||||
height: 30, |
||||
text: "Left-2", |
||||
cls: "layout-bg2 lattice-item", |
||||
hgap: 20 |
||||
}, { |
||||
type: "bi.label", |
||||
height: 30, |
||||
text: "Left-3", |
||||
cls: "layout-bg3 lattice-item", |
||||
hgap: 20 |
||||
}, { |
||||
type: "bi.label", |
||||
height: 30, |
||||
text: "Left-4", |
||||
cls: "layout-bg4 lattice-item", |
||||
hgap: 20 |
||||
}, { |
||||
type: "bi.label", |
||||
height: 30, |
||||
text: "Left-5", |
||||
cls: "layout-bg5 lattice-item", |
||||
hgap: 20 |
||||
}] |
||||
}] |
||||
} |
||||
}, |
||||
created: function () { |
||||
console.log("created"); |
||||
}, |
||||
mounted: function () { |
||||
console.log("mounted"); |
||||
} |
||||
}); |
||||
$.shortcut("demo.center", Demo.Center); |
@ -0,0 +1,30 @@
|
||||
Demo.Main = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "demo-main" |
||||
}, |
||||
render: function () { |
||||
return { |
||||
type: "bi.border", |
||||
items: { |
||||
north: { |
||||
height: 50, |
||||
el: { |
||||
type: "demo.north" |
||||
} |
||||
}, |
||||
west: { |
||||
width: 230, |
||||
el: { |
||||
type: "demo.west" |
||||
} |
||||
}, |
||||
center: { |
||||
el: { |
||||
type: "demo.center", |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
$.shortcut("demo.main", Demo.Main); |
@ -0,0 +1,9 @@
|
||||
Demo.North = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "demo-north" |
||||
}, |
||||
render: function () { |
||||
|
||||
} |
||||
}); |
||||
$.shortcut("demo.north", Demo.North); |
@ -0,0 +1,9 @@
|
||||
Demo.West = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "demo-west" |
||||
}, |
||||
render: function () { |
||||
|
||||
} |
||||
}); |
||||
$.shortcut("demo.west", Demo.West); |
@ -0,0 +1,5 @@
|
||||
.demo-main { |
||||
& .bg1 { |
||||
background-color: #178cdf; |
||||
} |
||||
} |
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
body,html{height:100%}#wrapper,body{position:absolute;left:0;top:0}#wrapper,html{overflow:hidden}a,body{text-decoration:none}body,input,ol,textarea,ul{margin:0;padding:0}.b-font,i{-webkit-text-stroke-width:.2px;-moz-osx-font-smoothing:grayscale}.b-font,body,i{-moz-osx-font-smoothing:grayscale}@font-face{font-family:bi;src:url(${servletURL}?op=resource&resource=/com/fr/bi/web/resources/fonts/iconfont.eot?#iefix) format('embedded-opentype'),url(${servletURL}?op=resource&resource=/com/fr/bi/web/resources/fonts/iconfont.woff) format('woff'),url(${servletURL}?op=resource&resource=/com/fr/bi/web/resources/fonts/iconfont.ttf) format('truetype'),url(${servletURL}?op=resource&resource=/com/fr/bi/web/resources/fonts/iconfont.svg#svgFontName) format('svg')}.b-font{font-family:bi;font-style:normal;-webkit-font-smoothing:antialiased}*,button,html,input,select,textarea{font-family:"Microsoft YaHei","Hiragino Sans GB W3"}*,a,body,div,html,img,li,p,span,ul{margin:0}body{width:100%;background-repeat:repeat;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;color:#1a1a1a;font:400 12px "Microsoft YaHei","Hiragino Sans GB W3";-webkit-font-smoothing:antialiased;-kthml-user-focus:normal;-moz-user-focus:normal;-moz-outline:0 none;outline:0}a,a:focus{outline:0}#wrapper{right:0;bottom:0;overflow-x:hidden;overflow-y:hidden}input,textarea{outline:0;border:1px solid #ccc}ul{list-style:disc}li{list-style-type:none}i{font-style:normal;-webkit-font-smoothing:antialiased}div::-webkit-scrollbar,textarea::-webkit-scrollbar{-webkit-appearance:none;background-color:#f4f4f4;width:6px;height:6px}div::-webkit-scrollbar-thumb,textarea::-webkit-scrollbar-thumb{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;background-color:#e2e2e2} |
File diff suppressed because one or more lines are too long
@ -1,56 +0,0 @@
|
||||
$(function(){ |
||||
var items = [], header = [], columnSize = []; |
||||
|
||||
var rowCount = 100, columnCount = 100; |
||||
for (var i = 0; i < 1; i++) { |
||||
header[i] = []; |
||||
for (var j = 0; j < columnCount; j++) { |
||||
header[i][j] = { |
||||
type: "bi.label", |
||||
text: "表头" + i + "-" + j |
||||
} |
||||
columnSize[j] = 100; |
||||
} |
||||
} |
||||
for (var i = 0; i < rowCount; i++) { |
||||
items[i] = []; |
||||
for (var j = 0; j < columnCount; j++) { |
||||
items[i][j] = { |
||||
type: "bi.label", |
||||
text: (i < 3 ? 0 : i) + "-" + j |
||||
} |
||||
} |
||||
} |
||||
|
||||
var table = BI.createWidget({ |
||||
type: "bi.resizable_table", |
||||
el: { |
||||
type: "bi.collection_table", |
||||
}, |
||||
width: 600, |
||||
height: 500, |
||||
isResizeAdapt: true, |
||||
isNeedResize: true, |
||||
isNeedMerge: true, |
||||
mergeCols: [0, 1], |
||||
mergeRule: function (col1, col2) { |
||||
return BI.isEqual(col1, col2); |
||||
}, |
||||
isNeedFreeze: true, |
||||
freezeCols: [0, 1], |
||||
columnSize: columnSize, |
||||
items: items, |
||||
header: header |
||||
}); |
||||
BI.createWidget({ |
||||
type: "bi.absolute", |
||||
element: "#wrapper", |
||||
items: [{ |
||||
el: table, |
||||
left: 10, |
||||
right: 10, |
||||
top: 10, |
||||
bottom: 10 |
||||
}] |
||||
}) |
||||
}) |
@ -1,89 +0,0 @@
|
||||
/** |
||||
* 图表控件 |
||||
* @class BI.Chart |
||||
* @extends BI.Widget |
||||
*/ |
||||
BI.Chart = BI.inherit(BI.Pane, { |
||||
|
||||
_defaultConfig: function () { |
||||
return BI.extend(BI.Chart.superclass._defaultConfig.apply(this, arguments), { |
||||
baseCls: "bi-chart" |
||||
}) |
||||
}, |
||||
|
||||
_init: function () { |
||||
BI.Chart.superclass._init.apply(this, arguments); |
||||
var self = this, o = this.options; |
||||
|
||||
this.isInit = false; |
||||
this.isSetOptions = false; |
||||
this.wants2SetData = false; |
||||
var width = 0; |
||||
var height = 0; |
||||
|
||||
this._resizer = BI.debounce(function () { |
||||
if (self.element.is(":visible") && self.vanCharts) { |
||||
self.vanCharts.resize(); |
||||
} |
||||
}, 30); |
||||
BI.Resizers.add(this.getName(), function (e) { |
||||
if (BI.isWindow(e.target) && self.element.is(":visible")) { |
||||
var newW = self.element.width(), newH = self.element.height(); |
||||
if (newW > 0 && newH > 0 && (width !== newW || height !== newH)) { |
||||
self._resizer(); |
||||
width = newW; |
||||
height = newH; |
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
_setData: function () { |
||||
this.vanCharts && this.vanCharts.setData(this.config); |
||||
}, |
||||
|
||||
resize: function () { |
||||
if (this.element.is(":visible") && this.isSetOptions === true) { |
||||
this._resizer(); |
||||
} |
||||
}, |
||||
|
||||
magnify: function () { |
||||
this.vanCharts && this.vanCharts.charts[0] && this.vanCharts.charts[0].refreshRestore(); |
||||
}, |
||||
|
||||
populate: function (items, options) { |
||||
var self = this, o = this.options; |
||||
o.items = items; |
||||
this.config = options || {}; |
||||
this.config.series = o.items; |
||||
|
||||
var setOptions = function () { |
||||
self.vanCharts.setOptions(self.config); |
||||
self.isSetOptions = true; |
||||
//if (self.wants2SetData === true) {
|
||||
// self._setData();
|
||||
//}
|
||||
}; |
||||
var init = function () { |
||||
if (self.element.is(":visible")) { |
||||
self.vanCharts = VanCharts.init(self.element[0]); |
||||
BI.nextTick(setOptions); |
||||
self.isInit = true; |
||||
} |
||||
}; |
||||
|
||||
if (this.isInit === false) { |
||||
BI.nextTick(init); |
||||
} |
||||
|
||||
if (this.element.is(":visible") && this.isSetOptions === true) { |
||||
this._setData(); |
||||
this.wants2SetData = null; |
||||
} else { |
||||
this.wants2SetData = true; |
||||
} |
||||
} |
||||
}); |
||||
BI.Chart.EVENT_CHANGE = "EVENT_CHANGE"; |
||||
$.shortcut('bi.chart', BI.Chart); |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue