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 }}
+
+ -
+
+
+ {{ file.name }}
+
+
+
+
+
+ {{ uploadText || '重新上传' }}
+
+
+
+
+
+
+
@@ -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"
>