This commit is contained in:
lmj
2022-12-14 22:52:09 +08:00
parent 80104a65dc
commit b8e7812e9c
4 changed files with 44 additions and 11 deletions

View File

@@ -32,13 +32,13 @@
</div>
<div class="teachphoto" style="height:70px">
<h3>擅长课程</h3>
<div class="teachexcel">
<div v-if="teachtext.courses" class="teachexcel">
{{ teachtext.courses }}
</div>
</div>
<div class="teachphoto" style="height:70px">
<h3>专长</h3>
<div class="teachexcel">
<div v-if="teachtext.expertise" class="teachexcel">
{{ teachtext.expertise }}
</div>
@@ -91,10 +91,10 @@
</ul>
</div> -->
<div >
<div class="interest" v-for="(sys,index) in sysTypeListMap" :key="sys.id">
<div class="interest" v-for="(sys,index) in sysTypeListtear" :key="sys.id">
<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-group v-model="checkboxtearGroup" v-if="sys.children.length > 0">
<el-checkbox size="medium" border v-for="ch in sys.children" :label="ch.id" :key="ch.id">{{ch.name}}</el-checkbox>
</el-checkbox-group>
</div>
@@ -106,7 +106,7 @@
<div>
<div style="text-align: center;margin-top:56px">
<el-button @click="Edittearch = true">取消</el-button>
<el-button type="primary" @click="teacherUpdata">保存</el-button>
<el-button type="primary" @click="teacherUpdata()">保存</el-button>
</div>
</div>
</div>
@@ -297,6 +297,7 @@
}
};
return {
sysTypeListtear:[],
teaechswich:false,
props: { multiple: true },
options: [{
@@ -357,11 +358,13 @@
hideHome:false,// 是否隐藏个人主页
cities: cityOptions,
checkboxGroup: [],
checkboxtearGroup: [],
radio: '1',
form:{
account:{}
},
teachform:{
id:'',
photo:'',
courses:'',//擅长课程
workExperience:'', //工作经历
@@ -415,10 +418,14 @@
}
},
Edittearch(){
this.gettearch();
},
// 监听"编辑按钮"事件变化
interestIsEdit(){
this.load();
this.getInfo();
}
@@ -430,18 +437,20 @@
this.hideHome = !this.userInfo.showHome;
this.load();
this.getInfo();
this.gettearch();
this.getSysTypeTree().then(rs => {
this.sysTypeListMap = rs;
// console.log(rs);
this.sysTypeListtear = rs;
});
this.Teacherprofile();
this.Teacherinfo();
},
methods:{
teacherUpdata(){
apiTeach.update(this.teachform).then(res =>{
console.log('编辑成功')
})
gettearch(){
// console.log(this.checkboxtearGroup,'lmj');
},
Teacherinfo(){
apiTeach.detailTeacher(this.userInfo.aid).then(res =>{
this.teachtext = res.result;
@@ -525,6 +534,21 @@
return this.sysTypeMap.get(code);
},
teacherUpdata(){
if(this.checkboxtearGroup.length <3 && this.checkboxtearGroup.length>=1) {
this.$message.error('至少选择三个专长!')
return;
}
console.log(this.checkboxtearGroup);
this.teachform.expertise = this.checkboxtearGroup.toString();
console.log(this.teachform.expertise);
this.teachform.id = this.userInfo.aid;
apiTeach.updateTeacher(this.teachform).then(res =>{
console.log('编辑成功')
})
this.Edittearch = true
},
// 更新用户与偏好数据
saveHobby(){
let data = []
@@ -677,6 +701,7 @@
height: 40px;
width: 100%;
h4{
cursor: pointer;
float: left;
font-weight: 400;
margin: 0;