import request from "@/utils/request";

// 查询周报列表
export function listWeekly(query) {
  return request({
    url: "/offcial/weekly/list",
    method: "get",
    params: query,
  });
}

// 查询周报详细
export function getWeekly(id) {
  return request({
    url: "/offcial/weekly/" + id,
    method: "get",
  });
}

// 新增周报
export function addWeekly(data) {
  return request({
    url: "/offcial/weekly",
    method: "post",
    data: data,
  });
}

// 修改周报
export function updateWeekly(data) {
  return request({
    url: "/offcial/weekly",
    method: "put",
    data: data,
  });
}

// 删除周报
export function delWeekly(id) {
  return request({
    url: "/offcial/weekly/" + id,
    method: "delete",
  });
}
// 获取自己的督办列表
export function myselfDb(query) {
  return request({
    url: "/offcial/supervision/sel/myselfDb",
    method: "get",
    params: query,
  });
}
// 预览汇总
export function leaderViewWeekReport(query) {
  return request({
    url: "/offcial/weekly/leaderViewWeekReport",
    method: "get",
    params: query,
  });
  // let f = new FormData();
  // Object.keys(data).forEach((key) => {
  //   f.append(key, data[key]);
  // });
  // return request({
  //   url: "/offcial/weekly/leaderViewWeekReport",
  //   method: "get",
  //   data: f,
  // });
}
