import axios from '@/common/services/axios-instance'

class AuditPorjectUserService {
  // 获取项目成员变更信息记录
  getUserChangeLogInfo(id) {
    return axios({
      url: `api/xcoa-mobile/v1/iamprojectuser/getProjectUserChangeInfo?projectId=` + id,
    })
  }

  // 获取项目成员信息
  getProjectUserInfo(id) {
    return axios({
      url: `api/xcoa-mobile/v1/iamprojectuser/getProjectUserInfo?projectId=` + id,
    })
  }

  // 操作前数据权限校验
  checkOperatorAuthority(id) {
    return axios({
      url: `api/xcoa-mobile/v1/iamprojectuser/checkOperatorAuthority?projectId=` + id,
    })
  }

  // 获取数据字典配置
  getDictionary(id) {
    return axios({
      url: `api/xcoa-mobile/v1/iam-law/dictionary?key=${id}`,
      method: 'get',
    })
  }

  // 判断用户是否是项目负责人、项目组长/项目副组长
  isProjectLeader(id, flag) {
    return axios({
      url: `api/xcoa-mobile/v1/iamprojectuser/isProjectLeader/${id}/${flag}`,
      method: 'post',
    })
  }
}

export default new AuditPorjectUserService()
