| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- import service from '/@/utils/request';
- function unwrap<T>(res: { data: T }): T {
- return res.data;
- }
- function silentHeaders(silent?: boolean) {
- return silent ? { 'X-Silent-Error': '1' } : undefined;
- }
- export interface S8Paged<T> {
- total: number;
- page: number;
- pageSize: number;
- list: T[];
- }
- export interface S8ExceptionRow {
- id: number;
- exceptionCode: string;
- title: string;
- status: string;
- statusLabel?: string | null;
- severity: string;
- severityLabel?: string | null;
- priorityScore: number;
- priorityLevel: string;
- sceneCode: string;
- sceneName?: string | null;
- moduleCode?: string | null;
- moduleName?: string | null;
- responsibleDeptId?: number | null;
- responsibleDeptName?: string | null;
- occurrenceDeptId?: number | null;
- occurrenceDeptName?: string | null;
- assigneeId?: number | null;
- slaDeadline?: string | null;
- timeoutFlag: boolean;
- createdAt: string;
- closedAt?: string | null;
- // S8-DEMO-CORE-FIELD-COMPLETE-1:损失时间(小时,1 位小数)与"是否超时关闭"冻结判定。
- lossHours?: number | null;
- isOverdueClosed?: boolean | null;
- activeFlowInstanceId?: number | null;
- activeFlowBizType?: string | null;
- verifierId?: number | null;
- verifierName?: string | null;
- verificationAssignedAt?: string | null;
- verifiedAt?: string | null;
- verificationResult?: string | null;
- verificationRemark?: string | null;
- exceptionTypeCode?: string | null;
- recoveredAt?: string | null;
- sourceRuleCode?: string | null;
- sourceObjectType?: string | null;
- sourceObjectId?: string | null;
- dedupKey?: string | null;
- lastDetectedAt?: string | null;
- ruleType?: string | null;
- // ORDER-FLOW-S8-INTEGRATED-DOMAIN-RESET-1 t3j:异常列表/详情携带订单链路字段。
- relatedObjectCode?: string | null;
- orderFlowCode?: string | null;
- orderFlowName?: string | null;
- stageCode?: string | null;
- ruleMechanism?: string | null;
- // S8-DEMO-IMPACT-SORT-NOTICE-1:30 天影响统计(运行期计算,不落库)。
- repeatCount30d?: number | null;
- cumulativeLossHours30d?: number | null;
- impactScore?: number | null;
- suggestedAttentionLevel?: string | null;
- suggestedAttentionLabel?: string | null;
- impactReason?: string | null;
- }
- export interface S8DecisionRow {
- id: number;
- decisionType: string;
- decisionMakerName: string;
- decisionBasis?: string | null;
- decisionResult?: string | null;
- decisionRemark?: string | null;
- decisionTime: string;
- }
- export interface S8EvidenceRow {
- id: number;
- evidenceType: string;
- fileName: string;
- fileUrl: string;
- sourceSystem?: string | null;
- uploadedBy?: number | null;
- uploadedAt: string;
- }
- export const s8ExceptionApi = {
- list: (params: Record<string, unknown>) =>
- service.get<S8Paged<S8ExceptionRow>>('/api/aidop/s8/exceptions', { params }).then(unwrap),
- filterOptions: (params?: { tenantId?: number; factoryId?: number }) =>
- service.get('/api/aidop/s8/exceptions/filter-options', { params }).then(unwrap),
- detail: (id: number, params?: { tenantId?: number; factoryId?: number }, options?: { silentError?: boolean }) =>
- service.get(`/api/aidop/s8/exceptions/${id}`, { params, headers: silentHeaders(options?.silentError) }).then(unwrap),
- timeline: (id: number, options?: { silentError?: boolean }) =>
- service.get(`/api/aidop/s8/exceptions/${id}/timeline`, { headers: silentHeaders(options?.silentError) }).then(unwrap),
- decisions: (id: number, options?: { silentError?: boolean }) =>
- service.get(`/api/aidop/s8/exceptions/${id}/decisions`, { headers: silentHeaders(options?.silentError) }).then(unwrap),
- evidences: (id: number, options?: { silentError?: boolean }) =>
- service.get(`/api/aidop/s8/exceptions/${id}/evidences`, { headers: silentHeaders(options?.silentError) }).then(unwrap),
- employees: (params?: { factoryRefId?: number }) =>
- service.get('/api/aidop/s8/master-data/employees', { params }).then(unwrap),
- claim: (id: number, body: { assigneeId: number; remark?: string }) =>
- service.post(`/api/aidop/s8/exceptions/${id}/claim`, body).then(unwrap),
- transfer: (id: number, body: { assigneeId: number; remark?: string }) =>
- service.post(`/api/aidop/s8/exceptions/${id}/transfer`, body).then(unwrap),
- upgrade: (id: number, body?: { remark?: string }) =>
- service.post(`/api/aidop/s8/exceptions/${id}/upgrade`, body ?? {}).then(unwrap),
- reject: (id: number, body?: { remark?: string }) =>
- service.post(`/api/aidop/s8/exceptions/${id}/reject`, body ?? {}).then(unwrap),
- startProgress: (id: number, body?: { remark?: string }) =>
- service.post(`/api/aidop/s8/exceptions/${id}/start-progress`, body ?? {}).then(unwrap),
- comment: (id: number, body?: { remark?: string }) =>
- service.post(`/api/aidop/s8/exceptions/${id}/comment`, body ?? {}).then(unwrap),
- submitVerification: (id: number, body: { verifierId: number; remark?: string }) =>
- service.post(`/api/aidop/s8/exceptions/${id}/submit-verification`, body).then(unwrap),
- approveVerification: (id: number, body: { remark?: string }) =>
- service.post(`/api/aidop/s8/exceptions/${id}/approve-verification`, body).then(unwrap),
- rejectVerification: (id: number, body: { remark: string }) =>
- service.post(`/api/aidop/s8/exceptions/${id}/reject-verification`, body).then(unwrap),
- };
|