From c6d567c13ab26316b36bfabe48e50ce6e5fa7f79 Mon Sep 17 00:00:00 2001 From: "@fawn-nine" <1271023382@qq.com> Date: Wed, 3 Jul 2024 15:06:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=A4=B1=E8=B4=A5=E5=BC=B9?= =?UTF-8?q?=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/book/talkBook-add-or-update.vue | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/views/modules/book/talkBook-add-or-update.vue b/src/views/modules/book/talkBook-add-or-update.vue index f85192c..f5668e1 100644 --- a/src/views/modules/book/talkBook-add-or-update.vue +++ b/src/views/modules/book/talkBook-add-or-update.vue @@ -36,12 +36,15 @@ - + + :action="baseUrl + '/oss/fileoss'" :file-list="videoList" + :on-error="onvideoEror" + :before-upload="beforeuploadVideo" + :on-success="videoSuccess" accept=".mp4" + :on-remove="videoRemove" :show-file-list="true"> 上传文件 @@ -161,7 +164,7 @@ trigger: "blur" }] }, - + VideoLoadingFlag:false, // 富文本编辑器配置 editorOption: { modules: { @@ -462,7 +465,22 @@ // setTimeout( () => {this.progressFlag = false}, 1000) // 一秒后关闭进度条 } }, - + // 上传失败 + onvideoEror(err, file, fileList){ + console.log(err,'err') + this.VideoLoadingFlag = false + // this.$message.error('上传失败') + this.$notify.error({ + title: '错误', + message: '上传失败', + duration: 0 + }); + + }, + // 视频上传成功前 + beforeuploadVideo(){ + this.VideoLoadingFlag = true + }, videoSuccess(res, file) { console.log(res, 'res') if (res.msg == "success") { @@ -483,6 +501,7 @@ } else { this.$message.error("上传失败"); } + this.VideoLoadingFlag = false }, videoRemove(file, fileList) {