|
@@ -8,105 +8,17 @@
|
|
|
max-width: 300px;
|
|
|
.ivu-input {
|
|
|
font-size: 13px;
|
|
|
- // background-color: #f5f5f5;
|
|
|
- // border: none;
|
|
|
- // color: var(--primary-text-color);
|
|
|
}
|
|
|
}
|
|
|
.multiSet {
|
|
|
- // &:hover {
|
|
|
- span {
|
|
|
- color: #40a8f0;
|
|
|
- }
|
|
|
- // }
|
|
|
+ span {
|
|
|
+ color: #40a8f0;
|
|
|
+ }
|
|
|
.icon {
|
|
|
vertical-align: middle;
|
|
|
margin-right: 7px;
|
|
|
}
|
|
|
}
|
|
|
-.userListContent {
|
|
|
- .ivu-table {
|
|
|
- // background-color: transparent;
|
|
|
- .ivu-table-header {
|
|
|
- tr:first-child {
|
|
|
- /* background: -webkit-linear-gradient(left, #272727, #222222);
|
|
|
- background: -o-linear-gradient(right, #272727, #222222);
|
|
|
- background: -moz-linear-gradient(right, #272727, #222222);
|
|
|
- background: linear-gradient(to right, #272727, #222222); */
|
|
|
- background: var(--body-bg);
|
|
|
- }
|
|
|
- }
|
|
|
- th {
|
|
|
- // background-color: transparent;
|
|
|
- border-bottom: 1px solid var(--border-color);
|
|
|
- color: var(--second-text-color);
|
|
|
- font-size: 12px;
|
|
|
- }
|
|
|
- td {
|
|
|
- // background-color: transparent;
|
|
|
- }
|
|
|
- .ivu-table-tbody {
|
|
|
- td {
|
|
|
- // background-color: transparent;
|
|
|
- border-bottom: 1px solid var(--border-color);
|
|
|
- color: var(--primary-text-color);
|
|
|
- font-size: 12px;
|
|
|
- }
|
|
|
- .ivu-table-row {
|
|
|
- td:nth-child(8) {
|
|
|
- .ivu-table-cell {
|
|
|
- display: none;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .ivu-table-row-hover {
|
|
|
- /* background: -webkit-linear-gradient(left, #272727, #373737);
|
|
|
- background: -o-linear-gradient(right, #272727, #373737);
|
|
|
- background: -moz-linear-gradient(right, #272727, #373737);
|
|
|
- background: linear-gradient(to right, #272727, #373737); */
|
|
|
- background: var(--active-item-start);
|
|
|
- td:last-child {
|
|
|
- .ivu-table-cell {
|
|
|
- display: block !important;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .ivu-checkbox-inner {
|
|
|
- background-color: transparent;
|
|
|
- border: 2px solid var(--border-color);
|
|
|
- border-radius: 3px;
|
|
|
- }
|
|
|
- .ivu-checkbox-checked .ivu-checkbox-inner:after {
|
|
|
- width: 8px;
|
|
|
- height: 14px;
|
|
|
- top: -2px;
|
|
|
- left: 4px;
|
|
|
- border-color: #0094ff;
|
|
|
- border-right-width: 3px;
|
|
|
- border-bottom-width: 3px;
|
|
|
- }
|
|
|
- .ivu-table-overflowY {
|
|
|
- &::-webkit-scrollbar {
|
|
|
- width: 5px;
|
|
|
- }
|
|
|
- &::-webkit-scrollbar-track {
|
|
|
- // margin: 0px;
|
|
|
- background: transparent;
|
|
|
- }
|
|
|
- &::-webkit-scrollbar-thumb {
|
|
|
- border-radius: 10px;
|
|
|
- background: #94998a;
|
|
|
- }
|
|
|
- &::-webkit-scrollbar-thumb:hover {
|
|
|
- /* background: #555; */
|
|
|
- }
|
|
|
- &::-webkit-scrollbar-button {
|
|
|
- display: none;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
.authSetting {
|
|
|
.ivu-btn {
|
|
|
background-color: #1cc0f2;
|
|
@@ -114,22 +26,10 @@
|
|
|
border-radius: 2px;
|
|
|
border: 0;
|
|
|
}
|
|
|
- .users {
|
|
|
- .jobInp {
|
|
|
- // .ivu-input {
|
|
|
- // background-color: transparent;
|
|
|
- // border: 0;
|
|
|
- // border-bottom: 1px solid #6b6a6a;
|
|
|
- // padding-left: 0;
|
|
|
- // color: #fefefe;
|
|
|
- // }
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
.ids {
|
|
|
.ivu-tooltip-inner {
|
|
|
opacity: 0.5;
|
|
|
- // background: rgba(100, 100, 100, 0.2);
|
|
|
background: #010101;
|
|
|
border: 1px rgba(160, 160, 160, 0.5) solid;
|
|
|
}
|
|
@@ -167,7 +67,6 @@
|
|
|
.jobModal {
|
|
|
.ivu-modal {
|
|
|
.ivu-modal-content {
|
|
|
- // background-color: #2a292e;
|
|
|
.ivu-modal-header,
|
|
|
.ivu-modal-footer {
|
|
|
border: 0;
|
|
@@ -231,12 +130,20 @@
|
|
|
<Button v-if="$access.can('admin.*|teacher-upd') && !authMulti && isOpenSpaceAuth == false" class="multiSet" type="text" @click="multiSet()">
|
|
|
<icon class="icon" icon="shield-alt" /> {{ $t('teachermgmt.mulitSet') }}
|
|
|
</Button>
|
|
|
+ <Button v-if="$access.can('admin.*|teacher-upd')" class="multiSet" type="text" @click="batchSetSubject()">
|
|
|
+ <Icon class="icon" type="ios-settings" size="18" />{{ $t('teachermgmt.batchSetSubj') }}
|
|
|
+ </Button>
|
|
|
</div>
|
|
|
<div class="userListContent">
|
|
|
- <Table v-if="isMockReloadAlive" class="scrollstyle" :height="tableHeight" ref="selection" :columns="tableColumns" :data="tableData" @on-selection-change="setTeachers" @on-sort-change="changeSort">
|
|
|
+ <Table v-if="isMockReloadAlive" stripe class="scrollstyle" :height="tableHeight" ref="selection" :columns="tableColumns" :data="tableData" @on-selection-change="setTeachers" @on-sort-change="changeSort">
|
|
|
<template slot-scope="{ row }" slot="picture">
|
|
|
<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)">
|
|
|
+ {{row.subjectIds && row.subjectIds.length ? getSubjectNames(row.subjectIds) : $t('teachermgmt.notSet')}}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
<template slot-scope="{ row }" slot="action" v-if="isOpenSpaceAuth == false">
|
|
|
<icon v-show="!row.roles.includes('admin')" icon="shield-alt" style="font-size: 14px; color: var(--normal-icon-color); margin-right: 20px; cursor: pointer;" @click="showAuth(row)" />
|
|
|
<icon v-show="!row.roles.includes('admin')" icon="trash" style="color: var(--normal-icon-color); font-size: 14px; cursor: pointer" @click="removeUser(row)" />
|
|
@@ -361,6 +268,11 @@
|
|
|
</Option>
|
|
|
</Select>
|
|
|
</Modal>
|
|
|
+ <!-- 设置教师学科 -->
|
|
|
+ <Modal v-model="setSubjStatus" :title="$t('teachermgmt.setSubjTitle')" @on-ok="confirmSetSubj" :loading="modalLoading">
|
|
|
+ <el-cascader ref="subjects" size="small" :options="targetData" clearable filterable v-model="setSubj" :props="props" style="width:100%;">
|
|
|
+ </el-cascader>
|
|
|
+ </Modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -374,6 +286,12 @@ export default {
|
|
|
name: 'userList',
|
|
|
data() {
|
|
|
return {
|
|
|
+ props: {
|
|
|
+ multiple: true,
|
|
|
+ value: 'id',
|
|
|
+ label: 'name'
|
|
|
+ },
|
|
|
+ setSubj: [],
|
|
|
columns: [
|
|
|
{
|
|
|
type: 'selection',
|
|
@@ -387,9 +305,8 @@ export default {
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
- // title: this.$t('teachermgmt.table.th1'),
|
|
|
title: 'ID',
|
|
|
- minWidth:160,
|
|
|
+ minWidth: 160,
|
|
|
key: 'id',
|
|
|
sortable: true
|
|
|
},
|
|
@@ -412,6 +329,12 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ {
|
|
|
+ title: this.$t('teachermgmt.table.th6'),
|
|
|
+ slot: 'subject',
|
|
|
+ minWidth: 160,
|
|
|
+ sortable: true
|
|
|
+ },
|
|
|
{
|
|
|
title: this.$t('teachermgmt.table.th4'),
|
|
|
sortable: true,
|
|
@@ -447,9 +370,9 @@ export default {
|
|
|
slot: 'action',
|
|
|
minWidth: 150,
|
|
|
align: 'center'
|
|
|
- // show: true
|
|
|
}
|
|
|
],
|
|
|
+ setSubjStatus: false,
|
|
|
transferStatus: false,
|
|
|
modalLoading: true,
|
|
|
curTeaId: '',//当前教师id
|
|
@@ -489,6 +412,21 @@ export default {
|
|
|
isKeyInSpace: 'spaceAuth/getIsKeyInSpace',
|
|
|
maxFixedAssignedValue: 'spaceAuth/getMaxFixedAssignedValue'
|
|
|
}),
|
|
|
+ targetData() {
|
|
|
+ let nodes = []
|
|
|
+ let schoolBase = this.$store.state.user.schoolProfile.school_base
|
|
|
+ if (schoolBase) {
|
|
|
+ schoolBase.period.forEach(item => {
|
|
|
+ let dataItem = {
|
|
|
+ id: item.id,
|
|
|
+ name: item.name,
|
|
|
+ children: item.subjects
|
|
|
+ }
|
|
|
+ nodes.push(dataItem)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return nodes
|
|
|
+ },
|
|
|
authListAll: function () {
|
|
|
// 所有權限列表(階層構造)
|
|
|
console.log('auth', this.authData.authListFormed)
|
|
@@ -503,9 +441,6 @@ export default {
|
|
|
return newAuthdisable
|
|
|
}
|
|
|
},
|
|
|
- //authstatus: function() { // (i-switch用)權限開關控制value資料
|
|
|
- // return this.authData.authStatus
|
|
|
- //},
|
|
|
authIdToPath: function () {
|
|
|
// 權限ID <=> 權限路徑 對照表
|
|
|
return this.authData.authIdToPath
|
|
@@ -689,19 +624,6 @@ export default {
|
|
|
} else {
|
|
|
return h('span', this.$t('teachermgmt.table.text1'))
|
|
|
}
|
|
|
- // if (params.row.permissionCount > 0) {
|
|
|
- // return h(
|
|
|
- // 'span',
|
|
|
- // {
|
|
|
- // style: {
|
|
|
- // color: '#1CC0F3'
|
|
|
- // }
|
|
|
- // },
|
|
|
- // this.$t('teachermgmt.table.text2')
|
|
|
- // )
|
|
|
- // } else {
|
|
|
- // return h('span', this.$t('teachermgmt.table.text1'))
|
|
|
- // }
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -722,23 +644,7 @@ export default {
|
|
|
title: ' ',
|
|
|
width: 80,
|
|
|
slot: 'picture',
|
|
|
- // key: 'picture',
|
|
|
align: 'center'
|
|
|
- // render: (h, params) => {
|
|
|
- // return h('img', {
|
|
|
- // attrs: {
|
|
|
- // src: params.row.picture
|
|
|
- // },
|
|
|
- // style: {
|
|
|
- // display: 'inline-block',
|
|
|
- // width: '36px',
|
|
|
- // 'border-radius': '50%',
|
|
|
- // 'align-items': 'center',
|
|
|
- // 'justify-content': 'center',
|
|
|
- // 'overflow': 'hidden'
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
},
|
|
|
{
|
|
|
title: this.$t('teachermgmt.table.th1'),
|
|
@@ -790,19 +696,6 @@ export default {
|
|
|
} else {
|
|
|
return h('span', this.$t('teachermgmt.table.text1'))
|
|
|
}
|
|
|
- // if (params.row.permissionCount > 0) {
|
|
|
- // return h(
|
|
|
- // 'span',
|
|
|
- // {
|
|
|
- // style: {
|
|
|
- // color: '#1CC0F3'
|
|
|
- // }
|
|
|
- // },
|
|
|
- // this.$t('teachermgmt.table.text2')
|
|
|
- // )
|
|
|
- // } else {
|
|
|
- // return h('span', this.$t('teachermgmt.table.text1'))
|
|
|
- // }
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -817,6 +710,80 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //批量设置学科
|
|
|
+ batchSetSubject() {
|
|
|
+ if (this.teachers && this.teachers.length) {
|
|
|
+ this.setSubj = []
|
|
|
+ this.setSubjIndex = -1
|
|
|
+ this.setSubjStatus = true
|
|
|
+ } else {
|
|
|
+ this.$Modal.warning({
|
|
|
+ title: this.$t('teachermgmt.model.warning.title'),
|
|
|
+ content: this.$t('teachermgmt.model.warning.text1')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //获取教师学科信息
|
|
|
+ getSubjectNames(ids) {
|
|
|
+ let data = this.$jsFn.getTeacherSubjects(ids)
|
|
|
+ console.log(ids, data)
|
|
|
+ if (data && data.length) {
|
|
|
+ return data.map(item => item.subjectName).join(',')
|
|
|
+ } else {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //确认设置教师学科
|
|
|
+ confirmSetSubj() {
|
|
|
+ console.log(this.setSubj)
|
|
|
+ if (this.setSubj.length) {
|
|
|
+ let teacherIds
|
|
|
+ if (this.setSubjIndex > -1) {
|
|
|
+ teacherIds = [this.tableData[this.setSubjIndex].id]
|
|
|
+ } else {
|
|
|
+ teacherIds = this.teachers.map(item => item.id)
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ "opt": "SetTeacherSubject",
|
|
|
+ "targerTecher": teacherIds,
|
|
|
+ "subjectIds": this.setSubj.map(item => item[1])
|
|
|
+ }
|
|
|
+ console.log(params)
|
|
|
+ this.$api.schoolUser.setTeacherInfo(params).then(
|
|
|
+ res => {
|
|
|
+ this.$Message.success(this.$t('teachermgmt.setOk'))
|
|
|
+ this.setSubjStatus = false
|
|
|
+ //更新UI
|
|
|
+ teacherIds.forEach(tid => {
|
|
|
+ let index = this.data.findIndex(item => item.id == tid)
|
|
|
+ if (index > -1) {
|
|
|
+ this.$set(this.data[index], 'subjectIds', this.setSubj.map(item => item[1]))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ this.$Message.error(this.$t('teachermgmt.setErr'))
|
|
|
+ }
|
|
|
+ )
|
|
|
+ } else {
|
|
|
+ this.$Message.warning(this.$t('teachermgmt.sltSubjTips'))
|
|
|
+ this.modalLoading = false
|
|
|
+ setTimeout(() => {
|
|
|
+ this.modalLoading = true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //显示设置教师学科
|
|
|
+ showSetSubj(index) {
|
|
|
+ this.setSubjIndex = index
|
|
|
+ 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
|
|
|
+ },
|
|
|
//确认转让
|
|
|
confirmTransfer() {
|
|
|
if (!this.toAdminId) {
|