getters.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. isSuper: (state) => state.ibps.user.info && state.ibps.user.info.user ? state.ibps.user.info.user.isSuper === 'Y' : false, // 是否超级管理员
  10. account: (state) => state.ibps.user.info && state.ibps.user.info.user ? state.ibps.user.info.user.account : '', // 用户名
  11. regOpen: (state) => state.ibps.user.regOpen, // 注册状态
  12. userInfo: (state) => state.ibps.user.info, // 用户信息
  13. // =========== 租户
  14. tenant: (state) => state.ibps.user.info && state.ibps.user.info.mainTenant ? state.ibps.user.info.mainTenant || {} : {}, // 当前租户
  15. tenants: (state) => state.ibps.user.info && state.ibps.user.info.tenants ? state.ibps.user.info.tenants || [] : [], // 当前拥有的租户
  16. tenantid: (state) => state.ibps.user.info && state.ibps.user.info.tenantId ? state.ibps.user.info.tenantId || '' : '', // 租户id
  17. isTenantAdmin: (state) => state.ibps.user.info && state.ibps.user.info.isTenantAdmin ? state.ibps.user.info.isTenantAdmin || false : false, // 是否租户管理员
  18. single: (state) => state.ibps.api.single, // 单体应用
  19. baseApi: (state) => state.ibps.api.base, // baseAPI地址
  20. websocket: (state) => state.ibps.api.websocket, // websocket地址
  21. isTenantOpen: (state) => state.ibps.sass ? state.ibps.sass.tenantOpen : false, // 是否租户模式
  22. designTenantid: (state) => state.ibps.user && state.ibps.user.designTenantid ? state.ibps.user.designTenantid || '' : '',
  23. // =========== 菜单
  24. menus: (state) => state.ibps.menu.menus, // 菜单
  25. routers: (state) => state.ibps.menu.routers, // 新增的路由表
  26. // =========== 子系统
  27. system: (state) => state.ibps.system.system, // 子系统
  28. systemid: (state) => state.ibps.system.system ? state.ibps.system.system.id : '', // 子系统id
  29. permissions: (state) => state.ibps.menu.permissions, // 拥有的权限
  30. jianCeDuiXiangId: (state) => state.ibps.jianCeDuiXiangId ? state.ibps.jianCeDuiXiangId : '',
  31. myform: (state) => (state.ibps.myform ? state.ibps.myform : ''),
  32. jianCeCanShuId: (state) => state.ibps.jianCeCanShuId ? state.ibps.jianCeCanShuId : '',
  33. // 所有检测项目名称及流程key数组
  34. testingList: (state) => state.ibps.param && state.ibps.param.testingList ? state.ibps.param.testingList : [],
  35. // 获取所有用户信息
  36. userList: (state) => state.ibps.param && state.ibps.param.userList ? state.ibps.param.userList : [],
  37. // 获取用户最高层级
  38. level: (state) => state.ibps.param && state.ibps.param.level ? state.ibps.param.level : [],
  39. // 获取所有部门信息
  40. deptList: (state) => state.ibps.param && state.ibps.param.deptList ? state.ibps.param.deptList : [],
  41. // 获取所有岗位信息
  42. positionList: (state) => state.ibps.param && state.ibps.param.positionList ? state.ibps.param.positionList : [],
  43. // 获取认证信息
  44. licence: state => state.ibps.licence ? state.ibps.licence.licJson : {}
  45. }