{"remainingRequest":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\examine-fvue\\src\\components\\ImportExportData\\ExportData\\ExportData.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\examine-fvue\\src\\components\\ImportExportData\\ExportData\\ExportData.vue","mtime":1667280203686},{"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":["//\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\r\nconst DataTemplateSetting = () =>\r\n import('@/components/ImportExportData/DataTemplateSetting')\r\nimport portal from '@/api/portal'\r\nexport default {\r\n name: 'ExportData',\r\n components: {DataTemplateSetting},\r\n props: {\r\n // 页面组件别名\r\n bizCode: {\r\n type: String,\r\n default: '',\r\n required: true,\r\n },\r\n // 模板文件名称\r\n tempFiles: {\r\n type: String,\r\n default: '',\r\n required: true,\r\n },\r\n originAPIOptions: {\r\n type: Object,\r\n default: () => {},\r\n required: true,\r\n },\r\n dataBaseOptions: {\r\n type: Object,\r\n default: () => {},\r\n required: true,\r\n },\r\n // 导出数据的条件查询 跟页面查询同步\r\n exportQuery: {\r\n type: Object,\r\n default: () => {},\r\n required: true,\r\n },\r\n },\r\n data() {\r\n return {\r\n noTemp: false, // 是否已有模板\r\n dialogShow: false,\r\n downLoading: false,\r\n tempId: '',\r\n }\r\n },\r\n methods: {\r\n checkTemp() {\r\n let data = this.qs.stringify({\r\n type: 1,\r\n bizCode: this.bizCode,\r\n })\r\n portal.checkTemp(data).then((res) => {\r\n if (res) {\r\n this.noTemp = false\r\n this.tempId = res.excelTemp.id\r\n } else {\r\n this.noTemp = true\r\n this.tempId = ''\r\n }\r\n })\r\n },\r\n openDialog() {\r\n this.checkTemp()\r\n this.dialogShow = true\r\n },\r\n cancel() {\r\n this.dialogShow = false;\r\n this.tempId = '';\r\n this.noTemp = false;\r\n this.downLoading = false;\r\n },\r\n setTemp() {\r\n this.$refs.DataTemplate.openDialog(this.tempId)\r\n },\r\n // 下载\r\n exportData() {\r\n this.downLoading = true\r\n let params = {\r\n originAPIOptions: this.originAPIOptions,\r\n bizCode: this.bizCode,\r\n exportQuery: this.exportQuery,\r\n }\r\n portal.ExportData(params).then((res) => {\r\n const content = res\r\n const blob = new Blob([content])\r\n const fileName = `${this.tempFiles}.xls`\r\n const elink = document.createElement('a')\r\n elink.download = fileName\r\n elink.style.display = 'none'\r\n elink.href = URL.createObjectURL(blob)\r\n document.body.appendChild(elink)\r\n elink.click()\r\n URL.revokeObjectURL(elink.href) // 释放URL 对象\r\n document.body.removeChild(elink)\r\n this.downLoading = false\r\n })\r\n },\r\n },\r\n}\r\n",null]}