fvs中点击电子树模式的标签值弹出不同的对话框,需要使用JS事件吗。需要的话麻烦提供示例

1.png

FineReport 小菜鸡222 发布于 2025-5-16 15:54
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共4回答
最佳回答
0
华莉星宸Lv7资深互助
发布于2025-5-16 16:06

这样,对节点名称进行判断

if (aa = "A") {

window.open(url1);

} else if (aa = "B") {

window.open(url2);

}

image.png

------------------

建议在新页签打开报表

全局接口-FS https://help.fanruan.com/finereport/doc-view-606.html

image.png

最佳回答
0
Z4u3z1Lv6专家互助
发布于2025-5-16 15:57
  • 小菜鸡222 小菜鸡222(提问者) 试过这个方法了 没法锁定这个标签 就跳转这个页面。我要书上4个标签 分别可跳转到4个不同的页面
    2025-05-16 16:02 
最佳回答
0
用户k6280494Lv6专家互助
发布于2025-5-16 15:59(编辑于 2025-5-16 16:08)

https://help.fanruan.com/finereport/doc-view-3745.html 

image.png

"use document";

const iframe = document.createElement("iframe");

iframe.width = "100%";

iframe.height = "100%";

iframe.scrolling = "no";

iframe.style = "border: none";

iframe.src = "/webroot/decision/view/report?viewlet=GettingStarted.cpt";



duchamp.showDialog({

title: "销量弹窗",

width: 700,

height: 500,

innerContent: iframe,

dialogType: "center",

});

参数说明:

  • title: 弹窗标题

  • width: 弹窗宽度,可以使用像素或百分比

  • height: 弹窗高度,可以使用像素或百分比

  • innerContent: 弹窗内容,使用 iframe 标签

  • dialogType: 弹窗的形式,默认为居中显示

示例下载

你可以点击以下链接下载相关模板:JS实现点击打开弹出框.fvs

Snag_70f94f87.png

image.png

"use document";

if(name=='A'){

const iframe = document.createElement("iframe");

iframe.width = "100%";

iframe.height = "100%";

iframe.scrolling = "no";

iframe.style = "border: none";

iframe.src = "/webroot/decision/view/report?viewlet=GettingStarted.cpt";

duchamp.showDialog({

title: "销量弹窗",

width: 700,

height: 500,

innerContent: iframe,

dialogType: "center",

});

}

  • 小菜鸡222 小菜鸡222(提问者) 我要树上4个标签 分别可跳转到4个不同的页面。不是传参
    2025-05-16 16:03 
  • 用户k6280494 用户k6280494 回复 小菜鸡222(提问者) 选js事件,根据参数判断
    2025-05-16 16:05 
  • 用户k6280494 用户k6280494 回复 小菜鸡222(提问者) 看补充回答吧
    2025-05-16 16:09 
最佳回答
0
小菜鸡222Lv4见习互助
发布于2025-5-16 17:01

-- 先设置参数image.png // 使用switch结构优化多条件判断({{JS判断操作系统语言(浏览器)-1886.md}})

switch(aa) {

    case "物料采购宗数":

        window.open(

            "https://www.baidu.com/?tn=62095104_29_oem_dg&ch=6",

            "_blank",

            "width=800,height=600"

        );

        break;

    case "物料采购金额":

        window.open(

            "https://baijiahao.baidu.com/s?id=1832247028504573469&wfr=spider&for=pc",

            "_blank",

            "width=800,height=600"

        );

        break;

    case "供应商宗数":  

        window.open(

            "https://mbd.baidu.com/newspage/data/landingsuper?context=%7B%22nid%22%3A%22news_9360932211423624799%22%7D&n_type=1&p_from=3",

            "_blank",

            "width=800,height=600"

        );

        break;

    case "供应商金额":  

        window.open(

            "https://mbd.baidu.com/newspage/data/landingsuper?context=%7B%22nid%22%3A%22news_9557378410688803957%22%7D&n_type=1&p_from=4",

            "_blank",

            "width=800,height=600"

        );

        break;

    default:

        console.warn("未匹配到有效条件");

}

  • 2关注人数
  • 47浏览人数
  • 最后回答于:2025-5-16 17:01
    请选择关闭问题的原因
    确定 取消
    返回顶部