{"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_qrcode.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/src/components/o_qrcode.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\nimport Constant from \"@/Constant.js\"\nimport QRCode from 'qrcodejs2'\nimport controlHidden from \"@/assets/js/controlHidden.js\"\nexport default {\n name: \"o-qrcode\",\n props: [\"id\"],\n computed: {\n field: function() {\n return this.$parent.findField(this.id);\n },\n },\n\n mounted(){\n let field = this.field;\n if(field.displayType != 3) {\n this.qrcode();\n }\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\n data: function() {\n return {\n Constant,\n };\n },\n\n methods: {\n dianji(){\n let that = this\n let _native = top.nativeAPI ? top.nativeAPI : nativeAPI;\n _native.toQRScan({\n success: function (res) {\n that.resData = res;\n } \n })\n },\n qrcode() {\n let text = '';\n let domainId = this.$store.state.domainId;\n let uuid = \"\";\n let len = 16;\n let chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';\n let maxPos = chars.length;\n for (let i = 0; i < len; i++) {\n uuid += chars.charAt(Math.floor(Math.random() * maxPos));\n }\n let field = this.field;\n let randomCode = uuid;\n switch (field.handleType) {\n case \"text\": {//显示值\n text = this.field.value || ' '\n if(text.indexOf(\"?\") > -1) {\n let v = text.split(\"?\")\n text = v[0] + \"?\"+ v[1] //encodeURIComponent(v[1])\n }\n text = encodeURI(text)\n break;\n }\n case \"link\"://打开链接\n case \"callback_event\": {//执行扫码事件回调脚本\n let accessToken = Constant.accessToken;\n let formId = field.formId,\n docId = field.docId,\n fieldId = field.divId,\n applicationId = this.$root.appid;\n text = obpmConfig.obpmFilePath +\"/portal/document/qrcodefield/ready?domainId=\" + domainId + \n \"&formId=\" + formId + \n \"&docId=\" + docId + \n \"&fieldId=\" + fieldId + \n \"&applicationId=\" + applicationId + \n \"&_randomCode=\" + randomCode + \n \"&accessToken=\" + accessToken;\n text = encodeURI(text)\n break;\n }\n default:\n break;\n } \n \n //text = host + \"/obpm/portal/document/qrcodefield/ready?domainId=\" + domainId + \"&formId=\" + formId + \"&docId=\" + docId + \"&fieldId=\" + fieldId + \"&applicationId=\" + applicationId + \"&_randomCode=\" + randomCode;\n let width ,\n height;\n if(this.field.displayType == 3){\n width = 0;\n height = 0;\n }else {\n width = this.field.size,\n height = this.field.size;\n }\n\n new QRCode(this.id, {\n width: width, \n height: height,\n correctLevel: 3,\n text: text, // 二维码地址\n })\n },\n }\n}\n",null]}