浏览代码

merge fix

scorpio 2 年之前
父节点
当前提交
fd2a17c0df
共有 1 个文件被更改,包括 17 次插入3 次删除
  1. 17 3
      src/views/home/component/dash.vue

+ 17 - 3
src/views/home/component/dash.vue

@@ -289,9 +289,9 @@ export default {
     }
   },
   methods: {
-    switchTab(item, index) {
+    switchTab (item, index) {
       this.active = index
-      this.onLoad({projectStage: item.dictKey})
+      this.onLoad({ projectStage: item.dictKey })
     },
     onLoad (query = {}) {
       this.loading = true
@@ -410,7 +410,7 @@ export default {
         })
       })
     },
-    projectSave() {
+    projectSave () {
       if (this.disable) {
         this.$message.error('正在处理,请稍后...')
         return
@@ -433,6 +433,20 @@ export default {
           })
         }
       })
+    },
+    exportExcel (res) {
+      const data = Object.assign(this.queryData, { columnName: res })
+      this.$api.params.exportResult(data).then(res => {
+        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()
+      })
     }
   }
 }