build / build (push) Successful in 1m31s
在 c93313c 之上增量落地原型与前端规范,保留既有流程图入口/失败提示/指派预览/线级停发:
- 审批/抄送抽屉按原型重构(422→1026 / 239→742 行):科室树+成员多选、SYSTEM/CUSTOM 分支、
CUSTOM 分类导航自动定位、跨节点导航重置、保存后重开回显
- 新增授权管理页 /admin/usage-grants(UsageGrants.vue,417 行):校域清单、按流程线筛选、
授予/撤销后回读,失败不宣称成功
- 路由与 API:新增 usage-grant(schoolList/summary/grant/revoke)、department(groups/options/resolve/members)、
instance/resubmit;TaskHandle 增加「退回待修改」入口(仅 status=50 显示)
- 错误处理沿用 flowError 统一出口,不透出后端原文
- 组件/契约测试:flow-error、flow2-contract、department-roundtrip、task-result
不含构建产物(dist-verify)与依赖目录
45 lines
1.5 KiB
TypeScript
45 lines
1.5 KiB
TypeScript
// @/utils/alova-iview.ts
|
||
import { createBschAlova } from "./alova-core";
|
||
import { Message } from "view-ui-plus";
|
||
import conf from "@/assets/config/host.config";
|
||
import { describeFlowError } from "@/utils/flowError";
|
||
|
||
/* 全局 loading 遮罩实例 */
|
||
let spinInstance: any = null;
|
||
|
||
/* 主动关闭 loading */
|
||
function closeLoading() {
|
||
if (spinInstance) {
|
||
Message.destroy();
|
||
spinInstance = null;
|
||
}
|
||
}
|
||
|
||
const baseUrl = conf.serviceHost;
|
||
|
||
/* 创建带 View Design UI 的 Alova 实例 */
|
||
export const alovaInstance = createBschAlova(baseUrl, {
|
||
injectHeaders(method) {
|
||
// currentRole: encodeURI(JSON.stringify({ userId, roleId, schId: schoolId })),
|
||
if (localStorage.getItem("currentRole") != null) {
|
||
method.config.headers["currentRole"] = localStorage.getItem("currentRole") as string;
|
||
}
|
||
},
|
||
|
||
/* 2. 加载动画 – View Design Spin */
|
||
onLoadingStart() {
|
||
spinInstance = Message.loading("加载中...");
|
||
},
|
||
onLoadingEnd: closeLoading,
|
||
/* 全局兜底提示(F05):只有带 bizCode 的业务信封原文才回显,
|
||
HTTP 状态文本/异常形态/无凭据文本一律换成不误导的通用话术(堆栈/SQL/令牌不进页面) */
|
||
onBizError(msg: string, err?: unknown) {
|
||
const text = describeFlowError(err ?? msg);
|
||
if (!!text) Message.error(text);
|
||
},
|
||
|
||
onHttpError(msg: string, err?: unknown) {
|
||
Message.error({ title: "请求未完成", content: describeFlowError(err ?? msg) });
|
||
},
|
||
});
|