getters.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. export default {
  2. // =========== 用户相关
  3. userId: state => state.ibps.user.info && state.ibps.user.info.user ? state.ibps.user.info.user.id : '', // 用户ID
  4. name: state => state.ibps.user.info && state.ibps.user.info.employee ? state.ibps.user.info.employee.name : '', // 姓名
  5. status: state => state.ibps.user.info && state.ibps.user.info.employee ? state.ibps.user.info.employee.status : '', // 用户状态
  6. org: state => state.ibps.user.info ? state.ibps.user.info.org : {}, // 用户部门信息
  7. role: state => state.ibps.user.info ? state.ibps.user.info.role : [], // 用户角色信息
  8. position: state => state.ibps.user.info && state.ibps.user.info.employee ? state.ibps.user.info.employee.positions : '', // 用户部门信息
  9. mainPosition: state => state.ibps.user.info && state.ibps.user.info.employee ? state.ibps.user.info.mainPosition : {}, // 用户部门信息
  10. isSuper: state => state.ibps.user.info && state.ibps.user.info.user ? state.ibps.user.info.user.isSuper === 'Y' : false, // 是否超级管理员
  11. account: state => state.ibps.user.info && state.ibps.user.info.user ? state.ibps.user.info.user.account : '', // 用户名
  12. regOpen: state => state.ibps.user.regOpen, // 注册状态
  13. userInfo: state => state.ibps.user.info, // 用户信息
  14. // =========== 租户
  15. tenant: state => state.ibps.user.info && state.ibps.user.info.mainTenant ? state.ibps.user.info.mainTenant || {} : {}, // 当前租户
  16. tenants: state => state.ibps.user.info && state.ibps.user.info.tenants ? state.ibps.user.info.tenants || [] : [], // 当前拥有的租户
  17. tenantid: state => state.ibps.user.info && state.ibps.user.info.tenantId ? state.ibps.user.info.tenantId || '' : '', // 租户id
  18. isTenantAdmin: state => state.ibps.user.info && state.ibps.user.info.isTenantAdmin ? state.ibps.user.info.isTenantAdmin || false : false, // 是否租户管理员
  19. single: state => state.ibps.api.single, // 单体应用
  20. baseApi: state => state.ibps.api.base, // baseAPI地址
  21. websocket: state => state.ibps.api.websocket, // websocket地址
  22. isTenantOpen: state => state.ibps.sass ? state.ibps.sass.tenantOpen : false, // 是否租户模式
  23. designTenantid: state => state.ibps.user && state.ibps.user.designTenantid ? state.ibps.user.designTenantid || '' : '',
  24. // =========== 菜单
  25. menus: state => state.ibps.menu.menus, // 菜单
  26. routers: state => state.ibps.menu.routers, // 新增的路由表
  27. // =========== 子系统
  28. system: state => state.ibps.system.system, // 子系统
  29. systemid: state => state.ibps.system.system ? state.ibps.system.system.id : '', // 子系统id
  30. permissions: state => state.ibps.menu.permissions, // 拥有的权限
  31. myform: state => state.ibps.myform ? state.ibps.myform : '',
  32. // 获取所有用户信息
  33. userList: state => state.ibps.param && state.ibps.param.userList ? state.ibps.param.userList : [],
  34. // 获取所有部门信息
  35. deptList: state => state.ibps.param && state.ibps.param.deptList ? state.ibps.param.deptList : [],
  36. // 获取用户最高层级
  37. level: state => state.ibps.param && state.ibps.param.level ? state.ibps.param.level : [],
  38. // 获取认证信息
  39. licence: state => state.ibps.licence ? state.ibps.licence.licJson : {}
  40. }