|
|
@ -1,6 +1,6 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="user-info-head" @click="editCropper()">
|
|
|
|
<div class="user-info-head" @click="editCropper()">
|
|
|
|
<img :src="options.img" title="点击上传头像" class="img-circle img-lg" />
|
|
|
|
<img :src="options.img" :title="t('userAvatar.uploadAvatar')" 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-row>
|
|
|
|
<el-col :xs="24" :md="12" :style="{ height: '350px' }">
|
|
|
|
<el-col :xs="24" :md="12" :style="{ height: '350px' }">
|
|
|
@ -33,7 +33,7 @@
|
|
|
|
:before-upload="beforeUpload"
|
|
|
|
:before-upload="beforeUpload"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-button>
|
|
|
|
<el-button>
|
|
|
|
选择
|
|
|
|
{{ t('userAvatar.choose') }}
|
|
|
|
<el-icon class="el-icon--right"><Upload /></el-icon>
|
|
|
|
<el-icon class="el-icon--right"><Upload /></el-icon>
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
</el-upload>
|
|
|
|
</el-upload>
|
|
|
@ -51,7 +51,7 @@
|
|
|
|
<el-button icon="RefreshRight" @click="rotateRight()"></el-button>
|
|
|
|
<el-button icon="RefreshRight" @click="rotateRight()"></el-button>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :lg="{ span: 2, offset: 6 }" :md="2">
|
|
|
|
<el-col :lg="{ span: 2, offset: 6 }" :md="2">
|
|
|
|
<el-button type="primary" @click="uploadImg()">提 交</el-button>
|
|
|
|
<el-button type="primary" @click="uploadImg()">{{ t('userAvatar.submit') }}</el-button>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
@ -63,13 +63,15 @@ import "vue-cropper/dist/index.css";
|
|
|
|
import { VueCropper } from "vue-cropper";
|
|
|
|
import { VueCropper } from "vue-cropper";
|
|
|
|
import { uploadAvatar } from "@/api/system/user";
|
|
|
|
import { uploadAvatar } from "@/api/system/user";
|
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
|
|
|
|
|
import {useI18n} from "vue-i18n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const {t} = useI18n();
|
|
|
|
const userStore = useUserStore();
|
|
|
|
const userStore = useUserStore();
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
|
|
|
|
|
|
|
const open = ref(false);
|
|
|
|
const open = ref(false);
|
|
|
|
const visible = ref(false);
|
|
|
|
const visible = ref(false);
|
|
|
|
const title = ref("修改头像");
|
|
|
|
const title = ref(t('userAvatar.ModifyAvatar'));
|
|
|
|
|
|
|
|
|
|
|
|
//图片裁剪数据
|
|
|
|
//图片裁剪数据
|
|
|
|
const options = reactive({
|
|
|
|
const options = reactive({
|
|
|
|