|
|
|
@ -70,15 +70,24 @@ |
|
|
|
|
<div class="head"> |
|
|
|
|
<div class="title">个人信息</div> |
|
|
|
|
<div class="icon"> |
|
|
|
|
<el-button |
|
|
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
link |
|
|
|
|
> |
|
|
|
|
编辑 |
|
|
|
|
<el-button type="primary" link @click="editUserInfo"> |
|
|
|
|
编辑 |
|
|
|
|
</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="info-box"> |
|
|
|
|
<div class="text"> |
|
|
|
|
<!-- <img style="width: 75px; height:75px ;" src="../../assets/images/item.png" alt="" srcset=""> --> |
|
|
|
|
<el-image |
|
|
|
|
style="width: 100px; height: 100px" |
|
|
|
|
:src="setImageUrl(userInfo.avatar)" |
|
|
|
|
:preview-src-list="[ |
|
|
|
|
setImageUrl(userInfo.avatar), |
|
|
|
|
]" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="info-box"> |
|
|
|
|
<div class="label">姓名</div> |
|
|
|
|
<div class="text">{{ userInfo.realname }}</div> |
|
|
|
@ -104,48 +113,214 @@ |
|
|
|
|
<div class="text">国际教育学院</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="info-box"> |
|
|
|
|
<div class="label">专业</div> |
|
|
|
|
<div class="text">软件工程</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="info-box"> |
|
|
|
|
<div class="label">邮箱</div> |
|
|
|
|
<div class="text">{{ userInfo.email }}</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="right"> |
|
|
|
|
<div class="personalAbilityEvaluationCollectList gradient" @click="Router.push('/personalAbilityEvaluationCollectList')"> |
|
|
|
|
<div |
|
|
|
|
class="personalAbilityEvaluationCollectList gradient" |
|
|
|
|
@click="Router.push('/personalAbilityEvaluationCollectList')" |
|
|
|
|
> |
|
|
|
|
个人积分管理 |
|
|
|
|
</div> |
|
|
|
|
<div class="personalAbilityEvaluationCollectList gradient" @click="Router.push('/personalEvaluateList')"> |
|
|
|
|
<div |
|
|
|
|
class="personalAbilityEvaluationCollectList gradient" |
|
|
|
|
@click="Router.push('/personalEvaluateList')" |
|
|
|
|
> |
|
|
|
|
个人能力评价 |
|
|
|
|
</div> |
|
|
|
|
<div class="personalAbilityEvaluationCollectList gradient" @click="Router.push('/personalReport')"> |
|
|
|
|
<div |
|
|
|
|
class="personalAbilityEvaluationCollectList gradient" |
|
|
|
|
@click="Router.push('/personalReport')" |
|
|
|
|
> |
|
|
|
|
个人能力报告 |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
</div> |
|
|
|
|
<el-dialog |
|
|
|
|
v-model="dialogVisible" |
|
|
|
|
v-if="dialogVisible" |
|
|
|
|
title="编辑" |
|
|
|
|
width="35%" |
|
|
|
|
:before-close="handleClose" |
|
|
|
|
> |
|
|
|
|
<el-form :model="form" label-width="80" style="padding-right: 30px"> |
|
|
|
|
<el-form-item label="头像"> |
|
|
|
|
<el-upload |
|
|
|
|
v-model:file-list="fileList" |
|
|
|
|
action="#" |
|
|
|
|
list-type="picture-card" |
|
|
|
|
:auto-upload="false" |
|
|
|
|
> |
|
|
|
|
<el-icon><Plus /></el-icon> |
|
|
|
|
</el-upload> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="姓名"> |
|
|
|
|
<el-input v-model="form.name" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="部门"> |
|
|
|
|
<el-cascader |
|
|
|
|
:props="props" |
|
|
|
|
style="width: 100%" |
|
|
|
|
v-model="form.facultiesId" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="生日"> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="form.birthday" |
|
|
|
|
type="date" |
|
|
|
|
placeholder="选择日期" |
|
|
|
|
style="width: 100%" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="性别"> |
|
|
|
|
<el-radio-group v-model="form.sex"> |
|
|
|
|
<el-radio :value="1" size="large">男</el-radio> |
|
|
|
|
<el-radio :value="0" size="large">女</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="邮箱"> |
|
|
|
|
<el-input v-model="form.email" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="手机号"> |
|
|
|
|
<el-input v-model="form.phone" type="number" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<template #footer> |
|
|
|
|
<div class="dialog-footer"> |
|
|
|
|
<el-button @click="dialogVisible = false">取消</el-button> |
|
|
|
|
<el-button type="primary" @click="submit">确认</el-button> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-dialog> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
import { onMounted, reactive, ref, toRefs, watch } from 'vue' |
|
|
|
|
import { useRouter } from 'vue-router'; |
|
|
|
|
import { nextTick, onMounted, reactive, ref, toRefs, watch } from 'vue' |
|
|
|
|
import { useRouter } from 'vue-router' |
|
|
|
|
import userStore from '@/store/module/user' |
|
|
|
|
import { getFaculties, uploadFile, editUserInfoApi } from '@/api/race' |
|
|
|
|
import { id } from 'element-plus/es/locale/index.mjs' |
|
|
|
|
const useUserStore = userStore() |
|
|
|
|
const userInfo = ref<any>({}) |
|
|
|
|
console.log(useUserStore.userInfo,'useUserStore'); |
|
|
|
|
console.log(useUserStore.userInfo, 'useUserStore') |
|
|
|
|
userInfo.value = useUserStore.userInfo |
|
|
|
|
const Router = useRouter() |
|
|
|
|
</script> |
|
|
|
|
const dialogVisible = ref(false) |
|
|
|
|
// 修改用户信息 |
|
|
|
|
const editUserInfo = () => { |
|
|
|
|
form.name = userInfo.value.realname |
|
|
|
|
form.birthday = userInfo.value.birthday |
|
|
|
|
form.sex = userInfo.value.sex |
|
|
|
|
form.email = userInfo.value.email |
|
|
|
|
// form.facultiesId = userInfo.value.facultiesId |
|
|
|
|
form.phone = userInfo.value.phone |
|
|
|
|
dialogVisible.value = true |
|
|
|
|
nextTick(() => { |
|
|
|
|
fileList.value = [ |
|
|
|
|
{ |
|
|
|
|
url: setImageUrl(userInfo.value.avatar), |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
const handleClose = () => { |
|
|
|
|
dialogVisible.value = false |
|
|
|
|
} |
|
|
|
|
const form = reactive({ |
|
|
|
|
name: '', |
|
|
|
|
birthday: '', |
|
|
|
|
sex: '', |
|
|
|
|
email: '', |
|
|
|
|
facultiesId: '', |
|
|
|
|
phone: '', |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// 上传文件 |
|
|
|
|
const fileList = ref<any>([]) |
|
|
|
|
const avatar = ref<any>('') |
|
|
|
|
const uploadFileEvent = async () => { |
|
|
|
|
const fromData = new FormData() |
|
|
|
|
fromData.append('file', fileList.value[0].raw) |
|
|
|
|
const res: any = await uploadFile(fromData) |
|
|
|
|
avatar.value = res.message |
|
|
|
|
console.log(res, 'res') |
|
|
|
|
} |
|
|
|
|
// 确认修改 |
|
|
|
|
const submit = async () => { |
|
|
|
|
if (fileList.value[0].hasOwnProperty('raw')) { |
|
|
|
|
await uploadFileEvent() |
|
|
|
|
} |
|
|
|
|
const data: any = { |
|
|
|
|
id: userInfo.value.id, |
|
|
|
|
realname: form.name, |
|
|
|
|
birthday: form.birthday, |
|
|
|
|
sex: form.sex, |
|
|
|
|
email: form.email, |
|
|
|
|
facultiesId: form.facultiesId, |
|
|
|
|
phone: form.phone, |
|
|
|
|
avatar: avatar.value, |
|
|
|
|
} |
|
|
|
|
for (const key in data) { |
|
|
|
|
if (data[key] === '') { |
|
|
|
|
delete data[key] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
await editUserInfoApi(data) |
|
|
|
|
useUserStore.getUserInfo() |
|
|
|
|
dialogVisible.value = false |
|
|
|
|
} |
|
|
|
|
onMounted(() => {}) |
|
|
|
|
// 获取院系列表 |
|
|
|
|
|
|
|
|
|
const FacultiesList = ref<any>([]) |
|
|
|
|
|
|
|
|
|
const getFacultiesList = async (data: any) => { |
|
|
|
|
const res: any = await getFaculties(data) |
|
|
|
|
console.log(res, 'res') |
|
|
|
|
FacultiesList.value = res.result |
|
|
|
|
} |
|
|
|
|
// 配置部门级联选择器 |
|
|
|
|
const props = { |
|
|
|
|
lazy: true, |
|
|
|
|
checkStrictly: true, |
|
|
|
|
emitPath: false, |
|
|
|
|
async lazyLoad(node: any, resolve: any) { |
|
|
|
|
await getFacultiesList({ |
|
|
|
|
primaryKey: 'key', |
|
|
|
|
pid: node.value, |
|
|
|
|
}) |
|
|
|
|
const nodes = FacultiesList.value.map((item: any) => ({ |
|
|
|
|
value: item.id, |
|
|
|
|
label: item.title, |
|
|
|
|
})) |
|
|
|
|
resolve(nodes) |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
watch( |
|
|
|
|
() => fileList.value, |
|
|
|
|
(newVal, oldVal) => { |
|
|
|
|
console.log(newVal, oldVal) |
|
|
|
|
if (newVal.length === 1) { |
|
|
|
|
;(document.querySelector('.el-upload') as HTMLElement).style.display = |
|
|
|
|
'none' |
|
|
|
|
} else { |
|
|
|
|
setTimeout(() => { |
|
|
|
|
;(document.querySelector('.el-upload') as HTMLElement).style.display = |
|
|
|
|
'flex' |
|
|
|
|
}, 0) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
) |
|
|
|
|
const setImageUrl = (url: string) => { |
|
|
|
|
return import.meta.env.VITE_APP_BASE_API + '/sys/common/static/' + url |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
.top-bg { |
|
|
|
|
position: relative; |
|
|
|
@ -196,7 +371,7 @@ const Router = useRouter() |
|
|
|
|
margin-bottom: 18px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// margin-right: 22px; |
|
|
|
|
// margin-right: 22px; |
|
|
|
|
|
|
|
|
|
.content { |
|
|
|
|
display: flex; |
|
|
|
@ -355,7 +530,7 @@ const Router = useRouter() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
width: 176px; |
|
|
|
|
height: 60px; |
|
|
|
|
height: 80px; |
|
|
|
|
display: flex; |
|
|
|
|
flex-direction: column; |
|
|
|
|
justify-content: space-between; |
|
|
|
@ -372,7 +547,7 @@ const Router = useRouter() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.text { |
|
|
|
|
height: 22px; |
|
|
|
|
// height: 22px; |
|
|
|
|
font-family: |
|
|
|
|
Microsoft YaHei UI, |
|
|
|
|
Microsoft YaHei UI; |
|
|
|
@ -387,12 +562,12 @@ const Router = useRouter() |
|
|
|
|
.right { |
|
|
|
|
width: 300px; |
|
|
|
|
padding: 25px; |
|
|
|
|
// background-color: pink; |
|
|
|
|
display: flex; |
|
|
|
|
flex-direction: column; |
|
|
|
|
justify-content: space-around; |
|
|
|
|
align-items: center; |
|
|
|
|
.personalAbilityEvaluationCollectList{ |
|
|
|
|
// background-color: pink; |
|
|
|
|
display: flex; |
|
|
|
|
flex-direction: column; |
|
|
|
|
justify-content: space-around; |
|
|
|
|
align-items: center; |
|
|
|
|
.personalAbilityEvaluationCollectList { |
|
|
|
|
width: 180px; |
|
|
|
|
// background-color: pink; |
|
|
|
|
height: 38px; |
|
|
|
@ -402,11 +577,11 @@ const Router = useRouter() |
|
|
|
|
border-radius: 10px; |
|
|
|
|
color: #fff; |
|
|
|
|
cursor: pointer; |
|
|
|
|
transition: all .2s; |
|
|
|
|
} |
|
|
|
|
.personalAbilityEvaluationCollectList:hover{ |
|
|
|
|
transition: all 0.2s; |
|
|
|
|
} |
|
|
|
|
.personalAbilityEvaluationCollectList:hover { |
|
|
|
|
transform: scale(1.1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|