forked from ezreal/BI-FR-MIX-FRONT
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.
33 lines
1.5 KiB
33 lines
1.5 KiB
;!(function () { |
|
BI.Plugin.registerWidget("bi.branch_map", function (widget) { |
|
if (BI.isFunction(widget.contentGetter)) { |
|
var oldcontentGetter = widget.contentGetter; |
|
widget.contentGetter = function (ob) { |
|
var result = oldcontentGetter.apply(this, arguments); |
|
var itemType = ob.itemType; |
|
var find = BI.find(BI.Front.SUPPORT_REPORT, function (index, item) { |
|
return itemType === item.typeValue; |
|
}); |
|
if (find && result.listeners) { |
|
var jumpAction = BI.find(result.listeners, function (i, o) { |
|
return o.eventName === "EVENT_JUMP" |
|
}); |
|
if (jumpAction) { |
|
jumpAction.action = function () { |
|
//ezreal:当前路由的方式判断下是怎么打开吧。 |
|
var currentRoute = BI.Router.$router.currentRoute; |
|
if (currentRoute && currentRoute.name == "subject_table") { |
|
BI.Front.showReportPage(ob.value.id, find.type) |
|
} else { |
|
var url = Dec.fineServletURL + "/v5/conf/subject/page/edit/" + ob.value.parentId + "/" + find.type + "/" + ob.value.id; |
|
window.open(url); |
|
} |
|
} |
|
} |
|
} |
|
return result; |
|
} |
|
} |
|
return widget; |
|
}) |
|
})(); |