From 4efd39b4696db81789d3d92a54d197f1e85ecdf2 Mon Sep 17 00:00:00 2001
From: feige <feige@qq.com>
Date: 星期三, 17 五月 2023 17:01:43 +0800
Subject: [PATCH] 把所有模块的导入模板和导出问题都解决了

---
 ruoyi-ui/src/views/bignote/index.vue |   32 +++++++++++++++++++++++++++-----
 1 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/ruoyi-ui/src/views/bignote/index.vue b/ruoyi-ui/src/views/bignote/index.vue
index 7705a6e..d52b55f 100644
--- a/ruoyi-ui/src/views/bignote/index.vue
+++ b/ruoyi-ui/src/views/bignote/index.vue
@@ -120,7 +120,7 @@
           plain
           icon="el-icon-download"
           size="mini"
-          @click="handleExport"
+          @click="handleExportTemplate"
           v-hasPermi="['family:note:export']"
         >瀵煎叆妯℃澘涓嬭浇</el-button>
       </el-col>
@@ -144,8 +144,8 @@
     </el-row>
     <!-- 搴忓彿銆佹椂闂淬�佷汉鐗┿�佸湴鐐广�佸ぇ浜嬫爣棰樸�佺數瀛愭枃浠躲�佸娉� -->
     <!-- 杩欓噷鏈変釜familyList鏁扮粍 鏄湪data()涓畾涔夌殑 -->
-    <el-table v-loading="loading"  :data="familyList" @selection-change="handleSelectionChange"  :row-class-name="tableRowClassName">
-      <el-table-column type="selection" width="55"  align="center" />
+    <el-table v-loading="loading"  :data="familyList" :row-key="getRowId" ref="multipleTable" @selection-change="handleSelectionChange"  :row-class-name="tableRowClassName">
+      <el-table-column type="selection"  :reserve-selection="true" width="55"  align="center" />
 
       <el-table-column  label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="120"/>
       <el-table-column label="鍙戠敓鏃堕棿" prop="happenTime" sortable width="100" align="center">
@@ -443,7 +443,10 @@
       this.open = false;
       this.reset();
     },
-
+    getRowId(row)
+    {
+      return row.id
+    },
     //闅旇鍙樿壊
     tableRowClassName({ row, rowIndex }) {
       if (rowIndex % 2 == 0) {
@@ -523,7 +526,7 @@
     // 澶氶�夋閫変腑鏁版嵁
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
-      console.log(this.ids)
+    //  alert(this.ids)
       this.single = selection.length!=1
       this.multiple = !selection.length
     },
@@ -606,17 +609,35 @@
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
     handleDelete(row) {
       const Ids = row.id || this.ids;
+
       this.$modal.confirm('鏄惁纭鍒犻櫎鎵�閫変腑鏁版嵁椤癸紵').then(function() {
         return delFamilyevent(Ids);
       }).then(() => {
         this.getList();
+        this.ids = []
         this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
       }).catch(() => {});
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
+        const Ids = this.ids;
+
+      if(Ids.length==0)
+      {
       this.download('/family/zfEvent/export', {
         ...this.queryParams
+      }, `zfEvent_${new Date().getTime()}.xlsx`)
+      }
+      else{
+        this.download('/family/zfEvent/export1/'+Ids, {
+        }, `zfEvent_${new Date().getTime()}.xlsx`)
+      }
+      },
+        /** 瀵煎叆妯℃澘涓嬭浇鎿嶄綔*/
+    handleExportTemplate()
+    {
+     this.download('/family/zfEvent/model', {
+
       }, `zfEvent_${new Date().getTime()}.xlsx`)
     },
     /** 瀵煎叆鎿嶄綔*/
@@ -635,6 +656,7 @@
       }
 
     }
+
   }
 };
 </script>

--
Gitblit v1.9.1