import request from "@/utils/request";

// 获取问卷列表
export const getQuestionnaireList = data => {
  return request({
    url: `/api/Questionnaire/Questionnaire/getList`,
    method: "POST",
    data
  });
};

// 新增保存问卷
export const addBaseQUestionnaire = data => {
  return request({
    url: `/api/BaseQuestionnaire/BaseQuestionnaire`,
    method: "POST",
    data
  });
};

// 删除问卷
export const deleteQuestionnaire = data => {
  return request({
    url: `/api/BaseQuestionnaire/BaseQuestionnaire/delete`,
    method: "POST",
    data
  });
};


// 下发问卷
export const IssuedQuestionnaire = data => {
  return request({
    url: `/api/BaseQuestionnaire/BaseQuestionnaire/push`,
    method: "POST",
    data
  });
};

// 获取问卷
export const getQuestionnaireDetail = id => {
  return request({
    url: `/api/BaseQuestionnaire/BaseQuestionnaire/detail/${id}`,
    method: "GET",
    data: null
  });
};


// 获取之前下发过的人员
export const getQuestionnaireUser = id => {
  return request({
    url: `/api/BaseQuestionnaire/BaseQuestionnaire/user?id=${id}`,
    method: "GET",
    data: null
  });
};


// 获取问卷统计
export const getQuestionnaireStats = (data) => {
  return request({
    url: `/api/BaseQuestionnaire/BaseQuestionnaire/stats`,
    method: "POST",
    data: data
  });
};

// 查询统计详情
export const getStatsDetail = (data) => {
  return request({
    url: `/api/BaseQuestionnaire/BaseQuestionnaire/stats/detail`,
    method: "POST",
    data: data
  });
};

