/*问卷接口*/
import request from '@/utils/request'

// 新增
export function add(data) {
  return request({
    url: '/liandao/questionnaire/config/add',
    method: 'post',
    data: data
  })
}

// 修改
export function edit(data) {
  return request({
    url: '/liandao/questionnaire/config/edit',
    method: 'post',
    data: data
  })
}


// 根据id删除
export function remove(id) {
  return request({
    url: '/liandao/questionnaire/config/delete',
    method: 'post',
    data: {id: id}
  })
}

//根据id查询详情
export function detail(id) {
  return request({
    url: '/liandao/questionnaire/config/detail',
    method: 'get',
    params: {id: id}
  })
}

//分页查询
export function page(params) {
  return request({
    url: '/liandao/questionnaire/config/page',
    method: 'get',
    params: params
  })
}

//获取问卷
export function getQuestionnaire() {
  return request({
    url: '/liandao/questionnaire/result/getQuestionnaire',
    method: 'get',
  })
}

//提交问卷
export function submitQuestionnaire(data) {
  return request({
    url: '/liandao/questionnaire/result/submitQuestionnaire',
    method: 'post',
    data: data
  })
}


//分页查询
export function resultPage(params) {
  return request({
    url: '/liandao/questionnaire/result/page',
    method: 'get',
    params: params
  })
}

//获取问卷提交结果
export function getResult(id) {
  return request({
    url: '/liandao/questionnaire/result/getResult',
    method: 'get',
    params: {id:id}
  })
}
