app端超链打不开怎么修改代码

var serverUrl = "http://192.168.2.207:8080/webroot/decision";

var reportLink = "";

if (dataType == "学校") {

reportLink = serverUrl + "/view/report?viewlet=学校.cpt&name=" + encodeURIComponent(name) + "&policeStation=" + encodeURIComponent(policeStation) + "";

else if (dataType == "学生") {

reportLink = serverUrl + "/view/report?viewlet=学生.cpt&name=" + encodeURIComponent(name) + "&policeStation=" + encodeURIComponent(policeStation) + "";

}

else{

reportLink="";

}

// 打开链接  

if (reportLink) {

window.open(reportLink, "_blank"); // 在新标签页打开链接  

} else {

FR.Msg.alert("提示", "未匹配到对应数据类型的报表链接!");

}

FineReport 帆软用户MdvQbhNPuc 发布于 2025-3-8 17:37
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共2回答
最佳回答
0
CD20160914Lv8专家互助
发布于2025-3-8 17:51(编辑于 2025-3-8 17:54)

用这种方式

var reportLink = "";

if (dataType == "学校") {

reportLink = encodeURI("${servletURL}?viewlet=学校.cpt&name=" +name + "&policeStation=" + policeStation);

else if (dataType == "学生") {

reportLink =  encodeURI("${servletURL}?viewlet=学生.cpt&name=" +name + "&policeStation=" + policeStation);

}

else{

reportLink="";

}

// 打开链接  

if (reportLink) {

FR.doHyperlinkByGet(reportLink); 

} else {

FR.Msg.alert("提示", "未匹配到对应数据类型的报表链接!");

}

[通用]JS自定义超链标题- FineReport帮助文档 - 全面的报表使用教程和学习资料

image.png

最佳回答
0
华莉星宸Lv7资深互助
发布于2025-3-8 17:53

移动端用 doHyperlinkByPost 或 doHyperlinkByGet 打开报表

参考

JS实现点击超链打开对话框报表并传参 https://help.fanruan.com/finereport/doc-view-3633.html

JavaScript超链传参 https://help.fanruan.com/finereport/doc-view-911.html

image.png

  • 3关注人数
  • 22浏览人数
  • 最后回答于:2025-3-8 17:54
    请选择关闭问题的原因
    确定 取消
    返回顶部