{"remainingRequest":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/src/components/o_word.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/src/components/o_word.vue","mtime":1740130327258},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/babel-loader/lib/index.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/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//\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//\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//\n//\n\nimport pdf from 'vue-pdf'\nimport Constant from \"@/Constant.js\"\nimport controlHidden from \"@/assets/js/controlHidden.js\"\nexport default {\n name: \"o-word\",\n props: [\"id\"],\n computed: {\n field: function() {\n let formData = this.$parent.findField(this.id);\n if(formData.openType == '1') {\n this.setEmbedPdf(formData['data-file-name'],formData['data-full-path']);\n }\n return this.$parent.findField(this.id);\n }\n },\n components: {\n pdf,\n },\n mounted(){\n this.$nextTick(()=>{\n let field = this.field;\n if(field.isHideType) {\n let id = this.id,\n formShowType = field.formShowType;\n controlHidden({id, field, formShowType})\n }\n })\n },\n data: function() {\n return {\n Constant,\n pdfUrl:'',\n popupVisible: false,\n\n currentPage: 0, // pdf文件页码\n pageCount: 0, // pdf文件总页数\n //fileType: 'pdf', // 文件类型\n src: '', // pdf文件地址\n pageX:'', \n pageY:'', \n initX:'', \n initY:'', \n isTouch:false,\n start: [],\n scaleLength:'',\n touchespageX:'',\n touchespageY:'',\n scale:100,\n touchMoveX:'',\n touchMoveY:'',\n valLength:'',\n now:'',\n startVal:'',\n endVal:'',\n isZoom:false,\n isembed:true,\n };\n },\n methods: {\n setEmbedPdf(value,path) {\n let id = value.split('.')[0];\n this.$api.readPDF(id,path, {\n onSucess: response => {\n let pdfUrl = obpmConfig.obpmFilePath + \"/\" + response.data.data\n let pdfPath = \"\";\n let statiContextPath = obpmConfig.statiContextPath;\n if(statiContextPath) { //5.0 trunk\n pdfPath = obpmConfig.statiContextPath + '/mobile/pdf/web/viewer.html?file=' + pdfUrl\n }else { //4.4 stable\n pdfPath = obpmConfig.obpmFilePath + '/mobile/pdf/web/viewer.html?file=' + pdfUrl\n }\n this.pdfUrl = pdfPath;\n }\n });\n },\n touchstart(e) {\n\t\t\tthis.pageX = e.targetTouches[0].pageX;\n\t\t\tthis.pageY = e.targetTouches[0].pageY;\n\t\t\tthis.initX = e.target.offsetLeft;\n this.initY = e.target.offsetTop;\n\t\t\t//记录初始 一组数据 作为缩放使用\n if (e.touches.length >= 2) { //判断是否有两个点在屏幕上\n this.start = e.touches; //得到第一组两个点\n this.isTouch = true;\n\t\t\t}\n\t\t\tthis.isTouch = true;\n },\n touchmove(e) {\n\t\t\t// 一根 手指 执行 目标元素移动 操作\n\t\t\tif (e.touches.length == 1 && this.isTouch) {\n\t\t\t\t//移动目标的 X Y 坐标\n\t\t\t\tthis.touchMoveX = e.targetTouches[0].pageX,\n\t\t\t\tthis.touchMoveY = e.targetTouches[0].pageY;\n\t\t\t\t//设置当前点击元素的 top left 定位值\n\t\t\t\te.target.style.left = parseInt(this.touchMoveX) - parseInt(this.pageX) + parseInt(this.initX) + \"px\";\n e.target.style.top = parseInt(this.touchMoveX) - parseInt(this.pageY) + parseInt(this.initY) + \"px\";\n\t\t\t}\n\n\t\t\t// 2 根 手指执行 目标元素放大操作\n\t\t\tif (e.touches.length >= 2 && this.isTouch) {\n e.preventDefault();\n this.now = e.touches;\n let x = this.now[1].pageX - this.now[0].pageX;\n let y = this.now[1].pageY - this.now[0].pageY;\n this.startVal = Math.sqrt((x * x) + (y * y));\n let z = this.start[1].pageX - this.start[0].pageX;\n let j = this.start[1].pageY - this.start[0].pageY;\n this.endVal = Math.sqrt((z * z) + (j * j));\n this.valLength = this.startVal/this.endVal;\n this.isZoom = true;\n }\n },\n\n touchend(isembed) {\n if (this.isTouch) {\n\t\t\t\tthis.isTouch = false;\n }\n if(isembed) {\n if(this.valLength>=1 && this.isZoom) {\n this.scale += 15;\n this.$refs.pdfs.$el.style.width = parseInt(this.scale) + \"%\";\n this.isZoom = false\n }else if(this.valLength<1 && this.isZoom){\n if (this.scale == 100) {\n return;\n }\n this.scale += -15;\n this.$refs.pdfs.$el.style.width = parseInt(this.scale) + \"%\";\n this.isZoom = false\n }\n }else {\n if(this.valLength>=1 && this.isZoom) {\n this.scale += 15;\n this.$refs.pdf.$el.style.width = parseInt(this.scale) + \"%\";\n this.isZoom = false\n }else if(this.valLength<1 && this.isZoom){\n if (this.scale == 100) {\n return;\n }\n this.scale += -15;\n this.$refs.pdf.$el.style.width = parseInt(this.scale) + \"%\";\n this.isZoom = false\n }\n }\n\n\n \n },\n\n // 改变PDF页码,val传过来区分上一页下一页的值,0上一页,1下一页\n changePdfPage (val) {\n if (val === 0 && this.currentPage > 1) {\n this.currentPage--\n }\n if (val === 1 && this.currentPage < this.pageCount) {\n this.currentPage++\n }\n },\n // pdf加载时\n loadPdfHandler (e) {\n console.log(e);\n this.currentPage = 1 // 加载的时候先加载第一页\n },\n\n openDialog() {\n //let path = this.field.fileInfo +''+ this.field.fileInfo;\n this.popupVisible = true;\n let id = this.field['data-file-name'].split('.')[0];\n let path = this.field['data-full-path'];\n this.dialogVisible = true;\n this.$api.readPDF(id,path, {\n onSucess: response => {\n let pdfUrl = obpmConfig.obpmFilePath + \"/\" + response.data.data\n let pdfPath = \"\";\n let statiContextPath = obpmConfig.statiContextPath;\n if(statiContextPath) { //5.0 trunk\n pdfPath = obpmConfig.statiContextPath + '/mobile/pdf/web/viewer.html?file=' + pdfUrl\n }else { //4.4 stable\n pdfPath = obpmConfig.obpmFilePath + '/mobile/pdf/web/viewer.html?file=' + pdfUrl\n }\n this.pdfUrl = pdfPath;\n }\n });\n },\n handleClose() {\n this.dialogVisible = false;\n },\n }\n}\n",null]}