当我们需要通过一个分析跳转到另一个分析页面时,如果另一个分析页使用的维度与当前维度不是同一个时,无法进行直接传参,可以通过如下设置,当前值转换为URL传参的形式,变为对方分析可以接受的参数,进行传参。
myCustomPortalPageNav1(1,'/shared/E2E网络价值显示/_portal/网络价值显示2','1169平台主图表展示','"Fact - 平台主显示指标"."平台名称"','','@{PARA1}','"Fact - 小V主"."PT_CODE"','','@{PARA2}','"FACT_CYZB_WEEK"."PT_CODE"','','@{PARA3}')
在仪表盘的页面中添加如下JavaScript代码
<script>
NQNavigateHandlerly = function (h, v) {
NQWClearActiveMenu();
var k = h.oNavObject;
var m = k.sSWEView != null;
var l = Math.min(k.vValues.length, 64);
if (m) {
if (k.sNavValue != "") {
NQSWENav(k.sSWEView, k.sSWEApplet, k.sNavValue)
}
return
}
var g = k.vTargets[v];
g[0](g, k);
var n = k.sPortal != null;
var u = XUICreateElement(saw.xml.kSawxNamespace, "expr");
if (l > 0) {
u = XUICreateElement(saw.xml.kSawxNamespace, "expr");
u.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
u.setAttribute("xsi:type", "sawx:sqlExpression");
u.setAttribute("op", "and");
for (var o = 0; o != l; ++o) {
var a = k.vValues[o];
if (!k.navColType || k.navColType[o] == false) {
var c = XUIAppendNewElement(u, saw.xml.kSawxNamespace, "expr");
XUISetXsiType(c, saw.xml.kSawxNamespace, "comparison");
XUISetAttributeString(c, "op", (null != a.sOp && a.sOp == "null") ? "null" : "equal");
var r = (a.sCodeFormula != null);
if (r) {
setExprLHSXMlForMappedColumn(c, a.sFormula, a.sCodeFormula, true)
} else {
setExprLHSXMlForUnMappedColumn(c, a.sFormula)
}
if (null == a.sOp || a.sOp != "null") {
var q = XUIAppendNewElement(c, saw.xml.kSawxNamespace, "expr");
XUISetXsiType(q, saw.xml.kSawxNamespace, "untypedLiteral");
XUISetElementText(q, a.sValue)
}
} else {
if (k.navColType && o < k.navColType.length && k.navColType[o] == true) {
var p = obips.XMLDOM.parseXML(a.sValue);
var d = obips.XMLDOM.selectSingleNode(p, "sawx:expr");
if (d) {
u.appendChild(d.cloneNode(true))
}
}
}
}
if (l == 1) {
u = u.firstChild
}
}
var f = {
reloadInplace : false,
commandRequest : "go"
};
var s = {};
s.Path = k.sPath;
s.ViewID = "";
var b = document.getElementById("idPageID");
if (b) {
s.PageID = b.getAttribute("pageID")
}
if (l > 0) {
s.P0 = saw.getXmlText(u)
}
s.P19 = k.sSearchID;
s.P17 = k.sPromptSearchID;
s.P16 = "NavRuleDefault";
s.NavFromViewID = k.sViewID;
if (n) {
f.command = "Dashboard";
f.workspaceModule = "biee.dashboards";
s.PortalPath = k.sPortal;
s.P1 = "dashboard";
if (k.sPage) {
s.Page = k.sPage
} else {
s.Page = ""
}
} else {
var e = k.sViewID.substr(0, k.sViewID.indexOf("~v:") == -1 ? k.sViewID.length : k.sViewID.indexOf("~v:"));
var j = document.getElementById(e + "Result");
if (j) {
s.P18 = j.getAttribute("options").replace(new RegExp("s", "gi"), "")
}
}
f.mobileNav = n ? "dashboard" : "report";
f.targetWindow = k.sWindowTarget;
obips.views.ViewController.handleViewAction("Navigate", k.sViewID, s, f, null, {
canChangeStateId : false,
requireUpToDateStateId : false
})
}
NQMakeFormulaly = function (b, a) {
if (a != "") {
return NQFixTableName(b) + "." + NQFixTableName(a)
} else {
return b
}
}
NQNavigately = function (a, c, e) {
var f = c.oNavObject.vTargets;
var b = "NQNavigateHandlerly(" + c.sJSObjName + ",";
var d = c.oNavObject.sSWEView != null;
if (d) {
NQNavigateHandlerly(c, null);
return false
}
if (f.length == 1) {
NQNavigateHandlerly(c, 0);
return false
}
return false
}
myCustomPortalPageNav1 = function (b, e, j) {
b = saw.getEvent(b);
var g = new NavigateInfo();
g.SetSearchID(GetMySearchID(saw.getEventTarget(b)));
g.SetPromptSearchID(GetMyPromptSearchID(saw.getEventTarget(b)));
g.SetViewID(GetMyViewID(saw.getEventTarget(b)));
g.SetTargets(new Array(new Array(NQWNavPortal, e, j)));
//g.setIsNewWindow("_blank");
var a = 0;
for (var f = 3; (f + 2 < arguments.length) && (a < 10); f += 3) {
var h = arguments[f];
var d = arguments[f + 1];
var c = arguments[f + 2];
if (c) {
if (c == "isnull") {
g.AddValue("null", NQMakeFormulaly(h, d), c)
} else {
g.AddValue("eq", NQMakeFormulaly(h, d), c)
}
}
++a
}
g.oNavObject = g;
NQNavigately(b, g)
}
</script>