fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
3.0 KiB

/**
* Created by Young's on 2017/3/10.
*/
BI.RelationViewRegionContainer = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.RelationViewRegionContainer.superclass._defaultConfig.apply(this, arguments), {
8 years ago
baseCls: "bi-relation-view-region-container",
width: 210
});
},
_init: function () {
BI.RelationViewRegionContainer.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.region = BI.createWidget({
type: "bi.relation_view_region",
value: o.value,
7 years ago
width: o.width,
header: o.header,
text: o.text,
handler: o.handler,
7 years ago
disabled: o.disabled,
items: o.items,
belongPackage: o.belongPackage
});
this.region.on(BI.RelationViewRegion.EVENT_PREVIEW, function (v) {
self.fireEvent(BI.RelationViewRegionContainer.EVENT_PREVIEW, v);
});
this.region.on(BI.RelationViewRegion.EVENT_HOVER_IN, function (v) {
self.fireEvent(BI.RelationViewRegionContainer.EVENT_HOVER_IN, v);
});
this.region.on(BI.RelationViewRegion.EVENT_HOVER_OUT, function (v) {
self.fireEvent(BI.RelationViewRegionContainer.EVENT_HOVER_OUT, v);
});
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.region],
width: this.region.getWidth(),
height: this.region.getHeight()
});
},
doRedMark: function () {
this.region.doRedMark.apply(this.region, arguments);
},
unRedMark: function () {
this.region.unRedMark.apply(this.region, arguments);
},
getWidth: function () {
return this.region.getWidth();
},
getHeight: function () {
return this.region.getHeight();
},
7 years ago
// 获取上方开始划线的位置
getTopLeftPosition: function () {
return this.region.getTopLeftPosition();
},
getTopRightPosition: function () {
return this.region.getTopRightPosition();
},
getBottomPosition: function () {
return this.region.getBottomPosition();
},
getLeftPosition: function () {
return this.region.getLeftPosition();
},
getRightPosition: function () {
return this.region.getRightPosition();
},
setValue: function (v) {
this.region.setValue(v);
},
toggleRegion: function (v) {
v === true ? this.region.element.fadeIn() : this.region.element.fadeOut();
},
7 years ago
setPreviewSelected: function (v) {
this.region.setPreviewSelected(v);
}
});
BI.RelationViewRegionContainer.EVENT_HOVER_IN = "RelationViewRegion.EVENT_HOVER_IN";
BI.RelationViewRegionContainer.EVENT_HOVER_OUT = "RelationViewRegion.EVENT_HOVER_OUT";
BI.RelationViewRegionContainer.EVENT_PREVIEW = "RelationViewRegion.EVENT_PREVIEW";
8 years ago
BI.shortcut("bi.relation_view_region_container", BI.RelationViewRegionContainer);