diff --git a/src/components/hzwlComponents/UploadFormItem.vue b/src/components/hzwlComponents/UploadFormItem.vue
index d35849758..e34615f83 100644
--- a/src/components/hzwlComponents/UploadFormItem.vue
+++ b/src/components/hzwlComponents/UploadFormItem.vue
@@ -60,13 +60,59 @@
:on-success="onSuccess"
:on-preview="onPreview"
:on-remove="removeOneFile"
- :show-file-list="true"
+ :show-file-list="false"
>
+
+
+
+
+
@@ -120,6 +166,13 @@ export default {
fileMadel: false,
fileList: [], // 用于el-upload
FileList: [], // 用于回显
+
+ openModifyFileNameDialog: false,
+ modifyFile: {
+ fileName: '',
+ fileId: ''
+ },
+ modifyFileNameLoading: false
}
},
created () {
@@ -234,6 +287,42 @@ export default {
this.$preview(attId)
}
},
+ handleRemoveFile (file) {
+ const fileList = []
+ this.FileList.forEach(item => {
+ if (item.id !== file.id) {
+ fileList.push(item)
+ }
+ })
+ this.removeOneFile(file, fileList)
+ },
+ handleModifyName (file) {
+ this.modifyFile.fileName = file.name
+ this.modifyFile.fileId = file.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
+ this.FileList.forEach(item => {
+ if(item.id === this.modifyFile.fileId) {
+ item.name = this.modifyFile.fileName
+ }
+ })
+ const ids = this.FileList.map(item => item.id).join(',')
+ const names = this.FileList.map(item => item.name).join(',')
+ this.$emit('update:ids', ids)
+ this.$emit('update:names', names)
+ }
+ }, e => {
+ this.modifyFileNameLoading = false
+ })
+ },
}
}
@@ -250,4 +339,12 @@ export default {
background: #fff3f3;
z-index: 9;
}
+.el-upload-list__item .el-icon-edit{
+ position: absolute;
+ top: 5px;
+ right: 25px;
+ cursor: pointer;
+ opacity: .75;
+ color: #606266;
+}