import request from '@/utils/request'

export function getOverviewDashboard(projectId) {
  return request({
    url: '/ccdi/project/overview/dashboard',
    method: 'get',
    params: { projectId }
  })
}

export function excludeOverviewRisk(data) {
  return request({
    url: '/ccdi/project/overview/risk-exclusions',
    method: 'post',
    data
  })
}

export function getOverviewRiskPeople(params) {
  return request({
    url: '/ccdi/project/overview/risk-people',
    method: 'get',
    params: {
      projectId: params.projectId,
      pageNum: params.pageNum,
      pageSize: params.pageSize
    }
  })
}

export function getOverviewExternalPersons(params) {
  return request({
    url: '/ccdi/project/overview/external-persons',
    method: 'get',
    params: {
      projectId: params.projectId,
      pageNum: params.pageNum,
      pageSize: params.pageSize
    }
  })
}

export function getOverviewExternalRiskSummary(projectId) {
  return request({
    url: '/ccdi/project/overview/external-persons/summary',
    method: 'get',
    params: { projectId }
  })
}

export function getOverviewRiskModelCards(projectId) {
  return request({
    url: '/ccdi/project/overview/risk-models/cards',
    method: 'get',
    params: { projectId }
  })
}

export function getOverviewExternalRiskModelCards(projectId) {
  return request({
    url: '/ccdi/project/overview/external-risk-models/cards',
    method: 'get',
    params: { projectId }
  })
}

export function getOverviewRiskModelPeople(params) {
  return request({
    url: '/ccdi/project/overview/risk-models/people',
    method: 'get',
    params: {
      projectId: params.projectId,
      modelCodes: params.modelCodes,
      matchMode: params.matchMode,
      keyword: params.keyword,
      deptId: params.deptId,
      pageNum: params.pageNum,
      pageSize: params.pageSize
    }
  })
}

export function getOverviewExternalRiskModelPeople(params) {
  return request({
    url: '/ccdi/project/overview/external-risk-models/people',
    method: 'get',
    params: {
      projectId: params.projectId,
      modelCodes: params.modelCodes,
      matchMode: params.matchMode,
      keyword: params.keyword,
      pageNum: params.pageNum,
      pageSize: params.pageSize
    }
  })
}

export function getOverviewPersonAnalysisDetail(params) {
  return request({
    url: '/ccdi/project/overview/person-analysis/detail',
    method: 'get',
    params: {
      projectId: params.projectId,
      staffIdCard: params.staffIdCard
    }
  })
}

export function getOverviewSuspiciousTransactions(params) {
  return request({
    url: '/ccdi/project/overview/suspicious-transactions',
    method: 'get',
    params: {
      projectId: params.projectId,
      modelCode: params.modelCode,
      suspiciousType: params.suspiciousType,
      pageNum: params.pageNum,
      pageSize: params.pageSize
    }
  })
}

export function getOverviewEmployeeCreditNegative(params) {
  return request({
    url: '/ccdi/project/overview/employee-credit-negative',
    method: 'get',
    params: {
      projectId: params.projectId,
      pageNum: params.pageNum,
      pageSize: params.pageSize
    }
  })
}

export function getOverviewAbnormalAccountPeople(params) {
  return request({
    url: '/ccdi/project/overview/abnormal-account-people',
    method: 'get',
    params: {
      projectId: params.projectId,
      pageNum: params.pageNum,
      pageSize: params.pageSize
    }
  })
}

export function getOverviewUnsubmittedAccounts(projectId) {
  return request({
    url: '/ccdi/project/overview/unsubmitted-accounts',
    method: 'get',
    params: { projectId }
  })
}

export function getOverviewUnsubmittedAccountFlows(params) {
  return request({
    url: '/ccdi/project/overview/unsubmitted-accounts/flows',
    method: 'get',
    params: {
      projectId: params.projectId,
      subjectName: params.subjectName,
      accountNo: params.accountNo
    }
  })
}

export function exportOverviewReport(projectId) {
  return request({
    url: '/ccdi/project/overview/report/export',
    method: 'post',
    responseType: 'blob',
    params: { projectId }
  })
}
