当前位置: 首页 > news >正文

html的iframe页面给帆软BI发送消息

需求:帆软的网页组件嵌套一个HTML页面,HTML页面要给帆软发消息。

解决方法是:fineReportWindow.duchamp.getWidgetByName("txt1").setValue('666');

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HTML Page for FineReport</title>
</head>
<body>
    <button id="sendButton">发送消息</button>
    <script>
        // 获取按钮元素
        var sendButton = document.getElementById('sendButton');

        // 向帆软发送消息的函数
        function sendMessageToFineReport(message) {
            // 假设 parent 是帆软的窗口对象,这里需要根据实际情况修改
            var fineReportWindow = parent; 
            // 使用 postMessage 发送消息
            fineReportWindow.postMessage(message, {}); 
            fineReportWindow.XXX=1;
            console.log(fineReportWindow);
            
            fineReportWindow.duchamp.getWidgetByName("下拉框1_页面1").setValue('87897232');
            //window.postMessage(message, '*'); 
        }

        // 监听按钮点击事件
        sendButton.addEventListener('click', function() {
           
            sendMessageToFineReport('999');
        });

    </script>
</body>
</html>

注意不要跨域,html页面可以丢到帆软的安装目录下。这样就同一个域名了

http://www.lryc.cn/news/522768.html

相关文章:

  • spark任务优化参数整理
  • C++ 模拟真人鼠标轨迹算法 - 防止游戏检测
  • 生产环境中常用的设计模式
  • 基于SpringBoot+Vue的药品管理系统【源码+文档+部署讲解】
  • 【CompletableFuture实战】
  • Redis 缓存穿透、击穿、雪崩 的区别与解决方案
  • Python自动化测试中定位隐藏菜单元素的策略
  • 【张雪峰高考志愿填报】合集
  • 53,【3】BUUCTF WEB october 2019 Twice SQLinjection
  • 【Linux系统】分区挂载
  • Oracle 可观测最佳实践
  • Ubuntu本地部署网站
  • 图数据库 | 18、高可用分布式设计(中)
  • Java 读取 Windows 设备的唯一性标识及定位
  • Spring boot框架下的RabbitMQ消息中间件
  • 1 行命令引发的 Go 应用崩溃
  • ScratchLLMStepByStep:训练自己的Tokenizer
  • G1原理—10.如何优化G1中的FGC
  • Java基础——概念和常识(语言特点、JVM、JDK、JRE、AOT/JIT等介绍)
  • 2025.1.16——三、supersqli 绕过|堆叠注入|handler查询法|预编译绕过法|修改原查询法
  • 浅谈计算机网络03 | 现代网络组成
  • Red Hat8:搭建FTP服务器
  • EWM 批次管理 / Batch Management
  • Java 面试题 - ArrayList 和 LinkedList 的区别,哪个集合是线程安全的?
  • 初学SpringBoot
  • 【网络云SRE运维开发】2025第3周-每日【2025/01/15】小测-【第14章ospf高级配置】理论和实操解析
  • AWS S3 跨账户访问 Cross Account Access
  • Ubuntu20.4和docker终端指令、安装Go环境、安装搜狗输入法、安装WPS2019:保姆级图文详解
  • Kotlin语言的正则表达式
  • npm的包管理