scorpio il y a 2 ans
Parent
commit
8204483248
1 fichiers modifiés avec 22 ajouts et 30 suppressions
  1. 22 30
      src/views/home/component/dash.vue

+ 22 - 30
src/views/home/component/dash.vue

@@ -436,41 +436,33 @@ export default {
     exportExcel (res) {
       const data = Object.assign(this.queryData, { columnName: res, projectIds: this.selectList.join(',') })
       this.$api.params.exportResult(data).then(res => {
-        if (res.code === 200) {
-          const url = window.URL.createObjectURL(new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' }))
-          const link = document.createElement('a')
-          link.style.display = 'none'
-          link.href = url
-          const excelName = new Date().getTime() + '.xlsx'
-          link.setAttribute('download', excelName)
-          document.body.appendChild(link)
-          link.click()
-          link.remove()
-          this.diaType = -1
-          this.$message.success('导出成功')
-        } else {
-          this.$message.error(res.msg)
-        }
+        const url = window.URL.createObjectURL(new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' }))
+        const link = document.createElement('a')
+        link.style.display = 'none'
+        link.href = url
+        const excelName = new Date().getTime() + '.xlsx'
+        link.setAttribute('download', excelName)
+        document.body.appendChild(link)
+        link.click()
+        link.remove()
+        this.diaType = -1
+        this.$message.success('导出成功')
       })
     },
     exportExcelTotal (item) {
       const data = { projectIds: this.selectList.join(',') }
       this.$api.params.summaryExport(Object.assign(item, data)).then(res => {
-        if (res.code === 200) {
-          const url = window.URL.createObjectURL(new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' }))
-          const link = document.createElement('a')
-          link.style.display = 'none'
-          link.href = url
-          const excelName = new Date().getTime() + '.xlsx'
-          link.setAttribute('download', excelName)
-          document.body.appendChild(link)
-          link.click()
-          link.remove()
-          this.diaType = -1
-          this.$message.success('导出成功')
-        } else {
-          this.$message.error(res.msg)
-        }
+        const url = window.URL.createObjectURL(new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' }))
+        const link = document.createElement('a')
+        link.style.display = 'none'
+        link.href = url
+        const excelName = new Date().getTime() + '.xlsx'
+        link.setAttribute('download', excelName)
+        document.body.appendChild(link)
+        link.click()
+        link.remove()
+        this.diaType = -1
+        this.$message.success('导出成功')
       })
     }
   }