yz3456
2024-03-25 86e76b965eca189b0d000cbadce383f5d4ecadba
ruoyi-ui/src/views/pet/noteInfo.vue
@@ -182,14 +182,14 @@
      // 数据范围选项
      fot:['.bmp','.jpg','.jpeg','.png','.tif','.gif','.pcx','.tga','.exif','.fpx',
        '.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng'],
      fileList:[
      ],
      fileList1:[],
      uploadFileList:[],
      uploadFileList1:[],
      fileListOther:[
      ],
      dsb:true,
      btn:false,
@@ -270,21 +270,32 @@
        this.formData = response.data;
        let paths = response.data.url.split(",");
        for(let i = 0; i < paths.length; i++)
        {
          if(paths[i]!="") {
    {
      if(paths[i]!="") {
            let pth = paths[i].substr(paths[i].length - 4, paths[i].length)
        let pth = paths[i].substr(paths[i].length - 4, paths[i].length)
    //   alert(pth)
        if (_this.fot.includes(pth) === true)
       {
          if(paths[i][0]=="/")
          _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1),res:false})
         else
            _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i],res:false})
         }
        else {
          // alert(paths[i])
        // alert()
          let nms = paths[i].split("\/")
          let nm = nms[nms.length - 1]
         if(paths[i][0]=="/")
          _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1),res:false})
          else
          _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i],res:false})
            if (_this.fot.includes(pth) === true)
              _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]})
            }
          }
        }
       }
      }
    //  _this.fileList1 = _this.fileList
    }
        this.loading = false;
      });
@@ -322,10 +333,18 @@
      this.$refs['elForm'].resetFields()
    },
    handleFileCardPreview(file){
      this.dialogFileUrl = file.url;
      const Base64 = require('js-base64').Base64
      this.desurl = process.env.VUE_APP_BASE_OTHER_API+'onlinePreview?url='+encodeURIComponent(Base64.encode(this.dialogFileUrl));
      myWindow=window.open(this.desurl,'','width=1200,height=800,top=150,left=300');
         this.dialogFileUrl = file.url;
     if(this.dialogFileUrl.includes("47.93.189.255")==true)
       this.dialogFileUrl = this.dialogFileUrl.replace("47.93.189.255","www.bendudu.com")
     //alert(this.dialogFileUrl)
     const Base64 = require('js-base64').Base64
     this.desurl = process.env.VUE_APP_BASE_OTHER_API+"preview/"+'onlinePreview?url='+encodeURIComponent(Base64.encode(this.dialogFileUrl));
     let myWindow=window.open(this.desurl,'','width=1200,height=800,top=150,left=300');
    },
    handlePreview(file)
    {
@@ -354,10 +373,10 @@
               this.$delete(this.uploadFileList1, Math.abs(i - this.uploadFileList1.length-1))
            }
            this.$delete(this.fileListOther,i);
         }
        }
        let ul = ""
        this.fileList.map(function (elem){
              if(elem.res==false)
@@ -374,7 +393,7 @@
           updatenotePet(this.formData).then(response => {
            this.$modal.msgSuccess("删除成功");
            // this.open = false;
           });
        }
    },
@@ -398,7 +417,7 @@
               //     alert(this.uploadFileList.length)
            }
           this.$delete(this.fileList,i);
       }
       }
       let ul = ""
@@ -451,7 +470,7 @@
   //自定义上传方法
       handleChange(file, fileList1) {
          //定义一个全局数组uploadFileList来做存储
        // this.uploadFileList.push(file.raw);
         console.log("=========5555=========")
        this.uploadFileList.push(file.raw);
@@ -460,7 +479,7 @@
      //自定义上传方法
      handleChange1(file, fileListOther1) {
             //定义一个全局数组uploadFileList来做存储
           // this.uploadFileList.push(file.raw);
          this.uploadFileList1.push(file.raw);
           this.fileListOther.push({name:file.name,url:file.url,res:true})
@@ -471,7 +490,7 @@
      },
      fileUpload(){
      //   var file = params.file;
         var formData = new FormData();
         //this.$refs.upload1.submit();
      //   alert(this.uploadFileList1.length)
@@ -479,42 +498,45 @@
         if(this.uploadFileList1.length==0){
              this.$modal.msgSuccess("文档上传列表不能为空!");
              return}
         this.uploadFileList1.forEach((elem)=>{
            formData.append("files", elem)
         })
         console.log(this.uploadFileList1)
         let _this = this
         this.uploading = true;
      // alert(234)
         uploadPic(formData).then(response => {
         _this.uploadFileList1 = []
           _this.formData.url = _this.formData.url+","+response.fileNames
        // alert(2346)
             updatenotePet(_this.formData).then(response => {
               this.$modal.msgSuccess("文档上传成功");
               // this.open = false;
            this.uploading = false;
             });
           })
      },
      picUpload()
      {
         var formData = new FormData();
         //this.$refs.upload.submit();
         //alert(this.uploadFileList.length)
      if(this.uploadFileList.length==0){
           this.$modal.msgSuccess("图像上传列表不能为空!");
           return}
         this.uploadFileList.forEach((elem)=>{
            formData.append("files", elem)
         })
         let _this = this
           uploadPic(formData).then(response => {
            // console.log(response.originalFilenames)
            // console.log(response.urls)
@@ -541,12 +563,12 @@
             updatenotePet(_this.formData).then(response => {
               _this.$modal.msgSuccess("图片上传成功");
               // this.open = false;
             });
           // }
           // else{
           //   _this.fileListOther.push({name:response.data.fileName, url:response.data.url})
           // }
         });
      },
@@ -554,10 +576,10 @@
       {
      //  alert(124)
   //    this.uploadFileList.push(params.file);
        //alert(34)
       },
       requestUpload1(params)
       {