编辑教师和教师信息接口

This commit is contained in:
lmj
2022-12-07 18:08:54 +08:00
parent 3c104fddeb
commit 0c42b2fc12
2 changed files with 31 additions and 21 deletions

View File

@@ -187,11 +187,9 @@
Teacherinfo(){ Teacherinfo(){
apiTeach.detail(this.userInfo.aid).then(res =>{ apiTeach.detail(this.userInfo.aid).then(res =>{
this.teachtext = res.result; this.teachtext = res.result;
console.log(this.teachtext);
}) })
}, },
Teacherprofile(){ Teacherprofile(){
console.log()
apiTeach.has(this.userInfo.aid).then(res =>{ apiTeach.has(this.userInfo.aid).then(res =>{
this.teaechswich = res.result.isTeacher; this.teaechswich = res.result.isTeacher;
}) })

View File

@@ -16,7 +16,7 @@
<div class="informationItem"> <div class="informationItem">
<div class="info-header"> <div class="info-header">
<h4 @click="infoswich=1" :class="infoswich == 1 ? 'h4active' : '' ">基础信息</h4> <h4 @click="infoswich=1" :class="infoswich == 1 ? 'h4active' : '' ">基础信息</h4>
<h4 @click="infoswich=0" :class="infoswich == 0 ? 'h4active' : '' ">教师信息</h4> <h4 v-if="teaechswich" @click="infoswich=0" :class="infoswich == 0 ? 'h4active' : '' ">教师信息</h4>
</div> </div>
<div v-if="infoswich == 0"> <div v-if="infoswich == 0">
<el-button type="primary" size="mini" @click="Edittearch = !Edittearch">教师信息编辑</el-button> <el-button type="primary" size="mini" @click="Edittearch = !Edittearch">教师信息编辑</el-button>
@@ -24,26 +24,17 @@
<div v-if="Edittearch"> <div v-if="Edittearch">
<div class="tearchimg"> <div class="tearchimg">
<h3>教师职业照</h3> <h3>教师职业照</h3>
<img src="../../../public/images/artfoot.png" alt=""> <img :src="BaseUrl + teachtext.photo" alt="">
</div> </div>
<div class="tearchexperi"> <div class="tearchexperi">
<h3>工作经历</h3> <h3>工作经历</h3>
<span>英语教研组在学校领导的关怀指导下,开学初制定了务实的工作计划我们认真按照开学初制定的计划开展教研活动,较好地完成了本学期工作任务</span> <span>{{ teachtext.workExperience }}</span>
</div> </div>
<div class="teachphoto" style="height:70px"> <div class="teachphoto" style="height:70px">
<h3>擅长课程</h3> <h3>擅长课程</h3>
<div class="teachexcel"> <div class="teachexcel">
通用力 通用力
</div> </div>
<div class="teachexcel">
产品经理培训
</div>
<div class="teachexcel">
规章制度
</div>
<div class="teachexcel">
职业操守与道德
</div>
</div> </div>
<div class="teachphoto" style="height:70px"> <div class="teachphoto" style="height:70px">
<h3>专长</h3> <h3>专长</h3>
@@ -72,7 +63,7 @@
maxlength="80" maxlength="80"
placeholder="请输入内容" placeholder="请输入内容"
show-word-limit show-word-limit
v-model="teachform.tearchexpe"> v-model="teachform.workExperience">
</el-input> </el-input>
</div> </div>
@@ -84,7 +75,7 @@
type="textarea" type="textarea"
:rows="2" :rows="2"
placeholder="请输入内容" placeholder="请输入内容"
v-model="teachform.couresexcel"> v-model="teachform.courses">
</el-input> </el-input>
</div> </div>
</div> </div>
@@ -101,7 +92,7 @@
<div> <div>
<div style="text-align: center;margin-top:56px"> <div style="text-align: center;margin-top:56px">
<el-button @click="Edittearch = true">取消</el-button> <el-button @click="Edittearch = true">取消</el-button>
<el-button type="primary">保存</el-button> <el-button type="primary" @click="teacherUpdata">保存</el-button>
</div> </div>
</div> </div>
</div> </div>
@@ -244,6 +235,7 @@
</template> </template>
<script> <script>
import apiTeach from '@/api/modules/teacher.js';
import { mapGetters, mapActions } from 'vuex'; import { mapGetters, mapActions } from 'vuex';
import userApi from "@/api/system/user"; import userApi from "@/api/system/user";
import accountApi from "@/api/account"; import accountApi from "@/api/account";
@@ -291,6 +283,7 @@
} }
}; };
return { return {
teaechswich:false,
props: { multiple: true }, props: { multiple: true },
options: [{ options: [{
value: 1, value: 1,
@@ -355,8 +348,10 @@
account:{} account:{}
}, },
teachform:{ teachform:{
img:'', photo:'',
tearchexpe:'', courses:'',//擅长课程
workExperience:'', //工作经历
expertise:'', //专长
}, },
dialogVisibleAvatar:false, dialogVisibleAvatar:false,
dialogVisiblePassword:false, dialogVisiblePassword:false,
@@ -424,8 +419,25 @@
this.getSysTypeTree().then(rs => { this.getSysTypeTree().then(rs => {
this.sysTypeListMap = rs; this.sysTypeListMap = rs;
}); });
this.Teacherprofile();
this.Teacherinfo();
}, },
methods:{ methods:{
teacherUpdata(){
apiTeach.update(this.teachform).then(res =>{
console.log('编辑成功')
})
},
Teacherinfo(){
apiTeach.detailTeacher(this.userInfo.aid).then(res =>{
this.teachtext = res.result;
})
},
Teacherprofile(){
apiTeach.has(this.userInfo.aid).then(res =>{
this.teaechswich = res.result.isTeacher;
})
},
// 保存个人主页选项的编辑 // 保存个人主页选项的编辑
saveHideHome(){ saveHideHome(){
//执行隐藏操作 //执行隐藏操作
@@ -551,12 +563,12 @@
this.avatarUrl= res.result.httpPath; this.avatarUrl= res.result.httpPath;
}, },
handtearchUploadSuccess(res){ handtearchUploadSuccess(res){
this.teachform.img = res.result.filePath; this.teachform.photo = res.result.filePath;
this.tearchUrl= res.result.httpPath; this.tearchUrl= res.result.httpPath;
}, },
removetearchHandle(){ removetearchHandle(){
this.avatarUrl=''; this.avatarUrl='';
this.teachform.img = ''; this.teachform.photo = '';
}, },
removeHandle(){ removeHandle(){
this.avatarUrl=''; this.avatarUrl='';