diff --git a/src/views/sce/sceInfo/index.vue b/src/views/sce/sceInfo/index.vue index a3f3f98..d1ce73c 100644 --- a/src/views/sce/sceInfo/index.vue +++ b/src/views/sce/sceInfo/index.vue @@ -199,12 +199,12 @@ style="float:left;margin-left: 10px;" action list-type="picture-card" - :on-progress="changeImgs" + :http-request="changeImgs" :show-file-list="false" element-loading-text="正在上传..." v-loading="loadingOtherImg" > - + + @@ -622,12 +622,12 @@ action list-type="picture-card" :show-file-list="false" - :on-progress='labeluploadmusic' :before-upload="uploadAudio" + :http-request="labeluploadmusic" element-loading-text="正在上传..." v-loading="loadingAudio" > - + @@ -812,13 +812,13 @@ action list-type="picture-card" :show-file-list="false" + :http-request="labeluploadvideo" :before-upload="uploadVideo" - :on-progress='labeluploadvideo' element-loading-text="正在上传..." v-loading="loading" > + - @@ -1757,18 +1757,19 @@ export default { } catch (err) {} }, //其他图片 - // changeImgs({ file }) { - changeImgs(e,file) { - console.log('其他图片进度',parseInt(e.percent)); + changeImgs({ file }) { + // changeImgs(e,file) { + // console.log('其他图片进度',parseInt(e.percent)); this.loadingOtherImg = true; //显示加载 - this.jinduOtherImgNum = parseInt(e.percent);//进度条从0开始 + this.jinduOtherImgNum = 0;//进度条从0开始 this.jinduShowOtherImg = true; //是否显示进度条 let formData = new FormData(); - formData.append("file", file.raw); + formData.append("file", file); formData.append("type", "product"); uploadFile(formData).then(res => { this.dataImg.push(res.data.wjUrl); this.loadingOtherImg = false; //显示加载 + this.jinduOtherImgNum = 100; if (this.jinduOtherImgNum >= 100) { this.jinduOtherImgNum = 100 setTimeout(() => { @@ -2046,16 +2047,16 @@ export default { } }, // 上传资源图片 - // labeluploadimg({ file }) { - labeluploadimg(e, file ) { - console.log('上传资源图片进度',parseInt(e.percent)); - console.log(file); + labeluploadimg({ file }) { + // labeluploadimg(e, file ) { + // console.log('上传资源图片进度',parseInt(e.percent)); + // console.log(file); const formdata = new FormData(); - formdata.append("file", file.raw); + formdata.append("file", file); formdata.append("type", "product"); this.loadingImg = true; this.jinduShowImg = true; - this.jinduImgNum = parseInt(e.percent); + this.jinduImgNum = 0; this.radioImg = 1; uploadFile(formdata).then(res => { this.imgData.push({ @@ -2069,6 +2070,7 @@ export default { }); this.imgType = true; this.loadingImg = false; + this.jinduImgNum = 100; if (this.jinduImgNum >= 100) { this.jinduImgNum = 100 setTimeout(() => { @@ -2078,16 +2080,16 @@ export default { }); }, //音频 - // labeluploadmusic({ file }) { - labeluploadmusic(e,file) { - console.log('音频进度',parseInt(e.percent)); + labeluploadmusic({ file }) { + // labeluploadmusic(e,file) { + this.radioMusic = 1; this.loadingAudio = true; this.jinduShowAudio = true; - this.jinduAudioNum = parseInt(e.percent); + this.jinduAudioNum = 0; const formdata = new FormData(); - formdata.append("file", file.raw); + formdata.append("file", file); formdata.append("type", "product"); uploadFile(formdata).then(res => { this.musicData.push({ @@ -2098,6 +2100,7 @@ export default { mediaType: 2, sourceType: 1 }); + this.jinduAudioNum = 100; this.loadingAudio = false; this.musicType = true; if (this.jinduAudioNum >= 100) { @@ -2109,9 +2112,9 @@ export default { }); }, //视频 - // labeluploadvideo({ file }) { - labeluploadvideo( e,file ) { - this.jinduVideoNum = parseInt(e.percent); + labeluploadvideo({ file }) { + // labeluploadvideo( e,file ) { + this.jinduVideoNum = 0; this.loading = true; this.radioVideo = 1; @@ -2119,7 +2122,7 @@ export default { // console.log(file.raw, 'file.rawfile.rawfile.raw'); // this.jinduVideoNum = 0; const formdata = new FormData(); - formdata.append("file", file.raw); + formdata.append("file", file); formdata.append("type", "product"); uploadFile(formdata).then(res => { console.log(res); @@ -2131,6 +2134,7 @@ export default { mediaType: 3, sourceType: 1 }); + this.jinduVideoNum = 100; this.loading = false; //取消加载 this.radioType = true; if (this.jinduVideoNum >= 100) {