From 6bd673610b45c8b7af056d296dde17585c886586 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 28 十月 2024 17:26:30 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
admin/src/views/meeting/components/OperaRoomsWindow.vue | 36 +++++++++++++++++++++++++++++++-----
1 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/admin/src/views/meeting/components/OperaRoomsWindow.vue b/admin/src/views/meeting/components/OperaRoomsWindow.vue
index 46e53f5..ebe13ac 100644
--- a/admin/src/views/meeting/components/OperaRoomsWindow.vue
+++ b/admin/src/views/meeting/components/OperaRoomsWindow.vue
@@ -36,7 +36,8 @@
<el-form-item v-if="form.fileType == 0" label="灞曠ず鍥剧墖" prop="imgurl">
<div class="upload_wrap">
<el-upload class="avatar-uploader" accept=".png,.jpg,.jpeg" :action="uploadImgUrl" :data="uploadData"
- :show-file-list="false" :on-success="handleImgSuccess">
+ :show-file-list="false" :before-upload="beforeAvatarUpload" :on-error="uploadError"
+ :on-success="handleImgSuccess">
<div>
<i class="el-icon-plus avatar-uploader-icon"></i>
</div>
@@ -48,8 +49,9 @@
</div>
</el-form-item>
<el-form-item v-if="form.fileType == 1" label="灞曠ず瑙嗛" prop="imgurl">
- <UploadAvatarVideo :file="{ 'videourlfull': form.videoFullUrl, 'videourl': form.videourl }" :uploadData="uploadData"
- @uploadSuccess="uploadAvatarSuccess" @uploadEnd="isUploading = false" @uploadBegin="isUploading = true" />
+ <UploadAvatarVideo :file="{ 'videourlfull': form.videoFullUrl, 'videourl': form.videourl }"
+ :uploadData="uploadData" @uploadSuccess="uploadAvatarSuccess" @uploadEnd="isUploading = false"
+ @uploadBegin="isUploading = true" />
</el-form-item>
<el-form-item label="浣跨敤椤荤煡" prop="tips">
<el-input v-model="form.tips" type="textarea" placeholder="璇疯緭鍏ヤ娇鐢ㄩ』鐭�" v-trim />
@@ -64,6 +66,7 @@
import UploadAvatarVideo from '@/components/common/UploadAvatarVideo'
import { numRule } from '@/utils/form'
import { fetchList } from '@/api/meeting/projects'
+import { Loading } from 'element-ui'
export default {
name: 'OperaRoomsWindow',
extends: BaseOpera,
@@ -87,6 +90,7 @@
folder: 'projects'
},
timeRange: ['', ''],
+ loading: null,
// 琛ㄥ崟鏁版嵁
form: {
id: null,
@@ -164,7 +168,7 @@
for (const key in this.form) {
this.form[key] = target[key]
}
- if(target.fileType == 1 && target.multifileList && target.multifileList.length > 0){
+ if (target.fileType == 1 && target.multifileList && target.multifileList.length > 0) {
this.$set(this.form, 'videoFullUrl', target.multifileList[0].fileurlFull)
this.$set(this.form, 'videourl', target.multifileList[0].fileurl)
}
@@ -178,7 +182,11 @@
this.form.multifileList.splice(i, 1)
},
handleImgSuccess(res) {
+ this.$nextTick(() => {
+ this.loading.close()
+ })
const list = [...this.form.multifileList]
+
if (res.code == 200) {
let { data } = res
list.push({
@@ -189,6 +197,22 @@
this.$set(this.form, 'multifileList', list)
}
+ },
+ uploadError() {
+ // this.$message.error('涓婁紶澶辫触')
+ this.$nextTick(() => {
+ this.loading.close()
+ })
+ },
+ // // 鎷︽埅
+ beforeAvatarUpload(file) {
+ this.loading = Loading.service({
+ lock: true,
+ text: 'Loading',
+ spinner: 'el-icon-loading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ })
+ return true
},
selectRange(v) {
// console.log(this.timeRange);
@@ -202,11 +226,13 @@
},
uploadAvatarSuccess(file) {
console.log('file', file)
- this.form.multifileList.push({
+ let temp = []
+ temp.push({
fileurl: file.imgurl,
fileurlFull: file.imgurlfull,
type: 1
})
+ this.form.multifileList = temp
this.$set(this.form, 'videourl', file.imgurl)
this.$set(this.form, 'videoFullUrl', file.imgurlfull)
},
--
Gitblit v1.9.3