{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\common\\HtFileUpload.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\common\\HtFileUpload.vue","mtime":1675071991678},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"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//\nimport { mapState } from \"vuex\";\nimport req from \"@/request.js\";\nimport utils from \"@/hotent-ui-util.js\";\nexport default {\n props: [\"limit\"],\n data: function data() {\n return {\n limits: this.limit,\n src: \"\",\n fileId: \"\",\n fileTree: \"\",\n iframeSrc: \"\",\n files: [],\n uploadingFiles: {},\n list: [],\n isChecking: true,\n accept: \".jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.PNG,.BMP,.PDF,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.rtf,.txt,.zip,.rar,.vsd,.dwg\",\n num: 0\n };\n },\n computed: mapState({\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 + \"/file/v1/upload\";\n }\n }),\n mounted: function mounted() {\n if (!this.limit) {\n this.limits = 9999999;\n }\n },\n methods: {\n exceed: function exceed(file, fileList) {\n if (this.limit == 1 && (fileList.length == 1 || file.length > 1)) {\n this.$message.warning(\"正文只能上传一个文件\");\n }\n },\n preview: function preview(files) {\n var _this = this;\n\n var id = files.id;\n this.$store.dispatch(\"menu/onlinePreview\", id).then(function (data) {\n _this.fileId = id;\n\n if (data.result == \"html\") {\n _this.iframeSrc = window.context.portal + data.pdfUrl;\n\n _this.$refs.iframeSrcSearch.handleOpen();\n } else if (data.result == \"txt\") {\n _this.iframeSrc = window.context.portal + data.TxtUrl;\n\n _this.$refs.iframeSrcSearch.handleOpen();\n } else if (data.result == \"picture\") {\n _this.iframeSrc = window.context.portal + data.currentUrl;\n\n _this.$refs.iframeSrcSearch.handleOpen();\n } else if (data.result == \"compress\") {\n _this.fileTree = JSON.parse(data.fileTree).childList;\n\n _this.$refs.fileTreeSearch.handleOpen();\n } else {\n _this.src = window.context.portal + data.pdfUrl;\n\n _this.$refs.pdfSearch.handleOpen();\n }\n });\n },\n beforeRemove: function beforeRemove(file, fileList) {\n var _this2 = this;\n\n if (this.isChecking) {\n return this.$confirm(\"\\u786E\\u5B9A\\u79FB\\u9664 \".concat(file.name, \"\\uFF1F\")).then(function () {\n _this2.num = 0;\n var value = {};\n\n if (file.response) {\n value = JSON.parse(file.response.value);\n } else {\n value = file;\n value.fileId = file.id;\n }\n\n for (var i = 0; i < _this2.files.length; i++) {\n if (_this2.files[i].id == value.fileId) {\n _this2.files.splice(i, 1); //删除数组某一项\n\n }\n }\n });\n } else {\n this.num = 0;\n var value = {};\n\n if (file.response) {\n value = JSON.parse(file.response.value);\n } else {\n value = file;\n value.fileId = file.id;\n }\n\n for (var i = 0; i < this.files.length; i++) {\n if (this.files[i].id == value.fileId) {\n this.files.splice(i, 1); //删除数组某一项\n\n delete this.uploadingFiles[Base64.encode(this.files[i].name)];\n }\n }\n }\n },\n error: function error(response, file, fileList) {\n delete this.uploadingFiles[Base64.encode(file.name)];\n },\n success: function success(response, file, fileList) {\n for (var i = 0; i < fileList.length; i++) {\n delete this.uploadingFiles[Base64.encode(fileList[i].name)];\n }\n\n if (this.num == 0) {\n this.list = [];\n\n for (var _i = 0; _i < fileList.length; _i++) {\n this.list.push(fileList[_i]);\n }\n }\n\n this.num = this.num + 1;\n\n for (var j = 0; j < this.list.length; j++) {\n if (!this.list[j].raw) {\n for (var _i2 = 0; _i2 < fileList.length; _i2++) {\n if (this.list[j].name == fileList[_i2].name) {\n fileList.splice(_i2, 1);\n break;\n }\n }\n }\n }\n\n if (this.num == fileList.length) {\n for (var _i3 = 0; _i3 < fileList.length; _i3++) {\n if (fileList[_i3].response) {\n var value = JSON.parse(fileList[_i3].response.value);\n var arrarFile = {};\n arrarFile.id = value.fileId;\n arrarFile.name = value.fileName;\n arrarFile.size = value.size;\n this.files.push(arrarFile);\n }\n }\n\n this.$emit(\"input\", JSON.stringify(this.files));\n }\n },\n // handleChange(file, fileList) {\n // if(file.status==\"success\"){\n // let value = JSON.parse(file.response.value);\n // let arrarFile = {};\n // arrarFile.id = value.fileId;\n // arrarFile.name = value.fileName;\n // arrarFile.size = value.size;\n // this.files.push(arrarFile);\n // this.$emit(\"input\", JSON.stringify(this.files));\n // }\n // },\n getFiles: function getFiles() {\n if (this.files.length == 0) {\n return \"\";\n } else {\n return this.files;\n }\n },\n isFinishUpload: function isFinishUpload() {\n if (JSON.stringify(this.uploadingFiles) != \"{}\") {\n this.$message.warning(\"正在上传附件,请稍后!\");\n throw \"正在上传附件,请稍后!\";\n }\n },\n beforeAvatarUpload: function beforeAvatarUpload(file) {\n // 文件类型限制\n var name = file.name ? file.name : \"\";\n var ext = name ? name.substr(name.lastIndexOf(\".\") + 1, name.length) : true;\n var isExt = this.accept.indexOf(ext) < 0;\n this.isChecking = !isExt;\n\n if (isExt) {\n if (this.accept == \"false\") {\n this.$message.error(\"请配置可上传文件的格式!\");\n } else {\n this.$message.error(\"上传的附件只能是 \" + this.accept + \"格式!\");\n }\n\n return !isExt;\n }\n\n this.uploadingFiles[Base64.encode(name)] = \"eror\";\n }\n }\n};",null]}