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/contacts/index.vue |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/ruoyi-ui/src/views/contacts/index.vue b/ruoyi-ui/src/views/contacts/index.vue
index 31d9577..d40a383 100644
--- a/ruoyi-ui/src/views/contacts/index.vue
+++ b/ruoyi-ui/src/views/contacts/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 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
   </div>
-    <el-table v-loading="loading" :data="contactList"  @selection-change="handleSelectionChange"  :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
-      <el-table-column type="selection" width="25"  align="center" />
+    <el-table v-loading="loading" :data="contactList"  :row-key="getRowId" ref="multipleTable"  @selection-change="handleSelectionChange"  :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
+      <el-table-column type="selection" :reserve-selection="true" width="25"  align="center" />
       <el-table-column  label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="80"/>
 
       <el-table-column label="鎴愬憳濮撳悕" prop="myName" sortable width="100" >
@@ -549,7 +549,10 @@
       this.open = false;
       this.reset();
     },
-
+    getRowId(row)
+    {
+      return row.id
+    },
     //闅旇鍙樿壊
     tableRowClassName({ row, rowIndex }) {
       if (rowIndex % 2 == 0) {
@@ -734,9 +737,22 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
+      const Ids = this.ids;
+      
+      if(Ids.length==0)
+      {
       this.download('zfContact/export', {
         ...this.queryParams
       }, `zfContact_${new Date().getTime()}.xlsx`)
+      }else{
+        this.download('zfContact/export1/'+Ids, {
+        }, `zfContact_${new Date().getTime()}.xlsx`)
+      }
+    },
+    handleExportTemplate(){
+      this.download('zfContact/model', {
+        ...this.queryParams
+      }, `zfContact_${new Date().getTime()}.xlsx`)
     },
     /** 瀵煎叆鎿嶄綔*/
     handleEnport(params){

--
Gitblit v1.9.1