|  |  |  | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | 
|---|
|  |  |  | </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 /> | 
|---|
|  |  |  | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | 
|---|
|  |  |  | folder: 'projects' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | timeRange: ['', ''], | 
|---|
|  |  |  | loading: null, | 
|---|
|  |  |  | // 表单数据 | 
|---|
|  |  |  | form: { | 
|---|
|  |  |  | id: null, | 
|---|
|  |  |  | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | 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({ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | console.log(v) | 
|---|