From ee15398472acb5686be991b6445bab3db3cf229b Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期六, 30 十一月 2024 01:25:41 +0800
Subject: [PATCH] 任务分配支持选部门

---
 src/views/projectEngineering/projectLibrary/component/FileDialog.vue |   33 +++++++++++----------------------
 1 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/src/views/projectEngineering/projectLibrary/component/FileDialog.vue b/src/views/projectEngineering/projectLibrary/component/FileDialog.vue
index 443aee5..aee768c 100644
--- a/src/views/projectEngineering/projectLibrary/component/FileDialog.vue
+++ b/src/views/projectEngineering/projectLibrary/component/FileDialog.vue
@@ -55,6 +55,7 @@
 
 <script>
 import { globalHeaders } from '@/utils/request';
+import {getToken} from "@/utils/auth";
 
 export default {
   name: 'FileDialog',
@@ -76,6 +77,7 @@
   },
   data() {
     return {
+      queryParams: {},
       uploadRef: null,
       targetColumn: [],
       accept: `.zip`,
@@ -85,6 +87,9 @@
     };
   },
   methods: {
+    submit() {
+      console.log("瀛愮粍浠秙ubmit")
+    },
     handleFileUploadProgress() {
       this.uploadIsUploading = true;
     },
@@ -104,25 +109,7 @@
       }
     },
     handleDownloadFile() {
-      const self = this;
-      // fetch(`${process.env.VITE_APP_BASE_API}/project/export/template`, {
-      //   method: 'GET',
-      //   headers: self.upload.headers
-      // })
-      //   .then(response => response.blob())
-      //   .then(blob => {
-      //     const url = window.URL.createObjectURL(blob);
-      //     const a = document.createElement('a');
-      //     a.style.display = 'none';
-      //     a.href = url;
-      //     a.download = `椤圭洰鏂囦欢妯℃澘_${new Date().getTime()}.zip`;
-      //     document.body.appendChild(a);
-      //     a.click();
-      //     window.URL.revokeObjectURL(url);
-      //   })
-      //   .catch(error => {
-      //     console.error('鏂囦欢涓嬭浇澶辫触:', error);
-      //   });
+      this.download('/project/info/export/template', {}, `椤圭洰鏂囦欢妯℃澘_${new Date().getTime()}.zip`)
     },
     submitFileForm() {
       if (this.uploadRef) {
@@ -133,15 +120,17 @@
       this.$emit('fileDialogCancel');
     },
     handleDownloadTargetList() {
-      console.log('瀵煎嚭鐩爣鍒楄〃鍐呭', this.currentColumns);
-      this.targetColumn = this.currentColumns.filter(item => item.visible);
+      this.queryParams.fieldList = this.currentColumns.filter(item => item.visible).map(item =>item.id);
+      this.queryParams.requireFile = false;
+      this.download('project/info/export', {
+          ...this.queryParams
+        }, `椤圭洰搴�${new Date().getTime()}.xlsx`)
     }
   },
   mounted() {
     this.uploadRef = this.$refs.uploadRef;
   },
   created() {
-
     this.isFileDialogVisible = this.fileDialogVisible;
   }
 };

--
Gitblit v1.8.0