{"remainingRequest":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\yhxt-web\\src\\components\\ImportExportData\\ImportFile.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\yhxt-web\\src\\components\\ImportExportData\\ImportFile.vue","mtime":1683772234329},{"path":"D:\\jenkins\\workspace\\yhxt-web\\babel.config.js","mtime":1667326389982},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.string.ends-with\";\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';\nvar portal = window.context.portal;\nexport default {\n name: 'importFile',\n props: {\n importData: {\n type: Object,\n default: function _default() {\n return [];\n }\n }\n },\n data: function data() {\n return {\n importDataParams: {},\n dialogImportVisible: false,\n fullscreenLoading: false\n };\n },\n computed: {\n uploadHeaders: function uploadHeaders() {\n return {\n Authorization: 'Bearer ' + this.$store.state.login.currentUser.token\n };\n }\n },\n methods: {\n downLoadTemplete: function downLoadTemplete() {\n var _this = this;\n this.loading = true;\n req.downloadGet(\"\".concat(portal, \"/yhxt/api/file/download?fileType=2\")).then(function (res) {\n _this.loading = false;\n var blob = new Blob([res.data], {\n type: 'application/vnd.ms-excel'\n });\n var link = document.createElement('a'); //定义一个a标签\n link.href = window.URL.createObjectURL(blob); //需要生成一个 URL 来实现下载,链接到blob上\n link.download = _this.importData.templateName; //下载后的文件名称\n link.click(); //模拟在按钮上实现一次鼠标点击\n window.URL.revokeObjectURL(link.href); //释放 URL 对象\n }).catch(function () {\n _this.loading = false;\n });\n },\n openDialog: function openDialog() {\n if (this.importData.mqiId !== '') {\n this.dialogImportVisible = true;\n if (this.importData.mqiId == false) {\n this.dialogImportVisible = true;\n }\n // else {\n this.importDataParams.mqiId = this.importData.mqiId;\n var obj = this.importData.params;\n if (obj) {\n for (var i in obj) {\n this.importDataParams[i] = obj[i];\n }\n }\n // }\n } else {\n this.$message.warning('请先选择一条项目进行导入');\n }\n },\n cancelConfirm: function cancelConfirm() {\n this.$refs.upload.clearFiles();\n this.dialogImportVisible = false;\n this.$refs.upload.uploadFiles = [];\n },\n submitImport: function submitImport() {\n if (!this.$refs.upload.uploadFiles || this.$refs.upload.uploadFiles.length == 0) {\n this.$message.warning('请选择要导入的数据文件!');\n return false;\n }\n this.$refs.upload.submit();\n },\n hadleUploadResult: function hadleUploadResult(response) {\n this.fullscreenLoading = false;\n if (response.state) {\n this.$message.success(response.message);\n this.dialogImportVisible = false;\n // this.$parent.$refs.AtTable.load()\n this.$emit('load', response.value);\n } else {\n this.$message.error(response.message);\n }\n },\n onExceed: function onExceed() {\n this.$message.warning('只能选择一个Excel文件!');\n },\n beforeUpload: function beforeUpload(file) {\n this.fileInfo = file;\n if (!file.name.endsWith('.xlsx') && !file.name.endsWith('.xls')) {\n this.$message.warning('只能导入Excel文件!');\n return false;\n }\n this.fullscreenLoading = true;\n }\n }\n};",null]}