决策报表父页面不展示对话框内容

微信图片_20230728152148.pngfunction GetQueryString(name) {

var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");

var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配

var context = "";

if (r != null)

//context = decodeURIComponent(r[2]);

context = r[2];

reg = null;

r = null;

return context == null || context == "" || context == "undefined" ? "" : context;

}

//alert(GetQueryString("viewlet"))

const baseUrl = window.location.origin+window.location.pathname+"?viewlet=";

const baseDir = GetQueryString("viewlet").replace(/%252F/g, '/').substring(0,GetQueryString("viewlet").replace(/%252F/g, '/').indexOf("/")+1);

const jumpFile = "jsc/jsc_home_mon_agent.cpt" ;//变量

const basePara = "&op=view"+"&agent=" + a ;

const targetUrl = baseUrl+baseDir+jumpFile+basePara;

//窗体

var $iframe = $("

//将窗体的src属性设置为模板路径

$iframe.attr("src", targetUrl);

//窗体的属性

var o = {

    title: "代理人明细",    //标题

    destroyOnClose:true,   // 是否在关闭对话框的时候将对话框从dom中移除

    width: 580,         //宽度

    height: 290,        //高度

  //、、background: "blue",

    //closable:true,    //是否显示关闭按钮,默认true

    //confirm:true,     //是否添加确认取消按钮,默认false

    //draggable:true   //是否可拖动,默认true

};

//弹出窗体

window.parent.FR.showDialog(o.title, o.width, o.height, $iframe, o);

FineReport 1z3333 发布于 2023-7-28 14:44 (编辑于 2023-7-28 15:22)
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共1回答
最佳回答
0
用户k6280494Lv6资深互助
发布于2023-7-28 14:56(编辑于 2023-7-28 15:11)

alert(targetUrl)看下你url正确不

var url = encodeURI(encodeURI("/webroot/decision/view/report?viewlet=GettingStarted.cpt"));

//窗体

var $iframe = $("<iframe id='inp' name='inp' width='100%' height='100%' scrolling='no' frameborder='0'>");

//将窗体的src属性设置为模板路径

$iframe.attr("src", url);

//窗体的属性

var o = {    title: "对话框",    

//标题   

 width: 750,        

  //宽度    

  height: 420, 

   closable:false   

 //是否显示关闭按钮,默认true是关闭,false是不显示关闭按钮。     

};

  //弹出窗体

   FR.showDialog(o.title, o.width, o.height, $iframe, o);

  • 1z3333 1z3333(提问者) 正确的
    2023-07-28 15:03 
  • 用户k6280494 用户k6280494 回复 1z3333(提问者) 你确定是正确的的,你直接写个报表路径看下
    2023-07-28 15:12 
  • 1z3333 1z3333(提问者) 回复 用户k6280494 正常这么写FR.showDialog 是没问题的,但我需要在父页面弹出对话框,window.parent.FR.showDialog 这么写之后,只有对话框,没有数据,对话框是空白的
    2023-07-28 15:18 
  • 2关注人数
  • 211浏览人数
  • 最后回答于:2023-7-28 15:22
    请选择关闭问题的原因
    确定 取消
    返回顶部