delete alert style

This commit is contained in:
ailanyin
2023-05-17 09:56:28 +08:00
parent e9764b6eb3
commit 26d259e8f0
111 changed files with 7876 additions and 6223 deletions

View File

@ -1,7 +1,14 @@
<template>
<div class="user-info-head" @click="editCropper()">
<img :src="options.img" title="点击上传头像" class="img-circle img-lg" />
<el-dialog :title="title" v-model="open" width="800px" append-to-body @opened="modalOpened" @close="closeDialog">
<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
@ -79,7 +86,7 @@ const options = reactive({
autoCropHeight: 200, // 默认生成截图框高度
fixedBox: true, // 固定截图框大小 不允许改变
outputType: "png", // 默认生成截图为PNG格式
previews: {} //预览数据
previews: {}, //预览数据
});
/** 编辑头像 */
@ -108,7 +115,9 @@ function changeScale(num) {
/** 上传预处理 */
function beforeUpload(file) {
if (file.type.indexOf("image/") == -1) {
proxy.$modal.msgError("文件格式错误,请上传图片类型,如JPGPNG后缀的文件。");
proxy.$modal.msgError(
"文件格式错误,请上传图片类型,如JPGPNG后缀的文件。"
);
} else {
const reader = new FileReader();
reader.readAsDataURL(file);
@ -119,10 +128,10 @@ function beforeUpload(file) {
}
/** 上传图片 */
function uploadImg() {
proxy.$refs.cropper.getCropBlob(data => {
proxy.$refs.cropper.getCropBlob((data) => {
let formData = new FormData();
formData.append("avatarfile", data);
uploadAvatar(formData).then(response => {
uploadAvatar(formData).then((response) => {
open.value = false;
options.img = import.meta.env.VITE_APP_BASE_API + response.imgUrl;
userStore.avatar = options.img;
@ -142,7 +151,7 @@ function closeDialog() {
}
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.user-info-head {
position: relative;
display: inline-block;
@ -166,4 +175,4 @@ function closeDialog() {
line-height: 110px;
border-radius: 50%;
}
</style>
</style>