{"remainingRequest":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\frontScreens\\components\\PDFModel.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\frontScreens\\components\\PDFModel.vue","mtime":1684458238559},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport digitalReservoir from '@/api/frontScreen/digitalReservoir.js';\nimport pdf from 'vue-pdf';\nexport default {\n name: 'PDFModel',\n components: {\n pdf: pdf\n },\n data: function data() {\n return {\n visible: false,\n pdfData: {\n name: '应急预案',\n value: '应急预案',\n src: ''\n },\n page: 1,\n numPages: 0,\n rotate: 0,\n previewUrl: window.context.portal + '/file/onlinePreviewController/v1/getFileById_',\n // ----- loading -----\n remindText: {\n loading: '加载文件中,文件较大请耐心等待...',\n refresh: '若卡住不动,可刷新页面重新加载...'\n },\n remindShow: '加载文件中,文件较大请耐心等待...',\n intervalID: '',\n // ----- vuepdf -----\n // src静态路径: /static/xxx.pdf\n // src服务器路径: 'http://.../xxx.pdf'\n src: '',\n // 当前页数\n currentPage: 0,\n // 总页数\n pageCount: 0,\n // 加载进度\n loadedRatio: 0\n };\n },\n destroyed: function destroyed() {\n // 在页面销毁时记得清空 setInterval\n clearInterval(this.intervalID);\n },\n mounted: function mounted() {\n var _this = this;\n\n // 更改 loading 文字\n this.intervalID = setInterval(function () {\n _this.remindShow === _this.remindText.refresh ? _this.remindShow = _this.remindText.loading : _this.remindShow = _this.remindText.refresh;\n }, 4000);\n },\n methods: {\n open: function open(val, title, id, path) {\n this.title = \"\".concat(title);\n this.visible = true;\n\n if (val == 1) {\n this.getDdgcPlan(id);\n } else if (val == 2) {\n this.getReservePlan(id);\n } else if (val == 3) {\n this.src = \"http://183.230.17.146:9080\" + path;\n }\n },\n // loadPdfHandler(e) {\n // \t// 加载的时候先加载第一页\n // \tthis.page = 1\n // },\n // inputEvent() {\n // \tif (this.page > this.numPages) {\n // \t\t// 1. 大于max\n // \t\tthis.page = this.numPages\n // \t} else if (this.page < 1) {\n // \t\t// 2. 小于min\n // \t\tthis.page = 1\n // \t}\n // },\n loadImg: function loadImg(event) {\n var _this2 = this;\n\n var el = event.target;\n\n if (el.scrollTop + el.clientHeight >= el.scrollHeight) {\n setTimeout(function () {\n _this2.changePdfPage('next');\n }, 500);\n }\n },\n // 获取调度规程预案\n getDdgcPlan: function getDdgcPlan(val) {\n var _this3 = this;\n\n this.pdfData.src = '';\n this.src = '';\n digitalReservoir.ddgcPlan(val, function (res) {\n if (res.state) {\n if (res.value) {\n _this3.pdfData.src = _this3.previewUrl + JSON.parse(res.value)[0].fileId;\n _this3.src = _this3.previewUrl + JSON.parse(res.value)[0].fileId;\n } else {\n _this3.remindShow = '暂无文件';\n clearInterval(_this3.intervalID);\n }\n }\n });\n },\n // 获取水库应急预案\n getReservePlan: function getReservePlan(val) {\n var _this4 = this;\n\n this.pdfData.src = '';\n this.src = '';\n digitalReservoir.reservePlan(val, function (res) {\n if (res.state) {\n if (res.value) {\n _this4.pdfData.src = _this4.previewUrl + JSON.parse(res.value)[0].fileId;\n _this4.src = _this4.previewUrl + JSON.parse(res.value)[0].fileId;\n } else {\n _this4.remindShow = '暂无文件';\n clearInterval(_this4.intervalID);\n }\n }\n });\n },\n // 页面回到顶部\n toTop: function toTop() {\n document.getElementById('container').scrollTop = 0;\n },\n // 输入页码时校验\n inputEvent: function inputEvent() {\n if (this.currentPage > this.pageCount) {\n // 1. 大于max\n this.currentPage = this.pageCount;\n } else if (this.currentPage < 1) {\n // 2. 小于min\n this.currentPage = 1;\n }\n },\n // 切换页数\n changePdfPage: function changePdfPage(val) {\n if (val === 'pre' && this.currentPage > 1) {\n // 切换后页面回到顶部\n this.currentPage--;\n this.toTop();\n } else if (val === 'next' && this.currentPage < this.pageCount) {\n this.currentPage++;\n this.toTop();\n } else if (val === 'first') {\n this.currentPage = 1;\n this.toTop();\n } else if (val === 'last' && this.currentPage < this.pageCount) {\n this.currentPage = this.pageCount;\n this.toTop();\n }\n },\n // pdf加载时\n loadPdfHandler: function loadPdfHandler(e) {\n // 加载的时候先加载第一页\n this.currentPage = 1;\n },\n // 禁用鼠标右击、F12 来禁止打印和打开调试工具\n prohibit: function prohibit() {\n // console.log(document)\n document.oncontextmenu = function () {\n return false;\n };\n\n document.onkeydown = function (e) {\n if (e.ctrlKey && (e.keyCode === 65 || e.keyCode === 67 || e.keyCode === 73 || e.keyCode === 74 || e.keyCode === 80 || e.keyCode === 83 || e.keyCode === 85 || e.keyCode === 86 || e.keyCode === 117)) {\n return false;\n }\n\n if (e.keyCode === 18 || e.keyCode === 123) {\n return false;\n }\n };\n },\n close: function close() {\n this.visible = false;\n this.$emit('close');\n },\n password: function password(updatePassword, reason) {\n updatePassword(prompt('password is \"test\"'));\n },\n error: function error(err) {\n this.$message.warning(err.message);\n }\n }\n};",null]}