feige
2024-02-21 c1cff08cdbcee3278c1ac8d8a3a067e3bf015202
ruoyi-ui/src/views/bignote/familyeventInfo.vue
@@ -101,6 +101,7 @@
                style="margin-left: 10px"
                size="small"
                type="success"
              v-if="btn"
                @click="picUpload"
              >上传到服务器</el-button>
      <h4 class="form-header">其他附件 </h4>
@@ -186,6 +187,7 @@
                style="margin-left: 10px"
                size="small"
                type="success"
                v-if="btn"
                @click="fileUpload"
              >上传到服务器</el-button>
                  <h4 class="form-header"> </h4>
@@ -304,13 +306,22 @@
            let pth = paths[i].substr(paths[i].length - 4, paths[i].length)
            if (_this.fot.includes(pth) === true)
              _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
         {
            if(paths[i][0]=="/")
              _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1)})
           else
              _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
           }
            else {
              // alert(paths[i])
              let nms = paths[i].split("\/")
              let nm = nms[nms.length - 1]
              _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
            }
           if(paths[i][0]=="/")
              _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1)})
            else
            _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
         }
          }
        _this.fileList1 = _this.fileList
        }
@@ -466,10 +477,13 @@
   },
   fileUpload(){
   //   var file = params.file;
      var formData = new FormData();
      this.$refs.upload1.submit();
      // formData.append('uploadFile', file);
      if(this.uploadFileList1.length==0){
           this.$modal.msgSuccess("文档上传列表不能为空!");
           return}
      
      this.uploadFileList1.forEach((elem)=>{
         formData.append("files", elem)
@@ -480,39 +494,23 @@
      this.uploading = true;
      uploadPic(formData).then(response => {
      //   let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length)
      //   _this.uploading = false;
      //   // this.$modal.msgSuccess("上传成功");
      //   if(_this.fot.includes(pth) === true)
      //   {
      //     _this.fileList.push({name:response.data.fileName, "url":response.data.url})
      //   }
      //   else{
      //     _this.fileListOther.push({name:response.data.fileName, url:response.data.url})
      //     let ul = _this.fileList.map(function (elem){
      //       return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
      //     }).join(",")
      //     let uls = _this.fileListOther.map(function (elem){
      //       return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
      //     }).join(",")
      //     _this.formData.url = ul+","+uls
      //     console.log(_this.formData.url)
      _this.uploadFileList1 = []
        _this.formData.url = _this.formData.url+","+response.fileNames
          updateFamilyevent(_this.formData).then(response => {
            this.$modal.msgSuccess("文档上传成功");
            // this.open = false;
          });
        })
   },
   picUpload()
   {
      var formData = new FormData();
      this.$refs.upload.submit();
   if(this.uploadFileList.length==0){
        this.$modal.msgSuccess("图像上传列表不能为空!");
        return}
      this.uploadFileList.forEach((elem)=>{
         formData.append("files", elem)
@@ -540,9 +538,9 @@
        //     return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
        //   }).join(",")
      //console.log(_this.fileList)
   //   alert(response.fileNames)
          _this.formData.url = _this.formData.url+","+response.fileNames
      _this.uploadFileList = []
         // alert(87)
          updateFamilyevent(_this.formData).then(response => {
            _this.$modal.msgSuccess("图片上传成功");