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/device/index.vue | 29 +++++++++++++++++++++++------ 1 files changed, 23 insertions(+), 6 deletions(-) diff --git a/ruoyi-ui/src/views/device/index.vue b/ruoyi-ui/src/views/device/index.vue index 2b64e80..1002cd0 100644 --- a/ruoyi-ui/src/views/device/index.vue +++ b/ruoyi-ui/src/views/device/index.vue @@ -99,7 +99,7 @@ plain icon="el-icon-download" size="mini" - @click="handleExport" + @click="handleExportTemplate" v-hasPermi="['family:note:export']" >瀵煎叆妯℃澘涓嬭浇</el-button> </el-col> @@ -123,8 +123,8 @@ </el-row> <!-- 搴忓彿銆佽澶囧悕绉般�佹椂闂淬�佽喘涔颁汉銆佷簨椤瑰唴瀹广�佸瓨鏀惧湴鐐广�佺數瀛愭枃浠躲�佸娉� 鎿嶄綔--> <!-- 杩欓噷鏈変釜familyList鏁扮粍 鏄湪data()涓畾涔夌殑 --> - <el-table v-loading="loading" :data="equipmentList" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" style="background: #FFEFF2; border-radius: 14px 14px 14px 14px;"> - <el-table-column type="selection" width="55" align="center" /> + <el-table v-loading="loading" :data="equipmentList" :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="55" align="center" /> <el-table-column label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="120"/> <el-table-column label="璁惧鍚嶇О" prop="name" sortable width="120" /> @@ -137,7 +137,7 @@ </template> </el-table-column> <el-table-column label="璐拱浜�" prop="buyer" sortable width="100" /> - <el-table-column label="鏍囬" prop="content" sortable :show-overflow-tooltip="true" width="150" /> + <el-table-column label="浜嬮」鍐呭" prop="content" sortable :show-overflow-tooltip="true" width="150" /> <el-table-column label="瀛樻斁鍦扮偣" prop="location" sortable width="100" /> <el-table-column label="澶囨敞" prop="remark" sortable width="100" > @@ -221,7 +221,7 @@ <el-input v-model="formDat.buyer" placeholder="璇疯緭鍏ヨ喘涔颁汉" clearable :style="{width: '100%'}" > </el-input> </el-form-item> - <el-form-item label="鏍囬" prop="content"> + <el-form-item label="浜嬮」鍐呭" prop="content"> <el-input v-model="formDat.content" placeholder="璇疯緭鍏ヤ簨椤瑰唴瀹�" clearable :style="{width: '100%'}" ></el-input> </el-form-item> <el-form-item label="瀛樻斁鍦扮偣" prop="location"> @@ -569,7 +569,10 @@ } }); }, - +getRowId(row) + { + return row.id + }, handlePictureCardPreview(file) { this.dialogImageUrl = file.url; @@ -631,9 +634,23 @@ }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { + const Ids = this.ids; + + if(Ids.length==0) + { this.download('/zfEquipment/export', { ...this.queryParams }, `zfEquiment_${new Date().getTime()}.xlsx`) + } + else{ + this.download('/zfEquipment/export1/'+Ids, { + }, `zfEquiment_${new Date().getTime()}.xlsx`) + } + }, + handleExportTemplate(){ + this.download('/zfEquipment/model', { + + }, `zfEquiment_${new Date().getTime()}.xlsx`) }, /** 瀵煎叆鎿嶄綔*/ handleEnport(params){ -- Gitblit v1.9.1