|
@@ -46,7 +46,7 @@
|
|
|
<PersonalPhoto :name="row.name || row.iname" :picture="row.picture" />
|
|
|
</template>
|
|
|
<template slot-scope="{ row,index }" slot="subject">
|
|
|
- <p :style="{color:row.subjectIds && row.subjectIds.length? '':'red'}" class="subject-tag" @click="showSetSubj(index)">
|
|
|
+ <p :style="{color:row.subjectIds && row.subjectIds.length? '':'red'}" class="subject-tag">
|
|
|
{{row.subjectIds && row.subjectIds.length ? getSubjectNames(row.subjectIds) : $t('teachermgmt.notSet')}}
|
|
|
</p>
|
|
|
</template>
|
|
@@ -65,8 +65,8 @@
|
|
|
</template>
|
|
|
<template slot-scope="{ row }" slot="action" v-if="!activePanel">
|
|
|
<div class="teacher-action-wrap">
|
|
|
- <icon v-show="row.roles && !row.roles.includes('admin')" icon="shield-alt" style="font-size: 13px; color: var(--normal-icon-color); margin-right: 15px; cursor: pointer;" @click="openPanel('single',row)" />
|
|
|
- <Icon type="md-create" style="color: var(--normal-icon-color); font-size: 15px; cursor: pointer;margin-right: 15px;" @click="editTeacher(row)" />
|
|
|
+ <icon v-show="row.roles && !row.roles.includes('admin') && row.status == 'join'" icon="shield-alt" style="font-size: 13px; color: var(--normal-icon-color); margin-right: 15px; cursor: pointer;" @click="openPanel('single',row)" />
|
|
|
+ <Icon type="md-create" v-show="row.status == 'join'" style="color: var(--normal-icon-color); font-size: 15px; cursor: pointer;margin-right: 15px;" @click="editTeacher(row)" />
|
|
|
<Icon v-show="row.roles && !row.roles.includes('admin')" size="16" type="md-trash" style="color: var(--normal-icon-color); cursor: pointer" @click="removeUser(row)" />
|
|
|
<Icon v-show="row.roles && row.roles.includes('admin') && row.id == $store.state.userInfo.TEAMModelId && row.status == 'join'" type="md-repeat" style="color: var(--normal-icon-color); font-size: 14px; cursor: pointer" @click="transferAdmin(row)" />
|
|
|
</div>
|
|
@@ -265,14 +265,14 @@
|
|
|
<FormItem :label="$t('teachermgmt.tcUpd2')">
|
|
|
{{`${teacherInfo.name}(${teacherInfo.id})`}}
|
|
|
</FormItem>
|
|
|
- <FormItem :label="$t('teachermgmt.tcUpd3')">
|
|
|
+ <!-- <FormItem :label="$t('teachermgmt.tcUpd3')">
|
|
|
管理员
|
|
|
- </FormItem>
|
|
|
+ </FormItem> -->
|
|
|
<FormItem :label="$t('teachermgmt.tcUpd4')">
|
|
|
<Input v-model="teacherInfo.iname" :placeholder="$t('teachermgmt.tcUpd4')"></Input>
|
|
|
</FormItem>
|
|
|
<FormItem :label="$t('teachermgmt.tcUpd5')">
|
|
|
- <el-cascader ref="subjects" size="small" :options="targetData" clearable filterable v-model="subjectsPath" :props="props" style="width:100%;" popper-class="el-cascader-custom">
|
|
|
+ <el-cascader ref="subjects" size="small" :options="targetData" clearable filterable v-model="teacherInfo.subjectsPath" :props="props" style="width:100%;" popper-class="el-cascader-custom">
|
|
|
</el-cascader>
|
|
|
</FormItem>
|
|
|
<FormItem :label="$t('teachermgmt.tcUpd6')">
|
|
@@ -282,7 +282,7 @@
|
|
|
<Input v-model="teacherInfo.note" :placeholder="$t('teachermgmt.tcUpd8')"></Input>
|
|
|
</FormItem>
|
|
|
</Form>
|
|
|
- <Button :loading="btnLoading" @click="confirmSetSubj" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
|
|
|
+ <Button :loading="btnLoading" @click="confirmUpdateTeacher" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
|
|
|
</div>
|
|
|
</Modal>
|
|
|
<Modal v-model="setSubjStatus" footer-hide className="ed-name-modal">
|
|
@@ -307,11 +307,12 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- subjectsPath: [],
|
|
|
teacherInfo: {
|
|
|
- name: '罗老师',
|
|
|
- id: '1595321354',
|
|
|
- iname: '罗xx'
|
|
|
+ name: '',
|
|
|
+ id: '',
|
|
|
+ iname: '',
|
|
|
+ note: '',
|
|
|
+ subjectsPath: []
|
|
|
},
|
|
|
editTeacherStatus: false,
|
|
|
filters: {
|
|
@@ -707,15 +708,50 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ confirmUpdateTeacher() {
|
|
|
+ let sIds = this.teacherInfo.subjectsPath.map(item => item[item.length - 1])
|
|
|
+ let params = {
|
|
|
+ "opt": "UpdateMoreInfo",
|
|
|
+ "teacherInfo": {
|
|
|
+ id: this.teacherInfo.id,
|
|
|
+ iname: this.teacherInfo.iname,
|
|
|
+ subjectIds: sIds,
|
|
|
+ job: this.teacherInfo.job,
|
|
|
+ note: this.teacherInfo.note
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.btnLoading = true
|
|
|
+ this.$api.schoolUser.setTeacherInfo(params).then(
|
|
|
+ res => {
|
|
|
+ this.$Message.success(this.$t('teachermgmt.setOk'))
|
|
|
+ this.editTeacherStatus = false
|
|
|
+ //更新UI
|
|
|
+ let t = this.teachers.find(item => item.id == this.teacherInfo.id)
|
|
|
+ if (t) {
|
|
|
+ t.subjectIds = sIds
|
|
|
+ t.iname = this.teacherInfo.iname
|
|
|
+ t.job = this.teacherInfo.job
|
|
|
+ t.note = this.teacherInfo.note
|
|
|
+ this.$store.commit('user/updTeacher', [t])
|
|
|
+ }
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ this.$Message.error(this.$t('teachermgmt.setErr'))
|
|
|
+ }
|
|
|
+ ).finally(() => {
|
|
|
+ this.btnLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
editTeacher(teacher) {
|
|
|
console.log(teacher)
|
|
|
+ this.teacherInfo = this._.cloneDeep(teacher)
|
|
|
if (teacher.subjectIds && teacher.subjectIds.length) {
|
|
|
let subjectInfos = this.$jsFn.getTeacherSubjects(teacher.subjectIds)
|
|
|
- this.subjectsPath = subjectInfos.map(item => [item.periodId, item.subjectId])
|
|
|
+ this.teacherInfo.subjectsPath = subjectInfos.map(item => [item.periodId, item.subjectId])
|
|
|
} else {
|
|
|
- this.subjectsPath = []
|
|
|
+ this.teacherInfo.subjectsPath = []
|
|
|
}
|
|
|
- this.teacherInfo = this._.cloneDeep(teacher)
|
|
|
+
|
|
|
this.editTeacherStatus = true
|
|
|
},
|
|
|
getGroupName(groups) {
|
|
@@ -1014,18 +1050,6 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- //单一设置教师学科
|
|
|
- showSetSubj(index) {
|
|
|
- this.setSubjIndex = index
|
|
|
- if (this.tableData[index].status != 'join') return
|
|
|
- if (this.tableData[index].subjectIds && this.tableData[index].subjectIds.length) {
|
|
|
- let subjectInfos = this.$jsFn.getTeacherSubjects(this.tableData[index].subjectIds)
|
|
|
- this.setSubj = subjectInfos.map(item => [item.periodId, item.subjectId])
|
|
|
- } else {
|
|
|
- this.setSubj = []
|
|
|
- }
|
|
|
- this.setSubjStatus = true
|
|
|
- },
|
|
|
//确认设置教师学科
|
|
|
confirmSetSubj() {
|
|
|
if (this.setSubj.length) {
|