{"remainingRequest":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\examine-fvue\\src\\components\\eipControl\\EipViewer.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\examine-fvue\\src\\components\\eipControl\\EipViewer.vue","mtime":1667280204061},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.number.constructor\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.function.name\";\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 req from \"@/request.js\";\nimport { mapState } from \"vuex\";\nimport { Loading } from \"element-ui\";\nimport hotentUtils from \"@/hotent-ui-util.js\";\nimport sub_pio_mixin from \"@/sub-permission-mixin.js\";\nimport utils from \"@/utils.js\";\nexport default {\n name: \"EipViewer\",\n props: [\"value\", \"permission\", \"modelExpression\", \"imgHeight\", \"imgWidth\", \"uploadType\", \"limit\", \"multiple\", \"validate\", \"name\", \"allowPreview\", \"allowDownload\"],\n mixins: [sub_pio_mixin],\n //混入方式引入表单组件中公共属性,处理子表、孙表行内联动(切面修改permission_sub_sub)\n data: function data() {\n return {\n httpsFile: {\n fileName: \"\",\n url: \"\",\n previewUrl: \"\"\n },\n dialogFormVisible: false,\n style: {\n width: \"265px\",\n height: \"180px\",\n border: \"2px solid #ccc\",\n borderRadius: \"3px\",\n padding: \"1px\",\n margin: \"1px\",\n cursor: \"pointer\"\n },\n imgArr: []\n };\n },\n computed: mapState({\n inputVal: {\n get: function get() {\n return this.value;\n },\n set: function set(val) {\n this.$emit(\"input\", val);\n }\n },\n inputWriteable: function inputWriteable() {\n return utils.getWriteable(this.permission_sub);\n },\n inputValidate: function inputValidate() {\n var validateObj = this.$store.state.index.validate;\n return utils.addRequiredOrNot(this.permission_sub, this.validate, validateObj, this);\n },\n inputName: function inputName() {\n var labeldesc = \"\";\n\n if (this.$slots && this.$slots.labeldesc && this.$slots.labeldesc[0].children && this.$slots.labeldesc[0].children[0].text) {\n labeldesc = this.$slots.labeldesc[0].children[0].text;\n return this.name ? this.name : utils.getName() + \"-\" + labeldesc;\n } else {\n return this.name ? this.name : utils.getName();\n }\n },\n header: function header(state) {\n return {\n Authorization: \"Bearer \".concat(state.login.currentUser.token)\n };\n },\n actionUrl: function actionUrl() {\n return window.context.portal + \"/system/file/v1/upload\";\n },\n previewAble: function previewAble() {\n if (this.permission_sub != 'w' && !this.allowPreview) {\n return false;\n }\n\n return true;\n },\n downloadAble: function downloadAble() {\n if (this.permission_sub != 'w' && !this.allowDownload) {\n return false;\n }\n\n return true;\n }\n }),\n watch: {\n imgArr: function imgArr(newVal, oldVal) {\n var _this = this;\n\n if (newVal && newVal.length > 0 && (!newVal[newVal.length - 1].status || newVal[newVal.length - 1].status != \"success\")) {\n if (this.previewAble) {\n var this_ = this;\n var index = 0;\n this.imgArr.forEach(function (img) {\n if (_this.uploadType == 'local' && !img.previewUrl) {\n req.get(img.url, 'arraybuffer').then(function (response) {\n var type = response.headers['content-type'];\n\n if (type) {\n img.previewUrl = window.URL.createObjectURL(new Blob([response.data], {\n type: type\n }));\n } else {\n img.previewUrl = window.URL.createObjectURL(new Blob([response.data]));\n }\n\n this_.$set(this_.imgArr, index, img);\n index++;\n });\n } else if (_this.uploadType == 'https') {\n img.previewUrl = img.url;\n }\n });\n }\n\n this.$emit(\"input\", JSON.stringify(this.imgArr));\n }\n }\n },\n mounted: function mounted() {\n if (this.value) {\n var ary = JSON.parse(this.value);\n\n if (ary instanceof Array) {\n this.imgArr = ary;\n }\n }\n\n if (this.imgHeight > 0 && this.imgWidth > 0) {\n this.style = {\n height: this.imgHeight + \"px\",\n width: this.imgWidth + \"px\"\n };\n }\n },\n created: function created() {\n this.$validator = this.$root.$validator;\n },\n methods: {\n handleExceed: function handleExceed(files, fileList) {\n this.$message.warning(\"\\u5F53\\u524D\\u9650\\u5236\\u9009\\u62E9 \".concat(Number(this.limit), \" \\u4E2A\\u6587\\u4EF6\\uFF0C\\u672C\\u6B21\\u9009\\u62E9\\u4E86 \").concat(files.length, \" \\u4E2A\\u6587\\u4EF6\\uFF0C\\u5171\\u9009\\u62E9\\u4E86 \").concat(files.length + fileList.length, \" \\u4E2A\\u6587\\u4EF6\"));\n },\n progress: function progress() {\n Loading.service(\"文件上传中\");\n },\n //文件上传成功时\n success: function success(response, file, fileList) {\n var loadingInstance = Loading.service(\"文件上传中\");\n var this_ = this;\n setTimeout(function () {\n if (fileList.length != this_.imgArr.length) {\n for (var i = 0; i < fileList.length; i++) {\n var value = fileList[i].response;\n\n if (value) {\n var item = {};\n item.url = window.context.portal + \"/file/onlinePreviewController/v1/getFileById_\" + value.fileId;\n item.fileName = value.fileName;\n item.previewUrl = '';\n this_.imgArr.push(item);\n }\n }\n } // 以服务的方式调用的 Loading 需要异步关闭\n\n\n loadingInstance.close();\n }, 1000);\n },\n beforeAvatarUpload: function beforeAvatarUpload(file) {\n var FileExt = file.name.replace(/.+\\./, \"\");\n\n if ([\"jpg\", \"png\", \"gif\", \"ico\", \"jpeg\"].indexOf(FileExt.toLowerCase()) === -1) {\n this.$message({\n type: \"warning\",\n message: \"请上传后缀名为jpg、png、gif、ico、jpeg类型的图片\"\n });\n return false;\n }\n },\n downloadFile: function downloadFile(item) {\n if (item && item.url && item.url.split(\"getFileById_\").length == 2) {\n var fileId = item.url.split(\"getFileById_\")[1];\n req.download(\"${portal}/system/file/v1/downloadFile?fileId=\" + fileId);\n }\n },\n httpsDialog: function httpsDialog() {\n var _this2 = this;\n\n this.$validator.validateAll(\"httpsFileForm\").then(function (result) {\n if (result) {\n var item = {\n fileName: _this2.httpsFile.fileName,\n url: _this2.httpsFile.url,\n previewUrl: ''\n };\n\n _this2.imgArr.push(item);\n\n _this2.httpsFile = {\n fileName: \"\",\n url: \"\",\n previewUrl: \"\"\n };\n _this2.dialogFormVisible = false;\n } else {\n _this2.$message.error(\"表单未正确填写\");\n }\n });\n }\n }\n};",null]}