feige
2024-02-21 c1cff08cdbcee3278c1ac8d8a3a067e3bf015202
ruoyi-ui/src/views/pet/petnote.vue
@@ -55,7 +55,7 @@
        >
          <el-button size="mini"   type="primary"
                     plain
                     icon="el-icon-plus" >导入</el-button>
                    icon="el-icon-top"  >导入</el-button>
        </el-upload>
      </el-col>
@@ -251,7 +251,7 @@
      name:'',
      disabled: false,
      loading: true,
      formData:[],
      formData:{},
      // 选中数组
      ids: [],
      // 非单个禁用
@@ -277,7 +277,10 @@
      // 日期范围
      dateRange: [],
      // 数据范围选项
      fot:[".jpg",".jif"],
      // 数据范围选项
      fot:['.bmp','.jpg','.jpeg','.png','.tif','.gif','.pcx','.tga','.exif','.fpx',
        '.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng'],
      fileList:[
      ],
      fileListOther:[
@@ -483,6 +486,7 @@
      this.formDat.url = ul+","+uls
      this.$refs["elForm"].validate(valid => {
        if (valid) {
      //   alert(33)
          addPetnote(this.formDat).then(response => {
            this.$modal.msgSuccess("新增成功");
            this.open = false;
@@ -498,11 +502,12 @@
    requestUpload(params)
    {
      var file = params.file;
      var formData = new FormData();
      formData.append('uploadFile', file);
      var formData1 = new FormData();
      formData1.append('uploadFile', file);
      let _this = this
   //  alert(123)
      uploadPic(formData).then(response => {
      uploadPic(formData1).then(response => {
        let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length)
        if(_this.fot.includes(pth) === true)
@@ -515,6 +520,22 @@
          _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)
        //  alert(87)
      const pid = _this.$route.params && _this.$route.params.id;
      _this.formData.pid = pid
          updatenotePet(_this.formData).then(response => {
            this.$modal.msgSuccess("图片上传成功");
            // this.open = false;
          });
      })
    },