From 5d3e0be26b31f7d6d29b3281adcb201ec494a1c6 Mon Sep 17 00:00:00 2001 From: Tcsm <1377977403@qq.com> Date: 星期二, 22 八月 2023 12:51:12 +0800 Subject: [PATCH] 新增不同时显示“正在上传” --- ruoyi-ui/src/views/economy/index.vue | 24 ++++++++++++++++-------- 1 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ruoyi-ui/src/views/economy/index.vue b/ruoyi-ui/src/views/economy/index.vue index d9e3c65..21d63ec 100644 --- a/ruoyi-ui/src/views/economy/index.vue +++ b/ruoyi-ui/src/views/economy/index.vue @@ -101,9 +101,9 @@ <!-- 杩欓噷鏈変釜familyList鏁扮粍 鏄湪data()涓畾涔夌殑 --> <el-table v-loading="loading" :data="economyList" @selection-change="handleSelectionChange" @row-click="handleCheck" :row-class-name="tableRowClassName" style="background: #FFEFF2; border-radius: 14px 14px 14px 14px;"> <el-table-column type="selection" width="55" align="center" /> - <el-table-column fixed label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="120"/> + <el-table-column fixed label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="80"/> - <el-table-column label="鍙戠敓鏃堕棿" prop="createTime" sortable width="100" align="center"> + <el-table-column label="鍙戠敓鏃堕棿" prop="createTime" sortable width="150" align="center"> <template slot-scope="scope">{{scope.row.createTime? scope.row.createTime: '鈥斺�斺�斺��'}}</template> </el-table-column> <el-table-column label="鍙拌处" prop="type" sortable width="100" /> @@ -268,7 +268,8 @@ :http-request="requestUpload" :show-file-list="true" > - <el-button type="primary">涓婁紶</el-button> + <el-button type="primary">鐐瑰嚮涓婁紶</el-button> + <div v-if="uploading" class="upload-status">姝e湪涓婁紶...</div> <template #tip> <div class="el-upload__tip"> </div> @@ -299,7 +300,7 @@ //鍦╯ystem/note/index.js涓鍏ユ帴鍙e嚱鏁� --鎺ュソ浜� -import {listEconomy,enload,getEconomyInfo,delEconomy, addEconomy, uploadPic} from "@/api/economy/index"; +import {listEconomy,enload,delEconomy, addEconomy, uploadPic} from "@/api/economy/index"; export default { name: "Role", @@ -343,6 +344,7 @@ ], dsb:true, btn:false, + uploading: false, formDat: { type: undefined, createTime: undefined, @@ -625,8 +627,13 @@ Object.keys(this.formDat).forEach(key => { this.formDat[key] = ''; }); - this.handleRemove(this.fileList[0]); - this.handleRemoveFile(this.fileListOther[0]); + for(let i = 0; i <= this.fileList.length; i++) + { + this.handleRemove(this.fileList[0]); + } + for(let i = 0; i < this.fileListOther.length; i++){ + this.handleRemoveFile(this.fileListOther[0]); + } }, requestUpload(params) { @@ -634,10 +641,11 @@ var formData = new FormData(); formData.append('uploadFile', file); let _this = this - + this.uploading = true; uploadPic(formData).then(response => { let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length) - + this.uploading = false; + this.$modal.msgSuccess("涓婁紶鎴愬姛"); if(_this.fot.includes(pth) === true) { _this.fileList.push({name:response.data.fileName, "url":response.data.url}) -- Gitblit v1.9.1