|
@@ -195,7 +195,7 @@
|
|
|
filterable
|
|
|
collapse-tags
|
|
|
multiple>
|
|
|
- <el-option v-for="item in roleList"
|
|
|
+ <el-option v-for="item in roleResetList"
|
|
|
:key="item.value"
|
|
|
:label="item.label"
|
|
|
:value="item.value"></el-option>
|
|
@@ -407,6 +407,7 @@
|
|
|
import pagination from '@/components/Pagination/index'
|
|
|
import { permission } from "@/utils/directivePage";
|
|
|
import { queryEmployByOrganId, employeeOperate, getUserRole, employeeAdd, employeeUpdate, hasCourseGroupRelation, updateEducationTeacherId, queryEmployeeOrganByUser, getDepts, getPosts } from '@/api/systemManage'
|
|
|
+import { userRole } from './api'
|
|
|
import { findEducationTeacher } from '@/api/specialSetting'
|
|
|
import deepClone from '@/helpers/deep-clone'
|
|
|
import { findEducationUsers } from '@/api/buildTeam'
|
|
@@ -451,7 +452,9 @@ export default {
|
|
|
handoverVisible: false,
|
|
|
roleStatus: false,
|
|
|
formActionTitle: 'create',
|
|
|
- roleList: [], // 角色列表
|
|
|
+ roleList: [], // 角色列表,
|
|
|
+ roleBaseList:[], // 登陆人角色
|
|
|
+ roleResetList:[],
|
|
|
formTitle: {
|
|
|
create: '添加员工',
|
|
|
update: '修改员工'
|
|
@@ -499,6 +502,7 @@ export default {
|
|
|
mounted () {
|
|
|
this.getList()
|
|
|
this.getRoleList()
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
permission,
|
|
@@ -611,7 +615,7 @@ export default {
|
|
|
}
|
|
|
return temp
|
|
|
},
|
|
|
- getRoleList () { // 获取角色
|
|
|
+ async getRoleList () { // 获取角色
|
|
|
getUserRole({ delFlag: 0, rows: 9999 }).then(res => {
|
|
|
let result = res.data
|
|
|
if (res.code == 200 && result && result.rows.length > 0) {
|
|
@@ -625,6 +629,22 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
+ // 获取可编辑角色
|
|
|
+ try {
|
|
|
+ const res= await userRole()
|
|
|
+ this.rolerulesList = []
|
|
|
+ res.data.forEach(item => {
|
|
|
+ this.roleBaseList.push({
|
|
|
+ label: item.roleName,
|
|
|
+ value: item.id,
|
|
|
+ disabled: false,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ res.data
|
|
|
+ }catch(e){
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+
|
|
|
getDepts({ rows: 9999 }).then(res => {
|
|
|
if(res.code == 200 && res.data && res.data.length > 0) {
|
|
|
const depts = res.data || []
|
|
@@ -698,8 +718,24 @@ export default {
|
|
|
})
|
|
|
this.formActionTitle = type
|
|
|
this.roleStatus = true
|
|
|
+
|
|
|
+ // 格式化 可选角色
|
|
|
+
|
|
|
// 修改的时候
|
|
|
if (type == 'update') {
|
|
|
+ let roleIdList = [...data.roleIds]
|
|
|
+ this.roleBaseList.forEach(item=>{
|
|
|
+ if(roleIdList.indexOf(item.id) == -1){
|
|
|
+ roleIdList.push(item.id)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.roleResetList = []
|
|
|
+ this.roleList.forEach(role=>{
|
|
|
+ console.log(role)
|
|
|
+ if(roleIdList.indexOf(role.value) != -1){
|
|
|
+ this.roleResetList.push(role)
|
|
|
+ }
|
|
|
+ })
|
|
|
// 初始化数据
|
|
|
let postDeptArr = []
|
|
|
const postDept = data.postDeptIds ? JSON.parse(data.postDeptIds) : []
|
|
@@ -721,6 +757,7 @@ export default {
|
|
|
postId: null,
|
|
|
deptIds: []
|
|
|
}]
|
|
|
+
|
|
|
}
|
|
|
|
|
|
const deptIds = data.deptIds ? eval(data.deptIds) : []
|
|
@@ -746,6 +783,8 @@ export default {
|
|
|
postDeptIds: postDeptArr,
|
|
|
deptIds: tempDeptIds
|
|
|
}
|
|
|
+ }else{
|
|
|
+ this.roleResetList = [...this.roleBaseList]
|
|
|
}
|
|
|
},
|
|
|
formatParentId(id, list, ids = []) {
|