fuliqi
2024-11-27 f37bf024e972156951dfcb849281edcb2ee7f9fb
上传文件改为集合
1个文件已修改
10 ■■■■ 已修改文件
src/components/FileUpload/index.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/FileUpload/index.vue
@@ -153,7 +153,7 @@
    // 上传成功回调
    handleUploadSuccess(res, file) {
      if (res.code === 200) {
        this.uploadList.push({ name: res.fileName, url: res.fileName });
        this.uploadList.push({ name: res.newFileName, originalName: res.originalFilename , url: res.fileName });
        this.uploadedSuccessfully();
      } else {
        this.number--;
@@ -166,7 +166,9 @@
    // 删除文件
    handleDelete(index) {
      this.fileList.splice(index, 1);
      this.$emit("input", this.listToString(this.fileList));
      // this.$emit("input", this.listToString(this.fileList));
      //修改为返回数组
      this.$emit("input", this.fileList);
    },
    // 上传结束处理
    uploadedSuccessfully() {
@@ -174,7 +176,9 @@
        this.fileList = this.fileList.concat(this.uploadList);
        this.uploadList = [];
        this.number = 0;
        this.$emit("input", this.listToString(this.fileList));
        // this.$emit("input", this.listToString(this.fileList));
        //修改为返回数组
        this.$emit("input", this.fileList);
        this.$modal.closeLoading();
      }
    },