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
|
* @param {teacherId->sysId : 原系统的id,接口返回} sysId
|
||||||
*/
|
*/
|
||||||
const updateSysId = function(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 label-width="100px" :model="form" ref="form" :rules="rules">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<div class="avator">
|
<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">
|
<div class="avatorText">
|
||||||
<p>上传头像</p>
|
<p>上传头像</p>
|
||||||
<p>图片尺寸建议在:宽100px,高100px</p>
|
<p>图片尺寸建议在:宽100px,高100px</p>
|
||||||
@@ -249,7 +249,8 @@
|
|||||||
systemData:[],//体系数组{id,name}
|
systemData:[],//体系数组{id,name}
|
||||||
levelData:[],//级别数组{id,name}
|
levelData:[],//级别数组{id,name}
|
||||||
queryLevelData:[],
|
queryLevelData:[],
|
||||||
teacherSystemids:[]
|
teacherSystemids:[],
|
||||||
|
coverImage:'',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
@@ -417,8 +418,8 @@
|
|||||||
if (res.status == 200 && res.result != null) {
|
if (res.status == 200 && res.result != null) {
|
||||||
this.havaInfo = true;
|
this.havaInfo = true;
|
||||||
this.form.account = res.result.account;
|
this.form.account = res.result.account;
|
||||||
if(res.result.account.avatar != '') {
|
if(res.result.photo != '') {
|
||||||
this.form.account.avatar = this.fileBaseUrl + res.result.account.avatar;
|
this.coverImage = this.fileBaseUrl+res.result.photo;
|
||||||
}
|
}
|
||||||
this.form.user = res.result;
|
this.form.user = res.result;
|
||||||
} else {
|
} else {
|
||||||
@@ -432,9 +433,13 @@
|
|||||||
},
|
},
|
||||||
removeHandle(){
|
removeHandle(){
|
||||||
this.form.account.avatar = '';
|
this.form.account.avatar = '';
|
||||||
|
this.coverImage = '';
|
||||||
|
this.form.photo = '';
|
||||||
},
|
},
|
||||||
handleUploadSuccess(res){
|
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(){
|
saveHandle(){
|
||||||
this.form.tsystemId = this.tSystemData.id;
|
this.form.tsystemId = this.tSystemData.id;
|
||||||
@@ -479,7 +484,6 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
saveBoe() {
|
saveBoe() {
|
||||||
console.log("111");
|
|
||||||
let data = {
|
let data = {
|
||||||
teacher_user_id:this.form.user.sysId,// 教师对应的用户的id
|
teacher_user_id:this.form.user.sysId,// 教师对应的用户的id
|
||||||
teacher_id:this.form.sysId, // 教师id ,有则编辑,没有则新建教师
|
teacher_id:this.form.sysId, // 教师id ,有则编辑,没有则新建教师
|
||||||
@@ -518,6 +522,7 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateHandle(data){
|
updateHandle(data){
|
||||||
|
this.coverImage = '';
|
||||||
this.saveLoading=false;
|
this.saveLoading=false;
|
||||||
this.newOrEdit='编辑教师';
|
this.newOrEdit='编辑教师';
|
||||||
this.allowInput=true;
|
this.allowInput=true;
|
||||||
@@ -533,6 +538,9 @@
|
|||||||
id:result.tlevelId,
|
id:result.tlevelId,
|
||||||
name: result.tlevelName
|
name: result.tlevelName
|
||||||
};
|
};
|
||||||
|
if(res.result.photo != '') {
|
||||||
|
this.coverImage = this.fileBaseUrl+res.result.photo;
|
||||||
|
}
|
||||||
this.updateSystem(result.tsystemId)
|
this.updateSystem(result.tsystemId)
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form label-width="120px" size="mini">
|
<el-form label-width="120px" size="mini">
|
||||||
<el-form-item label="头像:">
|
<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-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="">
|
<img style="width:100%;height:100%" v-else :src="webBaseUrl + '/images/Avatarwoman.png'" alt="" srcset="">
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 90px;height: 90px" v-else>
|
<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>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="讲师账号:">
|
<el-form-item label="讲师账号:">
|
||||||
@@ -286,9 +286,11 @@ export default {
|
|||||||
formatsec,
|
formatsec,
|
||||||
formatSeconds,
|
formatSeconds,
|
||||||
baseUrl: process.env.VUE_APP_BASE_API,
|
baseUrl: process.env.VUE_APP_BASE_API,
|
||||||
|
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
|
||||||
newForm:{
|
newForm:{
|
||||||
account:{},
|
account:{},
|
||||||
user:{},
|
user:{},
|
||||||
|
photo:''
|
||||||
},
|
},
|
||||||
dialogVisible:false,
|
dialogVisible:false,
|
||||||
activeName: "first",
|
activeName: "first",
|
||||||
@@ -349,9 +351,9 @@ export default {
|
|||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
// const result = res.result;
|
// const result = res.result;
|
||||||
this.newForm = res.result;
|
this.newForm = res.result;
|
||||||
if(res.result.account.avatar != '') {
|
// if(res.result.account.avatar != '') {
|
||||||
this.newForm.account.avatar = this.baseUrl + res.result.account.avatar;
|
// this.newForm.account.avatar = this.baseUrl + res.result.account.avatar;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user