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.
 
 
 

123 lines
4.5 KiB

/**
* 展示cpt模板
*/
;!(function () {
var RGAP = 15;
BI.CPTVIEW = BI.inherit(BI.Widget, {
props: {
reportType: "cpt"
},
watch: {},
_store: function () {
return BI.Models.getModel("bi.subject.view.extend.report.model", {
reportType: this.options.reportType
});
},
beforeInit: function (callback) {
this.store.initData(callback);
},
render: function () {
var self = this;
var o = this.options;
return {
type: "bi.absolute",
items: [
{
el: {
type: "bi.left_right_vertical_adapt",
cls: "bi-border-bottom",
height: 25,
items: {
left: [
{
type: "bi.label",
text: "",
// css: {"font-size": "large"},
height: 25
}
],
right: self._createRightItem()
}
}, left: 10, right: 10, top: 5, height: 25
},
{
el: {
type: "bi.iframe",
src: self.model.src,
ref: function (_ref) {
self.iframe = _ref;
}
/*type: "bi.label",
text: self.model.newId*/
}, left: 10, right: 10, top: 30, bottom: 0
}
]
}
},
mounted: function () {
},
_createRightItem: function () {
var self = this;
let rightItems = BI.Providers.getProvider("bi.provider.dashboard_toolbar").getRightItems(self.model.id);
rightItems = BI.map(rightItems, function (index, item) {
/*var cptId = self.model.subjectInfo.id + "/" + self.model.id;
if (item.text === "公共链接") {
cptId = self.model.subjectInfo.id + "_@_" + self.model.id;
}*/
return {
el: BI.extend(item, {
type: "bi.icon_text_item",
height: 25,
extraCls: "bi-list-item",
invisible: function () {
return false;
},
reportInfoGetter: function () {
return {
id: self.model.id,
name: self.model.name
}
},
isOwn: true,
refresh: function () {
}
}), rgap: RGAP
}
});
return BI.concat(rightItems, [
{
el: {
type: "bi.icon_text_item",
cls: "refresh-font",
extraCls: "bi-list-item",
height: 25,
text: "刷新",
handler: function () {
self.iframe.setSrc(self.model.src);
// self.iframe.reset();
}
}, rgap: RGAP
},
{
el: {
type: "bi.icon_text_item",
cls: "widget-edit-liner-font",
extraCls: "bi-list-item",
height: 25,
text: "打开设计器编辑",
handler: function () {
var url = "fanruan://" + window.location.origin + Dec.fineServletURL + "?" + Dec.personal.username + "?" + Dec.personal.username + "?reportlets/" + self.model.subjectInfo.id + "/" + self.model.id;
console.log(url);
window.open(url);
}
}, rgap: RGAP
}
])
}
});
BI.shortcut("bi.subject.view.extend.report", BI.CPTVIEW);
})();