feige
2024-02-22 a4d8869bff7df9a2b888530df9efef46b8d6eaf4
提交多图片,视频上传
2个文件已修改
55 ■■■■■ 已修改文件
ruoyi-ui/src/views/bignote/familyeventInfo.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/vue.config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/bignote/familyeventInfo.vue
@@ -378,22 +378,37 @@
      for(let i = 0; i < this.fileListOther.length; i++)
      {
        if(this.fileListOther[i].url==file.url)
        {
            if(this.fileListOther[i].res==false)
                res = true
            else
            {
                this.$delete(this.uploadFileList1, Math.abs(i - this.uploadFileList1.length-1))
            }
          this.$delete(this.fileListOther,i);
        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;
        }
      }
      updateFamilyevent(this.formData).then(response => {
        this.$modal.msgSuccess("删除成功");
        // this.open = false;
      
      });
      let ul = ""
      this.fileList.map(function (elem){
              if(elem.res==false)
                  ul = ul + ","+elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
      })
      let uls = ""
      this.fileListOther.map(function (elem){
        if(elem.res==false)
                  uls = uls +","+elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
      })
      this.formData.url = ul+","+uls;
      alert(this.formData.url)
      if(res==true){
          updateFamilyevent(this.formData).then(response => {
            this.$modal.msgSuccess("删除成功");
            // this.open = false;
          });
      }
    },
    handleRemove(file) {      
              //判断是否是之前的图片
@@ -483,10 +498,12 @@
       this.fileList.push({name:file.name,url:file.url,res:true})
    },
    //自定义上传方法
    handleChange1(file, fileListOther) {
    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})
          console.log("=========5555=========")
          //console.log(file)
        //  console.log(this.uploadFileList)
@@ -496,8 +513,8 @@
    //    var file = params.file;
        var formData = new FormData();
        this.$refs.upload1.submit();
        //this.$refs.upload1.submit();
    //    alert(this.uploadFileList1.length)
        // formData.append('uploadFile', file);
        if(this.uploadFileList1.length==0){
              this.$modal.msgSuccess("文档上传列表不能为空!");
@@ -585,7 +602,7 @@
    requestUpload1(params)
    {
    //    alert(123)
    this.uploadFileList1.push(params.file);
   // this.uploadFileList1.push(params.file);
  //  console.log("-----------")
    //console.log(this.uploadFileList1)
    },
ruoyi-ui/vue.config.js
@@ -35,8 +35,8 @@
    proxy: {
      // detail: https://cli.vuewww.bendudu.comjs.org/config/#devserver-proxy
      [process.env.VUE_APP_BASE_API]: {
      // target: `https://192.168.1.3:8080/`,
       target: 'https://www.bendudu.com:8080/',
       target: `https://192.168.1.3:8080/`,
       //target: 'https://www.bendudu.com:8080/',
        changeOrigin: true,
        pathRewrite: {
          ['^' + process.env.VUE_APP_BASE_API]: ''