mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-14 05:16:43 +08:00
资料编辑
This commit is contained in:
@@ -6,27 +6,27 @@
|
||||
<img src="../../../public/images/Avatarwoman.png" alt="">
|
||||
</div> -->
|
||||
<div class="uesr-avaer">
|
||||
<img :src="userInfo.avatar" v-if="userInfo.avatar !== '' ">
|
||||
<img :src="fileBaseUrl+userData.data.avatar" v-if="userData.data.avatar !== '' ">
|
||||
<div v-else class="uavatar">
|
||||
<div v-if="sex === 1 "><img src="../../../public/images/Avatarman.png" alt=""></div>
|
||||
<div v-if="userData.data.sex === 1 "><img src="../../../public/images/Avatarman.png" alt=""></div>
|
||||
<div v-else><img src="../../../public/images/Avatarwoman.png" alt=""></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="user-content">
|
||||
<div class="content-top">
|
||||
<h6 content-bottom><router-link to="/homePage"> {{userInfo.name}}</router-link>
|
||||
<h6 content-bottom><router-link to="/homePage"> {{userData.data.name}}</router-link>
|
||||
</h6>
|
||||
<div class="grade">
|
||||
<div>LV.1</div>
|
||||
<span style="color: #A3680A;margin-left:12px;line-height: 24px;">经验值:367</span>
|
||||
<div>{{userData.level}}</div>
|
||||
<span style="color: #A3680A;margin-left:12px;line-height: 24px;">经验值:{{userData.evalue}}</span>
|
||||
</div>
|
||||
<el-button round plain class="btn-user" size="small" v-if="pageId != userInfo.aid && !isFollowHas" @click="toFollow()">关注TA</el-button>
|
||||
<el-button round plain class="btn-user" size="small" v-if="isFollowHas">已关注</el-button>
|
||||
<el-button round plain class="btn-user" size="small"><router-link :to="'/homePage/leavingMessage?id='+pageId">去留言</router-link></el-button>
|
||||
</div>
|
||||
<div class="content-bottom">
|
||||
<p class="portal-summary-text">你必须非常努力才能看起来毫不费力</p>
|
||||
<p class="portal-summary-text">{{userData.data.sign}}</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -67,6 +67,7 @@
|
||||
import { mapGetters } from 'vuex'
|
||||
import apiStart from '@/api/phase2/stat.js';
|
||||
import apiFollow from "@/api/phase2/userfollow.js"
|
||||
import apiUser from "@/api/system/user.js";
|
||||
export default {
|
||||
name: 'UcHeader',
|
||||
computed:{
|
||||
@@ -89,6 +90,20 @@
|
||||
sex:'',
|
||||
pageId:'',
|
||||
isFollowHas:false,
|
||||
userData:{
|
||||
evalue: 0,
|
||||
level: "",
|
||||
data:{
|
||||
aid: "",
|
||||
avatar: "",
|
||||
code: "",
|
||||
name: "",
|
||||
orgInfo: "",
|
||||
sex: 2,
|
||||
sign: "",
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -100,12 +115,28 @@
|
||||
}
|
||||
this.orgInfo=cutFullName(this.userInfo.departFullName,1);
|
||||
this.getInfo();
|
||||
this.getLevel();
|
||||
if(this.pageId !== this.userInfo.aid) {
|
||||
this.followHas();
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
followHas() {
|
||||
getLevel(){//获取经验值和等级
|
||||
apiStart.getUserEValueAndLevel(this.pageId).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.userData.evalue = res.result.evalue;
|
||||
this.userData.level = res.result.level;
|
||||
}
|
||||
});
|
||||
apiUser.getByIds([this.pageId]).then(res => {
|
||||
if (res.status == 200) {
|
||||
this.userData.data = res.result[0];
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
followHas() {//他人主页,判断关注状态
|
||||
apiFollow.has(this.pageId).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.isFollowHas = res.result;
|
||||
|
||||
@@ -179,7 +179,7 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
||||
this.$store.dispatch('SetCurIdentity',iden);
|
||||
},
|
||||
jumrank(){
|
||||
this.$router.push({ path: '/user/ranking' });
|
||||
this.$router.push('/user/ranking');
|
||||
|
||||
},
|
||||
toPage(url){
|
||||
|
||||
13
src/icons/svg/passWard-edit.svg
Normal file
13
src/icons/svg/passWard-edit.svg
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="22px" height="22px" viewBox="0 0 22 22" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>编组 26</title>
|
||||
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="21.个人中心-编辑资料备份-3" transform="translate(-1685.000000, -354.000000)">
|
||||
<g id="编组-26" transform="translate(1685.000000, 354.000000)">
|
||||
<path d="M1.17939555,20.5245655 L1.63798708,16.7528903 C1.66390378,16.539739 1.75774048,16.3405902 1.90561573,16.1849044 L11.6656176,5.90939523 L11.6656176,5.90939523 L16.1839739,10.1033368 L6.12977645,20.4613638 C6.0048278,20.5900883 5.8475522,20.6828307 5.67443523,20.7298698 L2.4342958,21.6102754 C1.90133521,21.7550906 1.35188935,21.4404366 1.20707413,20.907476 C1.17320408,20.7828247 1.1638047,20.6527921 1.17939555,20.5245655 Z" id="路径-28备份" fill="#387DF7"></path>
|
||||
<polygon id="路径-46备份" fill="#387DF7" points="13.8376615 4.06057582 17.7538094 8.1576498 20.9640972 4.88672598 17.4008793 1"></polygon>
|
||||
<line x1="7.56351496" y1="21.100958" x2="19.08841" y2="21.100958" id="路径-47备份" stroke="#387DF7"></line>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -146,6 +146,7 @@
|
||||
apiGuestbook.answer(this.replysData).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.$message.success('留言发布成功');
|
||||
// this.leavingList.push()
|
||||
this.leavingList.forEach(item=>{
|
||||
item.isReplys = false;
|
||||
})
|
||||
@@ -178,7 +179,8 @@
|
||||
apiGuestbook.save(data).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.textarea = '';
|
||||
this.leavingList.push(res.result);
|
||||
// this.leavingList.push(res.result);
|
||||
this.getList();
|
||||
this.$message.success('留言发布成功');
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
|
||||
@@ -1,65 +1,77 @@
|
||||
<template>
|
||||
<div class="personSetting">
|
||||
<!-- <div class="avatar">
|
||||
<el-avatar :src="avatar" :size="80" alt=""></el-avatar>
|
||||
<span>{{userInfo.name}}</span>
|
||||
<el-button type="primary" @click="openAvatar">修改头像</el-button>
|
||||
</div> -->
|
||||
<el-form :model="form" label-position="right" label-width="80px">
|
||||
<el-button type="text" class="passWard-btn" @click="openPassword"><svg-icon icon-class="passWard-edit" style="margin-right: 10px;font-size: 22px;"></svg-icon>修改密码</el-button>
|
||||
<div class="avatar" @click="openAvatar">
|
||||
<el-avatar :src="avatar" :size="116" alt=""></el-avatar>
|
||||
<!-- <span>{{userInfo.name}}</span> -->
|
||||
<!-- <el-button type="primary" @click="openAvatar">修改头像</el-button> -->
|
||||
</div>
|
||||
<!-- <el-form :model="form" label-position="right" label-width="80px"> -->
|
||||
<div class="informationItem">
|
||||
<div class="information-header">
|
||||
<h4>基础信息</h4>
|
||||
<!-- <el-button type="primary" @click="openPassword">修改密码</el-button> -->
|
||||
</div>
|
||||
<el-form-item label="昵称">
|
||||
<el-input v-model="form.name" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别">
|
||||
<el-radio-group v-model="form.gender" disabled>
|
||||
<el-radio-button :label="1">男</el-radio-button>
|
||||
<el-radio-button :label="2">女</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属部门">
|
||||
<span class="depart">{{form.departName}}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="生日">
|
||||
<el-date-picker
|
||||
v-model="form.birthday" disabled
|
||||
type="date"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号">
|
||||
<el-input v-model="form.account.mobile" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="邮箱">
|
||||
<el-input v-model="form.account.email" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="我的签名">
|
||||
<el-input type="textarea" :rows="2"></el-input>
|
||||
</el-form-item>
|
||||
<ul class="base-info">
|
||||
<li><label class="label" style="width:32px">姓名</label><span class="info-text">{{form.name}}</span></li>
|
||||
<li><label class="label">性别</label><span class="info-text">{{form.gender == 1?'男':'女'}}</span></li>
|
||||
<li><label class="label">所属部门</label><span class="info-text">{{form.departName}}</span></li>
|
||||
</ul>
|
||||
<ul class="base-info">
|
||||
<li><label class="label" style="width:32px">生日</label><span class="info-text">{{form.birthday}}</span></li>
|
||||
<li><label class="label">手机号</label><span class="info-text">{{form.account.mobile}}</span></li>
|
||||
<li><label class="label">邮箱</label><span class="info-text">{{form.account.email}}</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="informationItem">
|
||||
<div class="information-header">
|
||||
<h4>个人签名</h4>
|
||||
</div>
|
||||
<div class="base-info">
|
||||
<label class="label" style="width:70px;text-align: left;">我的签名</label>
|
||||
<p class="info-text" style="width:540px" v-show="!signData.isEdit">{{form.sign}}</p>
|
||||
<el-input v-show="signData.isEdit" style="width:40%;height:40px" type="textarea" v-model="signData.sign" :rows="1"></el-input>
|
||||
<el-button v-show="signData.isEdit" style="margin-left:110px" @click="signData.isEdit = false">取消</el-button>
|
||||
<el-button v-show="signData.isEdit" type="primary" @click="saveSign()">保存</el-button>
|
||||
<el-button v-show="!signData.isEdit" style="margin-left:110px" type="primary" @click="signData.isEdit = true">编辑</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="informationItem">
|
||||
<div class="information-header">
|
||||
<h4>动态可见范围</h4>
|
||||
</div>
|
||||
<div class="dynamic-range">
|
||||
<span>动态可见范围</span>
|
||||
<el-radio v-model="radio" label="1">全部动态</el-radio>
|
||||
<el-radio v-model="radio" label="2">最近半年动态</el-radio>
|
||||
<el-radio v-model="radio" label="3">最近三个月动态</el-radio>
|
||||
<el-radio v-model="form.dynamic" :label="1">全部动态</el-radio>
|
||||
<el-radio v-model="form.dynamic" :label="2">最近半年动态</el-radio>
|
||||
<el-radio v-model="form.dynamic" :label="3">最近三个月动态</el-radio>
|
||||
<!-- <el-button v-show="dynamicData.isEdit" style="margin-left:110px" @click="dynamicData.isEdit = false">取消</el-button> -->
|
||||
<el-button style="margin-left:110px" type="primary" @click="saveDynamic()">保存</el-button>
|
||||
<!-- <el-button v-show="!dynamicData.isEdit" style="margin-left:110px" type="primary" @click="dynamicData.isEdit = true">编辑</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
<h4>兴趣爱好</h4>
|
||||
<div class="interest" v-show="!interestIsEdit">
|
||||
<ul class="interest-ul">
|
||||
<li class="interest-li" v-for="int in interestList" :key="int.id">{{int.name}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div v-show="interestIsEdit">
|
||||
<div class="interest" v-for="(sys,index) in sysTypeListMap" :key="sys.id">
|
||||
<span>{{sys.name}}</span>
|
||||
<span class="interest-title">{{sys.name}}</span>
|
||||
<div style="width:100%">
|
||||
<el-checkbox-group v-model="checkboxGroup" v-if="sys.children.length > 0">
|
||||
<el-checkbox-button size="medium" v-for="ch in sys.children" :label="ch.id" :key="ch.id">{{ch.name}}</el-checkbox-button>
|
||||
<el-checkbox size="medium" border v-for="ch in sys.children" :label="ch.id" :key="ch.id">{{ch.name}}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
<!-- <ul class="interest-index">
|
||||
<li v-for="ch in sys.children" :label="ch.id" :key="ch.id">{{ch.name}}</li>
|
||||
</ul> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center;margin-top:56px">
|
||||
<el-button type="primary" @click="saveHobby()">更改</el-button>
|
||||
<el-button v-show="interestIsEdit" @click="interestIsEdit = false">取消</el-button>
|
||||
<el-button v-show="interestIsEdit" type="primary" @click="saveHobby()">保存</el-button>
|
||||
<el-button v-show="!interestIsEdit" type="primary" @click="interestIsEdit = true">编辑</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<!-- </div> -->
|
||||
<!-- </el-form> -->
|
||||
<el-dialog
|
||||
title="上传头像"
|
||||
:visible.sync="dialogVisibleAvatar"
|
||||
@@ -113,7 +125,7 @@
|
||||
import accountApi from "@/api/account";
|
||||
import apiPassword from '@/api/boe/login.js'
|
||||
import imageUpload from '@/components/ImageUpload/index.vue';
|
||||
// import apiUserhobby from "@/api/modules/userhobby.js"
|
||||
import apiUserhobby from "@/api/phase2/userhobby.js"
|
||||
const cityOptions = ['上海', '北京', '广州', '深圳'];
|
||||
export default{
|
||||
components:{imageUpload},
|
||||
@@ -155,6 +167,10 @@
|
||||
}
|
||||
};
|
||||
return {
|
||||
signData:{
|
||||
sign:'',
|
||||
isEdit:false
|
||||
},
|
||||
cities: cityOptions,
|
||||
checkboxGroup: [],
|
||||
radio: '1',
|
||||
@@ -173,12 +189,14 @@
|
||||
{ validator: validatePass3, trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
sysTypeListMap:[]
|
||||
sysTypeListMap:[],
|
||||
interestList:[],//已有兴趣爱好列表
|
||||
interestIsEdit:false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
...mapGetters(['userInfo']),
|
||||
...mapGetters(['userInfo','sysTypeMap']),
|
||||
avatar(){
|
||||
if(this.userInfo.avatar){
|
||||
if(this.userInfo.avatar.indexOf('http')==-1){
|
||||
@@ -214,13 +232,37 @@
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
saveDynamic() {
|
||||
userApi.updateDynamic(this.form.dynamic).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.$message.success('修改动态可见范围成功');
|
||||
}
|
||||
})
|
||||
},
|
||||
saveSign() {
|
||||
userApi.updateSign(this.signData.sign).then(res=>{
|
||||
if(res.status == 200){
|
||||
this.$message.success('我的签名修改成功');
|
||||
this.form.sign = this.signData.sign;
|
||||
this.signData.isEdit = false;
|
||||
}
|
||||
})
|
||||
},
|
||||
getInfo() { //获取用户兴趣关联的id
|
||||
// apiUserhobby.info().then(res=>{
|
||||
// if(res.status == 200) {
|
||||
// let data = res.result.map(item => item.refId);
|
||||
// this.checkboxGroup = data;
|
||||
// }
|
||||
// })
|
||||
this.checkboxGroup = [];
|
||||
apiUserhobby.info(this.userInfo.aid).then(res=>{
|
||||
if(res.status == 200) {
|
||||
res.result.forEach(item=>{
|
||||
this.checkboxGroup.push(item.refId);
|
||||
item.name = this.sysTypeName(item.refId)
|
||||
})
|
||||
this.interestList = res.result;
|
||||
}
|
||||
})
|
||||
},
|
||||
sysTypeName(code){
|
||||
if(code==''){return '';}
|
||||
return this.sysTypeMap.get(code);
|
||||
},
|
||||
saveHobby(){
|
||||
let data = []
|
||||
@@ -234,13 +276,15 @@
|
||||
refId:item
|
||||
})
|
||||
})
|
||||
// apiUserhobby.update(data).then(res=>{
|
||||
// if(res.status == 200) {
|
||||
// this.$message.success('更改成功!')
|
||||
// } else {
|
||||
// this.$message.error("更改失败!")
|
||||
// }
|
||||
// })
|
||||
apiUserhobby.update(data).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.interestIsEdit = false;
|
||||
this.getInfo();
|
||||
this.$message.success('更改成功!')
|
||||
} else {
|
||||
this.$message.error("更改失败!")
|
||||
}
|
||||
})
|
||||
},
|
||||
...mapActions({
|
||||
getResOwnerTree: 'resOwner/getResOwnerTree',
|
||||
@@ -251,7 +295,11 @@
|
||||
load(){
|
||||
userApi.detail(this.userInfo.aid).then(res=>{
|
||||
if(res.status==200){
|
||||
this.form=res.result
|
||||
this.form=res.result;
|
||||
this.signData.sign = res.result.sign;
|
||||
if(res.result.dynamic == '') {
|
||||
this.form.dynamic = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -337,35 +385,46 @@
|
||||
.interest{
|
||||
display: flex;
|
||||
padding-left: 20px;
|
||||
.interest-index{
|
||||
flex: 84%;
|
||||
.interest-ul{
|
||||
display: flex;
|
||||
li{
|
||||
flex-wrap: wrap;
|
||||
.interest-li{
|
||||
width: 146px;
|
||||
height: 44px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 4px;
|
||||
border: 1px solid rgba(151,151,151,0.3);
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
line-height: 44px;
|
||||
font-size: 14px;
|
||||
color: #333333;
|
||||
border: 1px solid rgba($color: #979797, $alpha: 0.3);
|
||||
border-radius: 4px;
|
||||
margin-right: 44px;
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
span{
|
||||
// width: 80px;
|
||||
// flex: 1;
|
||||
.interest-title{
|
||||
width: 70px;
|
||||
margin-right: 17px;
|
||||
color: #333333;
|
||||
font-size: 14px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.el-checkbox-group{
|
||||
flex: 84%;
|
||||
.el-checkbox-button{
|
||||
margin-bottom: 20px;
|
||||
::v-deep .el-checkbox__input{
|
||||
display: none;
|
||||
}
|
||||
::v-deep .el-checkbox{
|
||||
width: 146px;
|
||||
height: 44px;
|
||||
margin-bottom: 22px;
|
||||
text-align: center;
|
||||
line-height: 26px;
|
||||
margin-left: 0px;
|
||||
margin-right: 48px;
|
||||
}
|
||||
::v-deep .el-checkbox.is-bordered+.el-checkbox.is-bordered{
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
}
|
||||
.dynamic-range{
|
||||
span{
|
||||
@@ -384,7 +443,21 @@
|
||||
.personSetting{
|
||||
background-color: #fff;
|
||||
box-sizing: border-box;
|
||||
padding: 60px 0px 0px 205px;
|
||||
padding: 30px 0px 0px 247px;
|
||||
// margin: 0 auto;
|
||||
position: relative;
|
||||
.avatar{
|
||||
position: absolute;
|
||||
left: 86px;
|
||||
top:56px;
|
||||
}
|
||||
.passWard-btn{
|
||||
position: absolute;
|
||||
font-size: 16px;
|
||||
top:45px;
|
||||
right:45px;
|
||||
}
|
||||
|
||||
::v-deep .el-radio-button__inner{
|
||||
background: #F4F4F4 !important;
|
||||
border-radius: 4px !important;
|
||||
@@ -396,34 +469,36 @@
|
||||
box-shadow: -1px 0 0 0 #387DF7;
|
||||
}
|
||||
.informationItem{
|
||||
// &:first-of-type{
|
||||
// margin-top: 10px;
|
||||
// }
|
||||
margin-bottom: 82px;
|
||||
.information-header{
|
||||
// display: flex;
|
||||
// justify-content: space-between;
|
||||
// align-items: center;
|
||||
// padding: 10px 0;
|
||||
margin-bottom: 22px;
|
||||
margin-bottom: 35px;
|
||||
}
|
||||
::v-deep .el-form-item{
|
||||
font-size: 12px;
|
||||
.el-form-item__label{
|
||||
color: #333333;
|
||||
.base-info{
|
||||
margin: 0;
|
||||
display: flex;
|
||||
margin-bottom: 46px;
|
||||
// flex-direction: row;
|
||||
// flex-wrap: nowrap;
|
||||
li{
|
||||
width: 260px;
|
||||
// flex-grow: 2;
|
||||
}
|
||||
.label{
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
width: 64px;
|
||||
margin-right: 20px;
|
||||
text-align: right;
|
||||
}
|
||||
.el-form-item__content{
|
||||
.el-input__inner{
|
||||
background: #ffffff;
|
||||
width: 336px;
|
||||
height: 34px;
|
||||
cursor: text;
|
||||
color:#343434;
|
||||
border-radius:6px;
|
||||
}
|
||||
.el-input__suffix{
|
||||
display: none;
|
||||
}
|
||||
.info-text{
|
||||
font-size: 14px;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user