You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.5 KiB
68 lines
2.5 KiB
// noinspection SpellCheckingInspection
|
|
|
|
import http from 'utils/axios';
|
|
|
|
const apiUrl = import.meta.env.VITE_API_URL;
|
|
const users = `${apiUrl}/gateway/tall3/v3.0/users`;
|
|
const tall = `${apiUrl}/gateway/tall3/v3.0`;
|
|
const experiment = `${apiUrl}/gateway/experiment`;
|
|
const filedeal = `${apiUrl}/filedeal`;
|
|
|
|
// 根据userId 获取token
|
|
// eslint-disable-next-line import/prefer-default-export
|
|
export const getToken = userId => http.get(`${users}/userId`, { params: { userId } });
|
|
|
|
// 登录api
|
|
export const signIn = params => http.post(`${users}/signin`, params);
|
|
|
|
// 获取项目列表
|
|
export const getProjects = (startTime, endTime) => http.post(`${tall}/project/query`, { param: { startTime, endTime } });
|
|
|
|
// 根据id获取项目信息
|
|
export const findProjectById = projectId => http.post(`${experiment}/project/findProjectById`, { param: { projectId } });
|
|
|
|
// 删除项目
|
|
export const delProject = projectId => http.post(`${tall}/project/deleteProject`, { param: { projectId } });
|
|
|
|
// 根据项目id查找角色
|
|
export const findShowRole = projectId => http.post(`${experiment}/role/show`, { param: { projectId } });
|
|
|
|
// 根据项目id查找所有成员
|
|
export const queryChecker = param => http.post(`${tall}/deliver/queryChecker`, param);
|
|
|
|
// 查找带时间的日常任务
|
|
export const getGlobal = params => http.post(`${experiment}/task/global`, params);
|
|
|
|
// 查找永久日常任务
|
|
export const getPermanent = params => http.post(`${experiment}/task/permanent`, params);
|
|
|
|
// 查找定期任务
|
|
export const getRegularTask = params => http.post(`${experiment}/task/regular`, params);
|
|
|
|
// 添加任务
|
|
export const saveTask = params => http.post(`${experiment}/task/save`, params);
|
|
|
|
// 查询子任务
|
|
export const findSonTask = params => http.post(`${experiment}/task/findSonTask`, params);
|
|
|
|
/**
|
|
* 导入wbs
|
|
* @param {object} e
|
|
*/
|
|
export const importWbs = async e => {
|
|
console.log('importWbs', e);
|
|
const file = e.target.files[0];
|
|
const param = new FormData();
|
|
param.append('file', file);
|
|
const config = { headers: { 'Content-Type': 'multipart/form-data' } };
|
|
// const result = await axios.post(`${projects}/wbs`, param, config);
|
|
console.log('importWbs11111', file, param);
|
|
const result = await http.post(`${experiment}/wbs`, param, config);
|
|
return result;
|
|
};
|
|
|
|
// 新建课题 -- 根据模板新建课题
|
|
export const create = param => http.post(`${experiment}/experiment/create`, { params: { param } });
|
|
|
|
// 上传文件
|
|
export const uploadImg = `${filedeal}/file/upload/multiple`;
|
|
|