export default {
  // 用户相关
  userId: state =>
    state.ibps.user.info && state.ibps.user.info.user
      ? state.ibps.user.info.user.id
      : "", // 用户ID
  userName: state =>
    state.ibps.user.info && state.ibps.user.info.employee
      ? state.ibps.user.info.employee.name
      : "", // 姓名
  status: state =>
    state.ibps.user.info && state.ibps.user.info.employee
      ? state.ibps.user.info.employee.status
      : "", // 用户状态
  isSuper: state =>
    state.ibps.user.info && state.ibps.user.info.user
      ? state.ibps.user.info.user.isSuper === "Y"
      : false, // 是否超级管理员
  account: state =>
    state.ibps.user.info && state.ibps.user.info.user
      ? state.ibps.user.info.user.account
      : "", // 用户名

  regOpen: state => state.ibps.user.regOpen, // 注册状态

  userInfo: state => state.ibps.user.info, // 用户信息

  hasDataChange: state => state.ibps.app.hasDataChange, // 是否有数据修改

  // ============ 表单
  form: state => state.ibps.form,

  single: state => state.ibps.api.single, // 单体应用
  baseApi: state => state.ibps.api.base, // baseAPI地址
  websocket: state => state.ibps.api.websocket, // websocket地址

  // 获取所有用户信息
  userList: state =>
    state.ibps.param && state.ibps.param.userList
      ? state.ibps.param.userList
      : [],
  // 获取所有部门信息
  deptList: state =>
    state.ibps.param && state.ibps.param.deptList
      ? state.ibps.param.deptList
      : [],
  // 获取用户最高层级
  level: state =>
    state.ibps.param && state.ibps.param.level ? state.ibps.param.level : []
};
