帆软要升级,记录下过程

1、帆软官网地址必不可少,戳这里,跳转帆软官网

点击前端开发指南
在这里插入图片描述
点击JS API
在这里插入图片描述
跳转过来就是版本11
在这里插入图片描述
一直往下翻,在最底部有个2.2 在Web中使用,圈起来的就是要引入到index.html中的脚本
在这里插入图片描述
在项目的静态文件夹public中的index.html中替换掉原先的版本9脚本
在这里插入图片描述
2、在vue.config.js中设置代理

     '/webroot': {
        target: 'http://192.xxx.x.xxx:xxxx/webroot',
        changeOrigin: true,
        pathRewrite: { '^/webroot': '' },
      },

3、点击打印的方法中

// this.loadJs('/WebReport/ReportServer?op=emb&resource=finereport.js').then(() =>{}

要改成

 this.loadJs('/webroot/decision/view/report?op=emb&resource=finereport.js').then(() =>{}

然后点击的时候就会出现这个页面
在这里插入图片描述
初次输入用户名和密码后,后面就不会在显示了

4、在点击打印的方法中,有两个地方有变化,一个是路径,一个是reportlet这个参数

//let realPath = '/WebReport/ReportServer'  版本9的写法
 
 // let allParameters  = {
 reportlet: item.cptPath,//版本9是reportlet
 id: id,
 op: write,
 fr_locale: fr_locale,
  __filename__: fileName,
}
  let date = new Date()
 let realPath = '/webroot/decision/view/report'  版本11的写法
 let allParameters  = {
 viewlet: item.cptPath,//版本11是viewlet
 id: id,
 op: write,
 fr_locale: fr_locale,
  __filename__: fileName,
}
  FR.doHyperlinkByPost(realPath,allParameters,date)

这样就升级完成了
在这里插入图片描述
/*
*
2024年12月20日更新:
新项目中使用新版本的帆软,按自己记录的教程执行之后,发现报错:FR is not defined
*/

其实报错不可怕,最怕的是不知道具体原因,排除定位问题是最花时间的。
我把每一个地方都检查过,确实没有写错的地方
我猜测会不会是静态页面index.html改的东西,不重启是不会及时更新的
果然,项目停掉重启后,帆软跳转正常了
在这里插入图片描述

Logo

永洪科技,致力于打造全球领先的数据技术厂商,具备从数据应用方案咨询、BI、AIGC智能分析、数字孪生、数据资产、数据治理、数据实施的端到端大数据价值服务能力。

更多推荐