mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-15 22:06:43 +08:00
教师管理修改
This commit is contained in:
@@ -108,7 +108,7 @@ const save = function(data) {
|
||||
* @param {teacherId->sysId : 原系统的id,接口返回} sysId
|
||||
*/
|
||||
const updateSysId = function(id,sysId) {
|
||||
return ajax.postJson('/xboe/teacher/update-sysid',{id,sysId});
|
||||
return ajax.post('/xboe/teacher/update-sysid',{id,sysId});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
<el-form label-width="100px" :model="form" ref="form" :rules="rules">
|
||||
<el-form-item>
|
||||
<div class="avator">
|
||||
<imageUpload dir="avatar" :value="form.account.avatar" @success="handleUploadSuccess" @remove="removeHandle"></imageUpload>
|
||||
<imageUpload dir="avatar" :value="coverImage" @success="handleUploadSuccess" @remove="removeHandle"></imageUpload>
|
||||
<div class="avatorText">
|
||||
<p>上传头像</p>
|
||||
<p>图片尺寸建议在:宽100px,高100px</p>
|
||||
@@ -249,7 +249,8 @@
|
||||
systemData:[],//体系数组{id,name}
|
||||
levelData:[],//级别数组{id,name}
|
||||
queryLevelData:[],
|
||||
teacherSystemids:[]
|
||||
teacherSystemids:[],
|
||||
coverImage:'',
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
@@ -417,8 +418,8 @@
|
||||
if (res.status == 200 && res.result != null) {
|
||||
this.havaInfo = true;
|
||||
this.form.account = res.result.account;
|
||||
if(res.result.account.avatar != '') {
|
||||
this.form.account.avatar = this.fileBaseUrl + res.result.account.avatar;
|
||||
if(res.result.photo != '') {
|
||||
this.coverImage = this.fileBaseUrl+res.result.photo;
|
||||
}
|
||||
this.form.user = res.result;
|
||||
} else {
|
||||
@@ -432,9 +433,13 @@
|
||||
},
|
||||
removeHandle(){
|
||||
this.form.account.avatar = '';
|
||||
this.coverImage = '';
|
||||
this.form.photo = '';
|
||||
},
|
||||
handleUploadSuccess(res){
|
||||
this.form.account.avatar = this.fileBaseUrl + res.result.filePath;
|
||||
this.coverImage = this.fileBaseUrl + res.result.filePath;
|
||||
this.form.account.avatar = res.result.filePath;
|
||||
this.form.photo = res.result.filePath;
|
||||
},
|
||||
saveHandle(){
|
||||
this.form.tsystemId = this.tSystemData.id;
|
||||
@@ -479,7 +484,6 @@
|
||||
});
|
||||
},
|
||||
saveBoe() {
|
||||
console.log("111");
|
||||
let data = {
|
||||
teacher_user_id:this.form.user.sysId,// 教师对应的用户的id
|
||||
teacher_id:this.form.sysId, // 教师id ,有则编辑,没有则新建教师
|
||||
@@ -518,6 +522,7 @@
|
||||
})
|
||||
},
|
||||
updateHandle(data){
|
||||
this.coverImage = '';
|
||||
this.saveLoading=false;
|
||||
this.newOrEdit='编辑教师';
|
||||
this.allowInput=true;
|
||||
@@ -533,6 +538,9 @@
|
||||
id:result.tlevelId,
|
||||
name: result.tlevelName
|
||||
};
|
||||
if(res.result.photo != '') {
|
||||
this.coverImage = this.fileBaseUrl+res.result.photo;
|
||||
}
|
||||
this.updateSystem(result.tsystemId)
|
||||
this.dialogVisible = true;
|
||||
}
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
<el-col :span="24">
|
||||
<el-form label-width="120px" size="mini">
|
||||
<el-form-item label="头像:">
|
||||
<div style="width: 90px;height: 90px" v-if="newForm && newForm.account && newForm.account.avatar == ''">
|
||||
<div style="width: 90px;height: 90px" v-if="newForm && newForm.photo == ''">
|
||||
<img style="width:100%;height:100%" v-if="newForm.gender == 1" :src="webBaseUrl + '/images/Avatarman.png'" alt="" srcset="">
|
||||
<img style="width:100%;height:100%" v-else :src="webBaseUrl + '/images/Avatarwoman.png'" alt="" srcset="">
|
||||
</div>
|
||||
<div style="width: 90px;height: 90px" v-else>
|
||||
<img style="width:100%;height:100%" :src="newForm && newForm.account && newForm.account.avatar" alt="" srcset="">
|
||||
<img style="width:100%;height:100%" :src="fileBaseUrl + newForm.photo" alt="" srcset="">
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="讲师账号:">
|
||||
@@ -286,9 +286,11 @@ export default {
|
||||
formatsec,
|
||||
formatSeconds,
|
||||
baseUrl: process.env.VUE_APP_BASE_API,
|
||||
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
|
||||
newForm:{
|
||||
account:{},
|
||||
user:{},
|
||||
photo:''
|
||||
},
|
||||
dialogVisible:false,
|
||||
activeName: "first",
|
||||
@@ -349,9 +351,9 @@ export default {
|
||||
if (res.status == 200) {
|
||||
// const result = res.result;
|
||||
this.newForm = res.result;
|
||||
if(res.result.account.avatar != '') {
|
||||
this.newForm.account.avatar = this.baseUrl + res.result.account.avatar;
|
||||
}
|
||||
// if(res.result.account.avatar != '') {
|
||||
// this.newForm.account.avatar = this.baseUrl + res.result.account.avatar;
|
||||
// }
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user