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