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.
 
 
 

191 lines
8.0 KiB

;!(function () {
BI.Front = BI.Front || {};
BI.Front = BI.extend(BI.Front, {
SUPPORT_REPORT: [
{
typeValue: 101,
type: "cpt",
name: "cpt",
suffix: ".cpt",
iconCls: "fanruan-cpt-logo",
text: "CPT报表",
showPage: function (id) {
const {params} = BI.Router.$router.history.current;
BI.Router.$router.push({
name: "finereport_cpt",
params: Object.assign(Object.assign({}, params), {id: id})
});
},
route:
{
edit: {
name: "finereport_cpt",
// path: "/:subjectId/cpt/:id",
path: "cpt/:id",
// path: "/:cpt",
// parent: parentRoute,
children: [],
components: {
analysis: {
type: "bi.subject.view.extend.report",
reportType: "cpt"
}
},
beforeEnter: (to, _from, next) => {
next();
},
},
view: {
name: "finereport_cpt",
path: "cpt/:id",
// path: "/:cpt",
// parent: parentRoute,
children: [],
components: {
analysis: {
type: "bi.subject.view.extend.report",
reportType: "cpt"
}
}
}
},
addAction: function () {
BI.Msg.prompt("新增cpt报表", "输入名称", function (value) {
if (BI.isNotNull(value)) {
BI.Front.subject_view.store.addExtendReport(value, 101);
} else {
BI.Msg.toast("名称为空", {level: "error"});
}
})
},
paneType: {
tab: "bi.subject.tab.extend.report.item",
}
},
{
type: "frm",
typeValue: 102,
name: "frm",
suffix: ".frm",
iconCls: "fanruan-frm-logo",
text: "决策报表",
showPage: function (id) {
const {params} = BI.Router.$router.history.current;
BI.Router.$router.push({
name: "finereport_frm",
params: Object.assign(Object.assign({}, params), {id: id})
});
},
addAction: function () {
BI.Msg.prompt("新增决策报表", "输入名称", function (value) {
if (BI.isNotNull(value)) {
BI.Front.subject_view.store.addExtendReport(value, 102);
} else {
BI.Msg.toast("名称为空", {level: "error"});
}
})
},
route: {
edit: {
name: "finereport_frm",
// path: "/:subjectId/frm/:id",
path: "frm/:id",
// path: "/:cpt",
// parent: parentRoute,
children: [],
components: {
analysis: {
type: "bi.subject.view.extend.report",
reportType: "frm"
}
},
beforeEnter: (to, _from, next) => {
next();
}
},
view: {
name: "finereport_frm",
path: "frm/:id",
// path: "/:cpt",
// parent: parentRoute,
children: [],
components: {
analysis: {
type: "bi.subject.view.extend.report",
reportType: "frm"
}
}
}
},
paneType: {
tab: "bi.subject.tab.extend.report.item",
}
}
],
showReportPage: function (reportId, reportType) {
var find = BI.find(BI.Front.SUPPORT_REPORT, function (index, o) {
return o.type === reportType || o.typeValue === reportType;
})
if (find) {
find.showPage(reportId);
}
}
});
/**
* 处理路径会被编码问题,cpt就不编码了
* @type {BI.Utils.multiUpdateDashboardShareAuthorityQueue}
*/
BI.Utils.oldMultiUpdateDashboardShareAuthorityQueue = BI.Utils.multiUpdateDashboardShareAuthorityQueue;
BI.Utils.multiUpdateDashboardShareAuthorityQueue = function (e, t, i) {
function filter(path) {
var x = BI.find(BI.Front.SUPPORT_REPORT, function (index, item) {
return path.endWith(item.suffix);
});
return x ? true : false;
}
if (BI.isKey(e) && filter(e)) {
Dec.reqPut("/v10/dashboard/share?entityId=" + e, t, i)
} else {
BI.Utils.oldMultiUpdateDashboardShareAuthorityQueue(e, t, i);
}
}
/**
* 公共链接更新问题,调用的产品方案,这个时候的id和创建id不一样,兼容一下
* @type {BI.Utils.updatePublicLink}
*/
BI.Utils.oldUpdatePublicLink = BI.Utils.updatePublicLink;
BI.Utils.updatePublicLink = function (e, t, i, n) {
t.reportId = t.reportId.replaceAll("_@_", "/");
BI.Utils.oldUpdatePublicLink(e, t, i, n);
}
function importResource(path, type) {
var url = Dec.fineServletURL + "/file?path=" + path;
BI.$import(url, type);
}
importResource("com/fr/plugin/bi/web/js/utils/bi.front.js", "js");
importResource("com/fr/plugin/bi/web/js/report/subject.report.tab.js", "js");
importResource("com/fr/plugin/bi/web/js/report/subject.report.view.js", "js");
importResource("com/fr/plugin/bi/web/js/report/subject.report.view.model.js", "js");
importResource("com/fr/plugin/bi/web/js/report/subject.report.service.js", "js");
importResource("com/fr/plugin/bi/web/js/report/subject.report.tab.model.js", "js");
importResource("com/fr/plugin/bi/web/js/core/front.subject.js", "js");
importResource("com/fr/plugin/bi/web/js/core/front.subject.tab.js", "js");
importResource("com/fr/plugin/bi/web/js/core/front.subject.view.js", "js");
importResource("com/fr/plugin/bi/web/js/core/front.subject.relationship.pane.js", "js");
importResource("com/fr/plugin/bi/web/js/core/front.subject.relationship.pane.map.js", "js");
importResource("com/fr/plugin/bi/web/js/core/front.subject.relationship.map.button.js", "js");
importResource("com/fr/plugin/bi/web/js/core/front.subject.relationship.pane.header.js", "js");
importResource("com/fr/plugin/bi/web/js/core/front.conf.pack.table.usage.js","js");
importResource("com/fr/plugin/bi/web/js/core/front.branch_map.js","js");
//ezreal:协助开发的,后续删
BI.Plugin.config(function (type, options) {
}, function (type, object) {
object.element.attr("shortcut", object.options.type);
});
})();