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/note/index.vue |   27 ++++++++++++++++++++++-----
 1 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/ruoyi-ui/src/views/note/index.vue b/ruoyi-ui/src/views/note/index.vue
index 0697987..a8eab94 100644
--- a/ruoyi-ui/src/views/note/index.vue
+++ b/ruoyi-ui/src/views/note/index.vue
@@ -106,7 +106,7 @@
 		    plain
 		    icon="el-icon-download"
 		    size="mini"
-		    @click="handleExport"
+		    @click="handleExportTemplate"
 		    v-hasPermi="['family:note:export']"
 		  >瀵煎叆妯℃澘涓嬭浇</el-button>
 		</el-col>
@@ -127,8 +127,8 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="propertyList" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName">
-      <el-table-column type="selection" width="55"  align="center" />
+    <el-table v-loading="loading" :data="propertyList" :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"/>
 
@@ -432,7 +432,10 @@
       this.open = false;
       this.reset();
     },
-
+    getRowId(row)
+    {
+      return row.id
+    },
     //闅旇鍙樿壊
     tableRowClassName({ row, rowIndex }) {
       if (rowIndex % 2 == 0) {
@@ -612,8 +615,22 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
+      const Ids = this.ids;
+
+      if(Ids.length==0)
+      {
       this.download('family/property/export', {
         ...this.queryParams
+      }, `property_${new Date().getTime()}.xlsx`)
+      }else{
+        this.download('family/property/export1/'+Ids, {
+          ...this.queryParams
+        }, `property_${new Date().getTime()}.xlsx`)
+      }
+    },
+    handleExportTemplate(){
+      this.download('family/property/model', {
+
       }, `property_${new Date().getTime()}.xlsx`)
     },
     /** 瀵煎叆鎿嶄綔*/
@@ -622,7 +639,7 @@
     var formData = new FormData();
     formData.append('excelImport', file);
     let _this = this
-    alert(file)
+
     enload(formData).then(response => {
        _this.getList();
       Message({ message: "瀵煎叆鎴愬姛", type: 'warning' })

--
Gitblit v1.9.1