{"remainingRequest":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/cache-loader/dist/cjs.js??ref--0-0!/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/components/o_photo.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/components/o_photo.vue","mtime":1725957645727},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/babel.config.js","mtime":1725957645200},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/babel-loader/lib/index.js","mtime":315532800000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/vue-loader/lib/index.js","mtime":1655715099000}],"contextDependencies":[],"result":["import \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport Constant from \"@/Constant.js\";\nimport form_operation from \"@/components/form_operation_log\";\nimport controlHidden from \"@/assets/js/controlHidden.js\";\nexport default {\n name: \"o-photo\",\n props: [\"id\"],\n components: {\n form_operation: form_operation\n },\n computed: {\n field: function field() {\n var formData = this.$parent.findField(this.id);\n if (formData.displayType == 5 || formData.displayType == 3) {\n formData.printHiddenValue = formData.printHiddenValue ? formData.printHiddenValue.replace(/ /g, \"\") : \"\";\n }\n return formData; //this.$parent.findField(this.id);\n }\n },\n data: function data() {\n return {\n Constant: Constant,\n dialogVisible: false,\n photo: \"\",\n savePhoto: \"\",\n showLogsDialog: false,\n showLogsIcon: true,\n operationData: \"\",\n dialogWidth: \"576px\" //在线拍照弹框宽度\n };\n },\n mounted: function mounted() {\n var _this = this;\n window.onresize = function () {\n return function () {\n //监听浏览器窗口改变,在线拍照弹窗宽度不变\n _this.setDialogWidth();\n }();\n };\n this.$nextTick(function () {\n var field = _this.field;\n if (field.isHideType) {\n var id = _this.id,\n formShowType = field.formShowType;\n controlHidden({\n id: id,\n field: field,\n formShowType: formShowType\n });\n }\n });\n },\n methods: {\n setDialogWidth: function setDialogWidth() {\n this.dialogWidth = \"576px\";\n },\n hiddenLogsDialog: function hiddenLogsDialog() {\n this.showLogsIcon = false;\n this.showLogsDialog = false;\n },\n enter: function enter() {\n if (this.field.isModified) {\n this.showLogsIcon = true;\n }\n },\n getOperationLogs: function getOperationLogs() {\n var obj = {};\n obj.fieldName = this.field.name;\n this.operationData = obj;\n this.showLogsDialog = true;\n },\n // 调用摄像头\n callCamera: function callCamera() {\n var _this2 = this;\n navigator.mediaDevices.getUserMedia({\n video: true\n }).then(function (success) {\n // 摄像头开启成功\n _this2.$refs[\"video\"].srcObject = success;\n // 实时拍照效果\n _this2.$refs[\"video\"].play();\n }).catch(function (error) {});\n },\n // 拍照\n photograph: function photograph() {\n var ctx = this.$refs[\"canvas\"].getContext(\"2d\");\n // 把当前视频帧内容渲染到canvas上\n ctx.drawImage(this.$refs[\"video\"], 0, 0, 160, 125);\n // 转base64格式、图片格式转换、图片质量压缩\n var imgBase64 = this.$refs[\"canvas\"].toDataURL(\"image/jpeg\", 0.7);\n this.savePhoto = imgBase64;\n },\n // 关闭摄像头\n closeCamera: function closeCamera() {\n if (!this.$refs[\"video\"].srcObject) return;\n var stream = this.$refs[\"video\"].srcObject;\n var tracks = stream.getTracks();\n tracks.forEach(function (track) {\n track.stop();\n });\n this.$refs[\"video\"].srcObject = null;\n },\n showDialog: function showDialog() {\n var explorer = window.navigator.userAgent;\n if (explorer.indexOf(\"MSIE\") >= 0 || explorer.indexOf(\"Edge\") >= 0) {\n alert($(\"photo.unsupport_ie\"));\n } else {\n this.dialogVisible = true;\n this.callCamera();\n }\n },\n onOk: function onOk() {\n this.photo = this.savePhoto;\n this.dialogVisible = false;\n this.closeCamera();\n },\n handleClose: function handleClose(done) {\n var _this3 = this;\n this.$confirm($t(\"close\")).then(function () {\n _this3.closeCamera();\n done();\n }).catch(function () {});\n },\n callOff: function callOff() {\n this.dialogVisible = false;\n this.closeCamera();\n }\n }\n};",null]}