|  |  |  | 
|---|
|  |  |  | class="avatar-uploader" | 
|---|
|  |  |  | :action="uploadUrl" | 
|---|
|  |  |  | :show-file-list="false" | 
|---|
|  |  |  | :on-error="uploadError" | 
|---|
|  |  |  | :on-success="handleAvatarSuccess" | 
|---|
|  |  |  | :before-upload="beforeAvatarUpload" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | 
|---|
|  |  |  | :action="uploadUrl" | 
|---|
|  |  |  | :show-file-list="false" | 
|---|
|  |  |  | :on-success="handleAfterSuccess" | 
|---|
|  |  |  | :on-error="uploadError" | 
|---|
|  |  |  | :before-upload="beforeAvatarUpload" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <img v-if="param.url" :src="param.url" class="avatar" /> | 
|---|
|  |  |  | 
|---|
|  |  |  | :action="uploadUrl" | 
|---|
|  |  |  | :show-file-list="false" | 
|---|
|  |  |  | :on-success="handleBackSuccess" | 
|---|
|  |  |  | :on-error="uploadError" | 
|---|
|  |  |  | :before-upload="beforeAvatarUpload" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <div class="upload_box"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | import GlobalWindow from '@/components/common/GlobalWindow' | 
|---|
|  |  |  | import { memberList } from '@/api/business/hiddenDangerParam' | 
|---|
|  |  |  | import { Loading } from 'element-ui' | 
|---|
|  |  |  | import { | 
|---|
|  |  |  | uploadFile, | 
|---|
|  |  |  | hiddenDangerDetail, | 
|---|
|  |  |  | 
|---|
|  |  |  | id: '', | 
|---|
|  |  |  | type: '', | 
|---|
|  |  |  | uploadUrl: uploadFile, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | loadingInstance: false, | 
|---|
|  |  |  | title: '访客预约详情', | 
|---|
|  |  |  | isShowModal: false, | 
|---|
|  |  |  | info: {}, | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | reject () { }, | 
|---|
|  |  |  | handleAvatarSuccess (res) { | 
|---|
|  |  |  | this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭 | 
|---|
|  |  |  | if(this.loadingInstance){ | 
|---|
|  |  |  | this.loadingInstance.close() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | if (res.code === 200) { | 
|---|
|  |  |  | const str = res.data.url.indexOf('png') > 0 || res.data.url.indexOf('jpg') > 0 | 
|---|
|  |  |  | const arr = this.handleParam.dealBeforeFileList || [] | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | handleAfterSuccess (res) { | 
|---|
|  |  |  | this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭 | 
|---|
|  |  |  | if(this.loadingInstance){ | 
|---|
|  |  |  | this.loadingInstance.close() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | if (res.code === 200) { | 
|---|
|  |  |  | const str = res.data.url.indexOf('png') > 0 || res.data.url.indexOf('jpg') > 0 | 
|---|
|  |  |  | const arr = this.handleParam.dealAfterFileList || [] | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | handleBackSuccess (res) { | 
|---|
|  |  |  | this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭 | 
|---|
|  |  |  | if(this.loadingInstance){ | 
|---|
|  |  |  | this.loadingInstance.close() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | if (res.code === 200) { | 
|---|
|  |  |  | const str = res.data.url.indexOf('png') > 0 || res.data.url.indexOf('jpg') > 0 | 
|---|
|  |  |  | const arr = this.backForm.dealBeforeFileList || [] | 
|---|
|  |  |  | 
|---|
|  |  |  | this.$set(this.backForm, 'dealBeforeFileList', arr) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | beforeAvatarUpload () { } | 
|---|
|  |  |  | beforeAvatarUpload () { | 
|---|
|  |  |  | this.loadingInstance = Loading.service({ | 
|---|
|  |  |  | lock: true, | 
|---|
|  |  |  | text: 'Loading', | 
|---|
|  |  |  | spinner: 'el-icon-loading', | 
|---|
|  |  |  | background: 'rgba(0, 0, 0, 0.7)' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | uploadError() { | 
|---|
|  |  |  | this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭 | 
|---|
|  |  |  | this.loadingInstance.close() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <style lang="scss" scoped> | 
|---|
|  |  |  | @import "@/assets/style/variables.scss"; | 
|---|
|  |  |  | .upload_wrap { | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | flex-wrap: wrap; | 
|---|
|  |  |  | 
|---|
|  |  |  | font-size: 13px; | 
|---|
|  |  |  | color: #888888; | 
|---|
|  |  |  | .status { | 
|---|
|  |  |  | color: #00ba67; | 
|---|
|  |  |  | color: $primaryColor; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .m_content { | 
|---|