import { download, post } from '@/api/request';

const env = import.meta.env;
const PREFIX = env.VITE_API_PREFIX_PROJECT;

export const createProjectApi = (params: any) => {
  return post(`${PREFIX}project/add`, params);
};

export const queryProjectListApi = (params: any) => {
  return post(`${PREFIX}project/list`, params);
};

export const exportTaskTreeApi = (params: any, filename: string) => {
  return download(`${PREFIX}project/exportTaskTree`, params, filename);
};

export const queryProjectInfoListApi = (params: any) => {
  return post(`${PREFIX}node/queryProjectInfoList`, params);
};

/**
 * 查询项目树列表
 * @param params projectNodeId 项目uuid phaseNodeId节点uuid tagMap
 * @returns
 */
export const getTaskTreeListApi = (params: any) => {
  return post(`${PREFIX}project/getTaskTreeList`, params);
};
