{"remainingRequest":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/cache-loader/dist/cjs.js??ref--0-0!/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/test-v5inweb-5.x-vue/src/components/report.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/src/components/report.vue","mtime":1739760944323},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/babel.config.js","mtime":1739760943855},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/babel-loader/lib/index.js","mtime":315532800000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/vue-loader/lib/index.js","mtime":1655715099000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.split\";\nimport form_searchform from \"@/components/form_searchform.vue\";\nexport default {\n props: [\"openParams\"],\n components: {\n form_searchform: form_searchform\n },\n watch: {},\n created: function created() {\n this.getReport();\n },\n mounted: function mounted() {\n this.getScollerHeight();\n },\n data: function data() {\n return {\n currentUrl: \"\",\n dialogVisible: false,\n iframeHeight: \"\",\n formData: \"\",\n isOpenTemplate: false,\n isShowBtn: false,\n chartType: \"report\",\n reportHtml: \"\"\n };\n },\n methods: {\n handleClose: function handleClose() {\n this.dialogVisible = false;\n },\n onSearch: function onSearch(data) {\n var _this = this;\n this.$api.searchReports(data.viewId, \"\", data, {\n onSucess: function onSucess(res) {\n var urls = res.data;\n _this.currentUrl = \"\";\n _this.reportHtml = \"\";\n setTimeout(function () {\n _this.currentUrl = obpmConfig.obpmFilePath + urls;\n }, 300);\n }\n });\n },\n showBtn: function showBtn(val) {\n this.isShowBtn = val;\n },\n openSearchTemplate: function openSearchTemplate() {\n this.isOpenTemplate = !this.isOpenTemplate;\n },\n printPage: function printPage() {\n var newWindow = window.open(\"_blank\"); // 打开新窗口\n var codestr = document.getElementById(\"print\").innerHTML; // 获取需要生成pdf页面的div代码\n newWindow.document.write(codestr); // 向文档写入HTML表达式或者JavaScript代码\n newWindow.document.close(); // 关闭document的输出流, 显示选定的数据\n setTimeout(function () {\n newWindow.print();\n }, 1000);\n },\n print: function print() {\n var _this2 = this;\n this.dialogVisible = true;\n setTimeout(function () {\n var id = \"print_\" + _this2.openParams.actionContent;\n _this2.setImgUrl(id);\n }, 500);\n },\n setImgUrl: function setImgUrl(id) {\n var imgLists = document.getElementById(id).getElementsByTagName(\"img\");\n var src = \"\";\n for (var i = 0; i < imgLists.length; i++) {\n var imgName = imgLists[i].src.split(\"/\");\n src = obpmConfig.obpmFilePath + \"/uploads/reports/\" + imgName[imgName.length - 2] + \"/\" + imgName[imgName.length - 1];\n imgLists[i].src = src;\n }\n },\n setParams: function setParams(op) {\n var params = \"\";\n for (var key in op) {\n //openParams参数必定携带这几个参数,不需要做参数传到后台\n if (key != \"actionContent\" && key != \"active\" && key != \"appId\" && key != \"linkType\" && key != \"name\" && key != \"title\" && key != \"_select\") {\n params = key + \"=\" + op[key] + \"&\";\n }\n }\n return params;\n },\n exportPdf: function exportPdf() {\n var _this3 = this;\n var op = this.openParams;\n var params = this.setParams(op);\n this.$api.exportReportPdf(op.actionContent, params, {\n onSucess: function onSucess(response) {\n var fileName = \"\";\n var type = response.headers[\"content-type\"];\n if (response.headers[\"content-disposition\"]) {\n // fileName = decodeURIComponent(response.headers['content-disposition'].split(\"=\")[1]);\n var suffix = fileName.split(\".\")[1];\n // fileName = name + \".\" + suffix;\n fileName = op.name + decodeURIComponent(\".pdf\");\n } else {\n fileName = $t(\"report.download\");\n }\n _this3.download(response, type, fileName);\n }\n });\n },\n exportExcel: function exportExcel() {\n var _this4 = this;\n var op = this.openParams;\n var params = this.setParams(op);\n this.$api.exportReportExcel(op.actionContent, params, {\n onSucess: function onSucess(response) {\n var fileName = \"\";\n var type = response.headers[\"content-type\"];\n if (response.headers[\"content-disposition\"]) {\n // fileName = decodeURIComponent(response.headers['content-disposition'].split(\"=\")[1]);\n var suffix = fileName.split(\".\")[1];\n // fileName = name + \".\" + suffix;\n fileName = op.name + decodeURIComponent(\".xls\"); //$t('report.datasource_down') + \".xls\";\n } else {\n fileName = $t(\"report.download\");\n }\n _this4.download(response, type, fileName);\n }\n });\n },\n download: function download(res, type, filename) {\n var blob = new Blob([res.data], {\n // 如果后端没返回下载文件类型,则需要手动设置:type: 'application/pdf;chartset=UTF-8' 表示下载文档为pdf,如果是word则设置为msword,excel为excel\n type: type\n });\n var a = document.createElement(\"a\");\n var herf = window.URL.createObjectURL(blob);\n // 下载链接\n a.href = herf;\n // 下载文件名,如果后端没有返回,可以自己写a.download = '文件.pdf'\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n window.URL.revokeObjectURL(herf);\n },\n getReport: function getReport() {\n var _this5 = this;\n var op = this.openParams;\n var id = op.actionContent;\n var params = {\n appId: op.appId ? op.appId : \"\",\n reportId: id,\n orderId: op.orderId ? op.orderId : \"\",\n docId: op.docId ? op.docId : \"\"\n };\n this.$api.getCustomreports(id, params, {\n onSucess: function onSucess(response) {\n var urls = response.data;\n if (urls.indexOf(\"未知系统异常\") > -1) {\n alert(urls);\n }\n _this5.currentUrl = obpmConfig.obpmFilePath + urls;\n _this5.$api.getCustomreportsHtml(urls, {\n onSucess: function onSucess(res) {\n _this5.reportHtml = res.data;\n var domId = \"report_\" + id;\n setTimeout(function () {\n _this5.setImgUrl(domId);\n }, 1000);\n }\n });\n }\n });\n },\n /**\n * 动态计算页面iframe高度\n */\n getScollerHeight: function getScollerHeight() {\n var _this6 = this;\n setTimeout(function () {\n var clientHeight = document.documentElement.clientHeight || document.body.clientHeight;\n //60 头部, 32 面包屑, 41 第一层页签, 40 第二层页签, 50 列表标题, 71 查询, 20 父组件外边距, 40分页, 16 外边距\n //这个组件在父组件dialog中高度给的85%,54 弹窗标题 30 弹窗底部padding 50 第一季页签 20机动距离\n _this6.iframeHeight = clientHeight - 60 - 32 - 41 - 50 - 20 - 16;\n }, 100);\n }\n }\n};",null]}