// 事项api
import local from "@/utils/local";
import request from "@/utils/request";
// 首页数据展示
export const getHomeInfo = (data) => {
  let baseUrl = local.getLocal("serverUrl");
  let siteId = local.getLocal("siteId");
  return request({
    url: `${baseUrl}sampleform/home/info`,
    method: "post",
    data: {
      siteId,
      ...data,
    },
  });
};

// 获取部门列表
export const getdeptList = (data) => {
  let baseUrl = local.getLocal("serverUrl");
  let siteId = local.getLocal("siteId");
  return request({
    url: `${baseUrl}sampleform/home/depts`,
    method: "post",
    data: {
      siteId,
      ...data,
    },
  });
};

// 查询事项列表
export const getWriteMatterList = (data) => {
  let baseUrl = local.getLocal("serverUrl");
  let siteId = local.getLocal("siteId");
  return request({
    url: `${baseUrl}sampleform/matter/list`,
    method: "post",
    data: {
      siteId,
      ...data,
    },
  });
};

//   查询材料列表
export const getMaterialsList = (data) => {
  let baseUrl = local.getLocal("serverUrl");
  let siteId = local.getLocal("siteId");
  return request({
    url: `${baseUrl}sampleform/matter/datum/list`,
    method: "post",
    data: {
      siteId,
      ...data,
    },
  });
};

// 表单合成
export const mergeFormToDocx = (data) => {
  let baseUrl = local.getLocal("serverUrl");
  let siteId = local.getLocal("siteId");
  return request({
    url: `${baseUrl}sampleform/home/mergeFormToDocx`,
    method: "post",
    data: {
      siteId,
      ...data,
    },
  });
};
