diff --git a/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue b/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue index 0029c26..21579da 100644 --- a/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue +++ b/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue @@ -14,13 +14,15 @@ <div slot="tip" class="el-upload__tip" v-if="!!field.options.uploadTip">{{field.options.uploadTip}}</div> <i slot="default" class="el-icon-plus avatar-uploader-icon"></i> - <div slot="file" slot-scope="{file}" class="upload-file-list"> - <span class="upload-file-name" :title="file.name">{{file.name}}</span> - <a :href="file.url" download=""> - <i class="el-icon-download file-action" title="i18nt('render.hint.downloadFile')"></i></a> - <i class="el-icon-delete file-action" title="i18nt('render.hint.removeFile')" v-if="!field.options.disabled" - @click="removeUploadFile(file.name)"></i> - </div> + <template #file="{ file }"> + <div class="upload-file-list"> + <span class="upload-file-name" :title="file.name">{{file.name}}</span> + <a :href="file.url" download=""> + <i class="el-icon-download file-action" title="i18nt('render.hint.downloadFile')"></i></a> + <i class="el-icon-delete file-action" title="i18nt('render.hint.removeFile')" v-if="!field.options.disabled" + @click="removeUploadFile(file.name)"></i> + </div> + </template> </el-upload> </form-item-wrapper> </template> @@ -182,6 +184,7 @@ if (file.status === 'success') { //this.fileList.push(file) /* 上传过程中,this.fileList是只读的,不能修改赋值!! */ this.updateUploadFieldModelAndEmitDataChange(fileList) + this.fileList = deepClone(fileList) this.uploadBtnHidden = fileList.length >= this.field.options.limit } @@ -189,7 +192,7 @@ }, handleFileRemove(file, fileList) { - this.fileList = fileList + this.fileList = deepClone(fileList) //this.fileList = fileList this.updateUploadFieldModelAndEmitDataChange(fileList) this.uploadBtnHidden = fileList.length >= this.field.options.limit diff --git a/src/components/form-designer/form-widget/field-widget/picture-upload-widget.vue b/src/components/form-designer/form-widget/field-widget/picture-upload-widget.vue index 38c7d32..fdc39f2 100644 --- a/src/components/form-designer/form-widget/field-widget/picture-upload-widget.vue +++ b/src/components/form-designer/form-widget/field-widget/picture-upload-widget.vue @@ -76,9 +76,6 @@ fileList: [], //上传文件列表 uploadBtnHidden: false, - // styleVariables: { - // '--select-file-action': selectFileText, - // }, } }, computed: { @@ -179,7 +176,7 @@ }, handlePictureRemove(file, fileList) { - this.fileList = fileList + this.fileList = deepClone(fileList) //this.fileList = fileList this.updateUploadFieldModelAndEmitDataChange(fileList) this.uploadBtnHidden = fileList.length >= this.field.options.limit