feige
2024-02-02 bd40473c9c634005bc7e62e7fc901bcd8b598fa0
ruoyi-ui/src/views/bignote/familyeventInfo.vue
@@ -48,6 +48,7 @@
        multiple
        :http-request="requestUpload"
        :file-list="fileList"
      :on-change="handleChange"
        :disabled="!btn"
        :class="{ hide: !btn }"
@@ -177,6 +178,7 @@
      fileList:[
      ],
      uploadFileList:[],
      fileListOther:[
      ],
@@ -237,11 +239,11 @@
      this.btn= jd
      this.dsb = !jd
      this.isShow=true
      document.title = "修改大事记详细信息";
     // document.title = "修改大事记详细信息";
      this.$route.meta.title = "修改大事记详细信息";//列表的名称
    }
    else{
      document.title = "家大事记详细信息";
    //  document.title = "家大事记详细信息";
      this.$route.meta.title = "家大事记详细信息";//列表的名称
      this.btn = false;
      this.isShow=false
@@ -397,32 +399,45 @@
      this.isShow=false
    },
    requestUpload(params)
//自定义上传方法
    handleChange(file, fileList) {
       //定义一个全局数组uploadFileList来做存储
      this.uploadFileList.push(file.raw);
      console.log("=========5555=========")
      //console.log(file)
      console.log(this.uploadFileList)
    },
    async requestUpload(params)
    {
     // alert(124)
      var file = params.file;
      var formData = new FormData();
      formData.append('uploadFile', file);
      let _this = this
     //alert(34)
      this.uploading1 = true;
      uploadPic(formData).then(response => {
      await uploadPic(formData).then(response => {
        let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length)
        this.uploading1= false;
        _this.uploading1= false;
        console.log(_this.fot.includes(pth))
        // debugger
        if(_this.fot.includes(pth) === true)
        {
          _this.fileList.push({name:response.data.fileName, "url":response.data.url})
          let ul = this.fileList.map(function (elem){
          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){
          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)
          updateFamilyevent(this.formData).then(response => {
            this.$modal.msgSuccess("图片上传成功");
          _this.formData.url = ul+","+uls
          console.log(_this.formData.url)
         // alert(87)
          updateFamilyevent(_this.formData).then(response => {
            _this.$modal.msgSuccess("图片上传成功");
            // this.open = false;
          });
@@ -443,7 +458,7 @@
      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.uploading = false;
        // this.$modal.msgSuccess("上传成功");
        if(_this.fot.includes(pth) === true)
        {
@@ -453,15 +468,15 @@
        else{
          _this.fileListOther.push({name:response.data.fileName, url:response.data.url})
          let ul = this.fileList.map(function (elem){
          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){
          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)
          updateFamilyevent(this.formData).then(response => {
          _this.formData.url = ul+","+uls
          console.log(_this.formData.url)
          updateFamilyevent(_this.formData).then(response => {
            this.$modal.msgSuccess("文档上传成功");
            // this.open = false;