{"remainingRequest":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\cssc-fvue\\src\\components\\common\\ContractPreview.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\cssc-fvue\\src\\components\\common\\ContractPreview.vue","mtime":1667804638649},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/web.dom.iterable\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport utils from \"@/utils.js\";\nimport { Message } from \"element-ui\";\nimport req from \"@/request.js\";\nexport default {\n name: \"contractPreview\",\n props: [\"options\"],\n data: function data() {\n return {\n filesProps: {\n label: \"originName\"\n },\n contracts: [],\n currentPage: 0,\n // pdf文件页码\n pageCount: 0,\n // pdf文件总页数\n height: 800,\n fileType: \"pdf\",\n // 文件类型\n currentFileId: '',\n currentFileName: '',\n pdfSrc: ''\n };\n },\n mounted: function mounted() {\n this.height = document.documentElement.clientHeight - 80;\n this.getContracts();\n },\n created: function created() {},\n methods: {\n getContracts: function getContracts() {\n var formInst = utils.getOnlineFormInstance(this);\n\n var _this = this;\n\n this.$http.get('${bpmRunTime}/runtime/bpmPrintRecord/v1/getByProInstId?procInstId=' + formInst.$parent['instId']).then(function (resp) {\n if (resp.data) {\n _this.contracts = resp.data;\n\n if (_this.contracts.length > 0) {\n _this.currentFileId = _this.contracts[0]['fileId'];\n _this.currentFileName = _this.contracts[0]['templateName'];\n\n _this.changeFile();\n }\n }\n }, function (error) {\n _this.$message({\n message: \"获取合同记录失败!\",\n type: \"error\"\n });\n });\n },\n changeFile: function changeFile() {\n var _this = this;\n\n if (this.currentFileId) {\n this.contracts.forEach(function (item) {\n if (item.fileId == _this.currentFileId) {\n _this.currentFileName = item.templateName;\n }\n });\n var url = window.context.portal + \"/file/onlinePreviewController/v1/onlinePreview?fileId=\" + this.currentFileId;\n this.$http.get(url).then(function (resp) {\n var data = resp.data;\n\n if (data.result == \"error\") {\n Message.error(\"附件不存在\");\n } else {\n _this.pdfSrc = window.context.portal + data.pdfUrl;\n }\n });\n }\n },\n // 改变PDF页码,val传过来区分上一页下一页的值,0上一页,1下一页 $scope.src=+portal+$scope.data.pdfUrl;\n changePdfPage: function changePdfPage(val) {\n if (val === 0 && this.currentPage > 1) {\n this.currentPage--;\n }\n\n if (val === 1 && this.currentPage < this.pageCount) {\n this.currentPage++;\n }\n },\n // pdf加载时\n loadPdfHandler: function loadPdfHandler() {\n this.currentPage = 1; // 加载的时候先加载第一页\n },\n handleOpen: function handleOpen() {\n this.pdfDialog = true;\n },\n //关闭弹框\n close: function close() {\n this.pdfDialog = false;\n },\n //附件下载\n download: function download() {\n req.download(\"${portal}/file/v1/downloadFile?fileId=\" + this.fileRow.id);\n }\n }\n};",null]}