From c003a5fb28554e2f37c431214dabf6f75f27cc29 Mon Sep 17 00:00:00 2001 From: Tcsm <1377977403@qq.com> Date: 星期三, 26 七月 2023 16:52:06 +0800 Subject: [PATCH] 除魅宠外其它模块的图片删除均已完善 --- ruoyi-ui/src/views/secret/secretInfo.vue | 81 ++++++++++++++++++++-------------------- 1 files changed, 40 insertions(+), 41 deletions(-) diff --git a/ruoyi-ui/src/views/secret/secretInfo.vue b/ruoyi-ui/src/views/secret/secretInfo.vue index 6caea1a..9b65ef2 100644 --- a/ruoyi-ui/src/views/secret/secretInfo.vue +++ b/ruoyi-ui/src/views/secret/secretInfo.vue @@ -2,9 +2,9 @@ <div class="app-container"> <div class="form-header mt"> <h4 class="dt h4">闅愮璇︾粏淇℃伅 </h4> - + </div> - + <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="120px"> <el-form-item label="鍙戠敓鏃堕棿" prop="happenTime"> <el-input v-model="formData.happenTime" placeholder="璇烽�夋嫨鏃堕棿" clearable :style="{width: '100%'}" :disabled="dsb"></el-input> @@ -38,8 +38,8 @@ <el-form-item label="澶囨敞" prop="remark"> <el-input v-model="formData.remark" placeholder="璇疯緭鍏ュ娉�" clearable :style="{width: '100%'}" :disabled="dsb"></el-input> </el-form-item> - - + + <h4 class="form-header">鐩稿叧鍥剧墖 </h4> <el-upload action="#" @@ -81,11 +81,11 @@ <i class="el-icon-delete"></i> </span> </span> - - + + </div> </el-upload> - + <h4 class="form-header">鍏朵粬闄勪欢 </h4> <el-upload action="" @@ -94,11 +94,11 @@ multiple list-type="picture-card" :on-preview="handleFileCardPreview" - :on-remove="handleRemove" + :on-remove="handleRemoveFile" :http-request="requestUpload" :show-file-list="true" > - + <i slot="default" class="el-icon-plus"></i> <div slot="file" slot-scope="{file}"> <img @@ -120,7 +120,7 @@ v-if="isShow" @click="handleRemove(file)" class="el-upload-list__item-delete" - + > <i class="el-icon-download"></i> </span> @@ -132,19 +132,19 @@ <i class="el-icon-delete"></i> </span> </span> - - + + </div> - - + + </el-upload> - + <el-form-item size="large"> <el-button v-if="isShow" type="primary" @click="submitForm" :disabled="dsb">淇敼</el-button> </el-form-item> </el-form> - - + + <el-dialog :visible.sync="dialogVisible"> <img w-full :src="dialogImageUrl" alt="Preview Image" /> </el-dialog> @@ -156,7 +156,7 @@ import {blobValidate} from "@/utils/ruoyi"; import errorCode from "@/utils/errorCode"; import {Message} from "element-ui"; - + export default { components: {}, props: [], @@ -168,7 +168,7 @@ fileList:[ ], fileListOther:[ - + ], dsb:true, btn:false, @@ -231,7 +231,7 @@ message: '璇疯緭鍏ュ娉�', trigger: 'blur' }], - + }, typeOptions: [{ value: '0', @@ -262,7 +262,7 @@ this.$route.meta.title = "鏌ョ湅闅愮璇︾粏淇℃伅";//鍒楄〃鐨勫悕绉� this.isShow=false } - + let _this = this if (id) { this.loading = true; @@ -272,9 +272,9 @@ for(let i = 0; i < paths.length; i++) { if(paths[i]!="") { - + let pth = paths[i].substr(paths[i].length - 4, paths[i].length) - + if (_this.fot.includes(pth) === true) _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i]}) else { @@ -288,7 +288,7 @@ this.loading = false; }); this.getCateInfor() - + } }, mounted() {}, @@ -300,7 +300,7 @@ return '鍙拌处' } }, - + getSrc2(kind) { if (kind == 0) { return '鐜伴噾' @@ -318,10 +318,10 @@ return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") }).join(",") this.formData.url = ul+","+uls - + this.$refs['elForm'].validate(valid => { - - + + if (valid) { if (this.formData.id != undefined) { updateSecret(this.formData).then(response => { @@ -331,7 +331,7 @@ }); } else { this.$modal.msgSuccess("淇敼澶辫触"); - + } } }) @@ -378,7 +378,7 @@ }, handleDownload(url) { var formData = {'path':"/"+url.replace(process.env.VUE_APP_BASE_TRUE_API,"")}; - + let lens = formData.path.split(".") let suffix = lens[lens.length-1] download(formData).then(async (response) => { @@ -401,34 +401,34 @@ var formData = new FormData(); formData.append('uploadFile', file); let _this = this - + uploadPic(formData).then(response => { let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length) - + if(_this.fot.includes(pth) === true) { _this.fileList.push({name:response.data.fileName, "url":response.data.url}) - + } - + else{ _this.fileListOther.push({name:response.data.fileName, url:response.data.url}) - + } }) - + }, - + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { this.download('/zfEconomy/export', { ...this.queryParams }, `zfEconomy_${new Date().getTime()}.xlsx`) } - + } } - + </script> <style scoped lang="scss"> .mt @@ -437,7 +437,7 @@ } .dt{ display: block; - + } .pt{ right: 10px; @@ -446,4 +446,3 @@ position: absolute; } </style> - \ No newline at end of file -- Gitblit v1.9.1