From 07eaed65a3ca22287c3b257cf808fca713e073d9 Mon Sep 17 00:00:00 2001 From: hanshaozhuang Date: Wed, 29 Jun 2022 13:24:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=BF=AE=E6=94=B9=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CustomFormComponents/File.vue | 85 ++++++++++++++++++- .../domesticStandardsAndRegulations/index.vue | 1 + 2 files changed, 84 insertions(+), 2 deletions(-) diff --git a/src/components/CustomFormComponents/File.vue b/src/components/CustomFormComponents/File.vue index ff7bece28..8c53d94bb 100644 --- a/src/components/CustomFormComponents/File.vue +++ b/src/components/CustomFormComponents/File.vue @@ -53,7 +53,7 @@ multiple drag - :show-file-list="showUploadlist" + :show-file-list="!showModifyName && showUploadlist" :on-success="uploadSuccess" :before-upload="beforeUpload" :on-remove="removeOneFile" @@ -68,6 +68,43 @@
{{ tips }}
+ + + + + + + @@ -87,7 +124,13 @@ export default { uploadPath: 'api/att/attFile/uploadNew', defaultFileList: [], // 默认显示 showFileList: [], - importModalshowflagtemp: false + importModalshowflagtemp: false, + modifyFile: { + fileName: '', + fileId: '' + }, + openModifyFileNameDialog: false, + modifyFileNameLoading: false } }, props: { @@ -150,6 +193,10 @@ export default { }, showUploadBtn: { type: Boolean + }, + showModifyName: { + type: Boolean, + default: false } }, watch: { @@ -204,6 +251,32 @@ export default { } }, methods: { + handleRemoveFile(file){ + console.log('file = ', file) + const index = this.$refs.importFileAboutStand.uploadFiles.findIndex(e => e.response.data.id === file.response.data.id); + console.log('index = ', index) + this.$refs.importFileAboutStand.uploadFiles.splice(index, 1); + this.showFileList.splice(index, 1) + }, + handleModifyName(file) { + this.modifyFile.fileName = file.name + this.modifyFile.fileId = file.response.data.id + this.openModifyFileNameDialog = true + }, + handleModifyNameSubmite(){ + this.modifyFileNameLoading = true + this.$http.get('att/attFile/updateFileName', this.modifyFile, { + _this: this + }, res => { + if(res.ok){ + this.modifyFileNameLoading = false + this.openModifyFileNameDialog = false + // TODO 查修改成功后 回显新的 名称 + } + }, e => { + this.modifyFileNameLoading = false + }) + }, handleExceed(files, fileList) { if (this.exceed) { this.$message.warning(this.exceed) @@ -491,4 +564,12 @@ export default { color: rgba(64, 158, 255, 1); } } + .el-upload-list__item .el-icon-edit{ + position: absolute; + top: 5px; + right: 25px; + cursor: pointer; + opacity: .75; + color: #606266; + } diff --git a/src/pages/regulatoryRepository/domesticStandardsAndRegulations/index.vue b/src/pages/regulatoryRepository/domesticStandardsAndRegulations/index.vue index 65c40907c..2e5c41fcb 100644 --- a/src/pages/regulatoryRepository/domesticStandardsAndRegulations/index.vue +++ b/src/pages/regulatoryRepository/domesticStandardsAndRegulations/index.vue @@ -749,6 +749,7 @@ :config="field" v-model="sarStandardsInfoEO[field.attrField]" :disabled="formdisableflag" + :show-modify-name="true" @fileSuccess="fileSuccess" >