import request from '@/utils/request';

export async function doEdit(data) {
  return request({
    url: '/webInfo/saveOrUpdate',
    method: 'post',
    data,
  });
}

export async function doAdd(data) {
  return request({
    url: 'webInfo/saveOrUpdate',
    method: 'post',
    data,
  });
}

export async function getData(data) {
  return request({
    url: '/webInfo/select',
    method: 'get',
    data,
  });
}

// 基础信息
export async function baseInfo(data) {
  let param = '';
  if (data.month) {
    param = '?month=' + data.month;
  }
  return request({
    url: '/systemAnalysis/baseInfo' + param,
    method: 'get',
    data,
  });
}
// 用户分析
export async function user(data) {
  let param = '';
  if (data.month) {
    param = '?month=' + data.month;
  }
  return request({
    url: '/systemAnalysis/user' + param,
    method: 'get',
    data,
  });
}

// 基础信息
export async function dept(data) {
  let param = '';
  if (data.month) {
    param = '?month=' + data.month;
  }
  return request({
    url: '/systemAnalysis/dept' + param,
    method: 'get',
    data,
  });
}

// 模块分析
export async function module(data) {
  let param = '';
  if (data.month) {
    param = '?month=' + data.month;
  }
  return request({
    url: '/systemAnalysis/module' + param,
    method: 'get',
    data,
  });
}

// 详情分析
export async function details(data) {
  let param = '';
  if (data.month) {
    param = '?month=' + data.month;
  }
  return request({
    url: '/systemAnalysis/details' + param,
    method: 'get',
    data,
  });
}
