refactor(frontend): services/api 迁至 src/api,http 迁至 utils/request
对齐 Vue 后台惯例: - src/api/ 域 API(原 services/api) - src/utils/request.ts HTTP 封装(原 services/http.ts) - src/utils/export.ts 客户端导出工具 - src/utils/index.ts 工具统一出口 全局导入改为 @/api 与 @/utils/request,tsc + build 通过。
This commit is contained in:
1 parent
9bf35b369c
commit
d19a03d427
145 files changed
+156
-142
No files matched your search
@@ -0,0 +1,28 @@
|
||||
// 审批流程 API // Logan.Li
|
||||
|
||||
import { http } from '@/utils/request';
|
||||
|
||||
export const approvalWorkflowApi = {
|
||||
list: async (params?: { category?: string }) => http.get('/approval-workflows', params),
|
||||
get: async (id: number | string) => http.get(`/approval-workflows/${id}`),
|
||||
create: async (data: Record<string, unknown>) => http.post('/approval-workflows', data),
|
||||
update: async (id: number | string, data: Record<string, unknown>) => http.put(`/approval-workflows/${id}`, data),
|
||||
delete: async (id: number | string) => http.delete(`/approval-workflows/${id}`),
|
||||
setDefault: async (id: number | string) => http.put(`/approval-workflows/${id}/default`),
|
||||
getSteps: async (id: number | string) => http.get(`/approval-workflows/${id}/steps`),
|
||||
};
|
||||
|
||||
export const approvalApi = {
|
||||
getTemplates: async (params?: { type?: string; category?: string }) => http.get('/approvals/templates', params),
|
||||
getTemplate: async (id: number | string) => http.get(`/approvals/templates/${id}`),
|
||||
createTemplate: async (data: Record<string, unknown>) => http.post('/approvals/templates', data),
|
||||
updateTemplate: async (id: number | string, data: Record<string, unknown>) => http.put(`/approvals/templates/${id}`, data),
|
||||
deleteTemplate: async (id: number | string) => http.delete(`/approvals/templates/${id}`),
|
||||
getProcesses: async (params?: { page?: number; page_size?: number; status?: string; category?: string }) =>
|
||||
http.get('/approvals/processes', params),
|
||||
createProcess: async (data: Record<string, unknown>) => http.post('/approvals/processes', data),
|
||||
approveProcess: async (id: number | string, comment?: string) =>
|
||||
http.post(`/approvals/processes/${id}/approve`, { comment }),
|
||||
rejectProcess: async (id: number | string, comment?: string) =>
|
||||
http.post(`/approvals/processes/${id}/reject`, { comment }),
|
||||
};
|
||||
Reference in new issue
Block a user