From cc9ddf2ecaf3ad935374f49c842227f7eb15779d Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期三, 16 十一月 2022 10:21:15 +0800
Subject: [PATCH] Merge branch 'master' of http://42.193.1.25:9521/r/sccg_ui

---
 src/views/systemSetting/platform/cockpitManage/index.vue |   19 ++++---------------
 1 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/src/views/systemSetting/platform/cockpitManage/index.vue b/src/views/systemSetting/platform/cockpitManage/index.vue
index 80b04b9..0a1d317 100644
--- a/src/views/systemSetting/platform/cockpitManage/index.vue
+++ b/src/views/systemSetting/platform/cockpitManage/index.vue
@@ -136,6 +136,7 @@
 import detailUser from "./detailUser";
 import { deleteTeam, exportTeamInfo, importTeamInfo, searchTeamInfo } from "@/api/system/portal/teamConstruction";
 import {SUCCESS_CODE} from "@/utils";
+import {downloadFile} from "@/utils/helper";
 
 export default {
     components: { updateUser, detailUser },
@@ -235,20 +236,8 @@
         exportTable() {
           exportTeamInfo({ current: this.currentPage, size: this.pageSize, departName: this.searchDepartment, status: this.searchStatus })
               .then(res => {
-                const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' });
-                const fileName = res.contentDisposition.split('=')[1];
-                if (window.navigator && window.navigator.msSaveBlob) {
-                  navigator.msSaveBlob(blob, fileName);
-                } else {
-                  const link = document.createElement('a');
-                  link.style.display = 'none';
-                  link.href = URL.createObjectURL(blob);
-                  link.setAttribute('download', decodeURI(fileName));
-                  document.body.appendChild(link);
-                  link.click();
-                  URL.revokeObjectURL(link.href);
-                  document.body.removeChild(link);
-                }
+                downloadFile(res);
+                this.$message({ type: 'success', message: '鎿嶄綔鎴愬姛' });
               })
               .catch(err => {
                 this.$message({ type: 'error', message: err });
@@ -257,7 +246,7 @@
 
         // 瀵煎叆
         importTable(file) {
-          importTeamInfo({ 'multipartFile': file.file })
+          importTeamInfo(file.file)
               .then(() => {
                   this.$message({ type: 'success', message: '鎿嶄綔鎴愬姛' });
                   this.getDepartmentList();

--
Gitblit v1.8.0