{"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\\checkImportData\\index.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\yhxt-web\\src\\components\\ImportExportData\\checkImportData\\index.vue","mtime":1679336030001},{"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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport req from '@/request.js';\nimport portal from '@/api/portal';\nexport default {\n name: 'ImportData',\n props: {\n // 模板文件名称\n tempFiles: {\n type: String,\n default: '',\n required: true\n },\n originAPIOptions: {\n type: Object,\n default: function _default() {},\n required: true\n }\n },\n computed: {\n uploadHeaders: function uploadHeaders(mapState) {\n return {\n Authorization: 'Bearer ' + this.$store.state.login.currentUser.token\n };\n },\n importUrl: function importUrl() {\n return window.context.portal + this.originAPIOptions.uploadApi;\n }\n },\n data: function data() {\n return {\n dialogShow: false,\n downLoading: false,\n uploading: false\n };\n },\n mounted: function mounted() {},\n methods: {\n cancel: function cancel() {\n this.$refs.upload.clearFiles();\n this.dialogShow = false;\n this.downLoading = false;\n },\n openDialog: function openDialog() {\n this.dialogShow = true;\n },\n downloadTemp: function downloadTemp() {\n var _this = this;\n this.downLoading = true;\n var params = {\n url: window.context.portal + this.originAPIOptions.downloadApi,\n method: 'GET',\n responseType: 'blob'\n };\n req.request(params).then(function (res) {\n var content = res.data;\n var blob = new Blob([content]);\n var fileName = \"\".concat(_this.tempFiles, \".xls\");\n var elink = document.createElement('a');\n elink.download = fileName;\n elink.style.display = 'none';\n elink.href = URL.createObjectURL(blob);\n document.body.appendChild(elink);\n elink.click();\n URL.revokeObjectURL(elink.href); // 释放URL 对象\n document.body.removeChild(elink);\n _this.downLoading = false;\n });\n },\n beforeUpload: function beforeUpload(file) {\n if (!file.name.endsWith('.xlsx') && !file.name.endsWith('.xls')) {\n this.$message.warning('只能导入Excel文件!');\n return false;\n }\n this.uploading = true;\n },\n //导入\n onExceed: function onExceed(file) {\n this.$message.warning('只能选择一个Excel文件!');\n },\n handleUploadResult: function handleUploadResult(response, file, fileList) {\n this.uploading = false;\n if (response.state) {\n this.$message.success(response.message);\n this.dialogShow = false;\n this.$emit('reload');\n } else {\n this.$message.error(response.message + ':' + response.value);\n }\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 }\n};",null]}