index.js
987 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import http from '../http.js'
const API_URL = 'task';
const api = {
// 任务管理接口
getAllTasks() {
return http.get(`${API_URL}/tasks`);
},
createTask(data) {
return http.post(`${API_URL}/tasks`, data);
},
updateTask(id, data) {
return http.post(`${API_URL}/tasks/${id}`, data);
},
deleteTask(id) {
return http.post(`${API_URL}/tasks/delete/${id}`);
},
executeTask(id) {
return http.post(`${API_URL}/tasks/execute/${id}`);
},
batchExecute(ids) {
return http.post(`${API_URL}/tasks/batch-execute`, { ids });
},
getExecuteTasks() {
return http.get(`${API_URL}/tasks/execute/list`);
},
// 执行历史接口
getExecutionHistory(taskId) {
return http.get(`${API_URL}/api/task-execution-history/${taskId}`);
},
saveExecutionHistory(data) {
return http.post(`${API_URL}/api/task-execution-history`, data);
}
};
export default api;