| | |
| | | <el-dialog :title="title" v-model="open" width="800px" append-to-body @opened="modalOpened" @close="closeDialog">
|
| | | <el-row>
|
| | | <el-col :xs="24" :md="12" :style="{ height: '350px' }">
|
| | | <vue-cropper
|
| | | ref="cropper"
|
| | | :img="options.img"
|
| | | :info="true"
|
| | | :autoCrop="options.autoCrop"
|
| | | :autoCropWidth="options.autoCropWidth"
|
| | | :autoCropHeight="options.autoCropHeight"
|
| | | :fixedBox="options.fixedBox"
|
| | | :outputType="options.outputType"
|
| | | @realTime="realTime"
|
| | | v-if="visible"
|
| | | />
|
| | | <vue-cropper ref="cropper" :img="options.img" :info="true" :autoCrop="options.autoCrop"
|
| | | :autoCropWidth="options.autoCropWidth" :autoCropHeight="options.autoCropHeight" :fixedBox="options.fixedBox"
|
| | | :outputType="options.outputType" @realTime="realTime" v-if="visible" />
|
| | | </el-col>
|
| | | <el-col :xs="24" :md="12" :style="{ height: '350px' }">
|
| | | <div class="avatar-upload-preview">
|
| | |
| | | <br />
|
| | | <el-row>
|
| | | <el-col :lg="2" :md="2">
|
| | | <el-upload
|
| | | action="#"
|
| | | :http-request="requestUpload"
|
| | | :show-file-list="false"
|
| | | :before-upload="beforeUpload"
|
| | | >
|
| | | <el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload">
|
| | | <el-button>
|
| | | 选择
|
| | | <el-icon class="el-icon--right"><Upload /></el-icon>
|
| | | <el-icon class="el-icon--right">
|
| | | <Upload />
|
| | | </el-icon>
|
| | | </el-button>
|
| | | </el-upload>
|
| | | </el-col>
|
| | |
| | | formData.append("avatarfile", data, options.filename)
|
| | | uploadAvatar(formData).then(response => {
|
| | | open.value = false
|
| | | options.img = import.meta.env.VITE_APP_BASE_API + response.imgUrl
|
| | | options.img = import.meta.env.VITE_APP_BASE_API + '/profile/' + response.imgUrl
|
| | | userStore.avatar = options.img
|
| | | proxy.$modal.msgSuccess("修改成功")
|
| | | visible.value = false
|