|
@@ -27,14 +27,22 @@
|
|
|
<PersonalPhoto :name="row.name" :picture="row.picture" />
|
|
|
</template>
|
|
|
<template slot-scope="{ row,index }" slot="subject">
|
|
|
- <span :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" @click="showSetSubj(index)">
|
|
|
{{row.subjectIds && row.subjectIds.length ? getSubjectNames(row.subjectIds) : $t('teachermgmt.notSet')}}
|
|
|
+ </p>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row,index }" slot="name">
|
|
|
+ <span>
|
|
|
+ {{row.name}}
|
|
|
+ </span>
|
|
|
+ <span v-show="row.status != 'join'" class="teacher-status" :style="{background:row.status == 'invite' ? '#2d8cf0' : ''}">
|
|
|
+ {{row.status == 'import' ? $t('teachermgmt.teacherStatus1') : row.status == 'invite' ? $t('teachermgmt.teacherStatus2') : ''}}
|
|
|
</span>
|
|
|
</template>
|
|
|
<template slot-scope="{ row }" slot="action" v-if="!activePanel">
|
|
|
- <icon v-show="!row.roles.includes('admin')" icon="shield-alt" style="font-size: 13px; color: var(--normal-icon-color); margin-right: 20px; cursor: pointer;" @click="openPanel('single',row)" />
|
|
|
+ <icon v-show="!row.roles.includes('admin') && row.status == 'join'" icon="shield-alt" style="font-size: 13px; color: var(--normal-icon-color); margin-right: 20px; cursor: pointer;" @click="openPanel('single',row)" />
|
|
|
<Icon v-show="!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.includes('admin') && row.id == $store.state.userInfo.TEAMModelId" type="md-repeat" style="color: var(--normal-icon-color); font-size: 14px; cursor: pointer" @click="transferAdmin(row)" />
|
|
|
+ <Icon v-show="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)" />
|
|
|
</template>
|
|
|
<!---手動輸入空間欄位-->
|
|
|
<template slot-scope="{ row }" slot="spaceShare">
|
|
@@ -208,7 +216,7 @@
|
|
|
<div class="edit-name-content">
|
|
|
<span>{{$t('teachermgmt.transferTo')}}</span>
|
|
|
<Select v-model="toAdminId" filterable style="margin-top:10px">
|
|
|
- <Option v-for="item in teachers" :value="item.id" :key="item.id">
|
|
|
+ <Option v-for="item in teacherJoin" :value="item.id" :key="item.id">
|
|
|
{{ `${item.name}(${item.id})` }}
|
|
|
</Option>
|
|
|
</Select>
|
|
@@ -277,9 +285,23 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters({
|
|
|
- teachers: 'user/getTeacherJoined',
|
|
|
+ teacherJoin: 'user/getTeacherJoined',
|
|
|
+ teacherInvite: 'user/getTeacherInvited',
|
|
|
+ teacherImport: 'user/getTeacherImport',
|
|
|
isKeyInSpace: 'spaceAuth/getIsKeyInSpace'
|
|
|
}),
|
|
|
+ teachers() {
|
|
|
+ let data = []
|
|
|
+ data.push(...this.teacherJoin)
|
|
|
+ data.push(...this.teacherInvite)
|
|
|
+ data.push(...this.teacherImport)
|
|
|
+ data.forEach(item => {
|
|
|
+ if (item.status != 'join') {
|
|
|
+ item._disabled = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return data
|
|
|
+ },
|
|
|
pieNumData() {
|
|
|
let data = [
|
|
|
{ value: 0, name: this.$t("teachermgmt.usedSpace") },
|
|
@@ -337,18 +359,34 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
title: this.$t('teachermgmt.table.th2'),
|
|
|
- key: 'name',
|
|
|
+ slot: 'name',
|
|
|
minWidth: 160,
|
|
|
maxWidth: 200,
|
|
|
- sortable: true
|
|
|
+ filters: [
|
|
|
+ {
|
|
|
+ label: this.$t('teachermgmt.teacherStatus3'),
|
|
|
+ value: 'join'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: this.$t('teachermgmt.teacherStatus2'),
|
|
|
+ value: 'invite'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: this.$t('teachermgmt.teacherStatus1'),
|
|
|
+ value: 'import'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ filterMethod(value, row) {
|
|
|
+ return row.status == value
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title: 'ID',
|
|
|
minWidth: 160,
|
|
|
maxWidth: 200,
|
|
|
key: 'id',
|
|
|
+ sortable: true
|
|
|
},
|
|
|
-
|
|
|
{
|
|
|
title: this.$t('teachermgmt.table.th6'),
|
|
|
slot: 'subject',
|
|
@@ -410,7 +448,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }, this.$t('teachermgmt.table.filter')),
|
|
|
+ }, this.$t('teachermgmt.filter')),
|
|
|
h('span', {
|
|
|
on: {
|
|
|
'click': () => {
|
|
@@ -454,7 +492,7 @@ export default {
|
|
|
minWidth: 180,
|
|
|
render: (h, params) => {
|
|
|
let p = ['content-read', 'exercise-read', 'knowledge-read', 'syllabus-read']
|
|
|
- let flag = params.row.permissions.some(item => {
|
|
|
+ let flag = params.row.permissions?.some(item => {
|
|
|
return !p.includes(item)
|
|
|
})
|
|
|
if (params.row.roles.includes('admin')) {
|
|
@@ -586,8 +624,8 @@ export default {
|
|
|
// 可以客制調整
|
|
|
filterData = this.teachers.filter(res => {
|
|
|
let a = res.name.toLowerCase()
|
|
|
- let b = res.id.toLowerCase()
|
|
|
- return a.includes(this.keyWord) || b.includes(this.keyWord)
|
|
|
+ let b = res.id?.toLowerCase()
|
|
|
+ return a?.includes(this.keyWord) || b?.includes(this.keyWord)
|
|
|
})
|
|
|
}
|
|
|
return filterData
|
|
@@ -840,6 +878,7 @@ 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])
|
|
@@ -903,7 +942,7 @@ export default {
|
|
|
let subNames = item.map(s => s.subjectName)
|
|
|
let pdName = item[0].periodName
|
|
|
return `${pdName}-${subNames.join('/')}`
|
|
|
- }).join('; ')
|
|
|
+ }).join('; \n')
|
|
|
} else {
|
|
|
return ''
|
|
|
}
|
|
@@ -947,16 +986,19 @@ export default {
|
|
|
removeUser(val) {
|
|
|
// val:使用者的資料(object)
|
|
|
if (this.$access.can('admin.*|teacher-upd')) {
|
|
|
+ let idText = val.id ? '(' + val.id + ')' : ''
|
|
|
this.$Modal.confirm({
|
|
|
title: this.$t('teachermgmt.model.delTeacher.title'),
|
|
|
- content: '<p>' + this.$t('teachermgmt.model.delTeacher.text1') + ' ' + val.name + '(' + val.id + ') ?</p>',
|
|
|
+ // content: '<p>' + this.$t('teachermgmt.model.delTeacher.text1') + ' ' + val.name + '(' + val.id + ') ?</p>',
|
|
|
+ content: `<p> ${this.$t('teachermgmt.model.delTeacher.text1')} ${val.name} ${idText}?</p>`,
|
|
|
onOk: () => {
|
|
|
this.$api.schoolUser.rmvSchoolUser({
|
|
|
school_code: this.$store.state.userInfo.schoolCode,
|
|
|
- id: val.id
|
|
|
+ id: val.id || undefined,
|
|
|
+ name: val.id ? undefined : val.name
|
|
|
}).then(
|
|
|
res => {
|
|
|
- this.$store.commit('user/delTeacher', [val.id])
|
|
|
+ this.$store.commit('user/delTeacher', [val.id || val.name])
|
|
|
},
|
|
|
err => {
|
|
|
}
|