This commit is contained in:
+21
-22
@@ -1,8 +1,8 @@
|
||||
import { Method } from "alova";
|
||||
import { alovaInstance } from "@/utils/alova/alova-iview";
|
||||
import type {
|
||||
ApplySubmitRequest,
|
||||
ApplyVo,
|
||||
FlowProgressVo,
|
||||
FlowSummary,
|
||||
PageResult,
|
||||
SiteOption,
|
||||
@@ -18,12 +18,14 @@ import type {
|
||||
} from "@/types/svc";
|
||||
|
||||
/**
|
||||
* 办事大厅接口封装(V2.0 Part B 契约)。
|
||||
* siteCode 为一切管理面/用户面定位键;conf.serviceHost 本地为空(走 vite 代理)。
|
||||
* 办事大厅后台管理端接口封装(V2.0 Part B 契约;用户面接口在独立前端 svc-hall-public)。
|
||||
* siteCode 为一切管理面定位键;conf.serviceHost 本地为空(走 vite 代理)。
|
||||
* 纪律:本文件不得出现 flow-center 地址——流程能力(列表/流程图)一律经本应用后端中转。
|
||||
*/
|
||||
|
||||
const SVC = "/api/svc";
|
||||
const APPLY = "/api/apply";
|
||||
|
||||
const FILE = "/api/file";
|
||||
|
||||
/** GET 请求 */
|
||||
@@ -137,32 +139,29 @@ class SvcFlowApi {
|
||||
list(siteCode: string) {
|
||||
return get<FlowSummary[]>(`${SVC}/flow/list`, { siteCode });
|
||||
}
|
||||
/** 流程图地址(同源 <img src>/window.open;后端换免签 token 取图,前端不碰 flow-center 地址) */
|
||||
diagramUrl(siteCode: string, flowGuid: string, mode = "dept") {
|
||||
return `${SVC}/flow/diagram.png?siteCode=${encodeURIComponent(siteCode)}`
|
||||
+ `&flowGuid=${encodeURIComponent(flowGuid)}&mode=${encodeURIComponent(mode)}`;
|
||||
}
|
||||
}
|
||||
|
||||
class ApplyApi {
|
||||
/** 发起(用户面) */
|
||||
submit(data: ApplySubmitRequest) {
|
||||
return postJSON<ApplyVo>(`${APPLY}`, data);
|
||||
}
|
||||
retry(id: number) {
|
||||
return postForm<ApplyVo>(`${APPLY}/${id}/retry`);
|
||||
}
|
||||
/** 一键重提(仅驳回/撤回态;同 bizId,flow-center R4 重启推进) */
|
||||
resubmit(id: number) {
|
||||
return postForm<ApplyVo>(`${APPLY}/${id}/resubmit`);
|
||||
}
|
||||
my(params?: Record<string, any>) {
|
||||
return get<PageResult<ApplyVo>>(`${APPLY}/my`, params);
|
||||
}
|
||||
/** 发起页数据(事项要点+表单 schema) */
|
||||
item(siteCode: string, itemCode: string) {
|
||||
return get<Record<string, any>>(`${APPLY}/item`, { siteCode, itemCode });
|
||||
/** 办件记录分页(管理面;用户面办件在独立前端 svc-hall-public) */
|
||||
adminPage(params: Record<string, any>) {
|
||||
return get<PageResult<ApplyVo>>(`${SVC}/apply/page`, params);
|
||||
}
|
||||
/** 办件详情(只读;与用户面同接口,管理员在守卫白名单内) */
|
||||
detail(id: number) {
|
||||
return get<ApplyVo>(`${APPLY}/${id}`);
|
||||
}
|
||||
adminPage(params: Record<string, any>) {
|
||||
return get<PageResult<ApplyVo>>(`${SVC}/apply/page`, params);
|
||||
/** 审批轨迹(只读;同上口径) */
|
||||
progress(id: number) {
|
||||
return get<FlowProgressVo>(`${APPLY}/${id}/progress`);
|
||||
}
|
||||
/** 流程图地址(同源图片;后端换免签 token 取图) */
|
||||
diagramUrl(id: number, mode = "dept") {
|
||||
return `${APPLY}/${id}/diagram.png?mode=${encodeURIComponent(mode)}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user