var boxes = _g().getWidgetsByName("box");//获取当前页的复选按钮控件数组var g_UUID_Name = ;if (typeof(boxes) != "undefined") { for (i = 0; i < boxes.length; i++) { if (boxes.selected()) { var aa = (boxes.options.location).toString().replace("A", "C"); g_UUID_Name.push(_g().getCellValue(aa,null)) } }} else { if (boxes.selected()) { var aa = (boxes.options.location).toString().replace("A", "C"); g_UUID_Name.push(_g().getCellValue(aa,null)) //如果控件只有1个,则直接判断是否选中,选中的话把单元格编号塞进数组中 }}var g_update = g_UUID_Name.join("','");if(g_update.length > 0){FR.Msg.confirm("警告", "点击确认,即将该报表报表展示逻辑!", function(value) { if (value == true) { for (i = 0; i < g_UUID_Name.length ; i++) { var g_UUID = g_UUID_Name.substring(0,36); var g_Report_Name = g_UUID_Name.substring(36,100); var config = { title: '提示', width: 380, height: 170, //closable: 'Boolean()', contentHtml: $('<div id="popup_fall" class ="fr-core-panel-loading" style="max-width: 360px;width: 360px; overflow-wrap: break-word; font-size: 13px; font-weight: bold; overflow-y: auto; max-height: 15px; font-family: SimSun,MS Gotihic,Helvetica Neue,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Heiti,黑体,sans-serif;color: #757575";>正在导出,此过程大概需要1分钟到数分钟!</div>') }; //FR.showLoadingDialog(config); // $(".fr-core-panel-tool-close").hide(); //文件地址 var url = '${servletURL}?viewlet=SJKSH/Technological/Service_Collaboration_input/Report_Logic_dow.cpt&g_UUID=' + g_UUID+'&format=text'; var exportName = g_Report_Name+"_报表展示逻辑"; //下载后文件名 var xhr = new XMLHttpRequest(); xhr.open('get', encodeURI(url), true); xhr.responseType = "blob"; // 返回类型blob // 定义请求完成的处理函数,请求前也可以增加加载框/禁用下载按钮逻辑 xhr.onload = function() { // 请求完成 if (this.status === 200) { // 返回200 var blob = this.response; var href = window.URL.createObjectURL(blob); //创建下载的链接 //判断是否是IE浏览器,是的话返回true if (window.navigator.msSaveBlob) { try { window.navigator.msSaveBlob(blob, exportName + '.txt') FR.hideLoadingDialog(); //FR.Msg.alert("提示", "导出成功!"); } catch (e) { console.log(e); } } else { // 谷歌浏览器 创建a标签 添加download属性下载 var downloadElement = document.createElement('a'); downloadElement.href = href; downloadElement.target = '_blank'; downloadElement.download = exportName + '.txt'; //下载后文件名 document.body.appendChild(downloadElement); downloadElement.click(); //点击下载 document.body.removeChild(downloadElement); //下载完成移除元素 window.URL.revokeObjectURL(href); //释放掉blob对象 FR.hideLoadingDialog(); //FR.Msg.alert("提示", "导出成功!"); } } } // 发送ajax请求 xhr.send(); FR.Msg.alert("提示", "导出成功!"); } } }, 100);}else{ FR.Msg.alert("提示", "请先选择要导出的报表展示逻辑!");}