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/collection/index.vue | 36 ++++++++++++++++++++++++------------ 1 files changed, 24 insertions(+), 12 deletions(-) diff --git a/ruoyi-ui/src/views/collection/index.vue b/ruoyi-ui/src/views/collection/index.vue index fe7572f..0b53229 100644 --- a/ruoyi-ui/src/views/collection/index.vue +++ b/ruoyi-ui/src/views/collection/index.vue @@ -196,8 +196,8 @@ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> </div> - <el-table v-loading="loading" :data="collectionList" @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="collectionList" :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="60"/> <el-table-column label="鑾峰緱鏃堕棿" prop="happenTime" sortable width="100" align="center"> <template slot-scope="scope">{{scope.row.happenTime? scope.row.happenTime: '鈥斺�斺�斺��'}}</template> @@ -214,7 +214,7 @@ <el-table-column label="鏉ユ簮" prop="source" sortable width="90" align="center" > <template slot-scope="scope">{{scope.row.source? scope.row.source: '鈥斺�斺�斺��'}}</template> </el-table-column> - <el-table-column label="鎸佹湁鑰�" prop="owner" sortable width="110" align="center"> + <el-table-column label="鎷ユ湁鑰�" prop="owner" sortable width="110" align="center"> <template slot-scope="scope">{{scope.row.owner? scope.row.owner: '鈥斺�斺�斺��'}}</template> </el-table-column> <el-table-column label="浠峰��" prop="price" sortable width="90" align="center"> @@ -223,7 +223,10 @@ <el-table-column label="瀛樻斁浣嶇疆" prop="location" sortable width="130" align="center"> <template slot-scope="scope">{{scope.row.location? scope.row.location: '鈥斺�斺�斺��'}}</template> </el-table-column> - <el-table-column label="鐢靛瓙鏂囦欢" prop="url" width="80" > + <el-table-column label="澶囨敞" prop="remark" sortable width="90" align="center"> + <template slot-scope="scope">{{scope.row.remark? scope.row.remark: '鈥斺�斺�斺��'}}</template> + </el-table-column> + <el-table-column label="鐢靛瓙鏂囦欢" prop="url" width="180" > <template slot-scope="scope" > <img class="el-upload-list__item-thumbnail" @@ -244,9 +247,7 @@ </template> </el-table-column> - <el-table-column label="澶囨敞" prop="remark" sortable width="90" align="center"> - <template slot-scope="scope">{{scope.row.remark? scope.row.remark: '鈥斺�斺�斺��'}}</template> - </el-table-column> + <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width" > <template slot-scope="scope" v-if="scope.row.roleId !== 1"> <el-button @@ -307,8 +308,8 @@ <el-input v-model="formDat.source" placeholder="璇疯緭鍏ユ潵婧�" clearable :style="{width: '100%'}" > </el-input> </el-form-item> - <el-form-item label="鎸佹湁鑰�" prop="owner"> - <el-input v-model="formDat.owner" placeholder="璇疯緭鍏ユ寔鏈夎��" clearable :style="{width: '100%'}" > + <el-form-item label="鎷ユ湁鑰�" prop="owner"> + <el-input v-model="formDat.owner" placeholder="璇疯緭鍏ユ嫢鏈夎��" clearable :style="{width: '100%'}" > </el-input> </el-form-item> <el-form-item label="浠锋牸" prop="price"> @@ -567,7 +568,10 @@ this.open = false; this.reset(); }, - + getRowId(row) + { + return row.id + }, //闅旇鍙樿壊 tableRowClassName({ row, rowIndex }) { if (rowIndex % 2 == 0) { @@ -752,15 +756,23 @@ }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { + const Ids = this.ids; + + if(Ids.length==0) + { this.download('zfCollection/export', { ...this.queryParams }, `zfCollection_${new Date().getTime()}.xlsx`) + }else{ + this.download('zfCollection/export1/'+Ids, { + }, `zfCollection_${new Date().getTime()}.xlsx`) + } }, /** 瀵煎叆妯℃澘涓嬭浇鎸夐挳鎿嶄綔 */ handleExportModel() { - this.downloadModel('zfCollection/model', { - ...this.queryParams + + this.download('/zfCollection/model', { }, `zfCollection_model_${new Date().getTime()}.xlsx`) }, -- Gitblit v1.9.1