修改问题、添加监管数据报送模块
这个提交包含在:
@@ -0,0 +1,43 @@
|
||||
import type { AxiosPromise } from '@/utils/api-types';
|
||||
import request from '@/utils/request';
|
||||
|
||||
export type ConfigKind = 'DEPARTMENT' | 'SYSTEM' | 'TOPIC';
|
||||
export interface Department { shortName: string; level: string; supervisor: string }
|
||||
export interface TargetSystem {
|
||||
endpoint: string; environment: 'DEVELOPMENT' | 'TEST' | 'PRODUCTION'; transport: 'HTTP_POST';
|
||||
authentication: 'NONE' | 'SECRET_REF'; timeoutSeconds: number; maxRetries: number;
|
||||
defaultVersion: string; fileNameRule: string; attachments: boolean; batchSupport: boolean; receiptQuery: boolean;
|
||||
}
|
||||
export interface Topic { responsibleDepartment: string; period: string }
|
||||
export interface ConfigCommand {
|
||||
version: number; kind: ConfigKind; code: string; name: string; parentId: string | null; description: string;
|
||||
enabled: boolean; department: Department | null; system: TargetSystem | null; topic: Topic | null;
|
||||
credentialReference: string | null;
|
||||
}
|
||||
export interface ConfigView extends Omit<ConfigCommand, 'credentialReference'> {
|
||||
id: string; parentName: string | null; credentialConfigured: boolean; organizationId: string; updatedAt: string;
|
||||
}
|
||||
export interface Page<T> { rows: T[]; total: number }
|
||||
export interface ConfigQuery { kind: ConfigKind; keyword?: string; parentId?: string; enabled?: boolean; pageNum: number; pageSize: number }
|
||||
export interface Overview { departments: number; systems: number; topics: number; enabledTopics: number }
|
||||
export interface Audit { id: string; action: string; actorId: string; version: number; reason: string | null; occurredAt: string }
|
||||
const base = '/api/integration/v1/regulatory-reporting';
|
||||
export const listConfigs = (params: ConfigQuery): AxiosPromise<Page<ConfigView>> => request({ url: `${base}/configs`, params });
|
||||
export const getConfig = (id: string): AxiosPromise<ConfigView> => request({ url: `${base}/configs/${id}` });
|
||||
export const saveConfig = (id: string, data: ConfigCommand): AxiosPromise<ConfigView> =>
|
||||
request({ url: `${base}/configs/${id}`, method: 'put', data, headers: { repeatSubmit: false } });
|
||||
export const getOverview = (): AxiosPromise<Overview> => request({ url: `${base}/overview` });
|
||||
export const getAudit = (id: string, pageNum: number, pageSize: number): AxiosPromise<Page<Audit>> =>
|
||||
request({ url: `${base}/configs/${id}/audit`, params: { pageNum, pageSize } });
|
||||
|
||||
export function emptyConfig(kind: ConfigKind): ConfigCommand {
|
||||
return { version: -1, kind, code: '', name: '', parentId: null, description: '', enabled: false, credentialReference: null,
|
||||
department: kind === 'DEPARTMENT' ? { shortName: '', level: '', supervisor: '' } : null,
|
||||
system: kind === 'SYSTEM' ? { endpoint: '', environment: 'TEST', transport: 'HTTP_POST', authentication: 'NONE', timeoutSeconds: 30,
|
||||
maxRetries: 0, defaultVersion: '', fileNameRule: '', attachments: false, batchSupport: false, receiptQuery: false } : null,
|
||||
topic: kind === 'TOPIC' ? { responsibleDepartment: '', period: 'ON_DEMAND' } : null };
|
||||
}
|
||||
export function editConfig(row: ConfigView): ConfigCommand {
|
||||
return structuredClone({ version: row.version, kind: row.kind, code: row.code, name: row.name, parentId: row.parentId,
|
||||
description: row.description, enabled: row.enabled, department: row.department, system: row.system, topic: row.topic, credentialReference: null });
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import type { AxiosPromise } from '@/utils/api-types';
|
||||
import request from '@/utils/request';
|
||||
import type { Page, Audit } from './index';
|
||||
export interface StandardField { name: string; label: string; type: string; required: boolean; maxLength: number | null; precision: number | null; scale: number | null }
|
||||
export interface StandardResource { code: string; name: string; fields: StandardField[]; templateId: string | null }
|
||||
export interface StandardDefinition { code: string; name: string; versionLabel: string; publisher: string; description: string; resources: StandardResource[] }
|
||||
export interface TemplateDifference { resourceCode: string; result: { missingFromTemplate: string[]; extraInTemplate: string[]; orderMismatch: boolean } | null; templateSha256: string | null }
|
||||
export interface StandardView { id: string; version: number; status: 'DRAFT' | 'PUBLISHED' | 'DISABLED'; definition: StandardDefinition; differences: TemplateDifference[]; differenceConfirmation: string | null; updatedAt: string }
|
||||
export interface TargetTemplate { id: string; sha256: string; recordElement: string; fields: string[] }
|
||||
const base = '/api/integration/v1/regulatory-reporting';
|
||||
export const listStandards = (params: { keyword: string; pageNum: number; pageSize: number }): AxiosPromise<Page<StandardView>> => request({ url: `${base}/standards`, params });
|
||||
export const getStandard = (id: string): AxiosPromise<StandardView> => request({ url: `${base}/standards/${id}` });
|
||||
export const getStandardAudit = (id: string, pageNum: number, pageSize: number): AxiosPromise<Page<Audit>> => request({ url: `${base}/standards/${id}/audit`, params: { pageNum, pageSize } });
|
||||
export const saveStandard = (id: string, version: number, definition: StandardDefinition): AxiosPromise<StandardView> => request({ url: `${base}/standards/${id}`, method: 'put', data: { version, definition }, headers: { repeatSubmit: false } });
|
||||
export const publishStandard = (id: string, version: number, reason: string): AxiosPromise<StandardView> => request({ url: `${base}/standards/${id}/publish`, method: 'post', data: { version, reason }, headers: { repeatSubmit: false } });
|
||||
export const disableStandard = (id: string, version: number, reason: string): AxiosPromise<StandardView> => request({ url: `${base}/standards/${id}/disable`, method: 'post', data: { version, reason }, headers: { repeatSubmit: false } });
|
||||
export const importTemplate = (xml: string, recordElement: string): AxiosPromise<TargetTemplate> => request({ url: `${base}/templates`, method: 'post', data: { xml, recordElement }, headers: { repeatSubmit: false } });
|
||||
export const blankField = (): StandardField => ({ name: '', label: '', type: 'STRING', required: false, maxLength: null, precision: null, scale: null });
|
||||
export const blankResource = (): StandardResource => ({ code: '', name: '', fields: [blankField()], templateId: null });
|
||||
export const blankStandard = (): StandardDefinition => ({ code: '', name: '', versionLabel: '', publisher: '', description: '', resources: [blankResource()] });
|
||||
export const hasDifference = (difference: TemplateDifference): boolean => !!difference.result && (difference.result.orderMismatch || difference.result.missingFromTemplate.length > 0 || difference.result.extraInTemplate.length > 0);
|
||||
@@ -25,7 +25,8 @@ export interface FieldMapping { sourceField: string; targetField: string; source
|
||||
transform: 'NONE'; filterValues: string[] }
|
||||
export interface DraftRequest { items: SourceSelection[]; targetType: TargetType }
|
||||
export interface DraftItem extends IngestionSelection { targetTable: string; sourceFingerprint?: string;
|
||||
columns: ColumnDefinition[]; mappings: FieldMapping[]; errorSummary?: string }
|
||||
columns: ColumnDefinition[]; mappings: FieldMapping[]; errorSummary?: string;
|
||||
fieldCompatibility?: { field: string; nativeType: string; conversion: string; error?: string }[] }
|
||||
export interface Draft { items: DraftItem[] }
|
||||
export interface SubmitItem extends IngestionSelection { targetTable: string; sourceFingerprint?: string;
|
||||
createTarget: boolean; columns: ColumnDefinition[]; mappings: FieldMapping[] }
|
||||
|
||||
在新工单中引用
屏蔽一个用户